![]() |
Routines |
| Prev: DAB7 | Up: Map | Next: DB89 |
|
Used by the routine at UPDATE_KNIGHT.
Z or SYMBOL SHIFT (bit 5 of the controls) turns the town round, to be seen from the other side, once a press: the key sets KEY_LATCH while held, and the turn happens when it is let go. The knight's facing gets a turn delay of two or three turns (bit 1 of +6), so a turn key held at the same time does not spin him while the view changes, and the panel's heading and compass are redrawn (PRINT_HEADING).
|
||||||||
| TURN_TOWN | DB68 | LD HL,KEY_LATCH | Held: remember it and wait | |||||
| DB6B | BIT 5,E | |||||||
| DB6D | JR Z,TURN_TOWN_0 | |||||||
| DB6F | LD (HL),$01 | |||||||
| DB71 | RET | |||||||
| TURN_TOWN_0 | DB72 | LD A,(HL) | Not held: done unless it was last turn | |||||
| DB73 | AND A | |||||||
| DB74 | RET Z | |||||||
| DB75 | LD (HL),$00 | |||||||
| DB77 | LD HL,VIEW | Turn the town round | ||||||
| DB7A | LD A,(HL) | |||||||
| DB7B | XOR $01 | |||||||
| DB7D | LD (HL),A | |||||||
| DB7E | LD A,(KNIGHT_FACING) | A turn delay for the knight | ||||||
| DB81 | OR $02 | |||||||
| DB83 | LD (KNIGHT_FACING),A | |||||||
| DB86 | JP PRINT_HEADING | Redraw the heading and the compass | ||||||
| Prev: DAB7 | Up: Map | Next: DB89 |