Prev: A694 Up: Map Next: A6CF
A6B1: Validate Object
Used by the routines at PrintObjects and CheckRoomObjects.
Input
BC Object counter
Output
F Z is unset if the object is valid, unset when invalid
ValidateObject A6B1 PUSH AF Stash AF and BC on the stack.
A6B2 PUSH BC
A6B3 INC BC Adjust the object counter.
A6B4 LD A,($BBC7) A=*Count_Objects_1.
A6B7 SUB C Calculate the index and store the result in E.
A6B8 LD E,A
A6B9 PUSH IX
A6BB LD IX,$AFDD IX=Table_ItemDescriptions.
A6BF CALL GetTableEntry Call GetTableEntry.
A6C2 POP IX
A6C4 POP BC Restore the object counter from the stack.
A6C5 LD A,H Jump to InvalidObject if the object is invalid.
A6C6 OR L
A6C7 JR Z,InvalidObject
A6C9 POP AF Restore the object type from the stack.
A6CA AND A Clear the Z flag.
A6CB RET Return.
InvalidObject A6CC POP AF Restore AF from the stack.
A6CD CP A Set the Z flag.
A6CE RET Return.
View the equivalent code in;
Prev: A694 Up: Map Next: A6CF