![]() |
Routines |
| Prev: A2E6 | Up: Map | Next: A30D |
|
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 | A2F0 | LD HL,$E1A0 | Point HL at the digits of the high score. | |
| A2F3 | LD DE,$E132 | Point DE at ScoreText_PlayerOne. | ||
| A2F6 | LD B,$05 | Set a counter of five digits. | ||
| UpdateHighScore_Compare | A2F8 | LD A,(DE) | Fetch a digit of the score. | |
| A2F9 | CP (HL) | Compare it with the same digit of the high score. | ||
| A2FA | RET C | Return if the score is lower. | ||
| A2FB | JR NZ,UpdateHighScore_Copy | Jump to UpdateHighScore_Copy if the score is higher. | ||
| A2FD | INC DE | Move onto the next digit of the score. | ||
| A2FE | INC HL | Move onto the next digit of the high score. | ||
| A2FF | JR UpdateHighScore_Compare | Jump back to compare the next digit. | ||
| UpdateHighScore_Copy | A301 | LD DE,$E1A0 | Point DE at the digits of the high score. | |
| A304 | LD HL,$E132 | Point HL at ScoreText_PlayerOne. | ||
| A307 | LD BC,$0005 | Set the number of digits. | ||
| A30A | LDIR | Copy the score over the high score. | ||
| A30C | RET | Return. | ||
| Prev: A2E6 | Up: Map | Next: A30D |