Prev: FC3D Up: Map Next: FC99
FC52: Print High Score
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 FC52 LD HL,$682C Point HL at 682C (the last digit of the current score).
PrintHighScore_Compare FC55 LD B,$07 Set a counter in B for 07 digits to compare.
PrintHighScore_ComparePointer FC57 LD DE,$FCAD Point DE at FCAD (the last digit of the stored high score).
PrintHighScore_CompareLoop FC5A LD A,(DE) Fetch a digit from the stored high score.
PrintHighScore_CompareDigit FC5B CP (HL) Jump to PrintHighScore_NextDigit if the high score digit is equal to the same digit of the current score.
FC5C JR Z,PrintHighScore_NextDigit
FC5E 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.
FC60 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 FC62 DEC HL Move to the next digit in the current score.
PrintHighScore_NextScoreDigit FC63 DEC DE Move to the next digit in the high score.
FC64 DJNZ PrintHighScore_CompareLoop Decrease the digit counter by one and loop back to PrintHighScore_CompareLoop until all 07 digits have been compared.
All digits matched so scores are equal, so no update needed.
FC66 JR PrintHighScore_Display Jump to PrintHighScore_Display.
New high score so copy the current score over the stored high score.
PrintHighScore_NewHighScore FC68 LD HL,$6825 Copy 0007 bytes of data from *CurrentScore to *HighScore.
FC6B LD DE,$FCA6
FC6E LD BC,$0007
FC71 LDIR
Print the high score label and value to the screen buffer.
PrintHighScore_Display FC73 LD HL,$50A7 HL=50A7 (screen buffer location).
FC76 LD B,$0C Set a counter in B for 0C characters to print to the screen buffer.
FC78 LD DE,$FC99 DE=Messaging_HighScore.
FC7B CALL PrintMessage_Loop Call PrintMessage_Loop.
FC7E LD IX,$FCA6 IX=HighScore.
FC82 LD BC,$0007 HL+=0007.
FC85 ADD HL,BC
FC86 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 FC89 LD HL,$6825 Clear 000A bytes of data from *CurrentScore onwards.
FC8C LD (HL),$00
FC8E LD DE,$6826
FC91 LD BC,$000A
FC94 LDIR
FC96 JP PlaySound_NextLevelJingle Jump to PlaySound_NextLevelJingle.
Prev: FC3D Up: Map Next: FC99