Prev: E220 Up: Map Next: E286
E25B: Clear the playing area (pixels)
Used by the routines at C63B and DA4D.
E25B LD A,$0E Playing area is 14 character rows high
E25D LD ($EAC7),A
E260 LD DE,$4042 Screen display address for top left of playing area
Clear a character row (8 pixels) of the playing area:
E263 LD C,$08 8 pixel rows
E265 LD H,D Copy screen display address from DE to HL
E266 LD L,E
E267 LD B,$1C 28 character rows to clear
E269 LD (HL),$00 Clear pixel byte
E26B INC L Move on character square right
E26C DJNZ $E269 Repeat for 28 character rows
E26E INC H Move down 1 pixel
E26F DEC C
E270 JR NZ,$E266 Repeat for 8 pixel rows
Move down to next (character) row:
E272 LD A,E Get starting left hand position
E273 ADD A,$20 Move down to next character square
E275 LD E,A Are we crossing a third-of-screen boundary?
E276 JR NC,$E27C
E278 LD A,D If so, recalculate screen display high-byte accordingly
E279 ADD A,$08
E27B LD D,A Store corrected screen address high byte back in D register
Check if all character rows have been cleared:
E27C LD A,($EAC7) Get character row counter
E27F DEC A ...and decrement
E280 LD ($EAC7),A
E283 JR NZ,$E263 Repeat for all 14 character squares of playing area
E285 RET
Prev: E220 Up: Map Next: E286