Prev: 45418 Up: Map Next: 45471
45447: 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 45447 LD A,(38573) Fetch the width of the actor from Actor_Width.
45450 NEG Negate the width.
45452 DEC A Subtract one.
45453 LD E,A Stash the new X position in E.
45454 LD A,(IX+1) Fetch the room of the actor.
45457 LD C,A Stash the room in C.
45458 DEC A Move to the room on the left.
This entry point is used by the routine at EnterRoomRight.
EnterRoomLeft_Row 45459 AND %00001111 Keep only bits 0-3 (the column).
45461 LD B,A Stash the column in B.
45462 LD A,C Fetch the old room.
45463 AND %11110000 Keep only bits 4-7 (the row).
45465 OR B Merge in the new column.
45466 LD (IX+1),A Set the new room of the actor.
45469 JR EnterRoom Jump to EnterRoom.
Prev: 45418 Up: Map Next: 45471