From bcff5c6eb2e25f6a32c7833663e53c04826e9190 Mon Sep 17 00:00:00 2001 From: d_m Date: Sun, 17 Nov 2024 23:32:25 -0500 Subject: [PATCH] Fix timers and save/restore audio setting. This fixes a subtle bug that occurs once every 60 seconds due to rst corruption. It also saves and restores the audio preferences, which will be nice for people who get tired of the music. --- kodiak.rom | Bin 19000 -> 19061 bytes kodiak.tal | 49 +++++++++++++++++++++++-------------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/kodiak.rom b/kodiak.rom index f8663402e67a388d136b22e3d4139ea51da038bc..f7eba8ebf742ab3c1cd58d3b5b807510522562a9 100644 GIT binary patch delta 1867 zcmZWpYitx%6ux)%HM`xmvu$_VO0lyGtZgCf7Q5^gXgj=Ll2Q#sAmX7CEMc@@AR+Lh z2h@^al-64#s3BK^2^e_^Mx$uT43v*WeQ1lO->89&VOp3d7k5 zz)SJ#2xdaa&eW*1sTsw-QS=8K z#9jh-YINeB8I z@COK@UAFb%P_zK=giOkVeaV472mAri$;X9zPDaNkO~`v&XI`*wfmIISKJg7-#;b*{ zGz13i=&UCo(|%%|QpAgQfqM+NJHfLEJk8+w6g&gqond6@;vHALQlN=Tu19%;71xDKILyA=wt`YaySK&6f86wJZbGt2wUU)fe?%PimGTnt9i1`phi?|&D5}-` z)N!yLp&yS2YnEYY&Woa2yiX6yYVD6xOvcFM|H;KRwMj8T;+#5`x16}4s@&J)#eDF^ z#65oruM|arX_Z06i&PSp=S3t4d9j-yM=`Q8z%(OxRWX8oY$yTdGJ-Fj*dD0m+2_F8 zHyXK|c1WDfN)!!2W`*G&!d?xpYa#5#92j~7{JTVMFf1kn=e2Fdgmh<7&s+uTtGHbF z2^vyy5&u0{M~J_TOQg#~{Asc+7bOv--@g7aSi4)JG?$}EEVsLov3ML4$idn~gkclw ziCAJ2%?LKEWMFM)&iHBSZnP$8B|1|ZX#!~!&6(04uzT4VOykZLuzn!2S98WQ^MSY- zj8xfaHPWUR`~5oeD^8lx=KubexAi*n*h=wu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QHDcq{V1`er~HnWv93VviR3TZROmd48?i`*fF4CAG#@w?OMkoQ2y_^r`0xHPy`bpYN);&OwN!Ij3U~Xy2rI$ILWX{0cCvK+%R!L>ls>Q_X z(uX9N7f8IODpmo;PXlYis~z0oWq4I};q@eqCD{_m(_@AU?>y1b(jPq0ExX2?)?~3J zbsirOhf)jpWzn0ukQ*XDt&z8jx6^{YA>PN7Hr>1yTDekpFSSzBl~zY}csH%MQEF^5 z*uK+P4%pXfECcL*jirM9w8q?c0iF8&&0sFm&9H%;r)n%nxO0leGDEn{;?@$U z5Oz$}2Ghm5^c=?-J^riMo_?dQ6uBYY^a5E1or`bM%=;l^MhKh%vTT8o_s+t|28dsW z_*p85*40n!- zA>VSR>V~*eEX|nXUDtvoHIfBm_4N>MhJm;^n9&~jnsyJt?H3ckW+mWG!MHY$fLf7t z)l%uT0B(J+-}_6f$_!_n(dn{>ztZm=!4WHbhgZM1U+l_k%3h^XJUgfsbe0AzJsrjx z>tU!%OvqZMlw&_S;C7v8&svb5X8>KvdOu#IQhDExsfu=M#1bZwV7CN~j{Jsrm^H-~ zxFQPuvx*85orKy0egfua2KueG^n~01=K4n@E!gg#KOu01I!;fl1Dj7 ) - .about LDZ #7f GTH ?{ clear-screen !draw-about-content } fill-box !draw-about-content @@ -401,13 +401,6 @@ #80 .Screen/sprite DEOk DEO JMP2r -( @draw-face ( x* y* addr* -> ) - .Screen/addr DEO2 - .Screen/y DEO2 - .Screen/x DEO2 - #16 .Screen/auto DEO - #80 .Screen/sprite DEOk DEO JMP2r ) - @draw-mouth ( x* y* addr* -> ) #0020 ADD2 .Screen/addr DEO2 #0008 ADD2 .Screen/y DEO2 @@ -736,7 +729,7 @@ DUP .Audio1/pitch DEO DUP .Audio2/pitch DEO DUP .Audio3/pitch DEO - DUP .Audio4/pitch DEO + .Audio4/pitch DEO JMP2r @start-audio ( -> ) @@ -759,12 +752,18 @@ STH2r INC2 .audio/pos STZ2 JMP2r ( ) @on-audio ( -> brk ) - .audio LDZ ?{ BRK } play-audio BRK + .audio LDZ ?&enabled + #0000 #0000 + DUP2 DUP2 .Audio1 #01 play-track + DUP2 DUP2 .Audio2 #01 play-track + DUP2 DUP2 .Audio3 #01 play-track + .Audio4 #01 play-track BRK + &enabled play-audio BRK @update-time ( -> ) .DateTime/sec DEI .seconds LDZ EQU STHk .tick LDZ AND ?{ STHr #00 EQU .tick STZ JMP2r } - ;draw-scores/time LDA2k INC2 SWP2 STA2 + POPr ;draw-scores/time LDA2k INC2 SWP2 STA2 #00 .tick STZ !draw @on-refresh ( -> brk ) @@ -889,7 +888,8 @@ DUP2 #009c GTH2 ?&no POP2 .Mouse/x DEI2 DUP2 #0070 LTH2 ?&no - DUP2 #0090 LTH2 ?close-about + DUP2 #008f GTH2 ?&no + POP2 !close-about &no POP2 JMP2r @distance ( a* b* -> max[a,b]-min[a,b]* ) @@ -988,10 +988,6 @@ INC LTHk #00 EQU ?&loop POP2 ( ) &done .dragging #05 initialize ( ) #0000 .held STZ2 !draw ( ) - .held LDZ2 SWP LITr 00 ( last^ first^ [zero^] ) - &loop2 STHkr OVR STZ ( last^ pos^ [zero^] ; pos<-zero ) - INC LTHk #00 EQU ?&loop2 ( last^ pos+1^ [zero^] ) - POP2 POPr !&done ( ) @find-top ( start^ size^ -> zp^ ) OVR LDZ ?&non-empty POP JMP2r @@ -1057,10 +1053,11 @@ .Mouse/y DEI2 STH2kr LTH2 ?&yes LIT2r 0008 ADD2r INC GTHk ?&loop - &no2 POP2r POP2 - &no1 #00 JMP2r + &no2 POP2r POP2 ( ) + &no1 #00 JMP2r ( 0^ ) &yes #0008 STH2r #0018 SUB2 ( lim^ zp^ x* y* ) - ROT2 NIP DUP start-drag draw #01 JMP2r + ROT2 NIP DUP LDZk ?&ok POP2 POP2 POP2 #00 JMP2r + &ok start-drag draw #01 JMP2r @maybe-select-waste ( -> bool^ ) .waste LDZ #00 EQU ?&no1 @@ -1174,8 +1171,8 @@ #04 SFT .auto ADD LDZ INC ( card^ base+1^ ) OVR #0f AND EQU ?&ok ( card^ ; base+1=face? ) POP #00 JMP2r ( 0^ ) - &ok ( card^ suit^ ) - DUP #30 AND ( card^ ) + &ok ( card^ ) + DUP #30 AND ( card^ suit^ ) #04 SFT INC INC #03 AND ( card^ par^ ) .auto ADD LDZ #04 ADD ( card^ pface+4^ ) OVR #0f AND GTH ?&ok2 ( card^ ) @@ -1234,7 +1231,7 @@ @on-click-up ( -> ) #ff .Mouse/state DEI EOR ( not-state^ ) .prev/mouse-state LDZ AND ( up^ ) - #01 AND ?&ok JMP2r &ok + #01 AND ?{ JMP2r } .dragging LDZ ?release JMP2r