Prev: B16A Up: Map Next: B19F
B187: Enter Room Left
Used by the routine at MoveActorLeft.
Used by MoveActor when an actor has gone off the left of the screen. The actor is put at the right of the room to the left (the room number is one less, but the room stays in the same row of the map) and its X position is set so that its right edge is at the edge of the screen.
Input
IX Actor record
Output
E New X position
EnterRoomLeft B187 LD A,($96AD) Fetch the width of the actor from Actor_Width.
B18A NEG Negate the width.
B18C DEC A Subtract one.
B18D LD E,A Stash the new X position in E.
B18E LD A,(IX+$01) Fetch the room of the actor.
B191 LD C,A Stash the room in C.
B192 DEC A Move to the room on the left.
This entry point is used by the routine at EnterRoomRight.
EnterRoomLeft_Row B193 AND %00001111 Keep only bits 0-3 (the column).
B195 LD B,A Stash the column in B.
B196 LD A,C Fetch the old room.
B197 AND %11110000 Keep only bits 4-7 (the row).
B199 OR B Merge in the new column.
B19A LD (IX+$01),A Set the new room of the actor.
B19D JR EnterRoom Jump to EnterRoom.
Prev: B16A Up: Map Next: B19F