Prev: 43746 Up: Map Next: 43791
43749: Fill Scratch Rectangle
Used by the routines at PrintText and DrawFrame.
Fills a rectangle of the attribute file using the rectangle at AttributeRectangle.
Input
HL The pixel position of the bottom left of the rectangle
FillScratchRectangle 43749 LD DE,43746 Point DE at the rectangle.
This entry point is used by the routines at ShowEnding, SwitchPlayer, StartGame, RunGame, DrawPanel and DrawGaugeBar.
This entry point takes the address of the rectangle in DE.
FillRectangle 43752 PUSH HL Save the position.
43753 CALL GetAttributeAddress Convert the position into an attribute address.
43756 LD A,(DE) Fetch the width of the rectangle.
43757 LD (43775),A Store it in the operand of the instruction at 43774.
43760 ADD A,30 Add 30 to it.
43762 CPL Invert it, to make minus the width less 31.
43763 LD (43783),A Store it in the operand of the instruction at 43782.
43766 INC DE Move onto the height.
43767 LD A,(DE) Fetch it.
43768 LD C,A Keep the height in C.
43769 INC DE Move onto the attribute.
43770 LD A,(DE) Fetch it.
43771 LD (43777),A Store it in the operand of the instruction at 43776.
FillRectangle_Row 43774 LD B,0 Set the width of the row (this is patched at 43775).
FillRectangle_Cell 43776 LD (HL),0 Set the attribute of a cell (this is patched at 43777).
43778 INC L Move onto the next cell.
43779 DJNZ FillRectangle_Cell Jump back until the row has been filled.
43781 DEC L Move back to the last cell of the row.
43782 LD DE,65280 Set the offset to the start of the row above (this is patched at 43783).
43785 ADD HL,DE Add it to the address.
43786 DEC C Decrease the height by one.
43787 JR NZ,FillRectangle_Row Jump back until all of the rows have been filled.
43789 POP HL Restore the position.
43790 RET Return.
Prev: 43746 Up: Map Next: 43791