uxn/projects/examples/dev.file.usm

75 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-04-21 12:37:59 +00:00
( Dev/File )
2021-04-21 18:38:30 +00:00
%8+ { #0008 ADD2 }
2021-04-21 12:37:59 +00:00
%MEMORY { #1000 }
2021-04-23 02:57:47 +00:00
%%^! { .% DEI } %%~! { .% DEO }
%%*! { .% DEI2 } %%=! { .% DEO2 }
%%^ { .% PEK } %%~ { .% POK }
%%* { .% PEK2 } %%= { .% POK2 }
( devices )
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|10 @Console [ &pad $8 &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 ]
|70 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ]
( variables )
|0000
2021-04-21 16:48:04 +00:00
( init )
2021-04-21 12:37:59 +00:00
2021-04-21 16:48:04 +00:00
|0100 ( -> )
2021-04-21 12:37:59 +00:00
( theme )
2021-04-23 02:57:47 +00:00
#0efc System/r=!
#03cc System/g=!
#03ac System/b=!
2021-04-21 12:37:59 +00:00
( load file )
2021-04-23 02:57:47 +00:00
#1000 File/length=!
;srcpath File/name=!
MEMORY File/load=!
2021-04-21 12:37:59 +00:00
2021-04-23 02:57:47 +00:00
File/success*! #0000 NEQ2 ;on-success JNZ2
2021-04-21 12:37:59 +00:00
2021-04-23 02:57:47 +00:00
;failedtxt Console/string=!
2021-04-21 18:38:30 +00:00
2021-04-21 12:37:59 +00:00
BRK
@on-success ( -> )
2021-04-21 12:37:59 +00:00
2021-04-23 02:57:47 +00:00
;successtxt Console/string=!
2021-04-21 18:38:30 +00:00
( draw image )
2021-04-23 02:57:47 +00:00
MEMORY Screen/addr=!
2021-04-21 18:38:30 +00:00
#0000 #0080
&ver
2021-04-23 02:57:47 +00:00
( save ) OVR2 Screen/y=!
2021-04-21 18:38:30 +00:00
#0000 #0080
&hor
2021-04-23 02:57:47 +00:00
( save ) OVR2 Screen/x=!
( draw ) #41 Screen/color~!
( incr ) Screen/addr*! #0010 ADD2 Screen/addr=!
2021-04-21 18:38:30 +00:00
( incr ) SWP2 8+ SWP2
OVR2 OVR2 LTH2 ,&hor JNZ
POP2 POP2
( incr ) SWP2 8+ SWP2
OVR2 OVR2 LTH2 ,&ver JNZ
POP2 POP2
( save file )
2021-04-23 02:57:47 +00:00
#1000 File/length=!
;dstpath File/name=!
MEMORY File/save=!
2021-04-21 12:37:59 +00:00
BRK
2021-04-21 12:37:59 +00:00
2021-04-21 18:38:30 +00:00
@successtxt "Success! $1
@failedtxt "Failed. $1
@srcpath "projects/pictures/ako10x10.chr $1
@dstpath "bin/image-copy.chr $1