Prev: 29562 Up: Map Next: 29645
29597: Print Scores
Used by the routine at CreateWindow.
Prints the 1UP, 2UP and high scores as six digit numbers at the top of the screen. Entry points set up the screen address and the score address, and PrintScore prints the three BCD bytes as six digits.
Before
scores-before
After
scores-after
Sets up the 1UP score.
Score_1UP 29597 LD HL,16417 HL=16417 (screen buffer address).
29600 LD DE,24069 DE=1UP_Score_1.
29603 JR PrintScore Jump to PrintScore.
This entry point is used by the routines at CreateWindow and AddPointsToScore.
Sets up the 2UP score.
Score_2UP 29605 LD HL,16441 HL=16441 (screen buffer address).
29608 LD DE,24072 DE=2UP_Score_1.
29611 JR PrintScore Jump to PrintScore.
This entry point is used by the routine at CreateWindow.
Sets up the HI score.
Score_HI 29613 LD HL,16429 HL=16429 (screen buffer address).
29616 LD DE,24064 DE=High_Score.
Prints the score.
PrintScore 29619 LD B,3 Set the byte counter to 3 (each byte of the score holds two digits).
PrintScore_Loop 29621 LD A,(DE) Fetch a byte of the score.
29622 RRCA Move the high digit down into the low nibble.
29623 RRCA
29624 RRCA
29625 RRCA
29626 AND %00001111 Keep only bits 0-3 (the high digit).
29628 ADD A,48 A=A + 48 (convert to ASCII).
29630 CALL PrintScreen Call PrintScreen.
29633 LD A,(DE) Fetch the same byte of the score again.
29634 AND %00001111 Keep only bits 0-3 (the low digit).
29636 ADD A,48 A=A + 48 (convert to ASCII).
29638 CALL PrintScreen Call PrintScreen.
29641 INC DE Increment DE by one.
29642 DJNZ PrintScore_Loop Decrease the byte counter by one and loop back to PrintScore_Loop until all six digits have been printed.
29644 RET Return.
View the equivalent code in;
Prev: 29562 Up: Map Next: 29645