Prev: 38221 Up: Map Next: 38296
38242: Fill the interior of a drawn window with its specified attribute (i.e. background colour and colour of text within)
Used by the routine at 36987.
38242 LD BC,(23493) Load B with y-coordinate of top edge and C with x-coordinate of left edge
38246 CALL 36569 Update virtual attribute cursor (memory location 23487 and in HL)
The operand of the instruction at 38249 represents the attribute value with which to paint the window. This is modified by the instruction at 37061.
38249 LD A,0 Load A with attribute to paint with
38251 LD (HL),A Paint attribute data to attribute file at current virtual cursor (attribute) position
38252 LD A,(23495) Load A with x-coordinate of right side of area to fill
38255 CP C Check if left and right edges are at same x-coordinate (i.e. zero width)...
38256 JP Z,38272 ...and if so, skip to 38272
38259 INC C Increase C
38260 LD A,C Copy C into A
38261 AND 31 Ensure current x-coordinate doesn't exceed 31 (i.e. width of screen)
38263 LD C,A Place back into C
38264 LD A,L Get LSB of attribute file address (virtual attribute cursor location)
38265 AND 224 Decrease to nearest multiple of 32 (i.e. start of character row in attribute file)
38267 ADD A,C Add x-offset (i.e. current x-coordinate, C)
38268 LD L,A Update virtual attribute cursor position
38269 JP 38249 Loop back to print next attribute block
38272 LD A,(23493) Get x-coordinate of left of area to fill
38275 LD C,A Store in C
38276 LD A,(23496) Get y-coordinate of bottom of area to fill
38279 CP B Compare with y-coordinate of top of area to fill
38280 RET Z If no difference between current y-coordinate and y-coordinate of bottom of area to fill then exit function and return
38281 INC B Move current y-coordinate down one unit
38282 LD A,B Copy current y-coordinate into A...
38283 CP 24 ...and ensure it doesn't exceed 24 (i.e. height of screen)...
38285 JP NZ,38290 ...if it doesn't then skip ahead...
38288 LD B,0 ...else set current y-coordinate to zero (top of screen)
38290 CALL 36569 Update virtual attribute cursor (memory location 23487 and in HL)
38293 JP 38249 Loop back to print next attribute block row
Prev: 38221 Up: Map Next: 38296