Prev: D15D Up: Map Next: D18E
D17D: Turn a cell round with the town
Used by the routines at DRAW_CELLS and LIST_THINGS_IN_CELL.
With the town turned round (bit 0 of VIEW) it is seen from the other side, which is the same as the map read from its far corner: column c becomes 31 - c and row r becomes 31 - r. Doing it twice gives the cell back, so the same routine turns a cell from the town's terms to the view's (DRAW_CELLS) and back again (LIST_THINGS_IN_CELL). In the usual view, nothing.
Input
L the column
H the row
Output
HL the column and row, turned if the town is
TURN_CELL D17D LD A,(VIEW) The usual view: as they are
D180 AND $01
D182 RET Z
D183 LD A,L Otherwise each complemented, within 0-31
D184 CPL
D185 AND $1F
D187 LD L,A
D188 LD A,H
D189 CPL
D18A AND $1F
D18C LD H,A
D18D RET
Prev: D15D Up: Map Next: D18E