Prev: 30156 Up: Map Next: 30234
30160: Erase Sprite
Used by the routines at 29861 and 29980.
Input
B Loop counter
C Actor Y position, or zero?
DE Address into a sprite/buffer
HL Address in the DISPLAY_FILE
MaskSprite 30160 LD A,C Jump to MaskSprite_4 if the sprites vertical position is zero.
30161 AND A
30162 JR Z,MaskSprite_4
30164 DEC C Else decrement.
30165 PUSH BC Stash BC and HL on the stack.
30166 PUSH HL
Loop to create a mask of the sprite and it write to the screen.
MaskSprite_0 30167 LD A,(DE) A=sprite byte.
30168 CPL Create mask and write to screen.
30169 AND (HL)
30170 LD (HL),A
30171 INC DE Move onto the next byte.
30172 INC L Move onto the next column.
30173 DJNZ MaskSprite_0 Decrease counter by one and loop back to MaskSprite_0 until counter is zero.
30175 POP HL Restore HL from the stack.
30176 CALL ScreenPos1PixelAbove Call ScreenPos1PixelAbove.
30179 POP BC Restore BC from the stack.
30180 EXX
30181 LD A,C Jump to MaskSprite_3 if C is zero.
30182 AND A
30183 JR Z,MaskSprite_3
MaskSprite_1 30185 DEC C
30186 PUSH BC Stash BC and HL on the stack.
30187 PUSH HL
MaskSprite_2 30188 LD A,(DE)
30189 OR (HL)
30190 LD (HL),A
30191 INC DE
30192 INC L
30193 DJNZ MaskSprite_2
30195 POP HL Restore HL from the stack.
30196 CALL ScreenPos1PixelAbove Call ScreenPos1PixelAbove.
30199 POP BC Restore BC from the stack.
MaskSprite_3 30200 EXX
30201 JR MaskSprite
MaskSprite_4 30203 EXX
30204 LD A,C
30205 AND A
30206 JR NZ,MaskSprite_1
This entry point is used by the routine at 29861.
MaskSprite_5 30208 EXX
This entry point is used by the routine at 29861.
MaskSprite_6 30209 LD A,(24080)
30212 LD C,A
30213 LD A,(24081)
30216 OR C
30217 RET Z
30218 XOR A
30219 LD (24080),A
30222 EXX
30223 LD A,(24081)
30226 LD C,A
30227 XOR A
This entry point is used by the routine at 29861.
MaskSprite_7 30228 LD (24081),A
30231 EXX
30232 JR MaskSprite
Prev: 30156 Up: Map Next: 30234