Prev: F3AC Up: Map Next: F801
F43E: Routine at F43E
Used by the routine at Controls_CheckLeftUp.
F43E LD A,(HL) A=*HL.
F43F LD HL,$E260 HL=E260.
F442 LD B,$00 B=00.
F444 LD C,A C=A.
F445 ADD HL,BC HL+=BC.
F446 LD A,(HL) A=*HL.
F447 LD ($E5B0),HL Write HL to *E5B0.
F44A CP $00 Jump to E352 if A is equal to 00.
F44C JP Z,$E352
F44F LD ($E2C7),A Write A to *Item_ID.
F452 LD A,($D832) Jump to F45E if *D832 is equal to 03.
F455 CP $03
F457 JR Z,$F45E
F459 LD A,$01 Write 01 to *D832.
F45B LD ($D832),A
F45E LD A,($D834) Compare *PlayerCursor_TileID with 09.
F461 CP $09
F463 LD A,($E5B2) A=*Data_Control.
F466 JP Z,$F801 Jump to F801 if *PlayerCursor_TileID is equal to 09.
F469 CP $11 Jump to F528 if *PlayerCursor_TileID is not equal to 11.
F46B JP NZ,$F528
This entry point is used by the routine at F801.
F46E INC HL Increment HL by one.
F46F LD A,(HL) Jump to F477 if *HL is not equal to 00.
F470 CP $00
F472 JR NZ,$F477
F474 INC B Increment B by one.
F475 JR $F46E Jump to F46E.
F477 CALL $F130 Call F130.
F47A CALL $F255 Call F255.
F47D PUSH BC Stash BC and HL on the stack.
F47E PUSH HL
F47F CALL $D99B Call D99B.
F482 CALL $E2FD Call E2FD.
F485 CALL MoveTile_Right Call MoveTile_Right.
F488 CALL $D9BE Call D9BE.
F48B POP HL Restore HL and BC from the stack.
F48C POP BC
F48D DEC HL Decrease HL by one.
F48E CALL $E2F1 Call E2F1.
F491 LD A,($D832) Return if *D832 is equal to 02.
F494 CP $02
F496 RET Z
F497 BIT 5,B Test bit 5 of B.
F499 JR Z,$F4B7 Jump to F4B7 if A is zero.
F49B LD A,$00 Write 00 to *D832.
F49D LD ($D832),A
F4A0 LD A,($E75E) A=*Tile_Vertical_Position.
F4A3 CP $0F Return if *Tile_Vertical_Position is greater than or equal to 0F.
F4A5 RET P
F4A6 ADD A,$04 A+=04.
F4A8 LD ($D82D),A Write A to *DestinationCursor_X_Position.
F4AB INC HL Increment HL by one.
F4AC LD ($E5B0),HL Write HL to *E5B0.
F4AF LD A,(HL) Write *HL to *Item_ID.
F4B0 LD ($E2C7),A
F4B3 LD B,$00 B=00.
F4B5 JR $F46E Jump to F46E.
F4B7 LD A,($D832) Jump to F4C5 if *D832 is not equal to 00.
F4BA CP $00
F4BC JR NZ,$F4C5
F4BE PUSH BC Stash BC and HL on the stack.
F4BF PUSH HL
F4C0 CALL $F5FB Call F5FB.
F4C3 POP HL Restore HL and BC from the stack.
F4C4 POP BC
F4C5 LD A,($D832) A=*D832.
F4C8 CP $02 Return if A is equal to 02.
F4CA RET Z
F4CB CP $03 Jump to F4D4 if A is equal to 03.
F4CD JR Z,$F4D4
F4CF LD A,$01 Write 01 to *D832.
F4D1 LD ($D832),A
F4D4 BIT 6,B Test bit 6 of B.
F4D6 JR NZ,$F4E0 Jump to F4E0 if A is not zero.
F4D8 LD A,($D832) Return if *D832 is equal to 03.
F4DB CP $03
F4DD RET Z
F4DE JR $F4A0 Jump to F4A0.
F4E0 LD A,($E761) C=*Tile_SpacesToMove.
F4E3 LD C,A
F4E4 LD A,($D82D) A=*DestinationCursor_X_Position.
F4E7 ADD A,C A+=C.
F4E8 LD ($D82D),A Write A to *DestinationCursor_X_Position.
F4EB LD ($E5B0),HL Write HL to *E5B0.
F4EE CALL Sound_TileMoving Call Sound_TileMoving.
F4F1 LD A,($D832) Jump to F4FD if *D832 is equal to 03.
F4F4 CP $03
F4F6 JR Z,$F4FD
F4F8 LD A,$02 Write 02 to *D832.
F4FA LD ($D832),A
F4FD CALL $F52D Call F52D.
F500 PUSH BC Stash BC and HL on the stack.
F501 PUSH HL
F502 CALL $F510 Call F510.
F505 POP HL Restore HL and BC from the stack.
F506 POP BC
F507 LD A,($D832) Return if *D832 is equal to 03.
F50A CP $03
F50C RET Z
F50D JP $F586 Jump to F586.
F510 LD A,($D82D) A=*DestinationCursor_X_Position.
F513 ADD A,$03 A+=03.
F515 RLCA RLCA.
F516 RLCA
F517 RLCA
F518 DEC A Decrease A by one.
F519 LD H,A H=A.
F51A LD A,($D82C) A=*DestinationCursor_Y_Position.
F51D INC A Increment A by one.
F51E RLCA RLCA.
F51F RLCA
F520 RLCA
F521 LD IX,$E17A IX=E17A.
F525 JP $E0E2 Jump to E0E2.
F528 CP $12 Jump to F611 if A is not equal to 12.
F52A JP NZ,$F611
F52D DEC HL Decrease HL by one.
F52E LD A,(HL) Jump to F536 if *HL is not equal to 00.
F52F CP $00
F531 JR NZ,$F536
F533 INC B Increment B by one.
F534 JR $F52D Jump to F52D.
F536 CALL $F130 Call F130.
F539 CALL $F255 Call F255.
F53C PUSH BC Stash BC and HL on the stack.
F53D PUSH HL
F53E CALL $D99B Call D99B.
F541 CALL $E2FD Call E2FD.
F544 CALL MoveTile_Left Call MoveTile_Left.
F547 CALL $D9BE Call D9BE.
F54A POP HL Restore HL and BC from the stack.
F54B POP BC
F54C BIT 7,B Test bit 7 of B.
F54E JR Z,$F578 Jump to F578 if B is zero.
F550 LD A,($E761) A=*Tile_SpacesToMove.
F553 PUSH AF Stash AF on the stack.
F554 CALL $E2DA Call E2DA.
F557 CALL $D99B Call D99B.
F55A PUSH BC Stash BC on the stack.
F55B LD A,$02 Write 02 to *Tile_Vertical_Position.
F55D LD ($E75E),A
F560 CALL MoveTile_Left Call MoveTile_Left.
F563 POP BC Restore BC from the stack.
F564 DJNZ $F55A Decrease counter by one and loop back to F55A until counter is zero.
F566 POP AF Restore AF from the stack.
F567 ADD A,$03 A+=03.
F569 LD ($E761),A Write A to *Tile_SpacesToMove.
F56C LD A,($D832) A=*D832.
F56F CP $01 Return if A is equal to 01.
F571 RET Z
F572 CP $03 Return if A is equal to 03.
F574 RET Z
F575 JP $F510 Jump to F510.
F578 INC HL Increment HL by one.
F579 CALL $E2F1 Call E2F1.
F57C LD A,($D832) Return if *D832 is equal to 02.
F57F CP $02
F581 RET Z
F582 BIT 5,B Test bit 5 of B.
F584 JR Z,$F5A2 Jump to F5A2 if A is zero.
F586 LD A,$00 Write 00 to *D832.
F588 LD ($D832),A
F58B LD A,($E75E) A=*Tile_Vertical_Position.
F58E CP $06 Return if A is lower than 06 (unsigned comparison).
F590 RET M
F591 SUB $04 A-=04.
F593 LD ($D82D),A Write A to *DestinationCursor_X_Position.
F596 DEC HL Decrease HL by one.
F597 LD ($E5B0),HL Write HL to *E5B0.
F59A LD A,(HL) Write *HL to *Item_ID.
F59B LD ($E2C7),A
F59E LD B,$00 B=00.
F5A0 JR $F52D Jump to F52D.
F5A2 LD A,($D832) Jump to F5B0 if *D832 is not equal to 00.
F5A5 CP $00
F5A7 JR NZ,$F5B0
F5A9 PUSH BC Stash BC and HL on the stack.
F5AA PUSH HL
F5AB CALL $F510 Call F510.
F5AE POP HL Restore HL and BC from the stack.
F5AF POP BC
F5B0 LD A,($D832) A=*D832.
F5B3 CP $02 Return if A is equal to 02.
F5B5 RET Z
F5B6 CP $03 Jump to F5BF if A is equal to 03.
F5B8 JR Z,$F5BF
F5BA LD A,$01 Write 01 to *D832.
F5BC LD ($D832),A
F5BF BIT 6,B Test bit 6 of B.
F5C1 JR NZ,$F5CB Jump to F5CB if A is not zero.
F5C3 LD A,($D832) Return if *D832 is equal to 03.
F5C6 CP $03
F5C8 RET Z
F5C9 JR $F58B Jump to F58B.
F5CB LD A,($E761) C=*Tile_SpacesToMove.
F5CE LD C,A
F5CF LD A,($D82D) A=*DestinationCursor_X_Position.
F5D2 SUB C A-=C.
F5D3 LD ($D82D),A Write A to *DestinationCursor_X_Position.
F5D6 LD ($E5B0),HL Write HL to *E5B0.
F5D9 CALL Sound_TileMoving Call Sound_TileMoving.
F5DC LD A,($D832) Jump to F5E8 if *D832 is equal to 03.
F5DF CP $03
F5E1 JR Z,$F5E8
F5E3 LD A,$02 Write 02 to *D832.
F5E5 LD ($D832),A
F5E8 CALL $F46E Call F46E.
F5EB PUSH BC Stash BC and HL on the stack.
F5EC PUSH HL
F5ED CALL $F5FB Call F5FB.
F5F0 POP HL Restore HL and BC from the stack.
F5F1 POP BC
F5F2 LD A,($D832) Return if *D832 is equal to 03.
F5F5 CP $03
F5F7 RET Z
F5F8 JP $F49B Jump to F49B.
F5FB LD A,($D82D) A=*DestinationCursor_X_Position.
F5FE DEC A Decrease A by one.
F5FF RLCA RLCA.
F600 RLCA
F601 RLCA
F602 LD H,A H=A.
F603 LD A,($D82C) A=*DestinationCursor_Y_Position.
F606 INC A Increment A by one.
F607 RLCA RLCA.
F608 RLCA
F609 RLCA
F60A LD IX,$E16E IX=E16E.
F60E JP $E0E2 Jump to E0E2.
F611 LD DE,$0007 DE=0007.
F614 CP $14 Jump to F70B if A is not equal to 14.
F616 JP NZ,$F70B
F619 ADD HL,DE HL+=DE.
F61A LD A,(HL) Jump to F622 if *HL is not equal to 00.
F61B CP $00
F61D JR NZ,$F622
F61F INC B Increment B by one.
F620 JR $F619 Jump to F619.
F622 CALL $F130 Call F130.
F625 CALL $F255 Call F255.
F628 PUSH BC Stash BC and HL on the stack.
F629 PUSH HL
F62A CALL $D99B Call D99B.
F62D CALL $E2FD Call E2FD.
F630 CALL MoveTile_Down Call MoveTile_Down.
F633 CALL $D9BE Call D9BE.
F636 POP HL Restore HL and BC from the stack.
F637 POP BC
F638 BIT 7,B Test bit 7 of B.
F63A JR Z,$F664 Jump to F664 if B is zero.
F63C LD A,($E761) A=*Tile_SpacesToMove.
F63F PUSH AF Stash AF on the stack.
F640 CALL $E2DA Call E2DA.
F643 CALL $D99B Call D99B.
F646 PUSH BC Stash BC on the stack.
F647 LD A,$12 Write 12 to *Tile_Horizontal_Position.
F649 LD ($E75D),A
F64C CALL MoveTile_Down Call MoveTile_Down.
F64F POP BC Restore BC from the stack.
F650 DJNZ $F646 Decrease counter by one and loop back to F646 until counter is zero.
F652 POP AF Restore AF from the stack.
F653 ADD A,$03 A+=03.
F655 LD ($E761),A Write A to *Tile_SpacesToMove.
F658 LD A,($D832) A=*D832.
F65B CP $01 Return if A is equal to 01.
F65D RET Z
F65E CP $03 Return if A is equal to 03.
F660 RET Z
F661 JP $F7EB Jump to F7EB.
F664 LD DE,$0007 HL-=0007.
F667 AND A
F668 SBC HL,DE
F66A CALL $E2F1 Call E2F1.
F66D LD A,($D832) Return if *D832 is equal to 02.
F670 CP $02
F672 RET Z
F673 BIT 5,B Test bit 5 of B.
F675 JR Z,$F696 Jump to F696 if A is zero.
F677 LD A,$00 Write 00 to *D832.
F679 LD ($D832),A
F67C LD A,($E75D) A=*Tile_Horizontal_Position.
F67F CP $0F Compare A with 0F.
F681 RET P Return P.
F682 ADD A,$04 A+=04.
F684 LD ($D82C),A Write A to *DestinationCursor_Y_Position.
F687 LD DE,$0007 HL+=0007.
F68A ADD HL,DE
F68B LD ($E5B0),HL Write HL to *E5B0.
F68E LD A,(HL) Write *HL to *Item_ID.
F68F LD ($E2C7),A
F692 LD B,$00 B=00.
F694 JR $F619 Jump to F619.
F696 LD A,($D832) Jump to F6A4 if *D832 is not equal to 00.
F699 CP $00
F69B JR NZ,$F6A4
F69D PUSH BC Stash BC and HL on the stack.
F69E PUSH HL
F69F CALL $F7EB Call F7EB.
F6A2 POP HL Restore HL and BC from the stack.
F6A3 POP BC
F6A4 LD A,($D832) A=*D832.
F6A7 CP $02 Return if A is equal to 02.
F6A9 RET Z
F6AA CP $03 Jump to F6B3 if A is equal to 03.
F6AC JR Z,$F6B3
F6AE LD A,$01 Write 01 to *D832.
F6B0 LD ($D832),A
F6B3 BIT 6,B Test bit 6 of B.
F6B5 JR NZ,$F6BF Jump to F6BF if A is not zero.
F6B7 LD A,($D832) Return if *D832 is equal to 03.
F6BA CP $03
F6BC RET Z
F6BD JR $F67C Jump to F67C.
F6BF LD A,($E761) C=*Tile_SpacesToMove.
F6C2 LD C,A
F6C3 LD A,($D82C) A=*DestinationCursor_Y_Position.
F6C6 ADD A,C A+=C.
F6C7 LD ($D82C),A Write A to *DestinationCursor_Y_Position.
F6CA LD ($E5B0),HL Write HL to *E5B0.
F6CD CALL Sound_TileMoving Call Sound_TileMoving.
F6D0 LD A,($D832) Jump to F6DC if *D832 is equal to 03.
F6D3 CP $03
F6D5 JR Z,$F6DC
F6D7 LD A,$02 Write 02 to *D832.
F6D9 LD ($D832),A
F6DC LD DE,$0007 DE=0007.
F6DF AND A Set flags.
F6E0 CALL $F711 Call F711.
F6E3 PUSH BC Stash BC and HL on the stack.
F6E4 PUSH HL
F6E5 CALL $F6F3 Call F6F3.
F6E8 POP HL Restore HL and BC from the stack.
F6E9 POP BC
F6EA LD A,($D832) Return if *D832 is equal to 03.
F6ED CP $03
F6EF RET Z
F6F0 JP $F76E Jump to F76E.
F6F3 LD A,($D82D) A=*DestinationCursor_X_Position.
F6F6 INC A Increment A by one.
F6F7 RLCA RLCA.
F6F8 RLCA
F6F9 RLCA
F6FA LD H,A H=A.
F6FB LD A,($D82C) A=*DestinationCursor_Y_Position.
F6FE ADD A,$03 A+=03.
F700 RLCA RLCA.
F701 RLCA
F702 RLCA
F703 DEC A Decrease A by one.
F704 LD IX,$E192 IX=E192.
F708 JP $E0E2 Jump to E0E2.
F70B CP $18 Compare A with 18.
F70D JP NZ,Handler_Bombs_5 Jump to Handler_Bombs_5 if A is not zero.
F710 AND A Set flags.
F711 SBC HL,DE HL-=DE (with carry).
F713 LD A,(HL) A=*HL.
F714 CP $00 Compare A with 00.
F716 JR NZ,$F71B Jump to F71B if A is not zero.
F718 INC B Increment B by one.
F719 JR $F711 Jump to F711.
F71B CALL $F130 Call F130.
F71E CALL $F255 Call F255.
F721 PUSH BC Stash BC and HL on the stack.
F722 PUSH HL
F723 CALL $D99B Call D99B.
F726 CALL $E2FD Call E2FD.
F729 CALL MoveTile_Up Call MoveTile_Up.
F72C CALL $D9BE Call D9BE.
F72F POP HL Restore HL and BC from the stack.
F730 POP BC
F731 BIT 7,B Test bit 7 of B.
F733 JR Z,$F75D Jump to F75D if B is zero.
F735 LD A,($E761) A=*Tile_SpacesToMove.
F738 PUSH AF Stash AF on the stack.
F739 CALL $E2DA Call E2DA.
F73C CALL $D99B Call D99B.
F73F PUSH BC Stash BC on the stack.
F740 LD A,$02 Write 02 to *Tile_Horizontal_Position.
F742 LD ($E75D),A
F745 CALL MoveTile_Up Call MoveTile_Up.
F748 POP BC Restore BC from the stack.
F749 DJNZ $F73F Decrease counter by one and loop back to F73F until counter is zero.
F74B POP AF Restore AF from the stack.
F74C ADD A,$03 A+=03.
F74E LD ($E761),A Write A to *Tile_SpacesToMove.
F751 LD A,($D832) Return if *D832 is either 01 or 03.
F754 CP $01
F756 RET Z
F757 CP $03
F759 RET Z
F75A JP $F6F3 Jump to F6F3.
F75D LD DE,$0007 HL+=0007.
F760 ADD HL,DE
F761 CALL $E2F1 Call E2F1.
F764 LD A,($D832) Return if *D832 is equal to 02.
F767 CP $02
F769 RET Z
F76A BIT 5,B Test bit 5 of B.
F76C JR Z,$F78F Jump to F78F if A is zero.
F76E LD A,$00 Write 00 to *D832.
F770 LD ($D832),A
F773 LD A,($E75D) A=*Tile_Horizontal_Position.
F776 CP $05 Return if A is lower than 05 (unsigned comparison).
F778 RET M
F779 SUB $04 A-=04.
F77B LD ($D82C),A Write A to *DestinationCursor_Y_Position.
F77E LD DE,$0007 HL-=0007 (with carry).
F781 AND A
F782 SBC HL,DE
F784 LD ($E5B0),HL Write HL to *E5B0.
F787 LD A,(HL) Write *HL to *Item_ID.
F788 LD ($E2C7),A
F78B LD B,$00 B=00.
F78D JR $F711 Jump to F711.
F78F LD A,($D832) Jump to F79D if *D832 is not equal to 00.
F792 CP $00
F794 JR NZ,$F79D
F796 PUSH BC Stash BC and HL on the stack.
F797 PUSH HL
F798 CALL $F6F3 Call F6F3.
F79B POP HL Restore HL and BC from the stack.
F79C POP BC
F79D LD A,($D832) Return if *D832 is equal to 02.
F7A0 CP $02
F7A2 RET Z
F7A3 CP $03 Jump to F7AC if *D832 is equal to 03.
F7A5 JR Z,$F7AC
F7A7 LD A,$01 Write 01 to *D832.
F7A9 LD ($D832),A
F7AC BIT 6,B Test bit 6 of B.
F7AE JR NZ,$F7B8 Jump to F7B8 if A is not zero.
F7B0 LD A,($D832) Return if *D832 is equal to 03.
F7B3 CP $03
F7B5 RET Z
F7B6 JR $F773 Jump to F773.
F7B8 LD A,($E761) C=*Tile_SpacesToMove.
F7BB LD C,A
F7BC LD A,($D82C) A=*DestinationCursor_Y_Position.
F7BF SUB C A-=C.
F7C0 LD ($D82C),A Write A to *DestinationCursor_Y_Position.
F7C3 LD ($E5B0),HL Write HL to *E5B0.
F7C6 CALL Sound_TileMoving Call Sound_TileMoving.
F7C9 LD A,($D832) Jump to F7D5 if *D832 is equal to 03.
F7CC CP $03
F7CE JR Z,$F7D5
F7D0 LD A,$02 Write 02 to *D832.
F7D2 LD ($D832),A
F7D5 LD DE,$0007 DE=0007.
F7D8 CALL $F619 Call F619.
F7DB PUSH BC Stash BC and HL on the stack.
F7DC PUSH HL
F7DD CALL $F7EB Call F7EB.
F7E0 POP HL Restore HL and BC from the stack.
F7E1 POP BC
F7E2 LD A,($D832) Return if *D832 is equal to 03.
F7E5 CP $03
F7E7 RET Z
F7E8 JP $F677 Jump to F677.
F7EB LD A,($D82D) A=*DestinationCursor_X_Position.
F7EE INC A Increment A by one.
F7EF RLCA RLCA.
F7F0 RLCA
F7F1 RLCA
F7F2 LD H,A H=A.
F7F3 LD A,($D82C) A=*DestinationCursor_Y_Position.
F7F6 DEC A Decrease A by one.
F7F7 RLCA RLCA.
F7F8 RLCA
F7F9 RLCA
F7FA LD IX,$E186 IX=E186.
F7FE JP $E0E2 Jump to E0E2.
Prev: F3AC Up: Map Next: F801