| Routines

20956: Guide a character onto the catwalk or off it

Used by the routine at 21152. 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.
20956 | LD B,40 | The character will walk 40 paces
20958 | PUSH BC |
20959 | LD H,210 | We use ERIC's buffer at page 210 to control the character
20961 | CALL 25012 | Update the SRB for the character's current animatory state and location
20964 | INC A | A=character's next animatory state
20965 | AND 251
20967 | BIT 0,A | Is the character midstride now?
20969 | JR NZ,20972 | Jump if so
20971 | INC E | Otherwise move forward a pace
20972 | CALL 24880 | Update the character's animatory state and location and update the SRB
20975 | CALL 25248 | Update the display
20978 | CALL 21419 | Make a walking sound effect
20981 | LD C,100 | Wait a bit
20983 | DJNZ 20983
20985 | DEC C
20986 | JR NZ,20983
20988 | POP BC |
20989 | DJNZ 20958 | Jump back until all 40 paces have been walked
20991 | RET |