Simplified the file example
This commit is contained in:
parent
743eaef47a
commit
928ed1e1c9
2
build.sh
2
build.sh
|
@ -32,7 +32,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Assembling.."
|
echo "Assembling.."
|
||||||
./bin/assembler projects/examples/dev.console.usm bin/boot.rom
|
./bin/assembler projects/examples/dev.file.usm bin/boot.rom
|
||||||
|
|
||||||
echo "Running.."
|
echo "Running.."
|
||||||
if [ "${2}" = '--cli' ];
|
if [ "${2}" = '--cli' ];
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
( Dev/File )
|
( Dev/File )
|
||||||
|
|
||||||
%RTN { JMP2r }
|
%8+ { #0008 ADD2 }
|
||||||
%STEP8 { #0033 SFT2 }
|
|
||||||
%++ { #01 ADD }
|
|
||||||
|
|
||||||
%MEMORY { #1000 }
|
%MEMORY { #1000 }
|
||||||
|
|
||||||
( devices )
|
( devices )
|
||||||
|
@ -11,8 +8,6 @@
|
||||||
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
||||||
|10 @Console [ &pad $8 &char $1 &byte $1 &short $2 &string $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 ]
|
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $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 ]
|
|70 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ]
|
||||||
|
|
||||||
( variables )
|
( variables )
|
||||||
|
@ -24,25 +19,51 @@
|
||||||
|0100 ( -> )
|
|0100 ( -> )
|
||||||
|
|
||||||
( theme )
|
( theme )
|
||||||
#804b .System/r DEO2
|
#0efc .System/r DEO2
|
||||||
#804b .System/g DEO2
|
#03cc .System/g DEO2
|
||||||
#e0bb .System/b DEO2
|
#03ac .System/b DEO2
|
||||||
|
|
||||||
( load file )
|
( load file )
|
||||||
#0100 .File/length DEO2
|
#1000 .File/length DEO2
|
||||||
;srcpath .File/name DEO2
|
;srcpath .File/name DEO2
|
||||||
MEMORY .File/load DEO2
|
MEMORY .File/load DEO2
|
||||||
|
|
||||||
.File/success DEI2 #0000 NEQ2 ;on-success JNZ2
|
.File/success DEI2 #0000 NEQ2 ;on-success JNZ2
|
||||||
|
|
||||||
|
;failedtxt .Console/string DEO2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-success ( -> )
|
@on-success ( -> )
|
||||||
|
|
||||||
;srcpath .Console/string DEO2
|
;successtxt .Console/string DEO2
|
||||||
;dstpath .Console/string DEO2
|
|
||||||
|
( draw image )
|
||||||
|
MEMORY .Screen/addr DEO2
|
||||||
|
#0000 #0080
|
||||||
|
&ver
|
||||||
|
( save ) OVR2 .Screen/y DEO2
|
||||||
|
#0000 #0080
|
||||||
|
&hor
|
||||||
|
( save ) OVR2 .Screen/x DEO2
|
||||||
|
( draw ) #41 .Screen/color DEO
|
||||||
|
( incr ) .Screen/addr DEI2 #0010 ADD2 .Screen/addr DEO2
|
||||||
|
( incr ) SWP2 8+ SWP2
|
||||||
|
OVR2 OVR2 LTH2 ,&hor JNZ
|
||||||
|
POP2 POP2
|
||||||
|
( incr ) SWP2 8+ SWP2
|
||||||
|
OVR2 OVR2 LTH2 ,&ver JNZ
|
||||||
|
POP2 POP2
|
||||||
|
|
||||||
|
( save file )
|
||||||
|
#1000 .File/length DEO2
|
||||||
|
;dstpath .File/name DEO2
|
||||||
|
MEMORY .File/save DEO2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@srcpath "README.md $1
|
@successtxt "Success! $1
|
||||||
@dstpath "bin/export.md $1
|
@failedtxt "Failed. $1
|
||||||
|
|
||||||
|
@srcpath "projects/pictures/ako10x10.chr $1
|
||||||
|
@dstpath "bin/image-copy.chr $1
|
||||||
|
|
Loading…
Reference in New Issue