Prev: 46505 Up: Map Next: 46588
46540: Print Scores
Used by the routine at GameInitialisation.
Prints the score of player 1, the score of player 2 or the high score on the screen as six digits. Each of the entry points sets the screen address and the score to print and joins the code at PrintScore.
Before
scores-before
After Score_1UP
scores-after
Sets up the 1UP score.
Score_1UP 46540 LD HL,16417 Set the screen address of the 1UP score in HL.
46543 LD DE,38552 Point DE at the score of 1UP at 1UP_Score_1.
46546 JR PrintScore Jump to PrintScore to print the score.
This entry point is used by the routines at GameInitialisation and AddPointsToScore.
Sets up the 2UP score.
Score_2UP 46548 LD HL,16441 Set the screen address of the 2UP score in HL.
46551 LD DE,38555 Point DE at the score of 2UP at 2UP_Score_1.
46554 JR PrintScore Jump to PrintScore to print the score.
This entry point is used by the routines at GameInitialisation and NewHighScore_Enter.
Sets up the HI score.
Score_HI 46556 LD HL,16429 Set the screen address of the high score in HL.
46559 LD DE,45828 Point DE at the top high score at Top_HighScore_1.
Prints the score.
PrintScore 46562 LD B,3 Set the number of bytes of the score in B to 3.
This entry point is used by the routines at PrintRoomsVisited and HallOfFame.
PrintScore_Loop 46564 LD A,(DE) Fetch a pair of digits of the score.
46565 RRCA Move the upper digit into the lower four bits.
46566 RRCA
46567 RRCA
46568 RRCA
46569 AND %00001111 Keep only bits 0-3.
46571 ADD A,48 Convert the digit to ASCII.
46573 CALL PrintScreen Print the upper digit.
This entry point is used by the routine at PrintRoomsVisited.
PrintScore_LowDigit 46576 LD A,(DE) Fetch the pair of digits of the score again.
46577 AND %00001111 Keep only bits 0-3.
46579 ADD A,48 Convert the digit to ASCII.
46581 CALL PrintScreen Print the lower digit.
46584 INC DE Move onto the next pair of digits of the score.
46585 DJNZ PrintScore_Loop Decrease the digit pair counter by one and loop back to PrintScore_Loop until all six digits have been printed.
46587 RET Return.
View the equivalent code in;
Prev: 46505 Up: Map Next: 46588