![]() |
Routines |
| Prev: 44221 | Up: Map | Next: 44325 |
|
Used by the routine at GameStart.
Matches the first input token from UserInput_FirstToken against the verb tokens at Table_VerbTokens. When a match is found, it indexes the verb script table at JumpTable_VerbScripts and runs that script through Handler_RunScript. When no match is found, it prints the rephrase message and returns.
|
||||
|
Search the verb token list at Table_VerbTokens for the first user-input token.
|
||||
| Handler_DispatchVerb | 44284 | LD HL,46112 | Point HL at the verb tokens table at Table_VerbTokens. | |
| 44287 | LD BC,(48075) | Load the verb-token count from *Count_VerbTokens into BC. | ||
| 44291 | LD A,(41275) | Fetch the first user-input token from *UserInput_FirstToken into A. | ||
| 44294 | CPIR | Search Table_VerbTokens for a matching token. | ||
| 44296 | JR Z,VerbMatched | Jump to VerbMatched if a match was found. | ||
|
The token is not a known verb.
Print "Please rephrase that.".
|
||||
| 44298 | LD HL,24 | HL=Messaging_PleaseRephraseThat. | ||
| 44301 | CALL PrintCompressedStringAndNewline | Call PrintCompressedStringAndNewline to print that compressed string and a newline. | ||
| 44304 | RET | Return. | ||
|
A verb matched: turn its place in Table_VerbTokens into an index for JumpTable_VerbScripts.
|
||||
| VerbMatched | 44305 | LD A,(48075) | Fetch the verb-token count from *Count_VerbTokens into A. | |
| 44308 | SUB C | Subtract the CPIR remainder in C to get the 1-based position. | ||
| 44309 | DEC A | Decrease by one for a zero-based index. | ||
| 44310 | LD E,A | Store that index in E for GetTableEntry. | ||
|
Look up and run the verb script from JumpTable_VerbScripts.
|
||||
| 44311 | LD IX,46154 | Point IX at the verb script table at JumpTable_VerbScripts. | ||
| 44315 | CALL GetTableEntry | Call GetTableEntry to fetch this verb's script address into HL. | ||
| 44318 | PUSH HL | Copy the script address from HL into IX (using the stack). | ||
| 44319 | POP IX | |||
| 44321 | CALL Handler_RunScript | Call Handler_RunScript to run that script. | ||
| 44324 | RET | Return. | ||
|
View the equivalent code in;
|
||||
| Prev: 44221 | Up: Map | Next: 44325 |