Prev: C4D3 Up: Map Next: C525
C515: Fill Window
Fills a rectangle of the screen buffer, or of the attribute file, with one byte. The rows of the rectangle are 20 bytes apart.
Input
A Byte to fill the rectangle with
B Width of the rectangle in bytes
C Height of the rectangle in lines
HL Address of the first byte
Fill each line of the rectangle, then move down a row.
FillWindow C515 LD DE,$0020 Set DE to the length of a line.
FillWindow_Line C518 PUSH BC Stash the width and height on the stack.
C519 PUSH HL Stash the address of the start of the line on the stack.
FillWindow_Byte C51A LD (HL),A Fill a byte.
C51B INC HL Move on to the next byte.
C51C DJNZ FillWindow_Byte Jump to FillWindow_Byte until the line is filled.
C51E POP HL Restore the address of the start of the line from the stack.
C51F ADD HL,DE Move on to the next line.
C520 POP BC Restore the width and height from the stack.
C521 DEC C Decrease the number of lines left.
C522 JR NZ,FillWindow_Line Jump to FillWindow_Line until all of the lines have been filled.
C524 RET Return.
View the equivalent code in;
Prev: C4D3 Up: Map Next: C525