Prev: 51259 Up: Map Next: 51316
51267: Test Passage Along Minus X
Finds out if the player is far enough through the wall on the side of low x, which is when the whole of it is beyond the limit. If it is, the player is put at the opposite side of the next room.
Input
IX Door record
IY Record of the legs of the player
Return unless the player is through the wall.
TestPassageAlongMinusX 51267 POP HL Restore the limits of the room from the stack.
51268 LD A,128 Set A to 128, the middle of the room.
51270 SUB L Take the limit along x away from it, to get the position of the wall.
51271 LD L,A Set the position of the wall in L.
51272 LD A,(IY+1) Fetch the x position of the player.
51275 ADD A,(IY+4) Add the half size along x.
51278 CP L Return if the player is not through the wall.
51279 RET NC
51280 LD (IY+1),0 Put the player at the lowest x position, ready for the next room.
This entry point is used by the routines at TestPassageAlongPlusX, TestPassageAlongPlusY and TestPassageAlongMinusY.
Save the player and build the next room.
TestPassageAlongMinusX_Done 51284 LD A,(IX+8) Set the room of the player to the room of the door.
51287 LD (IY+8),A
51290 LD A,(IY+12) Fetch the collision flags of the player.
51293 OR %00110000 Set the countdown from entering the room to three.
51295 LD (IY+12),A Set them.
51298 PUSH IY Take the first object record, using the stack.
51300 POP HL
51301 LD DE,50175 Take the records of the player to start from, PlayerRecords.
51304 LD BC,64 Set the number of bytes to copy in BC to 64, which is two records.
51307 LDIR Save the records of the player.
51309 INC SP Throw away the two return addresses on the stack.
51310 INC SP
51311 INC SP
51312 INC SP
51313 JP RunGame_NewRoom Jump to RunGame_NewRoom to build the next room.
Prev: 51259 Up: Map Next: 51316