0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-19 04:15:10 +00:00
uxn/projects/examples/gui/wallpaper.usm

70 lines
1.6 KiB
Text
Raw Normal View History

( devices )
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|10 @Console [ &vector $2 &pad $6 &char $1 &byte $1 &short $2 &string $2 ]
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|30 @Audio [ &wave $2 &envelope $2 &pad $4 &volume $1 &pitch $1 &play $1 &value $2 &delay $2 &finish $1 ]
|40 @Controller [ &vector $2 &button $1 &key $1 ]
|60 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &chord $1 ]
|70 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ]
|a0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 &refresh $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 #0001 SFT2 SUB2 .scroll/x POK2
#09b0 .scroll/y POK2
;frame .Screen/vector DEO2
#30 .scroll/wait POK
BRK
2021-04-14 05:50:01 +00:00
@frame ( -> )
#ffff
&loop
DUP2 ,row JSR
#0001 ADD2
DUP2 .Screen/height DEI2 LTH2 ,&loop JNZ
POP2
.scroll/wait PEK ,&noscroll JNZ
.scroll/y PEK2 #0001 ADD2 .scroll/y POK2
BRK
&noscroll
.scroll/wait PEK #01 SUB .scroll/wait POK
BRK
@row ( y* -- )
DUP2 .Screen/y DEO2
.scroll/y PEK2 ADD2
.Screen/width DEI2
&loop
#0001 SUB2
OVR2 OVR2 .scroll/x PEK2 ADD2 EOR2 DUP2 #0013 DIV2 #0013 MUL2 SUB2
DUP #00 EQU ,&draw JNZ
DUP #05 EQU ,&draw JNZ
POP2
&rest
DUP2 ORA ,&loop JNZ
POP2 POP2
JMP2r
#15 .Screen/color DEO
JMP2r
&draw
OVR2 .Screen/x DEO2
#05 ADD .Screen/color DEO
.Screen/y DEI2
DUP2 #0001 ADD2 .Screen/y DEO2
#00 .Screen/color DEO
.Screen/y DEO2
POP
,&rest JMP