Prev: 7BF2 Up: Map Next: 7C33
7C26: Item to itemstruct
This turns an item index to an itemstruct pointer.
Input
A Item index (type: item_t).
Output
HL Pointer to itemstruct (type: itemstruct_t).
item_to_itemstruct 7C26 LD L,A Multiply item index by seven
7C27 ADD A,A
7C28 ADD A,A
7C29 ADD A,A
7C2A SUB L
7C2B LD HL,$76C8 Point HL at the first element of item_structs
7C2E ADD A,L Add the two
7C2F LD L,A
7C30 RET NC
7C31 INC H
7C32 RET Return i'th element of item_structs in HL
Prev: 7BF2 Up: Map Next: 7C33