![]() |
Routines |
| Prev: B5A9 | Up: Map | Next: B5FC |
|
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.
|
||||||||
|
Sets up the 1UP score.
|
||||||||
| Score_1UP | B5CC | LD HL,$4021 | Set the screen address of the 1UP score in HL. | |||||
| B5CF | LD DE,$9698 | Point DE at the score of 1UP at 1UP_Score_1. | ||||||
| B5D2 | 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 | B5D4 | LD HL,$4039 | Set the screen address of the 2UP score in HL. | |||||
| B5D7 | LD DE,$969B | Point DE at the score of 2UP at 2UP_Score_1. | ||||||
| B5DA | 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 | B5DC | LD HL,$402D | Set the screen address of the high score in HL. | |||||
| B5DF | LD DE,$B304 | Point DE at the top high score at Top_HighScore_1. | ||||||
|
Prints the score.
|
||||||||
| PrintScore | B5E2 | LD B,$03 | Set the number of bytes of the score in B to 03. | |||||
|
This entry point is used by the routines at PrintRoomsVisited and HallOfFame.
|
||||||||
| PrintScore_Loop | B5E4 | LD A,(DE) | Fetch a pair of digits of the score. | |||||
| B5E5 | RRCA | Move the upper digit into the lower four bits. | ||||||
| B5E6 | RRCA | |||||||
| B5E7 | RRCA | |||||||
| B5E8 | RRCA | |||||||
| B5E9 | AND %00001111 | Keep only bits 0-3. | ||||||
| B5EB | ADD A,$30 | Convert the digit to ASCII. | ||||||
| B5ED | CALL PrintScreen | Print the upper digit. | ||||||
|
This entry point is used by the routine at PrintRoomsVisited.
|
||||||||
| PrintScore_LowDigit | B5F0 | LD A,(DE) | Fetch the pair of digits of the score again. | |||||
| B5F1 | AND %00001111 | Keep only bits 0-3. | ||||||
| B5F3 | ADD A,$30 | Convert the digit to ASCII. | ||||||
| B5F5 | CALL PrintScreen | Print the lower digit. | ||||||
| B5F8 | INC DE | Move onto the next pair of digits of the score. | ||||||
| B5F9 | DJNZ PrintScore_Loop | Decrease the digit pair counter by one and loop back to PrintScore_Loop until all six digits have been printed. | ||||||
| B5FB | RET | Return. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: B5A9 | Up: Map | Next: B5FC |