Prev: C47B Up: Map Next: C49F
C490: Parser: Validate Input Tokens
Output
A The number of references to items in the user input tokens
F The zero flag is set when there is only a verb present
F The zero flag is unset when there is at least one valid direct object
F The carry flag is set when the command is malformed
The first token is the verb, so target the second token for the direct object.
Parser_ValidateInputTokens C490 LD A,($BD67) Fetch the second token from the user input and store it in A.
C493 CP $FF Return if there is no second token.
C495 RET Z
There is a second token; so validate all direct objects after this point.
C496 CALL Parser_CountItems Call Parser_CountItems.
C499 RET NZ Return if there is at least one valid item mentioned in the user input tokens.
Any references are invalid.
Print "Please rephrase that.".
C49A CALL Response_PleaseRephraseThat Call Response_PleaseRephraseThat.
C49D SCF Set the carry flag.
C49E RET Return.
View the equivalent code in Warlord.
Prev: C47B Up: Map Next: C49F