Prev: C83B Up: Map Next: C874
C843: 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 C843 POP HL Restore the limits of the room from the stack.
C844 LD A,$80 Set A to 80, the middle of the room.
C846 SUB L Take the limit along x away from it, to get the position of the wall.
C847 LD L,A Set the position of the wall in L.
C848 LD A,(IY+$01) Fetch the x position of the player.
C84B ADD A,(IY+$04) Add the half size along x.
C84E CP L Return if the player is not through the wall.
C84F RET NC
C850 LD (IY+$01),$00 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 C854 LD A,(IX+$08) Set the room of the player to the room of the door.
C857 LD (IY+$08),A
C85A LD A,(IY+$0C) Fetch the collision flags of the player.
C85D OR %00110000 Set the countdown from entering the room to three.
C85F LD (IY+$0C),A Set them.
C862 PUSH IY Take the first object record, using the stack.
C864 POP HL
C865 LD DE,$C3FF Take the records of the player to start from, PlayerRecords.
C868 LD BC,$0040 Set the number of bytes to copy in BC to 40, which is two records.
C86B LDIR Save the records of the player.
C86D INC SP Throw away the two return addresses on the stack.
C86E INC SP
C86F INC SP
C870 INC SP
C871 JP RunGame_NewRoom Jump to RunGame_NewRoom to build the next room.
Prev: C83B Up: Map Next: C874