Prev: 74A4 Up: Map Next: 7592
7564: Clear Sprite Area
Clears a sprite area from the screen, skipping positions occupied by the player ship (INK:YELLOW, PAPER:BLACK (BRIGHT)) or (WHITE).
Input
DE Screen buffer address
ClearSpriteArea 7564 CALL ConvertScreenToAttributeBufferAddress Call ConvertScreenToAttributeBufferAddress.
7567 EX DE,HL Exchange the DE and HL registers.
7568 LD E,$01 Set the row counter to 01.
756A LD B,$03 Set a column counter in B for 03 columns.
ClearSpriteArea_ColumnLoop 756C PUSH BC Stash the column counter on the stack.
756D LD A,(HL) Jump to ClearSpriteArea_NextColumn if *HL is equal to INK:YELLOW, PAPER:BLACK (BRIGHT) or WHITE.
756E CP $46
7570 JR Z,ClearSpriteArea_NextColumn
7572 CP $07
7574 JR Z,ClearSpriteArea_NextColumn
7576 LD (HL),$00 Write 00 to *HL.
7578 PUSH HL Stash HL on the stack.
7579 CALL ConvertAttributeToScreenBufferAddress Call ConvertAttributeToScreenBufferAddress.
757C LD B,$08 Set a line counter in B (08 lines in a UDG).
757E XOR A A=00.
ClearSpriteArea_LineLoop 757F LD (HL),A Write A to *HL.
7580 INC H Increment H by one.
7581 DJNZ ClearSpriteArea_LineLoop Decrease the line counter by one and loop back to ClearSpriteArea_LineLoop until all 08 lines of the UDG character have been cleared.
7583 POP HL Restore HL from the stack.
ClearSpriteArea_NextColumn 7584 INC HL Increment HL by one.
7585 POP BC Restore BC from the stack.
7586 DJNZ ClearSpriteArea_ColumnLoop Decrease counter by one and loop back to ClearSpriteArea_ColumnLoop until counter is zero.
7588 LD A,E Return if E is zero.
7589 OR A
758A RET Z
758B LD C,$1E C=1E.
758D ADD HL,BC HL+=BC.
758E DEC E Decrease E by one.
758F INC B Increment B by one.
7590 JR ClearSpriteArea_ColumnLoop Jump to ClearSpriteArea_ColumnLoop.
Prev: 74A4 Up: Map Next: 7592