![]() |
Routines |
| Prev: 46432 | Up: Map | Next: 46500 |
|
Used by the routines at Handler_DispatchPhrase, Action_Light, Action_Rub, Action_Say and Action_Attack.
Match Phrase Tokens.
|
||||||||||||
| MatchPhraseTokens | 46453 | EX DE,HL | Move the phrase token pointer into DE. | |||||||||
| 46454 | JR MatchPhraseTokens_Next | Start the match at the first pattern byte, MatchPhraseTokens_Next. | ||||||||||
| Match_PhraseTokens_Loop | 46456 | INC DE | Advance DE to the next byte. | |||||||||
| MatchPhraseTokens_Next | 46457 | LD HL,44847 | Point HL at the second word token. | |||||||||
| 46460 | JR Match_PhraseTokens_Compare | Compare the command from its first word at Match_PhraseTokens_Compare. | ||||||||||
| MatchPhraseTokens_Loop | 46462 | INC HL | Advance HL to the next byte. | |||||||||
| 46463 | INC DE | Advance DE to the next byte. | ||||||||||
| Match_PhraseTokens_Compare | 46464 | LD A,(DE) | Read the next vocabulary byte into A. | |||||||||
| 46465 | CP (HL) | Branch to MatchPhraseTokens_Loop when the byte at HL means the values match. | ||||||||||
| 46466 | JR Z,MatchPhraseTokens_Loop | |||||||||||
| 46468 | CP 254 | Branch to Match_PhraseTokens_Alternative when 254 means the values differ. | ||||||||||
| 46470 | JR NZ,Match_PhraseTokens_Alternative | |||||||||||
| 46472 | LD A,(HL) | Accept the phrase when the command has ended. | ||||||||||
| 46473 | CP 255 | |||||||||||
| 46475 | RET | |||||||||||
| Match_PhraseTokens_Alternative | 46476 | CP 253 | Branch to Match_PhraseTokens_Skip when 253 means the values differ. | |||||||||
| 46478 | JR NZ,Match_PhraseTokens_Skip | |||||||||||
| 46480 | LD A,(HL) | Match this alternative when the command has ended, and try the next one when the player typed another word. | ||||||||||
| 46481 | CP 255 | |||||||||||
| 46483 | JR NZ,Match_PhraseTokens_Loop | |||||||||||
| 46485 | RET | |||||||||||
| Match_PhraseTokens_Skip | 46486 | INC DE | Advance DE to the next byte. | |||||||||
| 46487 | LD A,(DE) | Read the next vocabulary byte into A. | ||||||||||
| 46488 | CP 254 | Branch to Match_PhraseTokens_Done when 254 means the values match. | ||||||||||
| 46490 | JR Z,Match_PhraseTokens_Done | |||||||||||
| 46492 | CP 253 | Branch to Match_PhraseTokens_Skip when 253 means the values differ. | ||||||||||
| 46494 | JR NZ,Match_PhraseTokens_Skip | |||||||||||
| 46496 | JR Match_PhraseTokens_Loop | Try the next phrase alternative at Match_PhraseTokens_Loop. | ||||||||||
| Match_PhraseTokens_Done | 46498 | OR A | Test A so the following branch can see whether it is zero. | |||||||||
| 46499 | RET | Return. | ||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: 46432 | Up: Map | Next: 46500 |