Prev: EDEF Up: Map Next: EF4A
EE61: Routine at EE61
Used by the routine at LevelComplete.
EE61 LD A,$80 Write 80 to *Time.
EE63 LD ($D83A),A
EE66 LD A,$08 Write 08 to *D839.
EE68 LD ($D839),A
EE6B CALL $EF2D Call EF2D.
EE6E CALL $FA9D Call FA9D.
EE71 LD HL,$D839 HL=D839.
EE74 BIT 3,(HL) Test bit 3 of *HL.
EE76 JR NZ,$EE6B Jump to EE6B if is not zero.
EE78 LD A,$12 Write 12 to *DestinationCursor_Y_Position.
EE7A LD ($D82C),A
EE7D LD HL,$EF45 HL=EF45.
EE80 LD DE,$03E8 DE=03E8.
EE83 DEC DE Decrease DE by one.
EE84 LD A,$64 A=64.
EE86 DEC A Decrease A by one.
EE87 JR NZ,$EE86 Jump to EE86 if A is not zero.
EE89 LD A,D Jump to EE83 if DE is not zero.
EE8A OR E
EE8B JR NZ,$EE83
EE8D LD B,$04 B=04.
EE8F PUSH BC Stash BC on the stack.
EE90 LD B,$05 B=05.
EE92 PUSH HL Stash HL and BC on the stack.
EE93 PUSH BC
EE94 LD A,($D82C) Write *DestinationCursor_Y_Position to *Tile_Horizontal_Position.
EE97 LD ($E75D),A
EE9A LD A,(HL) A=*HL.
EE9B LD ($E75E),A Write A to *Tile_Vertical_Position.
EE9E SUB $0A A-=0A.
EEA0 JR Z,$EEB6 Jump to EEB6 if A is zero.
EEA2 JP P,$EEB0 Jump to EEB0 P.
EEA5 NEG NEG.
EEA7 LD ($E761),A Write A to *Tile_SpacesToMove.
EEAA CALL MoveTile_Right Call MoveTile_Right.
EEAD JP $EEB6 Jump to EEB6.
EEB0 LD ($E761),A Write A to *Tile_SpacesToMove.
EEB3 CALL MoveTile_Left Call MoveTile_Left.
EEB6 LD A,($D82C) A=*DestinationCursor_Y_Position.
EEB9 SUB $12 A-=12.
EEBB NEG NEG.
EEBD INC A Increment A by one.
EEBE LD ($E761),A Write A to *Tile_SpacesToMove.
EEC1 CALL MoveTile_Down Call MoveTile_Down.
EEC4 LD B,$04 B=04.
EEC6 LD A,$01 Write 01 to *Tile_SpacesToMove.
EEC8 LD ($E761),A
EECB PUSH BC Stash BC on the stack.
EECC LD A,$12 Write 12 to *Tile_Horizontal_Position.
EECE LD ($E75D),A
EED1 CALL MoveTile_Down Call MoveTile_Down.
EED4 LD D,$32 D=32.
EED6 LD E,$1E E=1E.
EED8 LD A,$05 A=05.
EEDA XOR %00010000 Flip bit 4.
EEDC OUT ($FE),A Send to the speaker.
EEDE LD B,D B=D.
EEDF DJNZ $EEDF Decrease counter by one and loop back to EEDF until counter is zero.
EEE1 DEC E Decrease E by one.
EEE2 JR NZ,$EEDA Jump to EEDA if E is not zero.
EEE4 POP BC Restore BC from the stack.
EEE5 DJNZ $EECB Decrease counter by one and loop back to EECB until counter is zero.
EEE7 POP BC Restore BC and HL from the stack.
EEE8 POP HL
EEE9 INC HL Increment HL by one.
EEEA DJNZ $EE92 Decrease counter by one and loop back to EE92 until counter is zero.
EEEC POP BC Restore BC from the stack.
EEED LD HL,$EF45 HL=EF45.
EEF0 LD A,($D82C) A=*DestinationCursor_Y_Position.
EEF3 SUB $04 A-=04.
EEF5 LD ($D82C),A Write A to *DestinationCursor_Y_Position.
EEF8 DJNZ $EE8F Decrease counter by one and loop back to EE8F until counter is zero.
EEFA LD DE,$03E8 DE=03E8.
EEFD DEC DE Decrease DE by one.
EEFE LD A,$64 A=64.
EF00 DEC A Decrease A by one.
EF01 JR NZ,$EF00 Jump to EF00 if A is not zero.
EF03 LD A,D Jump to EEFD if DE is not zero.
EF04 OR E
EF05 JR NZ,$EEFD
EF07 LD A,$45 A=INK: CYAN, PAPER: BLACK (BRIGHT) .
EF09 LD ($5AA9),A Write A to *5AA9 (attribute buffer location).
EF0C LD ($5AAA),A Write A to *5AAA (attribute buffer location).
EF0F LD ($5AAB),A Write A to *5AAB (attribute buffer location).
EF12 LD ($5AAC),A Write A to *5AAC (attribute buffer location).
EF15 LD A,$80 Write 80 to *Time.
EF17 LD ($D83A),A
EF1A LD A,$08 Write 08 to *D839.
EF1C LD ($D839),A
EF1F CALL $EF2D Call EF2D.
EF22 CALL $FAD6 Call FAD6.
EF25 LD HL,$D839 HL=D839.
EF28 BIT 3,(HL) Test bit 3 of *HL.
EF2A JR NZ,$EF1F Jump to EF1F if A is not zero.
EF2C RET Return.
EF2D LD BC,$03E8 BC=03E8.
EF30 LD H,$05 H=05.
EF32 LD A,(HL) A=*HL.
EF33 INC HL Increment HL by one.
EF34 AND %00011000 Keep only bits 3-4.
EF36 OR %00000101 Set bits 0, 2.
EF38 OUT ($FE),A Send to the speaker.
EF3A DEC BC Decrease BC by one.
EF3B LD A,B Jump to EF32 if BC is not zero.
EF3C OR C
EF3D JR NZ,$EF32
EF3F LD B,$08 B=08.
EF41 LD HL,($D84C) HL=*D84C.
EF44 RET Return.
EF45 LD A,(BC)
EF46 LD C,$12
EF48 LD B,$02
Prev: EDEF Up: Map Next: EF4A