| Prev: 683B | Up: Map | Next: 68B7 |
68A1: Clear top screen rows after scrolling
|
Clears the top rows of the screen based on scroll speed. After screen content scrolls upward, the topmost rows contain old data that needs to be zeroed.
|
||||
| clear_top_rows | 68A1 | LD HL,$4000 | Initialize screen pointer, row offset, and row count from speed. | |
| 68A4 | LD DE,$00E0 | |||
| 68A7 | LD A,($5F64) | |||
| clear_row_loop | 68AA | LD B,$20 | Set bytes per row (32). | |
| clear_byte_loop | 68AC | LD (HL),$00 | Clear byte, advance pointer, loop 32 times. | |
| 68AE | INC HL | |||
| 68AF | DJNZ clear_byte_loop | |||
| 68B1 | ADD HL,DE | Advance to next row and loop until all rows cleared. | ||
| 68B2 | DEC A | |||
| 68B3 | JP NZ,clear_row_loop | |||
| 68B6 | RET | |||
| Prev: 683B | Up: Map | Next: 68B7 |