![]() |
Routines |
| Prev: 27798 | Up: Map | Next: 27870 |
|
Used by the routines at AddPointsToScore and CreateWindow.
Prints the score or the high score at the top of the screen, as six BCD digits. The same code (from PrintScore) also prints other BCD numbers, such as the miles and the time.
|
||||||||
|
Sets up the player score.
|
||||||||
| Score_1UP | 27830 | LD HL,16397 | HL=16397 (screen location of the score). | |||||
| 27833 | LD DE,24140 | Point DE at the score (Score_1). | ||||||
| 27836 | JR PrintScore | Jump to PrintScore. | ||||||
|
This entry point is used by the routine at CreateWindow.
Sets up the HI score.
|
||||||||
| Score_HI | 27838 | LD HL,16408 | HL=16408 (screen location of the high score). | |||||
| 27841 | LD DE,24137 | Point DE at the high score (High_Score). | ||||||
|
Prints the score. Entering at PrintScore_Loop prints B bytes (two digits each) of the BCD number at DE to the screen location in HL.
|
||||||||
| PrintScore | 27844 | LD B,3 | Set the byte counter to 3 (a score is 3 bytes, so 6 digits). | |||||
|
This entry point is used by the routine at DisplayMiles.
|
||||||||
| PrintScore_Loop | 27846 | LD A,(DE) | Fetch the next byte of the number, which holds two digits. | |||||
| 27847 | RRCA | A=A / 16 (the first digit). | ||||||
| 27848 | RRCA | |||||||
| 27849 | RRCA | |||||||
| 27850 | RRCA | |||||||
| 27851 | AND %00001111 | Keep only bits 0-3. | ||||||
| 27853 | ADD A,48 | Add 48 to convert the digit to ASCII. | ||||||
| 27855 | CALL PrintScreen | Call PrintScreen to print the digit. | ||||||
|
Prints the second digit of the byte; entering here skips the first digit.
|
||||||||
| PrintScore_SecondDigit | 27858 | LD A,(DE) | Fetch the byte again, for the second digit. | |||||
| 27859 | AND %00001111 | Keep only bits 0-3. | ||||||
| 27861 | ADD A,48 | Add 48 to convert the digit to ASCII. | ||||||
| 27863 | CALL PrintScreen | Call PrintScreen to print the digit. | ||||||
| 27866 | INC DE | Move on to the next byte of the number. | ||||||
| 27867 | DJNZ PrintScore_Loop | Decrease the byte counter by one and loop back to PrintScore_Loop until all of the bytes have been printed. | ||||||
| 27869 | RET | Return. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: 27798 | Up: Map | Next: 27870 |