Prev: 936E Up: Map Next: 93CD
9392: PUT or DROP something in the river
The rivers' PUT IN and DROP IN handler. The river is an object in two places, one on each bank. The thing dropped in is carried to the location on the other side from the actor ('... and it gets swept away'); if the actor is on the river's second bank, the thing goes to location 0, and is lost.
9392 CALL $8CBA Is the target something that can even be picked up?
9395 CALL $9C99 Dry run? Then stop here: it would work
9398 LD A,($B5E7) A = the room the actor started this turn in (one bank of the river)
939B LD IX,($B5FA) IX = the river's own record (which has two locations, one on each bank)
939F LD B,(IX+$00) B = how many locations it has
93A2 CP (IX+$10) Is the actor's bank the FIRST of them?
93A5 JR Z,$93AE
93A7 INC IX No: try the next location
93A9 DJNZ $93A2
93AB JP $72C5 Neither bank matches (should not happen): "I cannot do that."
93AE LD A,(IX+$11) A = the OTHER bank (the one after this location)
93B1 DEC B Was this actually the last location?
93B2 JR NZ,$93B5
93B4 XOR A If so, there is no far bank: it is simply lost (room 0)
93B5 LD IX,($B5F8) IX = the target's own record
93B9 LD (IX+$10),A It moves to the far bank...
93BC LD (IX+$01),$FF ...held by nobody
93C0 LD B,A B = that room
93C1 LD A,($B5D9) Move it there, and report it if Bilbo can see
93C4 CALL $9B38
93C7 LD HL,$ACEF "...and it gets swept away."
93CA JP $72D4
Prev: 936E Up: Map Next: 93CD