Prev: 6374 Up: Map Next: 63CB
6398: Routine at 6398
Used by the routine at PlayerReset.
NewHighScore 6398 LD HL,($5CF4)
639B LD DE,($5CF7)
639F LD A,L
63A0 LD L,H
63A1 LD H,A
63A2 LD A,E
63A3 LD E,D
63A4 LD D,A
63A5 AND A
63A6 SBC HL,DE
63A8 JR C,COMPARE_2UP_SCORE
63AA JR NZ,COMPARE_1UP_SCORE
63AC LD A,($5CF6) E=5CF6.
63AF LD E,A
63B0 LD A,($5CF9) Compare E with 5CF9.
63B3 CP E
63B4 JR C,COMPARE_1UP_SCORE Jump if carry flag is set to COMPARE_1UP_SCORE
Tests to see if the highscore has been beaten by 2UP.
COMPARE_2UP_SCORE 63B6 LD HL,$5CF7 HL=2UP_Score
This entry point is used by the routine at UPDATE_HIGHSCORE.
CHECK_HIGHSCORE 63B9 PUSH HL Push HL onto the stack (see UPDATE_HIGHSCORE)
63BA LD DE,$5CF0 DE=High_Score
63BD LD B,$03 B=$03
NewHighScore_0 63BF LD A,(DE) Compare A against High_Score
63C0 CP (HL)
63C1 JR C,UPDATE_HIGHSCORE If it's higher, update the highscore
63C3 JR NZ,NewHighScore_1 Jump if not zero to NewHighScore_1 (so if it's less than the current highscore)
63C5 INC HL Increase HL by one
63C6 INC DE Increase DE by one
63C7 DJNZ NewHighScore_0 Decrease B by one, jump to NewHighScore_0 if not zero
NewHighScore_1 63C9 POP HL Fetch HL off the stack (to clear it)
63CA RET Return
Prev: 6374 Up: Map Next: 63CB