Prev: 46540 Up: Map Next: 46622
46588: New High Score
Used by the routine at GameOver_ControllerRestart.
Called when the game has ended to see whether either of the scores has made it into the hall of fame. The player with the highest score is dealt with first (see NewHighScore_Enter) and then the other player, so if both players have scored enough the higher score is entered first.
Before After NewHighScore
new-high-score-before new-high-score-after
NewHighScore 46588 LD HL,38552 Point HL at the score of 1UP at 1UP_Score_1.
46591 LD DE,38555 Point DE at the score of 2UP at 2UP_Score_1.
46594 CALL NewHighScore_Compare Compare the two scores.
46597 LD A,0 Clear the hall of fame updated flag in HallOfFameUpdated (without changing the flags).
46599 LD (38586),A
46602 JR Z,NewHighScore_Process Jump to NewHighScore_Process if the score of 1UP is higher than (or equal to) the score of 2UP.
46604 JR C,NewHighScore_Process
46606 CPL Flip the bits to make 2UP the active player.
46607 EX DE,HL Swap the score pointers, so HL points to the score of 2UP.
NewHighScore_Process 46608 LD (38558),A Set the active player to the one with the highest score.
46611 CALL NewHighScore_Enter Enter the high score.
46614 EX DE,HL Swap the score pointers back, so HL points to the other score.
46615 LD A,(38558) Fetch the active player from Flag_ActivePlayer.
46618 CPL Flip the bits to switch to the other player.
46619 LD (38558),A Set the other player as the active player.
View the equivalent code in;
Prev: 46540 Up: Map Next: 46622