Prev: 51567 Up: Map Next: 51635
51601: Fill Attributes
Fills an area of the attributes with one value. The area starts with its width, its height and the attribute. The position is that of the bottom row of the area, and the rows are filled going up the screen.
Input
DE Address of the area
HL Position (H is the pixel row and L is the pixel column)
FillAttributes 51601 LD A,(DE) Read DE.
51602 LD B,A B=A.
51603 INC DE Advance DE.
51604 LD A,(DE) Read DE.
51605 LD C,A C=A.
51606 CALL AttributeAddress Call AttributeAddress.
51609 INC DE Advance DE.
51610 LD A,(DE) Read DE.
51611 INC DE Advance DE.
51612 PUSH DE Stash DE on the stack.
51613 LD D,A D=A.
51614 LD E,B E=B.
FillAttributes_Row 51615 PUSH HL Stash HL on the stack.
51616 LD B,E B=E.
FillAttributes_Loop 51617 LD (HL),D Write D where HL points.
51618 INC HL Advance HL.
51619 DJNZ FillAttributes_Loop Decrease B and jump to FillAttributes_Loop until none remain.
51621 POP HL Bring HL back off the stack.
51622 PUSH BC Stash BC on the stack.
51623 LD BC,32 BC=32.
51626 AND A Is A zero?
51627 SBC HL,BC Subtract BC and the carry from HL.
51629 POP BC Bring BC back off the stack.
51630 DEC C Step C back.
51631 JR NZ,FillAttributes_Row Jump to FillAttributes_Row if the zero flag is clear.
51633 POP DE Bring DE back off the stack.
51634 RET Return.
Prev: 51567 Up: Map Next: 51635