|  | Routines | 
| Prev: 35903 | Up: Map | Next: 35994 | 
| 35940 | LD BC,(23493) | Load BC with the coordinates of the top-left corner of the area to fill | ||
| 35944 | CALL 54148 | Load HL with attribute file address for coordinates (C, B) | ||
| 
The operand of the instruction at 35947 is an attribute value. This is modified by the instructions at 32170, 32411, 32440, 32613, 35064, 35842, 35853 and 35868.
 | ||||
| 35947 | LD A,0 | Load attribute to place into A | ||
| 35949 | LD (HL),A | Apply attribute data to attribute file address in HL | ||
| 35950 | LD A,(23495) | Load A with x-coordinate of right side of area to fill | ||
| 35953 | CP C | Check if left and right edges are at same x-coordinate (i.e. zero width)... | ||
| 35954 | JP Z,35970 | ...and if so, skip to 35970 | ||
| 35957 | INC C | Increase C | ||
| 35958 | LD A,C | Copy C into A | ||
| 35959 | AND 31 | Ensure current x-coordinate doesn't exceed 31 (i.e. width of screen) | ||
| 35961 | LD C,A | Place back into C | ||
| 35962 | LD A,L | Get LSB of attribute file address | ||
| 35963 | AND 224 | Decrease to nearest multiple of 32 (i.e. start of character row in attribute file) | ||
| 35965 | ADD A,C | Add x-offset (i.e. current x-coordinate, C) | ||
| 35966 | LD L,A | Update HL with x-offset | ||
| 35967 | JP 35947 | Loop back to 35947 to print next attribute block | ||
| 35970 | LD A,(23493) | Get x-coordinate of left of area to fill | ||
| 35973 | LD C,A | Store in C | ||
| 35974 | LD A,(23496) | Get y-coordinate of bottom of area to fill | ||
| 35977 | CP B | Compare with y-coordinate of top of area to fill | ||
| 35978 | RET Z | If no difference between current y-coordinate and y-coordinate of bottom of area to fill then exit function and return | ||
| 35979 | INC B | Advance current y-coordinate down one unit | ||
| 35980 | LD A,B | Copy current y-coordinate into A... | ||
| 35981 | CP 24 | ...and ensure it doesn't exceed 24 (i.e. height of screen)... | ||
| 35983 | JP NZ,35988 | ...if it doesn't then skip ahead to 35988... | ||
| 35986 | LD B,0 | ...else set current y-coordinate to zero (top of screen) | ||
| 35988 | CALL 54148 | Load HL with attribute file address for coordinates (C, B) | ||
| 35991 | JP 35947 | Loop back to print next attribute block row | ||
| Prev: 35903 | Up: Map | Next: 35994 |