From 17ae93540901e7c4259aa81463fa540dc36769ad Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Fri, 5 Apr 2024 22:19:00 -0400 Subject: [PATCH] Implement tandy 3-voice support break swine meeper trying to make it faster :/ --- .gitignore | 2 ++ beep.jrt | 11 ++++++---- common.jrt | 2 +- dialer.com | Bin 37054 -> 37407 bytes dialer.jrt | 28 ++++++++++++------------- dialtest.com | Bin 24242 -> 24418 bytes swine.com | Bin 9657 -> 9781 bytes swine.jrt | 30 +++++++++++++++++--------- tandy.jrt | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ zipmin.com | Bin 15949 -> 15949 bytes zipoff.com | Bin 21174 -> 21349 bytes zipstub.seg | Bin 4732 -> 4961 bytes 12 files changed, 102 insertions(+), 29 deletions(-) create mode 100755 tandy.jrt diff --git a/.gitignore b/.gitignore index 0de5d82..25e289c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ *.dsk errors.txt *.sym +t.com + diff --git a/beep.jrt b/beep.jrt index 4212ded..3101132 100755 --- a/beep.jrt +++ b/beep.jrt @@ -24,11 +24,14 @@ OUT 0x61 # AL NEXT -: slide ( div count + -- ) - >r begin over >spk 2 sleep-csec swap r@ + swap 1- dup not until +: slide ( freq count + -- ) + >r swap freq>div swap begin over >spk 2 sleep-csec swap r@ + swap 1- dup not until rdrop drop drop silence ; -: boop ( div count -- ) swap >spk sleep-csec silence ; +: divboop ( count div ) >spk sleep-csec silence ; +: boop ( freq count -- ) swap freq>div divboop ; : noise ( count -- ) begin rand >spk 1 sleep-csec 1- dup not until drop silence ; -: arp ( d1 d2 count -- ) times each dup 1 boop swap next drop drop ; +: spk-arp ( f1 f2 count -- ) times each dup 1 boop swap next drop drop ; + +deferred arp spk-arp diff --git a/common.jrt b/common.jrt index 216f409..8aa2889 100755 --- a/common.jrt +++ b/common.jrt @@ -13,8 +13,8 @@ import task.jrt import iter.jrt import timer.jrt import beep.jrt +import tandy.jrt : !save ( v p -- ) openself >r dup >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&Yt09b`_Lxqa5YoHcew zuweRYdmX}LsxF+5r4C?;vs>2LwTd;p!;^>8O{P=wZY*qLFt)?v-?+Z8Aut}RQZmkd zq(2~MV0Y8cil=0|<~YPnYXzU_P=DDmEvU19hao8nkFe9)*+IGPcR8*2o;ciXQ`P@U z`}|BTbYAUvr9C%uI`fZY#}B#?YD!7Q82qV&>fdy`!GW3}QF8-T-3iF)#2$w&9oM<2 zrLApazFObuSwT^eh2_G2|j2SlP%*<9bbjH>-WLu123>({n4 zvyxv^qKPSSuv6P(f2Z2lIVme0#frjeHg#oq>dWEnJ*%;2P_J~lXK7Tej4Gvz8nY<8 zlS9=^6jm{;a~OMPCw(Vb!*JDIS~Qu{rAE5MASsd$^hJ-#hl);8>E?;2M&T>YV*f(C z$7ytyWYaPG@N)*m`A54(lGoE+eS%IIV(o4W{w2gLs1}WBe^>PyJV(#$mX?QSa0fomS7s z-~(iM7R!aZG23*6=+IDZ#1V(TgwA5|n1H{A$Z@pU?k?IVH&bi%YuOGTh29Re1~FMl zC6H1AE9UP0cJvO1L%*dkIDpk?>H;j4HI zS~iS_-$q!g0FH(~3Tbu1DHOGbU6>#2;pf6nchPN~4il$uL#ZK$ zq{T4^?WkY5G2m%grF|=CT-&sEJuY6~wsvKs_DMk7>Lj-56hN8C;`K;>n66U0ro%h> L!wJ~8qZR%E@KPlq diff --git a/dialer.jrt b/dialer.jrt index 13ea1eb..93a657c 100755 --- a/dialer.jrt +++ b/dialer.jrt @@ -16,8 +16,8 @@ var ms-error : ms ms-error @ + 8 /mod ms-error ! delay ; dbg" modem sounds" -array dtmf-col 1209 freq>div , 1336 freq>div , 1477 freq>div , -array dtmf-row 697 freq>div , 770 freq>div , 852 freq>div , 941 freq>div , +array dtmf-col 1209 , 1336 , 1477 , +array dtmf-row 697 , 770 , 852 , 941 , ( 0 1 2 3 4 5 @@ -39,25 +39,25 @@ array dtmf-row 697 freq>div , 770 freq>div , 852 freq>div , 941 freq>div , then then rdrop ; : dialst ( st -- ) chars each i dialch next ; -: dialtone [ 350 freq>div lit 440 freq>div lit ] 200 arp ; -: offhook noisy 30 sleep-csec 3 2 boop 15 sleep-csec 7 2 boop 10 sleep-csec ; +: dialtone 350 440 200 arp ; +: offhook noisy 30 sleep-csec 2 3 divboop 15 sleep-csec 2 7 divboop 10 sleep-csec ; -2100 freq>div const carrier-div -980 freq>div const hs-low -1180 freq>div const hs-high -1650 freq>div const hs2-low -1850 freq>div const hs2-high +2100 const carrier-freq +980 const hs-low +1180 const hs-high +1650 const hs2-low +1850 const hs2-high -: carrier-drop 0x6000 1 boop ; -: carrier ( csec -- ) carrier-div swap boop carrier-drop ; +: carrier-drop 1 0x6000 divboop ; +: carrier ( csec -- ) carrier-freq swap boop carrier-drop ; : scramblebip ( div div -- ) rand 2 % if swap then drop 1 boop ; : hs-with-carrier ( csec -- ) - over-csec each carrier-div 1 boop hs-low hs-high scramblebip next ; + over-csec each carrier-freq 1 boop hs-low hs-high scramblebip next ; : dual-hs ( csec -- ) over-csec each hs-low hs-high scramblebip hs2-low hs2-high scramblebip next ; -: probe-hi ( csec -- ) [ 2400 freq>div lit 1200 freq>div lit ] div lit 300 freq>div lit ] div >spk next silence ; : handshake diff --git a/dialtest.com b/dialtest.com index ea5c1018fb77fb3aed73c3197d968ccab2f1583e..49b5c30f4a169e072cef5348c122d43922c05f14 100755 GIT binary patch delta 3337 zcmYLLYj6|S6~4Qc{5CX5TFI7q2~233rC=TjghzRljt2vN%9bo!UTLqS9j|uf-4!zA zhs?AMP#nj$nrQ+}Leoc*5~m@~pR|EO+IUi+K+2S+ZKfefn})_in=+Xx!w`DTl>|R5 z@A=O2o_p>&=e3jEN2j=kYfBvuY`L*I8;G^M(sL_#|N4`=Q{f*5zSmOKGQU@BX$=mC zhr=ftj@bD~f9{N(@&^`7EiGNoahWMvW^lPV729%uDt}}aIagsPik7kr(!e!M$rZus zIR_S;5XwkYPfD_k@ci7=CD&SxZ|R?^atrmVd&5in8~Qf%3;o-B&i6ImqyznCor^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Mn#uHR&j+kOno)1_Ai5j367n zt>$9$0=|JQraujIBFC>ZNtZCS*OTT7tkP5Fytf<0CQ(J1$l9X-QLX@ChZ`4P5!3LM zaT*JC+RRFi;p#E3i5?7#E}UQ{>%&{Z9`uCC>|e~QvIpG^pECLS==CkJ8X0V24?@KdU)5)A%&VOO7Dhjk+z;DD#vuv(rcr}XzbAkUf zapmBEw#@3sr{<`hE`Avs#j-LUN(|!)<&3@TRS(CytTrRw7jewse(jk4S zQ9J{;Mm1_tR2|IoPc4cn4SOvQe$F`mvD&ZzMEh~yu+rEjv$K1xZ_S6kFq%eBNoCNY zH0jYk>mD3VO2!Nv!rvu0IVt2W(DJWYNv9!NfC|k1m{A}0-6MMUH>iXMzBtCM>PaJsh24I-f=VEZ3vX15D>U z)7i9ibMyC5OG7QXF^=*^louetH6Uj{EU?C-e89dcTeh6v8@x@Q= zj@^)nv&w$UT4MX<-Ds~f4o7b=M~|yCt1q%T&=>zj%>JaX)}}shZh5e2ee9w2>$j|b z7>n#1rdto$;+yurwfF65?PGgJo3uIoDtghFUuti!quWU-924%2C1UNdAH(TC?JkgO~m{=U#o)`#p!v6uTR@n0Z diff --git a/swine.jrt b/swine.jrt index e196b9c..83019d2 100755 --- a/swine.jrt +++ b/swine.jrt @@ -29,6 +29,14 @@ array board maxw maxh * allot 20 var, boardw 12 var, boardh 30 var, minecount +0xffff var, dirty-rows + +: dirty! ( -- ) 0xffff dirty-rows ! ; +( mark both the current row and the row above, to ensure all borders are + redrawn ) +: dirty-row! ( y -- ) 1 swap << dup 1 >> | dirty-rows @ | dirty-rows ! ; +: dirty-row? ( y -- f ) 1 swap << dirty-rows @ & ; +: draw-complete 0 dirty-rows ! ; : board-lim boardw @ boardh @ * board + ; : square-at ( x y -- p ) boardw @ * + board + ; @@ -244,9 +252,11 @@ dbg" board drawing" .| boardw @ times each dup draw-square 1+ .| next drop next-row ; : draw-board ( -- ) 0 boxstyle! col-grid col-bg boardx! boardy! draw-board-top - iterrows each i draw-row - i lastrow? not if draw-rowborder then - next draw-board-bottom ; + iterrows each i dirty-row? not if + i draw-row i lastrow? not if draw-rowborder then + else + next-row i lastrow? not if next-row then + then next draw-board-bottom draw-complete ; ( general-purpose drawing ) dbg" general-purpose drawing" @@ -321,21 +331,21 @@ dbg" game ui" bl .- br ; : move-cursor ( dx dy -- ) - cursy b@ + swap cursx b@ + swap 2dup valid-pos? - if cursy b! cursx b! else drop drop then ; + cursy b@ dup dirty-row! + swap cursx b@ + swap 2dup valid-pos? + if cursy b! cursx b! else drop drop then cursy b@ dirty-row! ; : curs@ cursx b@ cursy b@ ; 0x21 const %f : await-command wait-key key>scan - dup %esc = if leave then + dup %esc = if leave dirty! then dup %left = if -1 0 move-cursor then dup %right = if 1 0 move-cursor then dup %up = if 0 -1 move-cursor then dup %down = if 0 1 move-cursor then - dup %f = if curs@ flag-at then - dup %enter = swap %space = or if curs@ reveal-at then ; + dup %f = if curs@ flag-at cursy b@ dirty-row! then + dup %enter = swap %space = or if curs@ reveal-at dirty! then ; : popupbox ( h -- ) 20 8 textxy! 0 hstyle! 1 vstyle! @@ -359,9 +369,9 @@ dbg" game ui" : confirm-quit cancelled? if quitmenu col-bg clear then ; : draw-game draw-board draw-cursor ; -: play enter col-bg clear +: play enter col-bg clear dirty! begin draw-game await-command confirm-quit in-progress? not until - draw-board display-result enter ; + dirty! draw-board display-result enter ; : start init-board boardw @ 2/ cursx b! boardh @ 2/ cursy b! play ; diff --git a/tandy.jrt b/tandy.jrt new file mode 100755 index 0000000..ce3f829 --- /dev/null +++ b/tandy.jrt @@ -0,0 +1,58 @@ +:asm tnd! ( b -- ) + POP AX + OUT 0xc0 # AL + NEXT + +:asm tnd-vol! ( vol chan -- ) + POP AX + MOV CL 5 # + SHL AX CL + POP CX + OR AL CL + OR AL 0x90 # + OUT 0xc0 # AL + NEXT + +:asm tnd-note! ( note chan -- ) + POP DX + MOV CL 5 # + SHL DX CL ( DL: channel mask ) + POP BX ( BX: note ) + + ( first command ) + MOV AL 0x0f # + AND AL BL ( low 4 bits of divisor ) + OR AL DL ( channel mask ) + OR AL 0x80 # ( update frequency ) + OUT 0xc0 # AL + + ( second command ) + MOV AX BX + DEC CL ( shift by 4 ) + SHR AX CL + AND AL 0x3f # ( wrap any divisor above 10 bits ) + OUT 0xc0 # AL + NEXT + +:asm freq>tnd ( f -- d ) + MOV AX 0x9E99 # + MOV DX 0x36 # + POP BX + DIV BX + MOV CL 5 # + SHR AX CL + PUSH AX + NEXT + +: tnd-silence 0xf 0 tnd-vol! 0xf 1 tnd-vol! ; +: tnd-2chord ( f1 f2 count -- ) + >rot freq>tnd 0 tnd-note! freq>tnd 1 tnd-note! + 0 0 tnd-vol! 0 1 tnd-vol! + sleep-csec tnd-silence ; + +: set-tandy ( f -- ) if ' tnd-2chord else ' spk-arp then ' arp redefine ; + +: detect-tandy 0xc000 0xf000 b@far 0x21 = + 0xfffe 0xf000 b@far 0xfd = or ; + +' init :chain detect-tandy set-tandy ; diff --git a/zipmin.com b/zipmin.com index bc65e678d0877bf2a1f5f3a218d160d5255f994c..b27e01b34638a54cd75f0d40c6e40787187ac7be 100755 GIT binary patch delta 31 icmX?GbGBxK8XHr)!e$M&Y5XAifanxi5FKXxoeKcJp9^LH delta 31 icmX?GbGBxK8XHr9+GY*5Y5XAifanxi5FKXxoeKcA@Cwra diff --git a/zipoff.com b/zipoff.com index cd13eab4cfc3cf4de7735a63bc0d94e74b3c563d..89c2dfbae65899893c9675f946f98d3180bd9348 100755 GIT binary patch delta 386 zcmdnCl=0~@#tr*fnNmY0A7o8sYFF5-!M2l?iy@_w0SJmy(dja z!bUN6hUEO*#FUgG235vHkOpfs`E-UH~+zIJHE#Bry*dVudD;g#|-+7*bM8 hQj-yae}y*yU9MQ1SOzjjSEMSlptz(oNe>vh3;=WbcWeLv delta 210 zcmaF5jB(pi#tr*fnYIN_KFFHN6ri?QgKZ}(S29C!5d#B5accVHkKE#uc-S^`@NDB0 z3Q*f9#?FwOpPQJHQpBLjSR=gof~X}U(}Lj5+~N{4#&d#8gVTfG1Z@d&3tsJi+5c3K zT9918dB3@VO~E3;bAp{@IT+O39D|%4eSCo0MHqqhg&7-iF|7*T+-dtp#PLQT3qw+V zegQ+F35T#{Fe^h|er9nhkS8L%)|;6ju?QriCp-Ztqgb3+29og*uF5PZE-6jY1G<(0 E0J$eX{Qv*} diff --git a/zipstub.seg b/zipstub.seg index d9259203f471f67c729b27b65c663f232ef3f7ba..dff2ee69bdfdd569e54f196d0c5bf9b0f0ae5608 100755 GIT binary patch delta 405 zcmXv~ze_?<6u#%avX_|IJr9aplB9%)rkaHM0}`Cd-s>TVGz$&AmTWV(K;l_Lvx{K5 zNYjfDYstdJCFlo;V-miGQoGl3IKRI0eTT#M<9}T!EK77=DXmD;V~&(304Yyt(`h+m zLIS`O$tY6~NgFI?1JE2Zff9rFA-Yd(IHNUa(;~FkHmyPxo>&56kYfh>>x9mY0xOT_ zm<|RTD*QNPYwpfO7;B)z4BAkE4Zf*D0*)YvyBKL&`E>HOzqp5ytI_()j(q1j6&QyO zQRUE^R+yY?$d9h$rj>5=?&~f8`aj_U%jcKZYef6{{b3#91WI_4k$%vbIA=>pu=mB#}@iVgxCaP@%X4oCiuuVHKErZ&Rsq) iNrH94y7)f0KPcOy?OtGHqgfBoxkcobfp0MWF)5B*t%yD}*Y9E(%Rn5E3yF6NU*# z^L^!Y55m4qhBS-@mmnqO7X{Ni(zCgpugeThzOL0^QgUl>o1OSMc BD+d4o