![]() |
Routines |
| Prev: D508 | Up: Map | Next: D589 |
|
Reads a cell from the map (TOWN, 32 rows of 32 bytes) and keeps its column and row in CELL_LOOKED_UP for PROJECT_CELL. The cell comes in the view's terms: with the town turned round the offset into the map is complemented and added to the address one past its end, which reads the map backwards from its last byte -- the same as turning the cell round with TURN_CELL. The listing would otherwise call that address DRAW_ORDER, the table that follows the map.
|
||||||||||||||||
| LOOK_UP_CELL | D564 | LD (CELL_LOOKED_UP),HL | Kept for the projection | |||||||||||||
| D567 | LD A,L | HL = the row times 32, plus the column | ||||||||||||||
| D568 | LD L,H | |||||||||||||||
| D569 | LD H,$00 | |||||||||||||||
| D56B | ADD HL,HL | |||||||||||||||
| D56C | ADD HL,HL | |||||||||||||||
| D56D | ADD HL,HL | |||||||||||||||
| D56E | ADD HL,HL | |||||||||||||||
| D56F | ADD HL,HL | |||||||||||||||
| D570 | OR L | |||||||||||||||
| D571 | LD L,A | |||||||||||||||
| D572 | LD BC,TOWN | Turned round? | ||||||||||||||
| D575 | LD A,(VIEW) | |||||||||||||||
| D578 | AND $01 | |||||||||||||||
| D57A | JR Z,LOOK_UP_CELL_0 | |||||||||||||||
| D57C | LD A,L | The offset complemented, from one past the map's end: the map read backwards | ||||||||||||||
| D57D | CPL | |||||||||||||||
| D57E | LD L,A | |||||||||||||||
| D57F | LD A,H | |||||||||||||||
| D580 | CPL | |||||||||||||||
| D581 | LD H,A | |||||||||||||||
| D582 | LD BC,DRAW_ORDER | |||||||||||||||
| LOOK_UP_CELL_0 | D585 | ADD HL,BC | The type; Z if open | |||||||||||||
| D586 | LD A,(HL) | |||||||||||||||
| D587 | AND A | |||||||||||||||
| D588 | RET | |||||||||||||||
| Prev: D508 | Up: Map | Next: D589 |