Prev: 33640 Up: Map Next: 33657
33645: Check whether Magic Knight is carrying an object
Used by the routines at 27703, 27762, 28542, 31188, 34265, 34567 and 34627.
Input
A Index of an object
HL (entry at 33648) Pointer to start of a character's inventory
Output
F Zero flag set if object is present in inventory, reset otherwise
33645 LD HL,25164 Point HL at start of Magic Knight's current inventory (carrying)
This entry point is used by the routines at 33140, 33640, 33896 and 34265.
33648 LD B,5 Load B with 5 (as characters have five inventory slots)
33650 CP (HL) If object at current inventory slot is the object of interest...
33651 RET Z ...then return with zero flag set
33652 INC HL Advance HL to next inventory slot
33653 DJNZ 33650 Decrease B (remaining number of inventory slots to check) and loop back to 33650
33655 OR A Reset zero flag, as object is not present
33656 RET Return
Prev: 33640 Up: Map Next: 33657