Prev: 26400 Up: Map Next: 26479
26414: Clear Play-Area
Used by the routine at PrintHeader.
ClearPlayArea 26414 LD HL,22560 Clear 736 bytes of the attribute buffer from 22560 to 23295.
26417 LD DE,22561
26420 LD BC,735
26423 LD (HL),0
26425 LDIR
26427 LD HL,18432 Clear 4096 bytes of the screen buffer from 18432 to 22527.
26430 LD DE,18433
26433 LD BC,4095
26436 LD (HL),L
26437 LDIR
26439 LD HL,16416 Point HL to screen buffer position 16416 and DE to screen buffer position 16417.
26442 LD DE,16417
26445 LD B,7 Set a counter in B for 7 character rows.
ClearPlayArea_RowLoop 26447 PUSH BC Save the row counter on the stack.
26448 LD B,8 Set a counter in B for 8 pixel lines.
ClearPlayArea_LineLoop 26450 PUSH BC Stash the row counter and screen position pointers on the stack.
26451 PUSH DE
26452 PUSH HL
26453 LD BC,31 Clear 31 bytes across the line.
26456 LD (HL),B
26457 LDIR
26459 POP HL Restore the screen position pointers.
26460 POP DE
26461 INC H Move down one pixel line.
26462 INC D
26463 POP BC Restore the line counter and loop back to ClearPlayArea_LineLoop until all 8 lines are cleared.
26464 DJNZ ClearPlayArea_LineLoop
26466 LD H,64 Move to the next character row by resetting H and D to 64 then adding 32 to both L and E.
26468 LD D,H
26469 LD A,32
26471 ADD A,L
26472 LD L,A
26473 LD E,A
26474 INC E
26475 POP BC Restore the row counter and loop back to ClearPlayArea_RowLoop until all 7 rows are cleared.
26476 DJNZ ClearPlayArea_RowLoop
26478 RET Return.
Prev: 26400 Up: Map Next: 26479