Prev: 50233 Up: Map Next: 50288
50262: 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 50262 PUSH AF Stash AF and BC on the stack.
50263 PUSH BC
50264 INC BC Adjust the object counter.
50265 LD A,(48424) A=*Count_Items.
50268 SUB C Calculate the index and store the result in E.
50269 LD E,A
50270 LD IX,(48402) IX=*Pointer_ItemDescriptions.
50274 CALL GetTableEntry Call GetTableEntry.
50277 POP BC Restore the object counter from the stack.
50278 LD A,H Jump to InvalidObject if the object is invalid.
50279 OR L
50280 JR Z,InvalidObject
50282 POP AF Restore the object type from the stack.
50283 AND A Clear the Z flag.
50284 RET Return.
InvalidObject 50285 POP AF Restore AF from the stack.
50286 CP A Set the Z flag.
50287 RET Return.
Prev: 50233 Up: Map Next: 50288