Prev: 49023 Up: Map Next: 49080
49029: Select Mirrored Erase
Used by the routine at RunFrame.
Used when the ship is erased. If it is facing left (bit 7 of 51453 or of A if entered at SelectMirroredErase_Entry) the horizontal position is moved to the other side of the sprite by its width in ScratchQuad and IY is pointed at the routine for the width in the table at EraseMirroredRowDirectly, which erases a mirrored sprite.
Input
HL' Position (if entered at SelectMirroredErase_Entry)
Output
IY Address of the routine
SelectMirroredErase 49029 LD A,(51453) The ship's facing.
This entry point is used by the routine at DrawPiece.
SelectMirroredErase_Entry 49032 LD HL,(49027) Fetch the word at 49027 into HL.
49035 BIT 7,A Return if bit 7 of A is clear.
49037 RET Z
49038 LD B,249 B=249.
49040 LD A,(23592) The sprite width in bytes.
49043 DEC A Step A back.
49044 ADD A,A Double A.
49045 ADD A,A Double A.
49046 ADD A,A Double A.
49047 ADD A,L A gains L.
49048 LD (49027),A The column on the other side of the sprite.
49051 LD A,(23592) The sprite width in bytes.
49054 LD IY,42916 The erase mirrored row directly.
49058 CP 6 Return if A is 6.
49060 RET Z
49061 LD IY,42924 The second mirrored-row erase.
49065 CP 5 Return if A is 5.
49067 RET Z
49068 LD IY,42932 The third mirrored-row erase.
49072 CP 4 Return if A is 4.
49074 RET Z
49075 LD IY,42940 The fourth mirrored-row erase.
49079 RET Return.
Prev: 49023 Up: Map Next: 49080