![]() |
Routines |
| Prev: ADC3 | Up: Map | Next: AE0D |
|
Colours the map of the sectors that is shown in the panel. Each of the nine sectors is a block of two by two attributes, and its colour depends on the state of the sector.
|
||||
| DrawSectorMap | ADEA | LD HL,$967E | Point HL at the table of sector states. | |
| ADED | LD B,$09 | There are nine sectors. | ||
| DrawSectorMap_Next | ADEF | LD E,(HL) | Fetch the state of the sector... | |
| ADF0 | LD D,$00 | ...and clear D. | ||
| ADF2 | PUSH HL | Save the address of the state. | ||
| ADF3 | LD HL,$AE25 | Point HL at SectorStateAttributes. | ||
| ADF6 | ADD HL,DE | Add the state. | ||
| ADF7 | LD A,(HL) | Fetch the attribute. | ||
| ADF8 | PUSH BC | Save the counter. | ||
| ADF9 | LD C,B | Fetch the counter into C... | ||
| ADFA | DEC C | ...and take one off. | ||
| ADFB | LD B,$00 | Clear the high byte of the counter. | ||
| ADFD | LD HL,$AE1C | Point HL at SectorMapOffsets. | ||
| AE00 | ADD HL,BC | Add the number of the sector. | ||
| AE01 | LD C,(HL) | Fetch the offset into C. | ||
| AE02 | LD B,$01 | Use 0100 as the high byte of the offset. | ||
| AE04 | CALL ColourSectorSquare | Colour the sector using ColourSectorSquare. | ||
| AE07 | POP BC | Restore the counter... | ||
| AE08 | POP HL | ...and the address of the state. | ||
| AE09 | INC HL | Move on to the next state. | ||
| AE0A | DJNZ DrawSectorMap_Next | Loop back until all nine sectors have been drawn. | ||
| AE0C | RET | Return. | ||
| Prev: ADC3 | Up: Map | Next: AE0D |