Prev: 53118 Up: Map Next: 53159
53141: Limit Displacement
Used by the routine at MoveEntity.
Limits the displacement of the player to less than 2496 if the player is in a certain range of positions. Purpose not yet known.
Input
HL The displacement
IX The entity
Output
HL The limited displacement
LimitDisplacement 53141 LD A,(IX+14) Fetch the column.
53144 CP 132 Jump to 53151 if it is 132 or more.
53146 JR NC,LimitDisplacement_Skip
53148 CP 37 Compare A with 37.
53150 RET NC Return if the carry flag is reset.
LimitDisplacement_Skip 53151 LD DE,2496 DE is 2496.
53154 SBC HL,DE Subtract DE from HL. (with the carry)
53156 RET NC Return if the carry flag is reset.
53157 ADD HL,DE HL takes DE.
53158 RET Return.
Prev: 53118 Up: Map Next: 53159