Prev: 46326 Up: Map Next: 46408
46380: Load C with property of index A for all Magic Knight's carried objects, OR-ed together
Used by the routines at 46183 and 46326.
Input
A Index of required property of objects
Output
C Flags of all objects held, OR-ed together
46380 LD (46396),A Modify instruction at 46395 with index of required property
46383 LD IX,24848 Point IX at Magic Knight's current inventory (carrying)
46387 LD BC,1280 Load B with 5 and C with 0 (i.e. reset all bits in C)
46390 LD A,(IX+0) If Magic Knight's current inventory slot is empty...
46393 OR A ...
46394 RET Z ...then return
The operand of the instruction at 46395 represents the index of the required property. This is modified by the instruction at 46380.
46395 LD E,1 Load E with index of required property
46397 CALL 45390 Point HL to the E-th byte of the A-th record in object properties table
46400 LD A,(HL) Load A with value of required property (flags)...
46401 OR C ...and set corresponding bits of C...
46402 LD C,A ...
46403 INC IX Advance IX to next inventory slot...
46405 DJNZ 46390 ...and loop back to 46390 for next object
46407 RET Return
Prev: 46326 Up: Map Next: 46408