Prev: 890A Up: Map Next: 8947
8931: Fill Attribute Row
Write D over a block of attributes, B columns wide and C rows high, stepping up a row at a time. Empty (zero) attributes are left alone.
Input
B Number of columns
C Number of rows
D Attribute value
HL Attribute address of the bottom-left cell
FillAttributeRow 8931 PUSH BC Stash the counters and attribute address.
8932 PUSH HL
FillAttributeRow_Loop 8933 LD A,(HL) Jump to FillAttributeRow_NextColumn if this attribute is empty.
8934 AND A
8935 JR Z,FillAttributeRow_NextColumn
8937 LD (HL),D Write the fill colour.
FillAttributeRow_NextColumn 8938 INC L Move onto the next column and loop back to FillAttributeRow_Loop.
8939 DJNZ FillAttributeRow_Loop
893B POP HL Restore this row and step up one attribute row.
893C LD BC,$0020
893F AND A
8940 SBC HL,BC
8942 POP BC
8943 DEC C Decrease the height and loop back to FillAttributeRow until every row is painted.
8944 JR NZ,FillAttributeRow
8946 RET Return.
Prev: 890A Up: Map Next: 8947