diff --git a/dino.asm b/dino.asm index 03cafe9..b32f9b9 100644 --- a/dino.asm +++ b/dino.asm @@ -64,6 +64,7 @@ line:1_addr status_line dta d" l-hi 00000 r-hi 00000 00000 " score=status_line+33 +rhiscore=status_line+19 ;--------------------------------------------------- ; World table without dino WorldTable @@ -102,6 +103,7 @@ EndLoop jmp EndLoop EndGame key + jsr HiScoreR jmp NewGame rts @@ -587,6 +589,46 @@ Down rts .endp ;----------------------------------------------- +.proc HiScoreR + lda rhiscore + cmp score + bcc higher1 + bne lower + lda rhiscore+1 + cmp score+1 + bcc higher2 + bne lower + lda rhiscore+2 + cmp score+2 + bcc higher3 + bne lower + lda rhiscore+3 + cmp score+3 + bcc higher4 + bne lower + lda rhiscore+4 + cmp score+4 + bcc higher5 +lower + rts +higher1 + lda score + sta rhiscore +higher2 + lda score+1 + sta rhiscore+1 +higher3 + lda score+2 + sta rhiscore+2 +higher4 + lda score+3 + sta rhiscore+3 +higher5 + lda score+4 + sta rhiscore+4 + rts +.endp +;----------------------------------------------- .proc FadeColors ldy #0 sty COLOR1 diff --git a/dino.asm.bak b/dino.asm.bak index 5dbfd09..fabba0a 100644 --- a/dino.asm.bak +++ b/dino.asm.bak @@ -64,6 +64,7 @@ line:1_addr status_line dta d" l-hi 00000 r-hi 00000 00000 " score=status_line+33 +rhiscore=status_line+19 ;--------------------------------------------------- ; World table without dino WorldTable @@ -85,24 +86,16 @@ EndLoop ;lda #$5f ;sta COLBAK jsr CheckJoy - ;waitRTC ; or waitRTC ? - ;key mva #>font2 chbas waitRTC ; or waitRTC ? mva #3 hscrol - ;waitRTC ; or waitRTC ? - ;key mva #>font3 chbas waitRTC ; or waitRTC ? mva #2 hscrol jsr WorldShift ; better place (flickering) - ;waitRTC ; or waitRTC ? - ;key mva #>font4 chbas waitRTC ; or waitRTC ? mva #1 hscrol - ;waitRTC ; or waitRTC ? - ;key jsr Animate mva #>font1 chbas waitRTC ; or waitRTC ? @@ -110,6 +103,7 @@ EndLoop jmp EndLoop EndGame key + jsr HiScoreR jmp NewGame rts @@ -585,6 +579,48 @@ Down sta DinoState sta diff_level sta Hit + ; clear score + lda #$10 + sta score + sta score+1 + sta score+2 + sta score+3 + sta score+4 + rts +.endp +;----------------------------------------------- +.proc HiScoreR + lda rhiscore + cmp score + bcc higher1 + lda rhiscore+1 + cmp score+1 + bcc higher2 + lda rhiscore+2 + cmp score+2 + bcc higher3 + lda rhiscore+3 + cmp score+3 + bcc higher4 + lda rhiscore+4 + cmp score+4 + bcc higher5 + rts +higher1 + lda score + sta rhiscore +higher2 + lda score+1 + sta rhiscore+1 +higher3 + lda score+2 + sta rhiscore+2 +higher4 + lda score+3 + sta rhiscore+3 +higher5 + lda score+4 + sta rhiscore+4 rts .endp ;----------------------------------------------- diff --git a/dino.xex b/dino.xex index 1f3f60e..221dd19 100644 Binary files a/dino.xex and b/dino.xex differ