| The Hobbit (v1.0) | Routines |
| Prev: A8D9 | Up: Map | Next: A950 |
|
An actor can get into the barrel only from a room with an exit leading to where the barrel is, and only if that exit goes down (direction 10). Otherwise 'you cannot jump onto the barrel from here.' The actor then becomes held by the barrel (and so moves with it, 9B38).
|
||||
| A91B | LD IY,($B5F8) | IY = the barrel's own record | ||
| A91F | LD A,(IY+$10) | B = the room the barrel is in | ||
| A922 | LD B,A | |||
| A923 | CALL $9E76 | Find an exit from the actor's own room that leads there | ||
| A926 | CP $FF | |||
| A928 | LD HL,$B1F3 | "you cannot jump onto the barrel from here." | ||
| A92B | JP Z,$72D4 | No such exit: say so and stop | ||
| A92E | LD A,(IX+$00) | A = that exit's own direction | ||
| A931 | CP $0A | Is it DOWN? | ||
| A933 | JP NZ,$B1F3 | No: jump to the message text itself, rather than through the printer - see the bug note | ||
| A936 | CALL $9C99 | Dry run? Then stop here: it would work | ||
| A939 | LD A,($B5D9) | The actor becomes held by the barrel... | ||
| A93C | LD IX,($B5FC) | |||
| A940 | LD (IX+$01),A | |||
| A943 | CALL $9B38 | ...and moves wherever the barrel goes | ||
| A946 | LD A,($B5DB) | Is the actor Bilbo? | ||
| A949 | CP $00 | |||
| A94B | RET NZ | No: nothing more to do | ||
| A94C | LD A,B | Yes: describe the room the barrel is now in | ||
| A94D | JP $958E | |||
| Prev: A8D9 | Up: Map | Next: A950 |