Prev: 41702 Up: Map Next: 41741
41712: Update High Score
Used by the routine at RunGame.
Compares the five digits of the score at ScoreText_PlayerOne with the five digits of the high score at HighScoreText and, if the score is higher, copies it over the high score.
UpdateHighScore 41712 LD HL,57760 Point HL at the digits of the high score.
41715 LD DE,57650 Point DE at ScoreText_PlayerOne.
41718 LD B,5 Set a counter of five digits.
UpdateHighScore_Compare 41720 LD A,(DE) Fetch a digit of the score.
41721 CP (HL) Compare it with the same digit of the high score.
41722 RET C Return if the score is lower.
41723 JR NZ,UpdateHighScore_Copy Jump to UpdateHighScore_Copy if the score is higher.
41725 INC DE Move onto the next digit of the score.
41726 INC HL Move onto the next digit of the high score.
41727 JR UpdateHighScore_Compare Jump back to compare the next digit.
UpdateHighScore_Copy 41729 LD DE,57760 Point DE at the digits of the high score.
41732 LD HL,57650 Point HL at ScoreText_PlayerOne.
41735 LD BC,5 Set the number of digits.
41738 LDIR Copy the score over the high score.
41740 RET Return.
Prev: 41702 Up: Map Next: 41741