Prev: E200 Up: Map Next: E239
E21D: Fill Buffer
Used by the routine at CopyBuffersToScreen.
Fills a buffer with a word, by pushing it onto the stack. The buffer is filled downwards from the address in HL.
Input
B Number of rows of 24 bytes
DE Word to fill the buffer with
HL Address after the end of the buffer
Output
HL Address of the start of the buffer
Keep the stack pointer, and point it at the end of the buffer.
FillBuffer E21D LD ($BBAE),SP Save the stack pointer.
E221 LD SP,HL Point the stack pointer at the end of the buffer.
Fill a row.
FillBuffer_Row E222 PUSH DE Fill a row of 24 bytes by pushing twelve words onto the stack.
E223 PUSH DE
E224 PUSH DE
E225 PUSH DE
E226 PUSH DE
E227 PUSH DE
E228 PUSH DE
E229 PUSH DE
E22A PUSH DE
E22B PUSH DE
E22C PUSH DE
E22D PUSH DE
E22E DJNZ FillBuffer_Row Loop back until all of the rows have been filled.
Keep the start of the buffer, and restore the stack pointer.
E230 LD HL,$0000 Fetch the address of the start of the buffer.
E233 ADD HL,SP
E234 LD SP,($BBAE) Get the stack pointer back.
E238 RET Return.
View the equivalent code in;
Prev: E200 Up: Map Next: E239