Prev: EC3D Up: Map Next: EC5C
EC4A: Set a game flag to a value
Used by the routines at EDA3 and EDA8.
Input
HL Points to the value to use and the flag to set
EC4A LD E,(HL)
EC4B INC HL
This entry point is used by the routine at EDAC. At this point, E contains the ID of the flag to set.
EC4C PUSH HL Remember HL.
EC4D LD D,$00 Add the ID to the base address of flags at EC0F.
EC4F LD HL,$EC0F
EC52 ADD HL,DE
EC53 CP (HL) Set the zero flag if the flag already has this value.
EC54 LD (HL),A Set the value.
EC55 CALL NZ,$E41D If the value is different, update the inventory as it may have changed.
EC58 POP HL Restore HL.
EC59 JP $EAEB Continue to any further actions to process.
Prev: EC3D Up: Map Next: EC5C