Prev: B6CD Up: Map Next: B6ED
B6DD: Fill Window
Used by the routines at DrawChangedObjects and DisplayObjectsCarried.
Fills a rectangle of the buffer with a byte.
Input
A Byte to fill with
B Width in bytes
C Height in lines
HL Address in the buffer of the bottom left byte
Set the line length of the buffer.
FillWindow B6DD LD DE,$0020 Set DE to the length of a line of the buffer.
Fill one line, then step to the next.
FillWindow_NextLine B6E0 PUSH BC Stash the counters and the start of the line on the stack.
B6E1 PUSH HL
FillWindow_NextByte B6E2 LD (HL),A Write the byte.
B6E3 INC HL Move on to the next byte.
B6E4 DJNZ FillWindow_NextByte Decrease the width counter and loop until the line has been filled.
B6E6 POP HL Restore the start of the line from the stack.
B6E7 ADD HL,DE Move up to the next line.
B6E8 POP BC Restore the counters from the stack.
B6E9 DEC C Count down the lines and jump to FillWindow_NextLine until the rectangle is filled.
B6EA JR NZ,FillWindow_NextLine
B6EC RET Return.
View the equivalent code in;
Prev: B6CD Up: Map Next: B6ED