Prev: B665 Up: Map Next: B685
B670: Parser: Validate Direct Object
Output
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.
ParserValidateDirectObject B670 LD A,($AF2F) Fetch the AF2F(second token from the user input) and store it in A.
B673 CP $FF Jump forward to DirectObject_Process if the token is anything other than the terminator character (FF).
B675 JR NZ,DirectObject_Process
The token was the terminator character (FF), so the sentence is malformed.
E.g. They tried "TAKE" but didn't write anything after it.
B677 CALL Messaging_PleaseBeMoreSpecific_Newline Call Messaging_PleaseBeMoreSpecific_Newline.
B67A SCF Set the carry flag to indicate this call was a failure.
B67B RET Return.
Process the direct object.
DirectObject_Process B67C CALL ParserCountItemReferences Call ParserCountItemReferences.
B67F RET NZ Return if A is not equal to FF.
B680 CALL Messaging_PleaseRephraseThat_Newline Call Messaging_PleaseRephraseThat_Newline to ask the player to rephrase.
B683 SCF Set the carry flag to indicate the command is malformed.
B684 RET Return.
Prev: B665 Up: Map Next: B685