Prev: ECDC Up: Map Next: ECFD
ECE1: 'O' pressed - left
The address of this routine is found in the table of keypress handling routines at ED00. It is called from the main loop at F02B when 'O' is pressed.
Input
H 0xE6 (Sam)
ECE1 CALL $EBBB Move Sam left (or in the next best direction) if possible
This entry point is used by the routines at ECD2, ECD7 and ECDC.
ECE4 RET NC Return if Sam could not move in the desired direction
ECE5 LD A,($7FFD) Collect the offset of the last key pressed from 7FFD
ECE8 BIT 3,A Set the zero flag if a 'fast' key (upper case Q, A, O or P) was pressed
ECEA LD B,$04 4=fast
ECEC JR Z,$ECF0 Jump if a 'fast' key was pressed
This entry point is used by the routines at 6FDB, 76FA, 79E4 and F2F0.
ECEE LD B,$08 8=slow
ECF0 CALL $EC69 Make a sound effect
ECF3 LD L,$07 Point HL at byte 0x07 of Sam's buffer
ECF5 LD A,(HL) A=0 if Sam is neither midstride nor mid-action now
ECF6 INC L Set Sam's main action timer in byte 0x08 of his buffer to either 4 (fast) or 8 (slow)
ECF7 LD (HL),B
ECF8 AND A Is Sam midstride or mid-action?
ECF9 RET Z Return if not
ECFA INC L Set Sam's midstride/mid-action timer in byte 0x09 of his buffer to either 4 (fast) or 8 (slow)
ECFB LD (HL),B
ECFC RET
Prev: ECDC Up: Map Next: ECFD