| The Hobbit (v1.0) | Routines |
| Prev: A6B8 | Up: Map | Next: A762 |
|
Throwing the rope across a river: the exit through the river must lead somewhere. 'it sails across and ...'. Then chance takes over (A762: evens). If the wooden boat (object 41, location at C51A) is moored on the far side, the rope may land in the boat, which is then tied to it ('lands in the boat'), or fall short; if the boat is not there, the rope may land on the other side (and is moved there) or fall just short of it and come back.
|
||||
| A708 | LD A,($B5DA) | A = the instrument (the river) | ||
| A70B | CALL $9E71 | Find the exit that passes through it | ||
| A70E | CP $FF | |||
| A710 | JP Z,$9EBF | No such exit: fail with the usual message | ||
| A713 | CALL $9C99 | Dry run? Then stop here: it would work | ||
| A716 | LD HL,$AE59 | "it sails across and" | ||
| A719 | CALL $72D4 | |||
| A71C | LD A,($C51A) | A = wherever the wooden boat currently is | ||
| A71F | CP (IX+$02) | Is the boat moored on the far side of this exit? | ||
| A722 | JR NZ,$A740 | No: try the other outcome, below | ||
| A724 | CALL $A762 | Yes: an even chance - does the rope land well? | ||
| A727 | JR C,$A736 | No: it falls short or slides out (below) | ||
| A729 | LD HL,$AE69 | "falls just short of the other side." | ||
| A72C | CALL $A762 | Another even chance - does it end up IN the boat, or just miss? | ||
| A72F | JR C,$A75F | It just misses: print the "falls short" message and finish | ||
| A731 | LD HL,$AE75 | "lands in the boat. but slides out again." | ||
| A734 | JR $A75F | |||
| A736 | LD A,$12 | It landed well: mark the boat as now tied to the rope, for A76A to use | ||
| A738 | LD ($C50B),A | |||
| A73B | LD HL,$AE7E | "lands in the boat." | ||
| A73E | JR $A75F | |||
| A740 | LD HL,$AE69 | The boat is not over there: another even chance - does the rope reach the far bank anyway? | ||
| A743 | CALL $A762 | |||
| A746 | JR C,$A75F | No: print "falls just short" and finish | ||
| A748 | LD A,(IX+$02) | Yes: A = the far bank | ||
| A74B | LD IX,($B5F8) | IX = the rope's own record | ||
| A74F | LD (IX+$10),A | It moves to that bank... | ||
| A752 | LD (IX+$01),$FF | ...held by nobody | ||
| A756 | LD A,($B5D9) | Move it there, and report it if Bilbo can see | ||
| A759 | CALL $9B38 | |||
| A75C | LD HL,$AE60 | "lands on the other side." | ||
| A75F | JP $72D4 | |||
| Prev: A6B8 | Up: Map | Next: A762 |