| Routines

63954: Knock a character over

Used by the routines at 64005 and 64227. Knocks the character to the ground and updates the SRB accordingly.
Input
H | Character number (215-230)
63954 | CALL 59848 | Update the SRB for the character's current animatory state and location
63957 | BIT 7,A | Is the character facing left?
63959 | JR Z,63963 | Jump if so
63961 | DEC E | Subtract 2 from the character's x-coordinate if he's facing right
63962 | DEC E
63963 | INC D | Add 2 to the character's y-coordinate
63964 | INC D
63965 | PUSH DE | Save the character's new coordinates
63966 | AND 248 | A=character's base animatory state
63968 | PUSH HL | Save the character number briefly
63969 | PUSH AF | Save the character's base animatory state briefly
63970 | CALL 63784 | Prepare the sprite tiles used by the character when lying down
63973 | POP AF | Restore the character's base animatory state to A
63974 | POP HL | Restore the character number to H
63975 | ADD A,7 | A=animatory state of the character lying down
63977 | POP DE | Restore the character's new coordinates to DE
63978 | JP 59861 | Update the character's animatory state and location and update the SRB