From c3cedeab876bb7f3c7a9b6d688efddee7f057250 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Fri, 13 Aug 2021 00:15:00 -0600 Subject: [PATCH] starting animation and state handling --- uxn-client/xrxs.rom | Bin 324 -> 464 bytes uxn-client/xrxs.tal | 60 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/uxn-client/xrxs.rom b/uxn-client/xrxs.rom index 3d58d3e1ef41048b32488d8acb0f639592ff5308..3d4f0f7c9acc10f9a386dc94d7cbbb129347e26c 100644 GIT binary patch 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*} delta 182 zcmcb>e1vI&h?X_u3Uft92F6w9iVO^lOUxCSTo~5?Nidr^2gGKy*HdI%t2c3)GMhWE z3Q)ns{ZcFryR9rI-d1MZI`O|WFCzm`^9n|1pe%C^P&N`I3l!316y{}AGGk=4XVfrf z)G||K;ILrS0@@^C!MKx0SvjYlkwu=7kB?D8+@FzOhLHut%3)#T ) - +@init ( theme ) #02c1 .System/r DEO2 #02cd .System/g DEO2 @@ -61,8 +63,35 @@ #0200 .File/offset DEO2 ;xrxslogo .File/load DEO2 - ;draw-uxn-logo JSR2 - ;draw-xrxs-logo JSR2 + #00 .ticker STZ + #00 .state STZ + + ;on-frame .Screen/vector DEO2 + +BRK + +@on-frame ( -> ) + ( wait a couple frames, draw uxn logo ) + .ticker LDZ #01 ADD + DUP #20 EQU ,&next-render JCN + .ticker STZ + BRK + + &next-render .state LDZ + #00 .ticker STZ + DUP #00 NEQ ,&state1 JCN + ;draw-uxn-logo JSR2 + #01 ADD .state STZ + BRK + &state1 DUP #01 NEQ ,&state2 JCN + ;draw-xrxs-logo-xr JSR2 + #01 ADD .state STZ + BRK + &state2 DUP #02 NEQ ,&state3 JCN + ;draw-xrxs-logo-xs JSR2 + #01 ADD .state STZ + BRK + &state3 BRK @draw-uxn-logo ( -> ) @@ -74,7 +103,7 @@ BRK DUP2 ;uxnlogo ADD2 .Screen/addr DEO2 #81 .Screen/sprite DEO INC-X - NEXT-TILE #0040 MOD2 #0000 NEQ2 ,&no-inc-y JCN + NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN CENTER-X #0020 SUB2 .Screen/x DEO2 INC-Y &no-inc-y @@ -82,16 +111,33 @@ BRK RTN -@draw-xrxs-logo ( -> ) +@draw-xrxs-logo-xr ( -> ) CENTER-X .Screen/x DEO2 CENTER-Y #0010 SUB2 .Screen/y DEO2 - #0100 #0000 &while EQU2k ,&end JCN + #0080 #0000 &while EQU2k ,&end JCN DUP2 ;xrxslogo ADD2 .Screen/addr DEO2 #81 .Screen/sprite DEO INC-X - NEXT-TILE #0040 MOD2 #0000 NEQ2 ,&no-inc-y JCN + NEXT-TILE #0030 AND2 #0000 NEQ2 ,&no-inc-y JCN + CENTER-X .Screen/x DEO2 + INC-Y + &no-inc-y + #0010 ADD2 ,&while JMP &end POP2 POP2 + +RTN + +@draw-xrxs-logo-xs ( -> ) + + CENTER-X .Screen/x DEO2 + CENTER-Y .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 INC-Y &no-inc-y