![]() |
Routines |
| Prev: 64573 | Up: Map | Next: 64665 |
|
Used by the routine at Print_AuthorByline.
Checks if the current score is a new high score, and if so, copies it to the high score storage. Then prints the high score label and value to the screen.
|
||||
|
Compare the current score with the stored high score, byte by byte (most significant digit first).
|
||||
| Print_HighScore | 64594 | LD HL,26668 | Point HL at 26668 (the last digit of the current score). | |
| PrintHighScore_Compare | 64597 | LD B,7 | Set a counter in B for 7 digits to compare. | |
| PrintHighScore_ComparePointer | 64599 | LD DE,64685 | Point DE at 64685 (the last digit of the stored high score). | |
| PrintHighScore_CompareLoop | 64602 | LD A,(DE) | Fetch a digit from the stored high score. | |
| PrintHighScore_CompareDigit | 64603 | CP (HL) | Jump to PrintHighScore_NextDigit if the high score digit is equal to the same digit of the current score. | |
| 64604 | JR Z,PrintHighScore_NextDigit | |||
| 64606 | JR NC,PrintHighScore_Display | Jump to PrintHighScore_Display if the high score digit is greater than or equal to the same digit of the current score. | ||
| 64608 | JR C,PrintHighScore_NewHighScore | Jump to PrintHighScore_NewHighScore if the high score digit is less than the same digit of the current score. | ||
| PrintHighScore_NextDigit | 64610 | DEC HL | Move to the next digit in the current score. | |
| PrintHighScore_NextScoreDigit | 64611 | DEC DE | Move to the next digit in the high score. | |
| 64612 | DJNZ PrintHighScore_CompareLoop | Decrease the digit counter by one and loop back to PrintHighScore_CompareLoop until all 7 digits have been compared. | ||
|
All digits matched so scores are equal, so no update needed.
|
||||
| 64614 | JR PrintHighScore_Display | Jump to PrintHighScore_Display. | ||
|
New high score so copy the current score over the stored high score.
|
||||
| PrintHighScore_NewHighScore | 64616 | LD HL,26661 | Copy 0007 bytes of data from *CurrentScore to *HighScore. | |
| 64619 | LD DE,64678 | |||
| 64622 | LD BC,7 | |||
| 64625 | LDIR | |||
|
Print the high score label and value to the screen buffer.
|
||||
| PrintHighScore_Display | 64627 | LD HL,20647 | HL=20647 (screen buffer location). | |
| 64630 | LD B,12 | Set a counter in B for 12 characters to print to the screen buffer. | ||
| 64632 | LD DE,64665 | DE=Messaging_HighScore. | ||
| 64635 | CALL PrintMessage_Loop | Call PrintMessage_Loop. | ||
| 64638 | LD IX,64678 | IX=HighScore. | ||
| 64642 | LD BC,7 | HL+=0007. | ||
| 64645 | ADD HL,BC | |||
| 64646 | CALL PrintScore | Call PrintScore. | ||
|
This entry point is used by the routine at Print_AuthorByline.
Reset the current score to zero and return to the game flow.
|
||||
| PrintHighScore_ResetScore | 64649 | LD HL,26661 | Clear 0010 bytes of data from *CurrentScore onwards. | |
| 64652 | LD (HL),0 | |||
| 64654 | LD DE,26662 | |||
| 64657 | LD BC,10 | |||
| 64660 | LDIR | |||
| 64662 | JP PlaySound_NextLevelJingle | Jump to PlaySound_NextLevelJingle. | ||
| Prev: 64573 | Up: Map | Next: 64665 |