Prev: 54087 Up: Map Next: 54123
54100: Add To Bounty
Adds an amount to Bounty, as SubtractFromBounty subtracts from it. It also writes 0 to BulletUnpaidFlag, so the revolver may be loaded again.
Input
BC The amount, as four packed decimal digits
Allow the revolver to be loaded.
AddToBounty 54100 XOR A Write 0 to BulletUnpaidFlag.
54101 LD (41577),A
Add the lowest two digits.
54104 LD HL,41561 Point HL at Bounty_LastByte.
54107 LD A,C Add the lower two digits.
54108 ADD A,(HL)
54109 DAA Make it decimal.
54110 LD (HL),A Store the lowest two digits of Bounty.
54111 DEC HL Move on to the next byte.
Add the middle two digits.
54112 LD A,B Add the next two digits and the carry.
54113 ADC A,(HL)
54114 DAA Make it decimal.
54115 LD (HL),A Store the middle two digits of Bounty.
54116 DEC HL Move on to the next byte.
Add the highest two digits.
54117 LD A,(HL) Add the carry.
54118 ADC A,0
54120 DAA Make it decimal.
54121 LD (HL),A Store the highest two digits of Bounty.
54122 RET Return.
Prev: 54087 Up: Map Next: 54123