| Routines

60641: 'O' pressed - left

The address of this routine is found in the table of keypress handling routines at 60672. It is called from the main loop at 61483 when 'O' is pressed.
Input
H | 230 (Sam)
60641 | CALL 60347 | Move Sam left (or in the next best direction) if possible
This entry point is used by the routines at 60626, 60631 and 60636.
60644 | RET NC | Return if Sam could not move in the desired direction
60645 | LD A,(32765) | Collect the offset of the last key pressed from 32765
60648 | BIT 3,A | Set the zero flag if a 'fast' key (upper case Q, A, O or P) was pressed
60650 | LD B,4 | 4=fast
60652 | JR Z,60656 | Jump if a 'fast' key was pressed
This entry point is used by the routines at 28635, 30458, 31204 and 62192.
60654 | LD B,8 | 8=slow
60656 | CALL 60521 | Make a sound effect
60659 | LD L,7 | Point HL at byte 7 of Sam's buffer
60661 | LD A,(HL) | A=0 if Sam is neither midstride nor mid-action now
60662 | INC L | Set Sam's main action timer in byte 8 of his buffer to either 4 (fast) or 8 (slow)
60663 | LD (HL),B
60664 | AND A | Is Sam midstride or mid-action?
60665 | RET Z | Return if not
60666 | INC L | Set Sam's midstride/mid-action timer in byte 9 of his buffer to either 4 (fast) or 8 (slow)
60667 | LD (HL),B
60668 | RET |