![]() |
Routines |
| Prev: BB24 | Up: Map | Next: BB3B |
|
Used by the routine at ScoreForCreature.
Adds an amount to the score, which is held as three bytes of binary coded decimal, with the most significant byte first, and then draws the new score.
|
||||||||||||
| AddToScore | BB29 | LD HL,$A746 | Start at the last byte of the score, Score. | |||||||||
| BB2C | LD A,(HL) | Add the last two digits of the amount to the last two digits of the score. | ||||||||||
| BB2D | ADD A,C | |||||||||||
| BB2E | DAA | |||||||||||
| BB2F | LD (HL),A | |||||||||||
| BB30 | DEC HL | Move to the next byte of the score. | ||||||||||
| BB31 | LD A,(HL) | Add the next two digits of the amount, and the carry. | ||||||||||
| BB32 | ADC A,B | |||||||||||
| BB33 | DAA | |||||||||||
| BB34 | LD (HL),A | |||||||||||
| BB35 | DEC HL | Move to the first byte of the score. | ||||||||||
| BB36 | LD A,(HL) | Add the carry to the first two digits of the score. | ||||||||||
| BB37 | ADC A,$00 | |||||||||||
| BB39 | DAA | |||||||||||
| BB3A | LD (HL),A | |||||||||||
|
Continue on to DrawScore.
View the equivalent code in;
|
||||||||||||
| Prev: BB24 | Up: Map | Next: BB3B |