| Routines

B4E8: Move a character one step along the catwalk

Used by the routine at B5E8.
Input
H | 0x98 (boy) or 0xA4 (teacher)
B4E8 | CALL $6214 | Update the SRB for the character's current location
B4EB | INC A | A=character's next animatory state
B4EC | LD C,A | Store this in C
B4ED | RRCA | Set the carry flag if this animatory state is midstride
B4EE | LD A,C | Restore the next animatory state to A
B4EF | JR C,$B4F9 | Jump if the character will be midstride
The character will be moving from the midstride position, so move him one space forward.
B4F1 | INC E | Increment the character's x-coordinate
B4F2 | AND $03 | Keep only the walking phase identifier bits of the animatory state (bits 0-1)
B4F4 | LD A,C | Restore the next animatory state to A again
B4F5 | JR NZ,$B4F9 | Jump if the next animatory state is standing/walking phase 3
B4F7 | SUB $04 | Reset the animatory state to standing/walking phase 1
Now A holds the character's new animatory state, and E his x-coordinate.
B4F9 | CALL $61B0 | Update the character's animatory state and location and update the SRB
B4FC | JP $6992 | Update the display