![]() |
Routines |
| Prev: 53156 | Up: Map | Next: 53360 |
|
Used by the routine at Process_Wall_Bouncing_Enemy.
Paints the entity colour attribute across a three-cell-wide, three-row region of the attribute area at the entity's screen position. Uses Screen_Row_Address_Lookup_Table to resolve each pixel row to its attribute address; the colour is read from shadow B'. Called by Process_Wall_Bouncing_Enemy.
|
||||||||
| Paint_Wide_Entity_Attributes | 53252 | INC HL | Step to the entity Y position and load the attribute colour base into D. | |||||
| 53253 | LD D,70 | |||||||
| 53255 | LD E,(HL) | |||||||
| 53256 | INC HL | |||||||
| 53257 | SLA E | Shift the Y position left to form the row address table index in DE. | ||||||
| 53259 | RL D | |||||||
| 53261 | LD A,(HL) | Rotate the X position right three places to derive the attribute column. | ||||||
| 53262 | RRA | |||||||
| 53263 | RRA | |||||||
| 53264 | RRA | |||||||
| 53265 | AND %00011111 | Keep the attribute column index. | ||||||
| 53267 | LD C,A | Store the column index in C. | ||||||
| 53268 | EXX | Copy the entity colour attribute from shadow B' into B. | ||||||
| 53269 | LD A,B | |||||||
| 53270 | EXX | |||||||
| 53271 | LD B,A | |||||||
|
Write the entity colour to three adjacent attribute cells in each of three consecutive entity rows.
|
||||||||
| 53272 | LD A,(DE) | Look up the first attribute row address and add the column offset. | ||||||
| 53273 | ADD A,C | |||||||
| 53274 | LD L,A | |||||||
| 53275 | INC DE | |||||||
| 53276 | LD A,(DE) | |||||||
| 53277 | LD H,A | |||||||
| 53278 | INC DE | |||||||
| 53279 | LD A,H | Isolate the attribute page bits. | ||||||
| 53280 | RRCA | |||||||
| 53281 | RRCA | |||||||
| 53282 | RRCA | |||||||
| 53283 | AND %00000011 | Keep only the two attribute page bits. | ||||||
| 53285 | OR %01011000 | Combine with the attribute area base address. | ||||||
| 53287 | LD H,A | Store the computed attribute high byte. | ||||||
| 53288 | LD (HL),B | Write the entity colour to three adjacent attribute cells. | ||||||
| 53289 | INC HL | |||||||
| 53290 | LD (HL),B | |||||||
| 53291 | INC HL | |||||||
| 53292 | LD (HL),B | |||||||
| 53293 | INC DE | Advance the row address pointer to the second entity row. | ||||||
| 53294 | INC DE | |||||||
| 53295 | INC DE | |||||||
| 53296 | INC DE | |||||||
| 53297 | INC DE | |||||||
| 53298 | INC DE | |||||||
| 53299 | INC DE | |||||||
| 53300 | INC DE | |||||||
| 53301 | INC DE | |||||||
| 53302 | INC DE | |||||||
| 53303 | INC DE | |||||||
| 53304 | INC DE | |||||||
| 53305 | LD A,(DE) | Look up the second attribute row address and add the column offset. | ||||||
| 53306 | ADD A,C | |||||||
| 53307 | LD L,A | |||||||
| 53308 | INC DE | |||||||
| 53309 | LD A,(DE) | |||||||
| 53310 | LD H,A | |||||||
| 53311 | INC DE | |||||||
| 53312 | LD A,H | Isolate the attribute page bits. | ||||||
| 53313 | RRCA | |||||||
| 53314 | RRCA | |||||||
| 53315 | RRCA | |||||||
| 53316 | AND %00000011 | Keep only the two attribute page bits. | ||||||
| 53318 | OR %01011000 | Combine with the attribute area base address. | ||||||
| 53320 | LD H,A | Store the computed attribute high byte. | ||||||
| 53321 | LD (HL),B | Write the entity colour to three adjacent attribute cells. | ||||||
| 53322 | INC HL | |||||||
| 53323 | LD (HL),B | |||||||
| 53324 | INC HL | |||||||
| 53325 | LD (HL),B | |||||||
| 53326 | INC DE | Advance the row address pointer to the third entity row. | ||||||
| 53327 | INC DE | |||||||
| 53328 | INC DE | |||||||
| 53329 | INC DE | |||||||
| 53330 | INC DE | |||||||
| 53331 | INC DE | |||||||
| 53332 | INC DE | |||||||
| 53333 | INC DE | |||||||
| 53334 | INC DE | |||||||
| 53335 | INC DE | |||||||
| 53336 | INC DE | |||||||
| 53337 | INC DE | |||||||
| 53338 | INC DE | |||||||
| 53339 | INC DE | |||||||
| 53340 | LD A,(DE) | Look up the third attribute row address and add the column offset. | ||||||
| 53341 | ADD A,C | |||||||
| 53342 | LD L,A | |||||||
| 53343 | INC DE | |||||||
| 53344 | LD A,(DE) | |||||||
| 53345 | INC DE | |||||||
| 53346 | RRCA | Isolate the attribute page bits. | ||||||
| 53347 | RRCA | |||||||
| 53348 | RRCA | |||||||
| 53349 | AND %00000011 | Keep only the two attribute page bits. | ||||||
| 53351 | OR %01011000 | Combine with the attribute area base address. | ||||||
| 53353 | LD H,A | Store the computed attribute high byte. | ||||||
| 53354 | LD (HL),B | Write the entity colour to three adjacent attribute cells. | ||||||
| 53355 | INC HL | |||||||
| 53356 | LD (HL),B | |||||||
| 53357 | INC HL | |||||||
| 53358 | LD (HL),B | |||||||
| 53359 | RET | Return. | ||||||
| Prev: 53156 | Up: Map | Next: 53360 |