![]() |
Routines |
| Prev: 6892 | Up: Map | Next: 68E0 |
|
Used by the routine at GameLoop.
Replace a typed phrase with the verb it stands for.
|
||||
| Parser_ResolvePhrase | 68A4 | INC BC | The search stops one byte past the matching noun. | |
| 68A5 | LD A,($62C8) | Fetch how many nouns the game knows. | ||
| 68A8 | SUB C | Select this noun's phrase and the marker that ends it. | ||
| 68A9 | LD B,A | |||
| 68AA | LD E,A | |||
| 68AB | LD A,$FE | |||
| 68AD | LD HL,($62D2) | Fetch the noun-phrase table. | ||
| 68B0 | INC B | Count the phrase terminator as one more step. | ||
| 68B1 | JR Parser_ResolvePhrase_Step1 | Continue at Parser_ResolvePhrase_Step1 to walk past the phrases already considered. | ||
| Parser_ResolvePhrase_Loop1 | 68B3 | INC HL | Skip a byte inside the phrase just passed. | |
| Parser_ResolvePhrase_Loop2 | 68B4 | INC HL | Walk forward until the end-of-phrase marker. | |
| 68B5 | CP (HL) | |||
| 68B6 | JR Z,Parser_ResolvePhrase_Loop1 | |||
| Parser_ResolvePhrase_Step1 | 68B8 | DJNZ Parser_ResolvePhrase_Loop2 | Repeat for each phrase before this noun. | |
| 68BA | JR Parser_ResolvePhrase_Step2 | Continue at Parser_ResolvePhrase_Step2 to read the object this phrase names. | ||
| Parser_ResolvePhrase_Loop3 | 68BC | INC HL | Step to the next byte of the phrase. | |
| Parser_ResolvePhrase_Step2 | 68BD | LD A,(HL) | Read the object this phrase refers to. | |
| 68BE | CALL IsObjectInCurrentRoom | Call IsObjectInCurrentRoom to test whether the object is here. | ||
| 68C1 | RET Z | Return when that object is here or being carried. | ||
| 68C2 | INC HL | Step to the next byte of the phrase. | ||
| 68C3 | LD A,(HL) | Read the marker that follows the object. | ||
| 68C4 | CP $FE | Jump back to Parser_ResolvePhrase_Loop3 when another object follows in the phrase (FE). | ||
| 68C6 | JR Z,Parser_ResolvePhrase_Loop3 | |||
| 68C8 | LD HL,$6378 | Print I can't see on the same line. | ||
| 68CB | CALL PrintString | |||
| 68CE | LD IX,($62D4) | Fetch the noun table. | ||
| 68D2 | CALL GetTableEntry | Call GetTableEntry to look up the table entry. | ||
| 68D5 | CALL PrintString | Call PrintString to print the message. | ||
| 68D8 | LD HL,$6385 | Print here.. | ||
| 68DB | CALL PrintStringAndANewline | |||
| 68DE | SCF | Set the carry flag to reject the command. | ||
| 68DF | RET | Return. | ||
| Prev: 6892 | Up: Map | Next: 68E0 |