Routines |
Prev: 41986 | Up: Map | Next: 42629 |
Used by the routines at Main_Game and Start_1UP_Game.
|
||||
Check if either player has broken the high score.
|
||||
Check_HighScore | 42567 | LD HL,45109 | HL=high score. | |
42570 | LD DE,45103 | DE=1UP score | ||
If this is not a two player game then we skip forward to Check_HighScore_1UP to only test for the 1UP score.
|
||||
42573 | LD A,(39980) | Check Num_Players; is this a 2 player game? | ||
42576 | CP 2 | |||
42578 | JR NZ,Check_HighScore_1UP | If not, jump to Check_HighScore_1UP. | ||
42678 mirrors Num_Players here. todo: why?
|
||||
42580 | LD (42678),A | Store 2 at 42678. | ||
Check 2UP score.
|
||||
42583 | LD HL,45106 | HL=Score_P2 and call Is_HighScore. | ||
42586 | CALL Is_HighScore | |||
42589 | JR NC,Check_HighScore_Changes | Jump to Check_HighScore_Changes if this is not a new high score. | ||
Overwrite the high score with the 2UP score.
|
||||
42591 | LD BC,3 | Copy the 2UP score over the current Hi_Score. | ||
42594 | LDDR | |||
42596 | LD DE,45103 | DE=2UP score | ||
42599 | JR Check_HighScore_Restore | Jump to Check_HighScore_Restore. | ||
Checks if all three digits changed. todo: why?
|
||||
Check_HighScore_Changes | 42601 | LD A,(42679) | Check 42679; are there three digit changes? | |
42604 | CP 3 | |||
42606 | LD A,1 | Store 1 at 42678 (skips forward to HighScore_Write_A6B6). | ||
42608 | JR NZ,HighScore_Write_A6B6 | |||
Else reset 42678.
|
||||
42610 | XOR A | Write 0 to 42678. | ||
HighScore_Write_A6B6 | 42611 | LD (42678),A | ||
Resets HL with 45112 so the 1UP score can also be tested.
|
||||
Check_HighScore_Restore | 42614 | LD HL,45112 | HL=45112. | |
Check_HighScore_1UP | 42617 | CALL Is_HighScore | Call Is_HighScore. | |
42620 | RET C | Return if this is not a new high score. | ||
Overwrite the high score with the 1UP score.
|
||||
42621 | PUSH HL | Stash the high score memory address temporarily. | ||
42622 | EX DE,HL | Overwrite the high score. | ||
42623 | LD BC,3 | |||
42626 | LDDR | |||
42628 | POP HL | Restore the high score memory address to HL. |
Prev: 41986 | Up: Map | Next: 42629 |