Routines |
Prev: 59249 | Up: Map | Next: 59794 |
Used by the routines at 54098 and Handler_Bombs.
|
||||
59253 | LD A,(59229) | A=*Tile_Horizontal_Position. | ||
59256 | LD (59234),A | Write A to *59234. | ||
59259 | INC A | Increment A by one. | ||
59260 | LD (59235),A | Write A to *59235. | ||
59263 | LD A,(59230) | A=*Tile_Vertical_Position. | ||
59266 | LD (59236),A | Write A to *59236. | ||
59269 | INC A | Increment A by one. | ||
59270 | LD (59237),A | Write A to *59237. | ||
59273 | LD A,(59229) | B=*Tile_Horizontal_Position. | ||
59276 | LD B,A | |||
59277 | LD A,(59230) | C=*Tile_Vertical_Position. | ||
59280 | LD C,A | |||
59281 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59284 | LD E,127 | E=127. | ||
59286 | PUSH HL | Stash HL on the stack. | ||
59287 | LD A,(HL) | A=*HL. | ||
59288 | LD (HL),E | Write E to *HL. | ||
59289 | LD (59238),A | Write A to *59238. | ||
59292 | INC HL | Increment HL by one. | ||
59293 | LD A,(HL) | A=*HL. | ||
59294 | LD (HL),E | Write E to *HL. | ||
59295 | LD (59239),A | Write A to *59239. | ||
59298 | LD BC,31 | HL+=0031. | ||
59301 | ADD HL,BC | |||
59302 | LD A,(HL) | A=*HL. | ||
59303 | LD (HL),E | Write E to *HL. | ||
59304 | LD (59240),A | Write A to *59240. | ||
59307 | INC HL | Increment HL by one. | ||
59308 | LD A,(HL) | A=*HL. | ||
59309 | LD (HL),E | Write E to *HL. | ||
59310 | LD (59241),A | Write A to *59241. | ||
59313 | CALL 59813 | Call 59813. | ||
59316 | HALT | Halt operation (suspend CPU until the next interrupt). | ||
59317 | POP HL | Restore HL from the stack. | ||
59318 | LD A,(59238) | Write *59238 to *HL. | ||
59321 | LD (HL),A | |||
59322 | INC HL | Increment HL by one. | ||
59323 | LD A,(59239) | Write *59239 to *HL. | ||
59326 | LD (HL),A | |||
59327 | LD BC,31 | HL+=0031. | ||
59330 | ADD HL,BC | |||
59331 | LD A,(59240) | Write *59240 to *HL. | ||
59334 | LD (HL),A | |||
59335 | INC HL | Increment HL by one. | ||
59336 | LD A,(59241) | Write *59241 to *HL. | ||
59339 | LD (HL),A | |||
This entry point is used by the routine at 54098.
|
||||
59340 | LD D,0 | D=0. | ||
59342 | LD A,(59234) | A=*59234. | ||
59345 | CP 0 | Jump to 59355 if A is equal to 0. | ||
59347 | JR Z,59355 | |||
59349 | DEC A | Decrease A by one. | ||
59350 | LD (59234),A | Write A to *59234. | ||
59353 | SET 1,D | Set bit 1 of D. | ||
59355 | LD A,(59235) | A=*59235. | ||
59358 | CP 23 | Jump to 59368 if A is equal to 23. | ||
59360 | JR Z,59368 | |||
59362 | INC A | Increment A by one. | ||
59363 | LD (59235),A | Write A to *59235. | ||
59366 | SET 2,D | Set bit 2 of D. | ||
59368 | LD A,(59237) | A=*59237. | ||
59371 | CP 31 | Jump to 59381 if A is equal to 31. | ||
59373 | JR Z,59381 | |||
59375 | INC A | Increment A by one. | ||
59376 | LD (59237),A | Write A to *59237. | ||
59379 | SET 3,D | Set bit 3 of D. | ||
59381 | LD A,(59236) | A=*59236. | ||
59384 | CP 0 | Jump to 59394 if A is equal to 0. | ||
59386 | JR Z,59394 | |||
59388 | DEC A | Decrease A by one. | ||
59389 | LD (59236),A | Write A to *59236. | ||
59392 | SET 4,D | Set bit 4 of D. | ||
59394 | LD A,D | A=D. | ||
59395 | CP 0 | Return if A is equal to 0. | ||
59397 | RET Z | |||
59398 | LD B,2 | B=2. | ||
59400 | LD E,82 | E=82. | ||
59402 | PUSH BC | Stash BC on the stack. | ||
59403 | BIT 1,D | Test bit 1 of D. | ||
59405 | JR Z,59481 | Jump to 59481 if A is zero. | ||
59407 | LD A,(59234) | B=*59234. | ||
59410 | LD B,A | |||
59411 | LD A,(59230) | C=*Tile_Vertical_Position. | ||
59414 | LD C,A | |||
59415 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59418 | POP BC | Restore BC from the stack. | ||
59419 | PUSH BC | Stash BC on the stack. | ||
59420 | LD A,B | Jump to 59436 if B is equal to 2. | ||
59421 | CP 2 | |||
59423 | JR Z,59436 | |||
59425 | LD A,(59238) | Write *59238 to *HL. | ||
59428 | LD (HL),A | |||
59429 | INC HL | Increment HL by one. | ||
59430 | LD A,(59239) | Write *59239 to *HL. | ||
59433 | LD (HL),A | |||
59434 | JR 59447 | Jump to 59447. | ||
59436 | LD A,(HL) | Write *HL to *59238. | ||
59437 | LD (59238),A | |||
59440 | LD (HL),E | Write E to *HL. | ||
59441 | INC HL | Increment HL by one. | ||
59442 | LD A,(HL) | Write *HLto *59239. | ||
59443 | LD (59239),A | |||
59446 | LD (HL),E | Write E to *HL. | ||
59447 | BIT 3,D | Test bit 3 of D. | ||
59449 | JP Z,59580 | Jump to 59580 if HL is zero. | ||
59452 | LD A,(59234) | B=*59234. | ||
59455 | LD B,A | |||
59456 | LD A,(59237) | C=*59237. | ||
59459 | LD C,A | |||
59460 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59463 | POP BC | Restore BC from the stack. | ||
59464 | PUSH BC | Stash BC on the stack. | ||
59465 | LD A,B | Jump to 59476 if B is equal to 2. | ||
59466 | CP 2 | |||
59468 | JR Z,59476 | |||
59470 | LD A,(59240) | Write *59240 to *HL. | ||
59473 | LD (HL),A | |||
59474 | JR 59481 | Jump to 59481. | ||
59476 | LD A,(HL) | Write *HL to *59240. | ||
59477 | LD (59240),A | |||
59480 | LD (HL),E | Write E to *HL. | ||
59481 | BIT 3,D | Test bit 3 of D. | ||
59483 | JR Z,59580 | Jump to 59580 if A is zero. | ||
59485 | LD A,(59229) | B=*Tile_Horizontal_Position. | ||
59488 | LD B,A | |||
59489 | LD A,(59237) | C=*59237. | ||
59492 | LD C,A | |||
59493 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59496 | POP BC | Restore BC from the stack. | ||
59497 | PUSH BC | Stash BC on the stack. | ||
59498 | LD A,B | Jump to 59525 if B is equal to 2. | ||
59499 | CP 2 | |||
59501 | JR Z,59525 | |||
59503 | LD A,(59241) | Write *59241 to *HL. | ||
59506 | LD (HL),A | |||
59507 | LD A,(59229) | B=*Tile_Horizontal_Position. | ||
59510 | LD B,A | |||
59511 | INC B | Increment B by one. | ||
59512 | LD A,(59237) | C=*59237. | ||
59515 | LD C,A | |||
59516 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59519 | LD A,(59242) | Write *59242 to *HL. | ||
59522 | LD (HL),A | |||
59523 | JR 59547 | Jump to 59547. | ||
59525 | LD A,(HL) | Write *HL to *59241. | ||
59526 | LD (59241),A | |||
59529 | LD (HL),E | Write E to *HL. | ||
59530 | LD A,(59229) | B=*Tile_Horizontal_Position. | ||
59533 | LD B,A | |||
59534 | INC B | Increment B by one. | ||
59535 | LD A,(59237) | C=*59237. | ||
59538 | LD C,A | |||
59539 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59542 | LD A,(HL) | Write *HL to *59242. | ||
59543 | LD (59242),A | |||
59546 | LD (HL),E | Write E to *HL. | ||
59547 | BIT 2,D | Test bit 2 of D. | ||
59549 | JR Z,59658 | Jump to 59658 if B is zero. | ||
59551 | LD A,(59235) | B=*59235. | ||
59554 | LD B,A | |||
59555 | LD A,(59237) | C=*59237. | ||
59558 | LD C,A | |||
59559 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59562 | POP BC | Restore BC from the stack. | ||
59563 | PUSH BC | Stash BC on the stack. | ||
59564 | LD A,B | Jump to 59575 if B is equal to 2. | ||
59565 | CP 2 | |||
59567 | JR Z,59575 | |||
59569 | LD A,(59243) | Write *59243 to *HL. | ||
59572 | LD (HL),A | |||
59573 | JR 59580 | Jump to 59580. | ||
59575 | LD A,(HL) | Write *HL to *59243. | ||
59576 | LD (59243),A | |||
59579 | LD (HL),E | Write E to *HL. | ||
59580 | BIT 2,D | Test bit 2 of D. | ||
59582 | JR Z,59658 | Jump to 59658 if A is zero. | ||
59584 | LD A,(59235) | B=*59235. | ||
59587 | LD B,A | |||
59588 | LD A,(59230) | C=*Tile_Vertical_Position. | ||
59591 | LD C,A | |||
59592 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59595 | POP BC | Restore BC from the stack. | ||
59596 | PUSH BC | Stash BC on the stack. | ||
59597 | LD A,B | Jump to 59613 if B is equal to 2. | ||
59598 | CP 2 | |||
59600 | JR Z,59613 | |||
59602 | LD A,(59244) | Write *59244 to *HL. | ||
59605 | LD (HL),A | |||
59606 | INC HL | Increment HL by one. | ||
59607 | LD A,(59245) | Write *59245 to *HL. | ||
59610 | LD (HL),A | |||
59611 | JR 59624 | Jump to 59624. | ||
59613 | LD A,(HL) | Write *HL to *59244. | ||
59614 | LD (59244),A | |||
59617 | LD (HL),E | Write E to *HL. | ||
59618 | INC HL | Increment HL by one. | ||
59619 | LD A,(HL) | Write *HL to *59245. | ||
59620 | LD (59245),A | |||
59623 | LD (HL),E | Write E to *HL. | ||
59624 | BIT 4,D | Test bit 4 of D. | ||
59626 | JP Z,59757 | Jump to 59757 if HL is zero. | ||
59629 | LD A,(59235) | B=*59235. | ||
59632 | LD B,A | |||
59633 | LD A,(59236) | C=*59236. | ||
59636 | LD C,A | |||
59637 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59640 | POP BC | Restore BC from the stack. | ||
59641 | PUSH BC | Stash BC on the stack. | ||
59642 | LD A,B | Jump to 59653 if B is equal to 2. | ||
59643 | CP 2 | |||
59645 | JR Z,59653 | |||
59647 | LD A,(59246) | Write *59246 to *HL. | ||
59650 | LD (HL),A | |||
59651 | JR 59658 | Jump to 59658. | ||
59653 | LD A,(HL) | Write *HL to *59246. | ||
59654 | LD (59246),A | |||
59657 | LD (HL),E | Write E to *HL. | ||
59658 | BIT 4,D | Test bit 4 of D. | ||
59660 | JR Z,59757 | Jump to 59757 if A is zero. | ||
59662 | LD A,(59229) | B=*Tile_Horizontal_Position. | ||
59665 | LD B,A | |||
59666 | LD A,(59236) | C=*59236. | ||
59669 | LD C,A | |||
59670 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59673 | POP BC | Restore BC from the stack. | ||
59674 | PUSH BC | Stash BC on the stack. | ||
59675 | LD A,B | Jump to 59702 if B is equal to 2. | ||
59676 | CP 2 | |||
59678 | JR Z,59702 | |||
59680 | LD A,(59247) | Write *59247 to *HL. | ||
59683 | LD (HL),A | |||
59684 | LD A,(59229) | B=*Tile_Horizontal_Position. | ||
59687 | LD B,A | |||
59688 | INC B | Increment B by one. | ||
59689 | LD A,(59236) | C=*59236. | ||
59692 | LD C,A | |||
59693 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59696 | LD A,(59248) | Write *59248 to *HL. | ||
59699 | LD (HL),A | |||
59700 | JR 59724 | Jump to 59724. | ||
59702 | LD A,(HL) | Write *HL to *59247. | ||
59703 | LD (59247),A | |||
59706 | LD (HL),E | Write E to *HL. | ||
59707 | LD A,(59229) | B=*Tile_Horizontal_Position. | ||
59710 | LD B,A | |||
59711 | INC B | Increment B by one. | ||
59712 | LD A,(59236) | C=*59236. | ||
59715 | LD C,A | |||
59716 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59719 | LD A,(HL) | Write *HL to *59248. | ||
59720 | LD (59248),A | |||
59723 | LD (HL),E | Write E to *HL. | ||
59724 | BIT 1,D | Test bit 1 of D. | ||
59726 | JR Z,59757 | Jump to 59757 if B is zero. | ||
59728 | LD A,(59234) | B=*59234. | ||
59731 | LD B,A | |||
59732 | LD A,(59236) | C=*59236. | ||
59735 | LD C,A | |||
59736 | CALL Calculate_PositionToAttributeAddress | Call Calculate_PositionToAttributeAddress. | ||
59739 | POP BC | Restore BC from the stack. | ||
59740 | PUSH BC | Stash BC on the stack. | ||
59741 | LD A,B | Jump to 59752 if B is equal to 2. | ||
59742 | CP 2 | |||
59744 | JR Z,59752 | |||
59746 | LD A,(59249) | Write *59249 to *HL. | ||
59749 | LD (HL),A | |||
59750 | JR 59757 | Jump to 59757. | ||
59752 | LD A,(HL) | Write *HL to *59249. | ||
59753 | LD (59249),A | |||
59756 | LD (HL),E | Write E to *HL. | ||
59757 | LD A,R | A=the contents of the Memory Refresh Register. | ||
59759 | LD L,A | L=A. | ||
59760 | LD H,10 | H=10. | ||
59762 | LD A,(59235) | B=*59235. | ||
59765 | LD B,A | |||
59766 | LD A,24 | A=24. | ||
59768 | SUB B | A-=B. | ||
59769 | LD B,A | B=A. | ||
59770 | LD A,(HL) | A=*HL. | ||
59771 | AND %00011000 | Keep only bits 3-4. | ||
59773 | OR %00000101 | Set bits 0, 2. | ||
59775 | OUT (254),A | Set border to the colour held by A. | ||
59777 | INC HL | Increment HL by one. | ||
59778 | DJNZ 59770 | Decrease counter by one and loop back to 59770 until counter is zero. | ||
59780 | POP BC | Restore BC from the stack. | ||
59781 | LD A,B | A=B. | ||
59782 | CP 2 | Jump to 59787 if A is not equal to 2. | ||
59784 | JR NZ,59787 | |||
59786 | HALT | Halt operation (suspend CPU until the next interrupt). | ||
59787 | DEC B | Decrease B by one. | ||
59788 | JP NZ,59402 | Jump to 59402 if B is not zero. | ||
59791 | JP 59340 | Jump to 59340. |
Prev: 59249 | Up: Map | Next: 59794 |