Prev: 69F4 Up: Map Next: 6A11
69FE: Action: Subtract From Flag
Subtracts A from flag B, sticking at 00 instead of wrapping.
Input
A Amount
B Flag number
SubtractFromFlag 69FE CALL FlagAddress Call FlagAddress.
6A01 LD ($5B94),A Write the amount to *SubtractScratch.
6A04 LD A,(HL) Fetch the flag.
6A05 PUSH HL Stash the flag pointer on the stack.
6A06 LD HL,$5B94 Point HL at SubtractScratch.
6A09 AND A Subtract the amount.
6A0A SUB (HL)
6A0B JR NC,SubtractFlag_Store The difference sticks at 00.
6A0D XOR A
Store the difference.
SubtractFlag_Store 6A0E POP HL Restore the flag pointer from the stack.
6A0F LD (HL),A Store it.
6A10 RET Return.
Prev: 69F4 Up: Map Next: 6A11