0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-24 23:05:12 +00:00
uxn/projects/examples/gui/wallpaper.tal

64 lines
1.1 KiB
Tal
Raw Normal View History

( devices )
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ]
( variables )
|0000
@scroll [ &x $2 &y $2 &wait $1 ]
|0100 ( -> )
#90ff .System/r DEO2 #9000 .System/g DEO2 #900f .System/b DEO2
#08e0 .Screen/width DEI2 #01 SFT2 SUB2 .scroll/x STZ2
2021-05-11 18:14:52 +00:00
#09b0 .scroll/y STZ2
;frame .Screen/vector DEO2
2021-05-11 18:14:52 +00:00
#30 .scroll/wait STZ
BRK
2021-04-14 05:50:01 +00:00
@frame ( -> )
#ffff
&loop
DUP2 ,row JSR
2021-08-26 22:27:18 +00:00
INC2
2021-05-11 18:12:07 +00:00
DUP2 .Screen/height DEI2 LTH2 ,&loop JCN
POP2
2021-05-11 18:14:52 +00:00
.scroll/wait LDZ ,&noscroll JCN
2021-08-26 22:27:18 +00:00
.scroll/y LDZ2 INC2 .scroll/y STZ2
BRK
&noscroll
2021-05-11 18:14:52 +00:00
.scroll/wait LDZ #01 SUB .scroll/wait STZ
BRK
@row ( y* -- )
DUP2 .Screen/y DEO2
2021-05-11 18:14:52 +00:00
.scroll/y LDZ2 ADD2
.Screen/width DEI2
&loop
#0001 SUB2
2021-05-11 18:14:52 +00:00
OVR2 OVR2 .scroll/x LDZ2 ADD2 EOR2 DUP2 #0013 DIV2 #0013 MUL2 SUB2
2021-05-11 18:12:07 +00:00
DUP #00 EQU ,&draw JCN
DUP #05 EQU ,&draw JCN
POP2
&rest
2021-05-11 18:12:07 +00:00
DUP2 ORA ,&loop JCN
POP2 POP2
JMP2r
#15 .Screen/pixel DEO
JMP2r
&draw
OVR2 .Screen/x DEO2
#05 ADD .Screen/pixel DEO
.Screen/y DEI2
2021-08-26 22:27:18 +00:00
DUP2 INC2 .Screen/y DEO2
#00 .Screen/pixel DEO
.Screen/y DEO2
POP
,&rest JMP