Prev: E7AD Up: Map Next: E7D0
E7C2: Set Collected Flag
Used by the routine at Handle_Guardian.
Sets the collected flag of the entry of a table that an object came from. The entries are three bytes long, and byte 06 of the object is the number of the entry counted from the end of the table, so the entry is the length of the table less that number.
The routine has two entry points: Set_Collected_Flag for a table of 08 entries, and Set_Collected_Flag_Entry with the length in A.
Input
HL Address of the collected flag of the first entry
IX Object record
Set_Collected_Flag E7C2 LD A,$08 A=08.
This entry point is used by the routine at Collect_Extra_Life.
Set_Collected_Flag_Entry E7C4 SUB (IX+$06) Subtract byte 06 of the object, to get the number of the entry.
E7C7 LD E,A Store it in E.
E7C8 LD D,$00 Clear the high byte of the number of the entry.
E7CA ADD HL,DE Add the number of the entry three times, to point at the collected flag.
E7CB ADD HL,DE
E7CC ADD HL,DE
E7CD LD (HL),$01 Set the collected flag.
E7CF RET Return.
Prev: E7AD Up: Map Next: E7D0