Prev: A4B0 Up: Map Next: A5C6
A591: Parser: Validate Item
Used by the routine at Parser_ProcessItem.
Input
BC The position in the user input token of the object
Output
F The carry flag is set when the item isn't present
Parser_ValidateItem A591 INC BC Adjust the counter for the sum.
A592 LD A,($BBC9) Calculate the index (*Count_Objects_2-C) and store the result in E.
A595 SUB C
A596 LD E,A
A597 PUSH DE Stash DE on the stack.
A598 LD IX,$B60E Call GetTableEntry with Table_ItemGrouping.
A59C CALL GetTableEntry
A59F POP DE Restore DE from the stack.
A5A0 JR ValidateItem Jump to ValidateItem.
ValidateItem_Loop A5A2 INC HL Increment HL by one.
ValidateItem A5A3 LD A,(HL) Jump to Response_ItemNotHere if *HL is equal to FF.
A5A4 CP $FF
A5A6 JR Z,Response_ItemNotHere
A5A8 CALL ValidateItemPresent Call ValidateItemPresent.
A5AB JR NZ,ValidateItem_Loop Jump to ValidateItem_Loop if the item wasn't found.
A5AD RET Return.
The item being referenced isn't in the room or in the players inventory.
Print "I can't see ".
Response_ItemNotHere A5AE LD HL,$000E HL=Messaging_ICantSee.
A5B1 CALL PrintCompressedString Call PrintCompressedString.
Print the object name.
A5B4 LD IX,$AF31 Call GetTableEntry with Table_ObjectNounPhrases.
A5B8 CALL GetTableEntry
A5BB CALL PrintCompressedString Call PrintCompressedString.
Print " here.".
A5BE LD HL,$000F HL=Messaging_Here.
A5C1 CALL PrintCompressedStringAndNewline Call PrintCompressedStringAndNewline.
A5C4 SCF Set the carry flag.
A5C5 RET Return.
View the equivalent code in;
Prev: A4B0 Up: Map Next: A5C6