Prev: CA92 Up: Map Next: CAB3
CA9A: Leave by the west wall?
Out if the player's east edge, after this frame's move, is west of the west wall at $80 less the room's X half-size. The new room is one west: the low nibble of the room number less one, wrapping within its row.
X is set to 0, which is not a position but a marker: adjust_plyr_xyz_for_room_size sees it when the new room is built and puts the player in the doorway of that room's east wall, at the height of the arch there. The Y markers work the same way, $FF for the south wall and 0 for the north.
Input
HL the room's half-sizes (pushed by handle_exit_screen)
screen_west CA9A POP HL L = the west wall
CA9B LD A,$80
CA9D SUB L
CA9E LD L,A
CA9F LD A,(IX+$01) X + dX + half-width still at or beyond it: stay
CAA2 ADD A,(IX+$09)
CAA5 ADD A,(IX+$04)
CAA8 CP L
CAA9 RET NC
CAAA LD (IX+$01),$00 arrive at the east wall
CAAE LD A,(IX+$08) room - 1
CAB1 LD L,A
CAB2 DEC A
Prev: CA92 Up: Map Next: CAB3