| Routines

E125: 'C' pressed - catch a mouse or the frog

The address of this routine is found in the table of keypress handling routines at E550. It is called from the main loop at F6EA when 'C' is pressed.
E125 | LD A,$27 | 0x27=ERIC bending over, facing left
E127 | LD HL,$7B55 | The routine at 7B55 deals with ERIC after 'C' has been pressed
This entry point is used by the routines at 5D37, 5F1C, 7140, E225 and F99A with ERIC's new animatory state in A (bit 7 reset) and an appropriate routine address in HL.
E12A | LD ($7FD7),HL | Place into 7FD7 the address of the routine that will deal with ERIC after we've finished here
E12D | LD HL,$7FFB | Set bit 3 at 7FFB: ERIC is bending over, firing the water pistol, moving forward as if to kiss, or dropping a stinkbomb
E130 | LD (HL),$08
This entry point is used by the routine at 5EB7 with ERIC's new animatory state in A (bit 7 reset).
E132 | LD HL,$D200 | Point HL at byte 0x00 of ERIC's buffer
E135 | LD BC,$0003 |
E138 | BIT 7,(HL) | Is ERIC facing left?
E13A | JR Z,$E13E | Jump if so
E13C | ADD A,$80 | Set bit 7 of ERIC's new animatory state so he's still facing right
E13E | LD D,H | Point DE at byte 0x03 of ERIC's buffer
E13F | LD E,C
E140 | LDIR | Copy bytes 0x00-0x02 of ERIC's buffer (which hold ERIC's current animatory state and location) into bytes 0x03-0x05 for retrieval when ERIC has completed this action
E142 | JP $F3F4 | Update ERIC's animatory state and update the SRB