| The Hobbit (v1.0) | Routines |
| Prev: A7EA | Up: Map | Next: A842 |
|
If Gollum is in Bilbo's room: usually, if Gollum still has the golden ring (object 16), 'my birthday present, how did we lose it. my precious'; otherwise 'what has it got in its pocketses?'. The test at A82A only rarely (a random 8) says the pocketses line regardless.
|
||||
| A81A | LD A,($C3B0) | A = Gollum's own location | ||
| A81D | LD HL,$B5E6 | Is Bilbo in the same room? | ||
| A820 | CP (HL) | |||
| A821 | RET NZ | No: say nothing | ||
| A822 | CALL $9C99 | Dry run? Then stop here: it always works | ||
| A825 | LD HL,$B1CB | "what has it got in its pocketses?" | ||
| A828 | LD A,$08 | Pick a random number from 0 to 8 | ||
| A82A | CALL $9BF4 | |||
| A82D | JP NC,$A113 | Is it negative (the rare, skewed case)? If so, say that regardless | ||
| A830 | LD IX,$C209 | Otherwise: IX = the golden ring's own record | ||
| A834 | LD A,$44 | Does Gollum (object 68) still hold it? | ||
| A836 | CP (IX+$01) | |||
| A839 | JP Z,$A113 | Yes: say the "pocketses" line anyway | ||
| A83C | LD HL,$B1D9 | "my birthday present, how did we lose it. my precious" | ||
| A83F | JP $A113 | No (he has lost it): say that instead | ||
| Prev: A7EA | Up: Map | Next: A842 |