From 932e2e9c3559020a200b6b24f62ff5b1d0301521 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Fri, 13 Aug 2021 00:41:38 -0600 Subject: [PATCH] formatting and use zero page to store logo coordinates --- uxn-client/xrxs.rom | Bin 464 -> 0 bytes uxn-client/xrxs.tal | 48 ++++++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 uxn-client/xrxs.rom diff --git a/uxn-client/xrxs.rom b/uxn-client/xrxs.rom deleted file mode 100644 index 3d4f0f7c9acc10f9a386dc94d7cbbb129347e26c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 464 zcmb`Cu}TAB5QO);yW-RwT(F4ct+^rwiB|b9Ac%$dAQoC!#U^EZ3SYqD5PJ(ND+>{P zoRm)P5+o?t*bKWf^Uv(>(JN{2=!0$HJ00O0b#RQw;AT9C`Q%C1%<)3AM7jd&Iu{f{ zYYuw}MM{!Mlax261lwXKbM8kn=z%5BFj4%?L@jf*W{mwYoVpbg27$6&@(IJ`VY;g3 zJS%lq#bMx%qaK5?TUyCoy5*JI@ri5)^s>#UVQW*4Ts(LB{hQYCqsQh=&zXAS#h*R9 ctDa@dX2;7f9qWJ0YyKyHHl5v$F0ZHd1=z1U{Qv*} diff --git a/uxn-client/xrxs.tal b/uxn-client/xrxs.tal index 670755c..f7387df 100644 --- a/uxn-client/xrxs.tal +++ b/uxn-client/xrxs.tal @@ -1,10 +1,5 @@ ( utility macros ) -%+ { ADD } %- { SUB } %* { MUL } %/ { DIV } -%< { LTH } %> { GTH } %= { EQU } %! { NEQ } -%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 } -%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 } - %INC-X { .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 } ( -- ) %INC-Y { .Screen/y DEI2 #0008 ADD2 .Screen/y DEO2 } ( -- ) @@ -16,9 +11,6 @@ %NEXT-TILE { DUP2 #0010 ADD2 } -%DEBUG { ;print-hex JSR2 #0a .Console/write DEO } -%DEBUG2 { SWP ;print-hex JSR2 ;print-hex JSR2 #0a .Console/write DEO } - %RTN { JMP2r } ( devices ) @@ -41,14 +33,21 @@ @state $1 @ticker $1 + +@logo-coords [ + &x $2 + &y $2 +] + @cart $64 @realm $64 ( program ) -|0100 ( -> ) -@init - ( theme ) +|0100 +@init ( -> ) + + ( steppewnolf-dark theme ) #02c1 .System/r DEO2 #02cd .System/g DEO2 #02cb .System/b DEO2 @@ -65,16 +64,21 @@ #00 .ticker STZ #00 .state STZ + CENTER-X .logo-coords/x STZ2 + CENTER-Y .logo-coords/y STZ2 + ;on-frame .Screen/vector DEO2 BRK @on-frame ( -> ) - ( wait a couple frames, draw uxn logo ) + + ( draw a piece of the logos ~ every half second ) + .ticker LDZ #01 ADD DUP #20 EQU ,&next-render JCN .ticker STZ - BRK + BRK &next-render .state LDZ #00 .ticker STZ @@ -95,15 +99,15 @@ BRK @draw-uxn-logo ( -> ) - CENTER-X #0020 SUB2 .Screen/x DEO2 - CENTER-Y #0010 SUB2 .Screen/y DEO2 + .logo-coords/x LDZ2 #0020 SUB2 .Screen/x DEO2 + .logo-coords/y LDZ2 #0010 SUB2 .Screen/y DEO2 #0100 #0000 &while EQU2k ,&end JCN DUP2 ;uxnlogo ADD2 .Screen/addr DEO2 #81 .Screen/sprite DEO INC-X NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN - CENTER-X #0020 SUB2 .Screen/x DEO2 + .logo-coords/x LDZ2 #0020 SUB2 .Screen/x DEO2 INC-Y &no-inc-y #0010 ADD2 ,&while JMP &end POP2 POP2 @@ -112,15 +116,15 @@ RTN @draw-xrxs-logo-xr ( -> ) - CENTER-X .Screen/x DEO2 - CENTER-Y #0010 SUB2 .Screen/y DEO2 + .logo-coords/x LDZ2 .Screen/x DEO2 + .logo-coords/y LDZ2 #0010 SUB2 .Screen/y DEO2 #0080 #0000 &while EQU2k ,&end JCN DUP2 ;xrxslogo ADD2 .Screen/addr DEO2 #81 .Screen/sprite DEO INC-X NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN - CENTER-X .Screen/x DEO2 + .logo-coords/x LDZ2 .Screen/x DEO2 INC-Y &no-inc-y #0010 ADD2 ,&while JMP &end POP2 POP2 @@ -129,15 +133,15 @@ RTN @draw-xrxs-logo-xs ( -> ) - CENTER-X .Screen/x DEO2 - CENTER-Y .Screen/y DEO2 + .logo-coords/x LDZ2 .Screen/x DEO2 + .logo-coords/y LDZ2 .Screen/y DEO2 #0100 #0080 &while EQU2k ,&end JCN DUP2 ;xrxslogo ADD2 .Screen/addr DEO2 #81 .Screen/sprite DEO INC-X NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN - CENTER-X .Screen/x DEO2 + .logo-coords/x LDZ2 .Screen/x DEO2 INC-Y &no-inc-y #0010 ADD2 ,&while JMP &end POP2 POP2