Routines |
Prev: A685 | Up: Map | Next: A6B6 |
Used by the routine at Check_HighScore.
|
||||
Is_HighScore | A697 | LD A,$00 | Write 00 to A6B7. | |
A699 | LD ($A6B7),A | |||
A69C | PUSH DE | Stash the high score and player score positions on the stack. | ||
A69D | PUSH HL | |||
A69E | LD B,$03 | Set the counter to 03 for the three score digits. | ||
Is_HighScore_Loop | A6A0 | LD A,(DE) | Fetch the score digit. | |
A6A1 | CP (HL) | Compare the score digit against the high score. | ||
A6A2 | JR C,Is_HighScore_Return | If the the high score is higher, jump to Is_HighScore_Return. | ||
A6A4 | JR NZ,Is_HighScore_Skip | If the high score is lower skip ahead to Is_HighScore_Skip. | ||
A6A6 | LD A,($A6B7) | Increase A6B7 by one. | ||
A6A9 | INC A | |||
A6AA | LD ($A6B7),A | |||
Is_HighScore_Skip | A6AD | DEC DE | Move onto the next digits for both the player score and high score. | |
A6AE | DEC HL | |||
A6AF | DJNZ Is_HighScore_Loop | Decrease counter by one and loop back to Is_HighScore_Loop until counter is zero. | ||
A6B1 | SCF | Sets then clears the carry flag. | ||
A6B2 | CCF | |||
Is_HighScore_Return | A6B3 | POP HL | Restore high score and player score positions from the stack. | |
A6B4 | POP DE | |||
A6B5 | RET | Return. |
Prev: A685 | Up: Map | Next: A6B6 |