Prev: CCD8 Up: Map Next: CCEC
CCDD: Shorten dX at the walls
Used by the routine at dZ_ok.
Keeps the whole of the object's footprint between the room's east and west walls, $80 plus and minus the X half-size in $5BAB, shortening dX a unit at a time and setting bit 0 of +$0C if it had to.
Two things switch the walls off: the room-entry walk (the top nibble of +$0C) and being near an archway (bit 0 of +$07, set by chk_plyr_spec_near_arch). That is how the player walks into an arch at all -- and why only the arch's own pillars, which are objects, then stop him.
Input
IX the object
C dX
C on exit, dX shortened
adj_dX_for_out_of_bounds CCDD LD A,(IX+$0C) not during the room-entry walk
CCE0 AND $F0
CCE2 RET NZ
CCE3 BIT 0,(IX+$07) not near an archway
CCE7 RET NZ
CCE8 LD A,($5BAB) B = the X half-size
CCEB LD B,A
Prev: CCD8 Up: Map Next: CCEC