Prev: 48018 Up: Map Next: 48081
48027: Fill a region of attribute file with specified attribute (e.g. background colour and colour of text within)
Used by the routine at 47193.
48027 LD BC,(23408) Load BC with the coordinates of the top-left corner of the area to fill
48031 CALL 63219 Load HL with attribute file address for coordinates (C, B)
The operand of the instruction at 48034 is an attribute value. This is modified by the instruction at 47267.
48034 LD A,0 Load attribute to place into A
48036 LD (HL),A Apply attribute data to attribute file address in HL
48037 LD A,(23410) Load A with x-coordinate of right side of area to fill
48040 CP C Check if left and right edges are at same x-coordinate (i.e. zero width)...
48041 JP Z,48057 ...and if so, skip to 48057
48044 INC C Increase C
48045 LD A,C Copy C into A
48046 AND 31 Ensure current x-coordinate doesn't exceed 31 (i.e. width of screen)
48048 LD C,A Place back into C
48049 LD A,L Get LSB of attribute file address
48050 AND 224 Decrease to nearest multiple of 32 (i.e. start of character row in attribute file)
48052 ADD A,C Add x-offset (i.e. current x-coordinate, C)
48053 LD L,A Update HL with x-offset
48054 JP 48034 Loop back to 48034 to print next attribute block
48057 LD A,(23408) Get x-coordinate of left of area to fill
48060 LD C,A Store in C
48061 LD A,(23411) Get y-coordinate of bottom of area to fill
48064 CP B Compare with y-coordinate of top of area to fill
48065 RET Z If no difference between current y-coordinate and y-coordinate of bottom of area to fill then exit function and return
48066 INC B Advance current y-coordinate down one unit
48067 LD A,B Copy current y-coordinate into A...
48068 CP 24 ...and ensure it doesn't exceed 24 (i.e. height of screen)...
48070 JP NZ,48075 ...if it doesn't then skip ahead to 48075...
48073 LD B,0 ...else set current y-coordinate to zero (top of screen)
48075 CALL 63219 Load HL with attribute file address for coordinates (C, B)
48078 JP 48034 Loop back to print next attribute block row
Prev: 48018 Up: Map Next: 48081