Prev: 737A Up: Map Next: 73CD
739D: 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 739D LD HL,$4021 HL=4021 (screen buffer address).
73A0 LD DE,$5E05 DE=1UP_Score_1.
73A3 JR PrintScore Jump to PrintScore.
This entry point is used by the routines at CreateWindow and AddPointsToScore.
Sets up the 2UP score.
Score_2UP 73A5 LD HL,$4039 HL=4039 (screen buffer address).
73A8 LD DE,$5E08 DE=2UP_Score_1.
73AB JR PrintScore Jump to PrintScore.
This entry point is used by the routine at CreateWindow.
Sets up the HI score.
Score_HI 73AD LD HL,$402D HL=402D (screen buffer address).
73B0 LD DE,$5E00 DE=High_Score.
Prints the score.
PrintScore 73B3 LD B,$03 Set the byte counter to 03 (each byte of the score holds two digits).
PrintScore_Loop 73B5 LD A,(DE) Fetch a byte of the score.
73B6 RRCA Move the high digit down into the low nibble.
73B7 RRCA
73B8 RRCA
73B9 RRCA
73BA AND %00001111 Keep only bits 0-3 (the high digit).
73BC ADD A,$30 A=A + 30 (convert to ASCII).
73BE CALL PrintScreen Call PrintScreen.
73C1 LD A,(DE) Fetch the same byte of the score again.
73C2 AND %00001111 Keep only bits 0-3 (the low digit).
73C4 ADD A,$30 A=A + 30 (convert to ASCII).
73C6 CALL PrintScreen Call PrintScreen.
73C9 INC DE Increment DE by one.
73CA DJNZ PrintScore_Loop Decrease the byte counter by one and loop back to PrintScore_Loop until all six digits have been printed.
73CC RET Return.
View the equivalent code in;
Prev: 737A Up: Map Next: 73CD