![]() |
Routines |
| H | Number of character looking for ERIC (161, 163-166) |
| 31739 | LD L,105 | Replace the address of this routine in bytes 105 and 106 of the character's buffer (if present) with that of 31648 |
| 31741 | LD (HL),160 | |
| 31743 | CALL 25108 | Update SRB for the character's current location |
| 31746 | LD L,108 | D=character's new y-coordinate (adjusted by the value in byte 108 of his buffer, placed there by the routine at 31768) |
| 31748 | LD B,A | |
| 31749 | LD A,D | |
| 31750 | ADD A,(HL) | |
| 31751 | LD D,A | |
| 31752 | DEC L | E=character's new x-coordinate (adjusted by the value in byte 107 of his buffer, placed there by the routine at 31768) |
| 31753 | LD A,E | |
| 31754 | ADD A,(HL) | |
| 31755 | LD E,A | |
| 31756 | LD A,(HL) | A=x-coordinate increment (-1 or +1) |
| 31757 | ADD A,B | Add this to the character's current animatory state |
| 31758 | AND 3 | Set C to the new walking phase identifier (0 or 2) |
| 31760 | LD C,A | |
| 31761 | LD A,B | A=character's current animatory state |
| 31762 | AND 252 | Clear the walking phase bits (bits 0-1) |
| 31764 | ADD A,C | Set the walking phase to 0 or 2 |
| 31765 | JP 25008 | Update the character's animatory state and location and update SRB |