Prev: 48027 Up: Map Next: 48164
48081: Blank the interior of an area of the display file (i.e. set bytes to zero)
Used by the routine at 47193.
48081 PUSH IX Store IX
48083 LD BC,(23408) Load B with y-coordinate of top, and C with x-coordinate of left of area to fill
48087 LD DE,(23410) Load D with y-coordinate of bottom, and E with x-coordinate of right of area to fill
48091 LD L,C Load HL with x-coordinate of left of area to fill...
48092 LD H,0 ...
48094 LD (48141),HL ...and store as operand of instruction at 48140
48097 LD A,D Load A with y-coordinate of bottom of area to fill...
48098 SUB B ...subtract B (y-coordinate of top of area to fill)...
48099 INC A ...and add one to give number of rows to fill
48100 ADD A,A Multiply A by eight to get number of pixel rows to fill...
48101 ADD A,A ...
48102 ADD A,A ...
48103 LD (48132),A ...and store as operand of instruction at 48131
48106 LD A,B Load A with y-coordinate of top of area to fill (characters)...
48107 ADD A,A ...and multiply by eight to get y-coordinate in pixels...
48108 ADD A,A ...
48109 ADD A,A ...
48110 LD L,A Load y-coordinate (pixels) into HL...
48111 LD H,0 ...
48113 ADD HL,HL Double HL (as entries in table at 65140 are two bytes wide)
48114 PUSH DE Store DE (coordinates of bottom right of area to fill)
48115 LD DE,65140 Point DE at table of display file addresses of start of each pixel row
48118 ADD HL,DE Add HL as offset, in HL
48119 POP DE Restore DE (coordinates of bottom right of area to fill)
48120 PUSH HL Copy pointer to entry in table of display file addresses for start of pixel row at top of area to fill from HL to IX...
48121 POP IX ...
48123 LD A,E Load A with x-coordinate of right of area to fill (characters)...
48124 SUB C ...subtract C (x-coordinate of left of area to fill)...
48125 LD L,A ...and load into HL...
48126 LD H,0 ...
48128 LD (48148),HL ...and store as operand of instruction at 48147
The operand of the instruction at 48131 represents the number of pixel rows to fill. This is modified by the instruction at 48103.
48131 LD B,0 Load B with number of pixel rows to fill
48133 PUSH BC Store BC (B = remaining number of pixel rows to fill)
48134 LD L,(IX+0) Load HL with display file address of start of current pixel row...
48137 LD H,(IX+1) ...
The operand of the instruction at 48140 represents the x-coordinate of the area to fill (characters). This is modified by the instruction at 48094.
48140 LD BC,0 Load BC with x-coordinate of area to fill (characters)...
48143 ADD HL,BC ...and add to HL as offset
48144 PUSH HL Copy display file address of left-most byte of top pixel row of area to fill from HL to DE...
48145 POP DE ...
48146 INC DE Advance DE to next address in display file
The operand of the instruction at 48147 represents the width, minus 1, of the area to fill (characters). This is modified by the instruction at 48128.
48147 LD BC,0 Load BC with width, minus 1, of area to fill (characters)
48150 LD (HL),0 Set content of this address to zero...
48152 LDIR ...and repeat for remaining BC addresses, clearing entire pixel row within specified x-coordinates
48154 POP BC Restore BC (B = remaining number of pixel rows to fill)
48155 INC IX Advance IX by two bytes to point to start address of next pixel row down in display file...
48157 INC IX ...
48159 DJNZ 48133 Decrease B (remaining number of pixel rows to fill) and loop back to 48133 if not zero
48161 POP IX Restore IX
48163 RET Return
Prev: 48027 Up: Map Next: 48164