From b3c2ed1cba67f8689f6aca9fc4e05102792ebc22 Mon Sep 17 00:00:00 2001 From: Pecusx Date: Mon, 12 Aug 2024 10:40:36 +0200 Subject: [PATCH] HiScore --- dino.asm | 42 +++++++++++++++++++++++++++++++++++++++++ dino.asm.bak | 52 +++++++++++++++++++++++++++++++++++++++++++-------- dino.xex | Bin 5788 -> 5871 bytes 3 files changed, 86 insertions(+), 8 deletions(-) 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 1f3f60e996879d24490e898bc94294615caa8652..221dd1981e15ca3ff59900e02325353cd3289840 100644 GIT binary patch delta 382 zcmbQE`(Ag0h5+NH$(jPw#Ca_hCfF(z+A1*GD#TkVbXzTLyWpd6V)8WsC6Nltl{&p& zn3jqh75VUIC1Wqk6@|Z(c?4CM6%=hJ8wiF=Iaw}ZXlvRVVqw6tLczf5S<|wn2M!nB zCn)TlyiibteY4$42aCUpC+`tdW!yaZkzg5Ht6giu&MA}Qgksn^K}>$T$p?j6#kSa; zWV*oYv(EY?Gmw(BImrT~$~VUdpJl8!w_M54+T7aGyV9 zBoo#G4Y0RZ3pB&QVlB`ZM~k&UlbkHp23qtwTO=%C=sC*NbBw9y1jOHyBSbsccAkCs zb?MT{&qT`{L`7vyRc&=$eM4hYb4zROP=ScBke~oRA1@C#7bgch8|xOk-FA#j%q%R- NOpFhh9x_d_006tqio5^- delta 295 zcmaE_J4bheh5%#yWKDr-;#`&rwzdj#whI4j6k;qDI;@tqUGPyjI{BJ_l1QoLN}b*> zOiM+MihTI9lChWNio&nSJc25djRnI^?JXBEv^DJwu`pm+p`dH^tZ7-(1BVOm6BKq? zE@0RhYB4j!;=}>_3tv|<09or2>{dEh{0*4AUr?1XVe(VKGBzW-)`p#qlM{tv*tgjN znR{#}9}#L5OSC)5bb;Atwe?A6ASGsVk_AYWY>pQ`%P4DNxssu^xwWM?!LGG!r9iK* zMX#SlufIiafJJZMeA=4BK0O43_{r~^~