Prev: 63668 Up: Map Next: 64090
63982: Erase Entity
Used by the routine at JumpTable_EraseEntity.
Tests whether the entity overlaps the player.
Erase_Entity 63982 LD A,(25617) Return if *RestartRoomFlag is already set.
63985 OR A
63986 RET NZ
63987 LD C,(IX+0) Fetch the column, row, width and height.
63990 LD B,(IX+1)
63993 LD E,(IX+4)
63996 LD D,(IX+5)
63999 CALL Next_PrintCell Call Next_PrintCell.
64002 XOR A Return if the clipped width or height is zero.
64003 CP E
64004 RET Z
64005 CP D
64006 RET Z
64007 LD L,E Write the width*8+16 into the compare at 64053.
64008 LD H,D
64009 ADD HL,HL
64010 ADD HL,HL
64011 ADD HL,HL
64012 LD A,16
64014 ADD A,L
64015 LD (64053),A
64018 LD A,24 Write the height*8+24 into the compare at 64079.
64020 ADD A,H
64021 LD (64079),A
64024 PUSH IY Point IY at the player at Player.
64026 LD IY,25764
64030 LD A,C Jump to Erase_Entity_Branch unless the entity overlaps the player horizontally.
64031 ADD A,A
64032 ADD A,A
64033 ADD A,A
64034 ADD A,(IX+2)
64037 LD C,A
64038 LD A,(IY+0)
64041 ADD A,A
64042 ADD A,A
64043 ADD A,A
64044 ADD A,(IY+2)
64047 CP C
64048 SBC A,0
64050 ADD A,L
64051 SUB C
Erase_Entity_WidthCompare 64052 CP 0 Compare against the stored width and jump to Erase_Entity_Branch if there is no overlap.
64054 JR NC,Erase_Entity_Branch
64056 LD A,B Jump to Erase_Entity_Branch unless the entity overlaps the player vertically.
64057 ADD A,A
64058 ADD A,A
64059 ADD A,A
64060 ADD A,(IX+3)
64063 LD C,A
64064 LD A,(IY+1)
64067 ADD A,A
64068 ADD A,A
64069 ADD A,A
64070 ADD A,(IY+3)
64073 CP C
64074 SBC A,0
64076 ADD A,H
64077 SUB C
Erase_Entity_HeightCompare 64078 CP 0 Compare against the stored height and jump to Erase_Entity_Branch if there is no overlap.
64080 JR NC,Erase_Entity_Branch
64082 LD A,1 Write 1 to *RestartRoomFlag.
64084 LD (25617),A
Erase_Entity_Branch 64087 POP IY Restore IY from the stack.
64089 RET Return.
Prev: 63668 Up: Map Next: 64090