| The Hobbit (v1.0) | Routines |
| Prev: A2C0 | Up: Map | Next: A316 |
|
Taking the ring off (also done automatically when timer 6 runs out, A9D4). If the ring is visible it is not being worn: '<actor> is not wearing the ring.' Otherwise the ring and its wearer become visible again, the wearer's strength is multiplied by 4, and timer 6 is stopped.
Because putting the ring on divided the strength by 4 with SRL and taking it off multiplies it by 4 with SLA, the two lowest bits are lost each time: a strength of 74, for example, comes back as 72. Each use of the ring can cost Bilbo up to 3 points of strength.
|
||||
| A2EC | LD IX,($B5FC) | IX = the wearer's record | ||
| A2F0 | LD IY,$C209 | IY = the ring's record | ||
| A2F4 | BIT 7,(IY+$07) | Is the ring visible (not being worn)? | ||
| A2F8 | LD HL,$AF66 | "you are not wearing the ring." | ||
| A2FB | JP NZ,$72D4 | Yes: say so | ||
| A2FE | CALL $9C99 | Dry run? Then stop: it would work | ||
| A301 | SET 7,(IY+$07) | The ring can be seen again... | ||
| A305 | SET 7,(IX+$07) | ...and so can the wearer... | ||
| A309 | SLA (IX+$05) | ...whose strength is multiplied by 4 (the bottom two bits lost on the way in are gone) | ||
| A30D | SLA (IX+$05) | |||
| A311 | SUB A | Stop timer 6 | ||
| A312 | LD ($C99E),A | |||
| A315 | RET | |||
| Prev: A2C0 | Up: Map | Next: A316 |