| The Hobbit (v1.0) | Routines |
| Prev: A1E4 | Up: Map | Next: A232 |
|
Swimming across the fast river: the exit through the river is found (9E6E); if it leads anywhere, the river is opened for a moment and the actor goes through it with an ordinary move (8D19, at 8D27), then the river is closed again. The entry at $A20C is the handler used by many doors and containers for their OPEN action when they are chained to a movement.
|
||||
| A1FD | CALL $9E6E | Find the exit that passes through the river | ||
| A200 | LD A,(IX+$02) | Does it lead anywhere? | ||
| A203 | CP $00 | |||
| A205 | JR NZ,$A20B | Yes: swim across, below | ||
| A207 | CALL $9C99 | No: dry run? Then stop here: the attempt itself is possible | ||
| A20A | RET | (falls through to failing normally otherwise) | ||
| A20B | LD A,(IX+$00) | A = the exit's own direction | ||
| A20E | LD HL,($B5D8) | Save the current action for a moment... | ||
| A211 | PUSH HL | |||
| A212 | LD ($B5D8),A | ...and use the direction as the movement action instead | ||
| A215 | LD IX,($B5F8) | IX = the river's own record | ||
| A219 | SET 5,(IX+$07) | Open it, just long enough to move through it | ||
| A21D | PUSH IX | |||
| A21F | LD A,$FF | No specific target - just moving | ||
| A221 | LD ($B5D9),A | |||
| A224 | CALL $8D27 | Carry out the move | ||
| A227 | POP IX | Restore the river's own record | ||
| A229 | RES 5,(IX+$07) | Close it again | ||
| A22D | POP HL | Restore the original action | ||
| A22E | LD ($B5D8),HL | |||
| A231 | RET | |||
| Prev: A1E4 | Up: Map | Next: A232 |