Prev: 45505 Up: Map Next: 45522
45510: Check whether Magic Knight is carrying an object
Used by the routines at 38780, 40190, 40258, 40614, 42157, 43494, 44100, 45149, 46183, 46326, 46463, 46490 and 62443.
Input
A Index of an object
HL (entry at 45513) Pointer to start of a character's inventory
Output
F Zero flag set if object is present in inventory, reset otherwise
45510 LD HL,24848 Point HL at start of Magic Knight's current inventory (carrying)
This entry point is used by the routines at 45227 and 45505.
45513 LD B,5 Load B with 5 (as characters have five inventory slots)
45515 CP (HL) If object at current inventory slot is the object of interest...
45516 RET Z ...then return with zero flag set
45517 INC HL Advance HL to next inventory slot
45518 DJNZ 45515 Decrease B (remaining number of inventory slots to check) and loop back to 33650
45520 OR A Reset zero flag, as object is not present
45521 RET Return
Prev: 45505 Up: Map Next: 45522