| The Hobbit (v1.0) | Routines |
| Prev: AA04 | Up: Map | Next: AA2E |
|
Called by 9611 on each turn that the eyes timer (entry at C9AB) is counting down and at or below its threshold of 3. It prints 'you see some pale bulbous eyes staring at you' (B203).
It then checks whether Bilbo has moved. C01B is Bilbo's location (the first location byte of object 0, see C00B) and B5E4 is the room he was in when the timer was started. If he is still in the same room, all is well. If he has moved to the other 'eyes' room (from 2 to 3 or from 3 to 2), all is also well. Otherwise he has left too early: execution falls into AA3E, which prints 'some thing drops from above and stings' (B211) and kills him (903C).
In practice the room-2/room-3 exception is never needed, because entering either room restarts the timer anyway (see C6CC).
|
||||
| AA13 | LD HL,$B203 | Print the eyes message | ||
| AA16 | CALL $72D4 | Print the message at HL | ||
| AA19 | LD A,($C01B) | C = Bilbo's current room | ||
| AA1C | LD C,A | C = A | ||
| AA1D | LD HL,$B5E4 | HL = the address of the room where the eyes timer started | ||
| AA20 | CP (HL) | Still in the same room: fine | ||
| AA21 | RET Z | Return if yes | ||
| AA22 | LD B,(HL) | B = (HL) | ||
| AA23 | LD A,$02 | A = the other eyes room | ||
| AA25 | CP B | Compare with B | ||
| AA26 | JR NZ,$AA2A | If no, go to AA2A | ||
| AA28 | LD A,$03 | A = 3 | ||
| AA2A | CP C | Moved to the other eyes room: fine | ||
| AA2B | RET Z | Return if yes | ||
| AA2C | JR $AA3E | Otherwise: stung to death | ||
| Prev: AA04 | Up: Map | Next: AA2E |