![]() |
Routines |
| Prev: 24897 | Up: Map | Next: 24965 |
|
Used by the routine at RunScripts.
Accepts a script line whose verb and noun match the command. 126 matches any word. The high-priority table matches every line.
|
||||||||
| MatchCommand | 24917 | LD A,(HL) | The end marker 127 is not a verb. | |||||
| 24918 | CP 127 | |||||||
| 24920 | JR NZ,MatchCommand_Verb | |||||||
| 24922 | LD HL,0 | It returns a zero pointer. | ||||||
| 24925 | RET | Return. | ||||||
|
Test the verb.
|
||||||||
| MatchCommand_Verb | 24926 | LD A,(23446) | The high-priority table matches every line. | |||||
| 24929 | OR A | |||||||
| 24930 | JR NZ,MatchCommand_Hit | |||||||
| 24932 | LD A,126 | A verb of 126 matches any command. | ||||||
| 24934 | CP (HL) | |||||||
| 24935 | JR Z,MatchCommand_Noun | |||||||
| 24937 | LD A,(23423) | Otherwise the verb must be the one just typed. | ||||||
| 24940 | CP (HL) | |||||||
| 24941 | JR Z,MatchCommand_Noun | |||||||
| 24943 | INC HL | Advance to the noun. | ||||||
| 24944 | JR MatchCommand_Miss | Jump to MatchCommand_Miss. | ||||||
|
Test the noun.
|
||||||||
| MatchCommand_Noun | 24946 | INC HL | Advance to the noun. | |||||
| 24947 | LD A,126 | Jump to MatchCommand_NounOk if the noun is 126. | ||||||
| 24949 | CP (HL) | |||||||
| 24950 | JR Z,MatchCommand_NounOk | |||||||
| 24952 | LD A,(23424) | Otherwise the noun must be the one just typed. | ||||||
| 24955 | CP (HL) | |||||||
| 24956 | JR NZ,MatchCommand_Miss | |||||||
|
The noun matched.
|
||||||||
| MatchCommand_NounOk | 24958 | INC HL | The noun matched, so the line's tests follow. | |||||
|
This line is a hit.
|
||||||||
| MatchCommand_Hit | 24959 | PUSH HL | Remember this line. | |||||
| 24960 | POP DE | |||||||
| 24961 | RET | Return. | ||||||
|
This line missed.
|
||||||||
| MatchCommand_Miss | 24962 | INC HL | Advance past the noun. | |||||
| 24963 | JR SkipLine_Conditions | Jump to SkipLine_Conditions. | ||||||
| Prev: 24897 | Up: Map | Next: 24965 |