| The Hobbit (v1.0) | Routines |
| Prev: A094 | Up: Map | Next: A0BC |
|
Explains why an action failed by describing the state of the object at IX: 'the door is locked.', 'the chest is closed.', 'the bottle is empty.' The low bits of A choose the flag bit that was wrong, and bit 7 whether it was set or clear; the word comes from the tables at A154 (UNLOCKED, EMPTY, OFF, CLOSED, DEAD) and A164 (LOCKED, FULL, BROKEN, ON, OPEN, ALIVE).
|
||||||||||
| A09C | LD L,(IX+$08) | TARGET VERSION: HL = the target's own words... | ||||||||
| A09F | LD H,(IX+$09) | |||||||||
|
This entry point is used by the routine at A094.
|
||||||||||
| A0A2 | PUSH DE | Save the caller's DE | ||||||||
| A0A3 | PUSH HL | Push the object's own words, so the message below can name it | ||||||||
| A0A4 | LD HL,$A154 | HL = the wording for a CLEAR flag (unlocked, empty, off, closed, dead)... | ||||||||
| A0A7 | BIT 7,A | ...unless the state we were given says the flag is actually SET... | ||||||||
| A0A9 | JR Z,$A0AE | |||||||||
| A0AB | LD HL,$A164 | ...in which case use the SET wording instead (locked, full, broken, on, open, alive) | ||||||||
| A0AE | CALL $9FED | DE = the exact word for this particular state | ||||||||
| A0B1 | POP HL | Recover the object's own words for a moment... | ||||||||
| A0B2 | PUSH DE | ...push the state word first... | ||||||||
| A0B3 | PUSH HL | ...then the object's words back on top of it, in the order the message needs them | ||||||||
| A0B4 | LD HL,$AEAE | "the X is Y." | ||||||||
| A0B7 | CALL $72D4 | Print it | ||||||||
| A0BA | POP DE | Restore the caller's DE | ||||||||
| A0BB | RET | |||||||||
| Prev: A094 | Up: Map | Next: A0BC |