Prev: A0F2 Up: Map Next: A10B
A0F9: Increase score
This increases the score by the amount specified in B then plots it.
Input
B Amount to increase score by.
Increment the score digit-wise until B is zero.
increase_score A0F9 LD A,$0A Set A to our base: 10
A0FB LD HL,$A136 Point HL at the last of the score digits
Start loop
increase_score_0 A0FE PUSH HL Save HL
increment_score A0FF INC (HL) Increment the pointed-to score digit by one
A100 CP (HL) Has the pointed-to digit incremented to equal our base 10?
A101 JR NZ,increase_score_1 No - loop
A103 LD (HL),$00 Yes - reset the current digit to zero
A105 DEC HL Move to the next higher digit
A106 JR increment_score "Recurse" - we'll arrive at the next instruction when we increment a digit which doesn't roll over
increase_score_1 A108 POP HL Restore HL
A109 DJNZ increase_score_0 ...loop until the (score specified on entry) turns have been had
FALL THROUGH into plot_score.
Prev: A0F2 Up: Map Next: A10B