Prev: D17D Up: Map Next: D19D
D18E: Turn a position round with the town
Used by the routine at PROJECT_THING.
The same for a position along U or V, whose high byte is the cell and low byte the place in it: turned round, it becomes the distance from the far edge of the town, 8191 less it. Used by PROJECT_THING for a thing's U and V.
Input
HL a U or a V
Output
HL the same, turned if the town is
TURN_POSITION D18E LD A,(VIEW) The usual view: as it is
D191 AND $01
D193 RET Z
D194 LD A,L Otherwise both bytes complemented, the high one within 0-31
D195 CPL
D196 LD L,A
D197 LD A,H
D198 CPL
D199 AND $1F
D19B LD H,A
D19C RET
Prev: D17D Up: Map Next: D19D