Prev: AD32 Up: Map Next: AE6B
AE36: 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 AE36 INC BC Adjust the counter for the sum.
AE37 LD A,($A7E8) Calculate the index (*Count_Objects-C) and store the result in E.
AE3A SUB C
AE3B LD E,A
AE3C PUSH DE Stash DE on the stack.
AE3D LD IX,($A7D4) Call GetTableEntry with *Pointer_ItemGroupingTable.
AE41 CALL GetTableEntry
AE44 POP DE Restore DE from the stack.
AE45 JR ValidateItem Jump to ValidateItem.
ValidateItem_Loop AE47 INC HL Increment HL by one.
ValidateItem AE48 LD A,(HL) Jump to Response_ItemNotHere if *HL is equal to FF.
AE49 CP $FF
AE4B JR Z,Response_ItemNotHere
AE4D CALL ValidateItemPresent Call ValidateItemPresent.
AE50 JR NZ,ValidateItem_Loop Jump to ValidateItem_Loop if the item wasn't found.
AE52 RET Return.
The item being referenced isn't in the room or in the players inventory.
Print "I can't see ".
Response_ItemNotHere AE53 LD HL,$A8DB HL=Messaging_ICantSee.
AE56 CALL PrintString Call PrintString.
Print the object name.
AE59 LD IX,($A7D6) Call GetTableEntry with *Pointer_ObjectNounPhrases.
AE5D CALL GetTableEntry
AE60 CALL PrintString Call PrintString.
Print " here.".
AE63 LD HL,$A8E8 HL=Messaging_Here.
AE66 CALL PrintStringAndNewline Call PrintStringAndNewline.
AE69 SCF Set the carry flag.
AE6A RET Return.
View the equivalent code in The Jewels Of Babylon.
Prev: AD32 Up: Map Next: AE6B