![]() |
Routines |
| Prev: 6720 | Up: Map | Next: 676F |
|
Used by the routine at PrintHeader.
|
||||
| ClearPlayArea | 672E | LD HL,$5820 | Clear 02E0 bytes of the attribute buffer from 5820 to 5AFF. | |
| 6731 | LD DE,$5821 | |||
| 6734 | LD BC,$02DF | |||
| 6737 | LD (HL),$00 | |||
| 6739 | LDIR | |||
| 673B | LD HL,$4800 | Clear 1000 bytes of the screen buffer from 4800 to 57FF. | ||
| 673E | LD DE,$4801 | |||
| 6741 | LD BC,$0FFF | |||
| 6744 | LD (HL),L | |||
| 6745 | LDIR | |||
| 6747 | LD HL,$4020 | Point HL to screen buffer position 4020 and DE to screen buffer position 4021. | ||
| 674A | LD DE,$4021 | |||
| 674D | LD B,$07 | Set a counter in B for 07 character rows. | ||
| ClearPlayArea_RowLoop | 674F | PUSH BC | Save the row counter on the stack. | |
| 6750 | LD B,$08 | Set a counter in B for 08 pixel lines. | ||
| ClearPlayArea_LineLoop | 6752 | PUSH BC | Stash the row counter and screen position pointers on the stack. | |
| 6753 | PUSH DE | |||
| 6754 | PUSH HL | |||
| 6755 | LD BC,$001F | Clear 1F bytes across the line. | ||
| 6758 | LD (HL),B | |||
| 6759 | LDIR | |||
| 675B | POP HL | Restore the screen position pointers. | ||
| 675C | POP DE | |||
| 675D | INC H | Move down one pixel line in the screen buffer. | ||
| 675E | INC D | |||
| 675F | POP BC | Restore the line counter and loop back to ClearPlayArea_LineLoop until all 08 lines are cleared. | ||
| 6760 | DJNZ ClearPlayArea_LineLoop | |||
| 6762 | LD H,$40 | Move to the next character row by resetting H and D to 40 then adding 20 to both L and E. | ||
| 6764 | LD D,H | |||
| 6765 | LD A,$20 | |||
| 6767 | ADD A,L | |||
| 6768 | LD L,A | |||
| 6769 | LD E,A | |||
| 676A | INC E | |||
| 676B | POP BC | Restore the row counter and loop back to ClearPlayArea_RowLoop until all 07 rows are cleared. | ||
| 676C | DJNZ ClearPlayArea_RowLoop | |||
| 676E | RET | Return. | ||
| Prev: 6720 | Up: Map | Next: 676F |