| Routines

B5E8: Guide a character onto the catwalk or off it

Used by the routines at B3E8 and EFE0. Makes a character walk in from the left to the middle of the screen (at which point his name may be changed), or from the middle of the screen and off to the right.
B5E8 | LD B,$26 | The character will take 38 steps along the catwalk
B5EA | PUSH BC |
B5EB | LD H,$98 | This instruction is set by the routine at B175 to either 'LD H,$98' (boy) or 'LD H,$A4' (teacher) as appropriate
B5ED | CALL $B4E8 | Move the character one step along the catwalk
B5F0 | CALL $FE40 | Make a walking sound effect
B5F3 | LD C,$64 | Pause briefly between steps
B5F5 | DJNZ $B5F5
B5F7 | DEC C
B5F8 | JR NZ,$B5F5
B5FA | POP BC |
B5FB | DJNZ $B5EA | Jump back until 38 steps have been taken
B5FD | RET |