Afterall, I decided to not use the fancy new macros, I think pek/pok is more readable than glyphs in the end
This commit is contained in:
parent
1b4623be1b
commit
8ca9e6d4de
2
build.sh
2
build.sh
|
@ -32,7 +32,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Assembling.."
|
echo "Assembling.."
|
||||||
./bin/assembler projects/examples/gui.animation.usm bin/boot.rom
|
./bin/assembler projects/examples/dev.audio.usm bin/boot.rom
|
||||||
|
|
||||||
echo "Running.."
|
echo "Running.."
|
||||||
if [ "${2}" = '--cli' ];
|
if [ "${2}" = '--cli' ];
|
||||||
|
|
|
@ -2,11 +2,6 @@
|
||||||
|
|
||||||
%MOD { DUP2 DIV MUL SUB }
|
%MOD { DUP2 DIV MUL SUB }
|
||||||
|
|
||||||
%%^! { .% DEI } %%~! { .% DEO }
|
|
||||||
%%*! { .% DEI2 } %%=! { .% DEO2 }
|
|
||||||
%%^ { .% PEK } %%~ { .% POK }
|
|
||||||
%%* { .% PEK2 } %%= { .% POK2 }
|
|
||||||
|
|
||||||
@timer $1
|
@timer $1
|
||||||
@progress $1
|
@progress $1
|
||||||
|
|
||||||
|
@ -19,41 +14,41 @@
|
||||||
|0100 ( -> )
|
|0100 ( -> )
|
||||||
|
|
||||||
( set color pallete )
|
( set color pallete )
|
||||||
#00ff System/r=!
|
#00ff .System/r DEO2
|
||||||
#0f0f System/g=!
|
#0f0f .System/g DEO2
|
||||||
#0ff0 System/b=!
|
#0ff0 .System/b DEO2
|
||||||
|
|
||||||
;on-frame Screen/vector=! ( run on-frame every 1/60th of a second )
|
;on-frame .Screen/vector DEO2 ( run on-frame every 1/60th of a second )
|
||||||
#ff Audio/vol~! ( set volume to max )
|
#ff .Audio/vol DEO ( set volume to max )
|
||||||
;saw Audio/wave=! ( set waveform to saw for audio engine )
|
;saw .Audio/wave DEO2 ( set waveform to saw for audio engine )
|
||||||
;env Audio/env=! ( set envelope for audio engine )
|
;env .Audio/env DEO2 ( set envelope for audio engine )
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-frame ( -> )
|
@on-frame ( -> )
|
||||||
|
|
||||||
( incr ) timer^ #01 ADD timer~
|
( incr ) .timer PEK #01 ADD .timer POK
|
||||||
( skip ) timer^ #10 EQU ,&play-note JNZ BRK &play-note
|
( skip ) .timer PEK #10 EQU ,&play-note JNZ BRK &play-note
|
||||||
|
|
||||||
( get note )
|
( get note )
|
||||||
;melody #00 progress^ ADD2 GET
|
;melody #00 .progress PEK ADD2 GET
|
||||||
|
|
||||||
( play note )
|
( play note )
|
||||||
DUP #80 ORA Audio/pitch~!
|
DUP #80 ORA .Audio/pitch DEO
|
||||||
#01 Audio/play~!
|
#01 .Audio/play DEO
|
||||||
|
|
||||||
( erase last note )
|
( erase last note )
|
||||||
#20 Screen/color~!
|
#20 .Screen/color DEO
|
||||||
|
|
||||||
( draw note )
|
( draw note )
|
||||||
#00 SWP #0004 MUL2 #0100 SUB2 Screen/y=!
|
#00 SWP #0004 MUL2 #0100 SUB2 .Screen/y DEO2
|
||||||
#00 progress^ #0008 MUL2 Screen/x=!
|
#00 .progress PEK #0008 MUL2 .Screen/x DEO2
|
||||||
;dot Screen/addr=!
|
;dot .Screen/addr DEO2
|
||||||
#21 Screen/color~!
|
#21 .Screen/color DEO
|
||||||
|
|
||||||
( incr ) progress^ #01 ADD #20 MOD progress~
|
( incr ) .progress PEK #01 ADD #20 MOD .progress POK
|
||||||
|
|
||||||
#00 timer~
|
#00 .timer POK
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
@ -65,10 +60,10 @@ BRK
|
||||||
|
|
||||||
@saw ( -> )
|
@saw ( -> )
|
||||||
|
|
||||||
#6000 Audio/value=!
|
#6000 .Audio/value DEO2
|
||||||
#0000 Audio/delay=! ( move to volume #600 after 0 delay )
|
#0000 .Audio/delay DEO2 ( move to volume #600 after 0 delay )
|
||||||
#0000 Audio/value=!
|
#0000 .Audio/value DEO2
|
||||||
#ffff Audio/delay=! ( reach volume 0 after the whole note. Interpolated linearly )
|
#ffff .Audio/delay DEO2 ( reach volume 0 after the whole note. Interpolated linearly )
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
@ -76,11 +71,11 @@ BRK
|
||||||
|
|
||||||
@env ( -> )
|
@env ( -> )
|
||||||
|
|
||||||
#ffff Audio/value=!
|
#ffff .Audio/value DEO2
|
||||||
#1000 Audio/delay=! ( move pretty quickly to volume #ffff (maximum) )
|
#1000 .Audio/delay DEO2 ( move pretty quickly to volume #ffff (maximum) )
|
||||||
#0000 Audio/value=!
|
#0000 .Audio/value DEO2
|
||||||
#4000 Audio/delay=! ( interpolating linearly, move to #0000 after a delay of #4000 where #8000 is half a second )
|
#4000 .Audio/delay DEO2 ( interpolating linearly, move to #0000 after a delay of #4000 where #8000 is half a second )
|
||||||
#00 Audio/finish~! ( end the envelope )
|
#00 .Audio/finish DEO ( end the envelope )
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,6 @@
|
||||||
%-- { #0001 SUB2 }
|
%-- { #0001 SUB2 }
|
||||||
%2/ { #0002 DIV2 }
|
%2/ { #0002 DIV2 }
|
||||||
|
|
||||||
%%^! { .% DEI } %%~! { .% DEO }
|
|
||||||
%%*! { .% DEI2 } %%=! { .% DEO2 }
|
|
||||||
%%^ { .% PEK } %%~ { .% POK }
|
|
||||||
%%* { .% PEK2 } %%= { .% POK2 }
|
|
||||||
|
|
||||||
( devices )
|
( devices )
|
||||||
|
|
||||||
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
||||||
|
@ -26,62 +21,62 @@
|
||||||
|0100 ( -> )
|
|0100 ( -> )
|
||||||
|
|
||||||
( theme )
|
( theme )
|
||||||
#0daf System/r=!
|
#0daf .System/r DEO2
|
||||||
#02ff System/g=!
|
#02ff .System/g DEO2
|
||||||
#035f System/b=!
|
#035f .System/b DEO2
|
||||||
|
|
||||||
( vectors )
|
( vectors )
|
||||||
;on-frame Screen/vector=!
|
;on-frame .Screen/vector DEO2
|
||||||
|
|
||||||
( set origin )
|
( set origin )
|
||||||
Screen/width*! 2/ Screen/x=!
|
.Screen/width DEI2 2/ .Screen/x DEO2
|
||||||
Screen/height*! 2/ Screen/y=!
|
.Screen/height DEI2 2/ .Screen/y DEO2
|
||||||
|
|
||||||
;default_icn Screen/addr=!
|
;default_icn .Screen/addr DEO2
|
||||||
#31 Screen/color~!
|
#31 .Screen/color DEO
|
||||||
#2a slime~
|
#2a .slime POK
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-frame ( -> )
|
@on-frame ( -> )
|
||||||
|
|
||||||
#2a slime~
|
#2a .slime POK
|
||||||
;default_icn Screen/addr=!
|
;default_icn .Screen/addr DEO2
|
||||||
|
|
||||||
( hold ctrl key to change slime color )
|
( hold ctrl key to change slime color )
|
||||||
Controller/button^! #0f AND
|
.Controller/button DEI #0f AND
|
||||||
DUP #01 NEQ ,&no-ctrl JNZ #25 slime~ &no-ctrl
|
DUP #01 NEQ ,&no-ctrl JNZ #25 .slime POK &no-ctrl
|
||||||
DUP #02 NEQ ,&no-alt JNZ #2f slime~ &no-alt
|
DUP #02 NEQ ,&no-alt JNZ #2f .slime POK &no-alt
|
||||||
POP
|
POP
|
||||||
|
|
||||||
( clear ) #30 Screen/color~!
|
( clear ) #30 .Screen/color DEO
|
||||||
|
|
||||||
( detect movement )
|
( detect movement )
|
||||||
Controller/button^! #f0 AND
|
.Controller/button DEI #f0 AND
|
||||||
DUP #04 SFT #01 AND #01 NEQ ,&no-up JNZ
|
DUP #04 SFT #01 AND #01 NEQ ,&no-up JNZ
|
||||||
( move )
|
( move )
|
||||||
Screen/y*! -- Screen/y=!
|
.Screen/y DEI2 -- .Screen/y DEO2
|
||||||
;up_icn Screen/addr=! &no-up
|
;up_icn .Screen/addr DEO2 &no-up
|
||||||
DUP #05 SFT #01 AND #01 NEQ ,&no-down JNZ
|
DUP #05 SFT #01 AND #01 NEQ ,&no-down JNZ
|
||||||
( move )
|
( move )
|
||||||
Screen/y*! ++ Screen/y=!
|
.Screen/y DEI2 ++ .Screen/y DEO2
|
||||||
;down_icn Screen/addr=! &no-down
|
;down_icn .Screen/addr DEO2 &no-down
|
||||||
DUP #06 SFT #01 AND #01 NEQ ,&no-left JNZ
|
DUP #06 SFT #01 AND #01 NEQ ,&no-left JNZ
|
||||||
( move )
|
( move )
|
||||||
Screen/x*! -- Screen/x=!
|
.Screen/x DEI2 -- .Screen/x DEO2
|
||||||
;left_icn Screen/addr=! &no-left
|
;left_icn .Screen/addr DEO2 &no-left
|
||||||
DUP #07 SFT #01 AND #01 NEQ ,&no-right JNZ
|
DUP #07 SFT #01 AND #01 NEQ ,&no-right JNZ
|
||||||
( move )
|
( move )
|
||||||
Screen/x*! ++ Screen/x=!
|
.Screen/x DEI2 ++ .Screen/x DEO2
|
||||||
;right_icn Screen/addr=! &no-right
|
;right_icn .Screen/addr DEO2 &no-right
|
||||||
POP
|
POP
|
||||||
|
|
||||||
( draw face )
|
( draw face )
|
||||||
#31 Screen/color~!
|
#31 .Screen/color DEO
|
||||||
|
|
||||||
( draw slime )
|
( draw slime )
|
||||||
;slime_icn Screen/addr=!
|
;slime_icn .Screen/addr DEO2
|
||||||
slime^ Screen/color~!
|
.slime PEK .Screen/color DEO
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,6 @@
|
||||||
%8+ { #0008 ADD2 }
|
%8+ { #0008 ADD2 }
|
||||||
%8* { #0030 SFT2 }
|
%8* { #0030 SFT2 }
|
||||||
|
|
||||||
%%^! { .% DEI } %%~! { .% DEO }
|
|
||||||
%%*! { .% DEI2 } %%=! { .% DEO2 }
|
|
||||||
%%^ { .% PEK } %%~ { .% POK }
|
|
||||||
%%* { .% PEK2 } %%= { .% POK2 }
|
|
||||||
|
|
||||||
( devices )
|
( devices )
|
||||||
|
|
||||||
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
||||||
|
@ -20,36 +15,36 @@
|
||||||
|0100 ( -> )
|
|0100 ( -> )
|
||||||
|
|
||||||
( theme )
|
( theme )
|
||||||
#0f73 System/r=!
|
#0f73 .System/r DEO2
|
||||||
#0fe3 System/g=!
|
#0fe3 .System/g DEO2
|
||||||
#0fc3 System/b=!
|
#0fc3 .System/b DEO2
|
||||||
( vectors )
|
( vectors )
|
||||||
;on-button Controller/vector=!
|
;on-button .Controller/vector DEO2
|
||||||
;draw-cursor JSR2
|
;draw-cursor JSR2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-button ( -> )
|
@on-button ( -> )
|
||||||
|
|
||||||
Controller/key^! #00 NEQ ,&skip JNZ BRK &skip
|
.Controller/key DEI #00 NEQ ,&skip JNZ BRK &skip
|
||||||
Controller/key^! #0d NEQ ,&no-return JNZ
|
.Controller/key DEI #0d NEQ ,&no-return JNZ
|
||||||
( draw ) #20 Screen/color~!
|
( draw ) #20 .Screen/color DEO
|
||||||
( reset ) #0000 Screen/x=!
|
( reset ) #0000 .Screen/x DEO2
|
||||||
( incr ) Screen/y*! 8+ Screen/y=!
|
( incr ) .Screen/y DEI2 8+ .Screen/y DEO2
|
||||||
;draw-cursor JSR2
|
;draw-cursor JSR2
|
||||||
BRK
|
BRK
|
||||||
&no-return
|
&no-return
|
||||||
;font #00 Controller/key^! 8* ADD2 Screen/addr=!
|
;font #00 .Controller/key DEI 8* ADD2 .Screen/addr DEO2
|
||||||
( draw ) #21 Screen/color~!
|
( draw ) #21 .Screen/color DEO
|
||||||
( incr ) Screen/x*! 8+ Screen/x=!
|
( incr ) .Screen/x DEI2 8+ .Screen/x DEO2
|
||||||
;draw-cursor JSR2
|
;draw-cursor JSR2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@draw-cursor ( -- )
|
@draw-cursor ( -- )
|
||||||
|
|
||||||
;cursor Screen/addr=!
|
;cursor .Screen/addr DEO2
|
||||||
#22 Screen/color~!
|
#22 .Screen/color DEO
|
||||||
|
|
||||||
RTN
|
RTN
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,6 @@
|
||||||
%8+ { #0008 ADD2 }
|
%8+ { #0008 ADD2 }
|
||||||
%MEMORY { #1000 }
|
%MEMORY { #1000 }
|
||||||
|
|
||||||
%%^! { .% DEI } %%~! { .% DEO }
|
|
||||||
%%*! { .% DEI2 } %%=! { .% DEO2 }
|
|
||||||
%%^ { .% PEK } %%~ { .% POK }
|
|
||||||
%%* { .% PEK2 } %%= { .% POK2 }
|
|
||||||
|
|
||||||
( devices )
|
( devices )
|
||||||
|
|
||||||
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
||||||
|
@ -24,35 +19,35 @@
|
||||||
|0100 ( -> )
|
|0100 ( -> )
|
||||||
|
|
||||||
( theme )
|
( theme )
|
||||||
#0efc System/r=!
|
#0efc .System/r DEO2
|
||||||
#03cc System/g=!
|
#03cc .System/g DEO2
|
||||||
#03ac System/b=!
|
#03ac .System/b DEO2
|
||||||
|
|
||||||
( load file )
|
( load file )
|
||||||
#1000 File/length=!
|
#1000 .File/length DEO2
|
||||||
;srcpath File/name=!
|
;srcpath .File/name DEO2
|
||||||
MEMORY File/load=!
|
MEMORY .File/load DEO2
|
||||||
|
|
||||||
File/success*! #0000 NEQ2 ;on-success JNZ2
|
.File/success DEI2 #0000 NEQ2 ;on-success JNZ2
|
||||||
|
|
||||||
;failedtxt Console/string=!
|
;failedtxt .Console/string DEO2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-success ( -> )
|
@on-success ( -> )
|
||||||
|
|
||||||
;successtxt Console/string=!
|
;successtxt .Console/string DEO2
|
||||||
|
|
||||||
( draw image )
|
( draw image )
|
||||||
MEMORY Screen/addr=!
|
MEMORY .Screen/addr DEO2
|
||||||
#0000 #0080
|
#0000 #0080
|
||||||
&ver
|
&ver
|
||||||
( save ) OVR2 Screen/y=!
|
( save ) OVR2 .Screen/y DEO2
|
||||||
#0000 #0080
|
#0000 #0080
|
||||||
&hor
|
&hor
|
||||||
( save ) OVR2 Screen/x=!
|
( save ) OVR2 .Screen/x DEO2
|
||||||
( draw ) #41 Screen/color~!
|
( draw ) #41 .Screen/color DEO
|
||||||
( incr ) Screen/addr*! #0010 ADD2 Screen/addr=!
|
( incr ) .Screen/addr DEI2 #0010 ADD2 .Screen/addr DEO2
|
||||||
( incr ) SWP2 8+ SWP2
|
( incr ) SWP2 8+ SWP2
|
||||||
OVR2 OVR2 LTH2 ,&hor JNZ
|
OVR2 OVR2 LTH2 ,&hor JNZ
|
||||||
POP2 POP2
|
POP2 POP2
|
||||||
|
@ -61,9 +56,9 @@ BRK
|
||||||
POP2 POP2
|
POP2 POP2
|
||||||
|
|
||||||
( save file )
|
( save file )
|
||||||
#1000 File/length=!
|
#1000 .File/length DEO2
|
||||||
;dstpath File/name=!
|
;dstpath .File/name DEO2
|
||||||
MEMORY File/save=!
|
MEMORY .File/save DEO2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
( dev/mouse )
|
( dev/mouse )
|
||||||
|
|
||||||
%RTN { JMP2r }
|
%RTN { JMP2r }
|
||||||
%ABS2 { DUP2 #000f SFT2 EQU #04 JNZ #ffff MUL2 }
|
%ABS2 { DUP2 #000f SFT2 EQU #04 JNZ #ffff MUL2 }.
|
||||||
|
|
||||||
%%^! { .% DEI } %%~! { .% DEO }
|
|
||||||
%%*! { .% DEI2 } %%=! { .% DEO2 }
|
|
||||||
%%^ { .% PEK } %%~ { .% POK }
|
|
||||||
%%* { .% PEK2 } %%= { .% POK2 }
|
|
||||||
|
|
||||||
( devices )
|
( devices )
|
||||||
|
|
||||||
|
@ -25,11 +20,11 @@
|
||||||
|0100 ( -> )
|
|0100 ( -> )
|
||||||
|
|
||||||
( theme )
|
( theme )
|
||||||
#f0f0 System/r=!
|
#f0f0 .System/r DEO2
|
||||||
#f00f System/g=!
|
#f00f .System/g DEO2
|
||||||
#f000 System/b=!
|
#f000 .System/b DEO2
|
||||||
( vectors )
|
( vectors )
|
||||||
;on-mouse Mouse/vector=!
|
;on-mouse .Mouse/vector DEO2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
|
@ -37,79 +32,79 @@ BRK
|
||||||
|
|
||||||
;draw-cursor JSR2
|
;draw-cursor JSR2
|
||||||
( on down )
|
( on down )
|
||||||
Mouse/state^! #00 NEQ pointer/state^ #00 EQU #0101 EQU2 ,on-mouse-down JNZ
|
.Mouse/state DEI #00 NEQ .pointer/state PEK #00 EQU #0101 EQU2 ,on-mouse-down JNZ
|
||||||
( on drag )
|
( on drag )
|
||||||
Mouse/state^! #00 NEQ ,on-mouse-drag JNZ
|
.Mouse/state DEI #00 NEQ ,on-mouse-drag JNZ
|
||||||
Mouse/state^! pointer/state~
|
.Mouse/state DEI .pointer/state POK
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-mouse-down ( -> )
|
@on-mouse-down ( -> )
|
||||||
|
|
||||||
( record start position )
|
( record start position )
|
||||||
Mouse/x*! DUP2 pointer/x= pointer/lastx=
|
.Mouse/x DEI2 DUP2 .pointer/x POK2 .pointer/lastx POK2
|
||||||
Mouse/y*! DUP2 pointer/y= pointer/lasty=
|
.Mouse/y DEI2 DUP2 .pointer/y POK2 .pointer/lasty POK2
|
||||||
Mouse/state^! pointer/state~
|
.Mouse/state DEI .pointer/state POK
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-mouse-drag ( -> )
|
@on-mouse-drag ( -> )
|
||||||
|
|
||||||
( draw line )
|
( draw line )
|
||||||
pointer/lastx*
|
.pointer/lastx PEK2
|
||||||
pointer/lasty*
|
.pointer/lasty PEK2
|
||||||
pointer/x*
|
.pointer/x PEK2
|
||||||
pointer/y*
|
.pointer/y PEK2
|
||||||
#01 [ Mouse/state^! #10 EQU #02 MUL ADD ]
|
#01 [ .Mouse/state DEI #10 EQU #02 MUL ADD ]
|
||||||
;draw-line JSR2
|
;draw-line JSR2
|
||||||
( record last position )
|
( record last position )
|
||||||
Mouse/x*! pointer/lastx=
|
.Mouse/x DEI2 .pointer/lastx POK2
|
||||||
Mouse/y*! pointer/lasty=
|
.Mouse/y DEI2 .pointer/lasty POK2
|
||||||
Mouse/state^! pointer/state~
|
.Mouse/state DEI .pointer/state POK
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@draw-cursor ( -- )
|
@draw-cursor ( -- )
|
||||||
|
|
||||||
( clear last cursor )
|
( clear last cursor )
|
||||||
;clear Screen/addr=!
|
;clear .Screen/addr DEO2
|
||||||
pointer/x* Screen/x=!
|
.pointer/x PEK2 .Screen/x DEO2
|
||||||
pointer/y* Screen/y=!
|
.pointer/y PEK2 .Screen/y DEO2
|
||||||
#30 Screen/color~!
|
#30 .Screen/color DEO
|
||||||
( record pointer positions )
|
( record pointer positions )
|
||||||
Mouse/x*! pointer/x=
|
.Mouse/x DEI2 .pointer/x POK2
|
||||||
Mouse/y*! pointer/y=
|
.Mouse/y DEI2 .pointer/y POK2
|
||||||
( draw new cursor )
|
( draw new cursor )
|
||||||
;cursor Screen/addr=!
|
;cursor .Screen/addr DEO2
|
||||||
pointer/x* Screen/x=!
|
.pointer/x PEK2 .Screen/x DEO2
|
||||||
pointer/y* Screen/y=!
|
.pointer/y PEK2 .Screen/y DEO2
|
||||||
( colorize on state )
|
( colorize on state )
|
||||||
#31 [ Mouse/state^! #00 NEQ ] ADD Screen/color~!
|
#31 [ .Mouse/state DEI #00 NEQ ] ADD .Screen/color DEO
|
||||||
|
|
||||||
RTN
|
RTN
|
||||||
|
|
||||||
@draw-line ( x1 y1 x2 y2 color -- )
|
@draw-line ( x1 y1 x2 y2 color -- )
|
||||||
|
|
||||||
( load ) color~ line/y0= line/x0= line/y= line/x=
|
( load ) .color POK .line/y0 POK2 .line/x0 POK2 .line/y POK2 .line/x POK2
|
||||||
line/x0* line/x* SUB2 ABS2 line/dx=
|
.line/x0 PEK2 .line/x PEK2 SUB2 ABS2 .line/dx POK2
|
||||||
line/y0* line/y* SUB2 ABS2 #0000 SWP2 SUB2 line/dy=
|
.line/y0 PEK2 .line/y PEK2 SUB2 ABS2 #0000 SWP2 SUB2 .line/dy POK2
|
||||||
#ffff #00 line/x* line/x0* LTS2 #0002 MUL2 ADD2 line/sx=
|
#ffff #00 .line/x PEK2 .line/x0 PEK2 LTS2 #0002 MUL2 ADD2 .line/sx POK2
|
||||||
#ffff #00 line/y* line/y0* LTS2 #0002 MUL2 ADD2 line/sy=
|
#ffff #00 .line/y PEK2 .line/y0 PEK2 LTS2 #0002 MUL2 ADD2 .line/sy POK2
|
||||||
line/dx* line/dy* ADD2 line/e1=
|
.line/dx PEK2 .line/dy PEK2 ADD2 .line/e1 POK2
|
||||||
&loop
|
&loop
|
||||||
( draw )
|
( draw )
|
||||||
line/x* Screen/x=!
|
.line/x PEK2 .Screen/x DEO2
|
||||||
line/y* Screen/y=!
|
.line/y PEK2 .Screen/y DEO2
|
||||||
color^ Screen/color~!
|
.color PEK .Screen/color DEO
|
||||||
line/x* line/x0* EQU2 line/y* line/y0* EQU2 #0101 EQU2 ,&end JNZ
|
.line/x PEK2 .line/x0 PEK2 EQU2 .line/y PEK2 .line/y0 PEK2 EQU2 #0101 EQU2 ,&end JNZ
|
||||||
line/e1* #0002 MUL2 line/e2=
|
.line/e1 PEK2 #0002 MUL2 .line/e2 POK2
|
||||||
line/e2* line/dy* LTS2 ,&skipy JNZ
|
.line/e2 PEK2 .line/dy PEK2 LTS2 ,&skipy JNZ
|
||||||
line/e1* line/dy* ADD2 line/e1=
|
.line/e1 PEK2 .line/dy PEK2 ADD2 .line/e1 POK2
|
||||||
line/x* line/sx* ADD2 line/x=
|
.line/x PEK2 .line/sx PEK2 ADD2 .line/x POK2
|
||||||
&skipy
|
&skipy
|
||||||
line/e2* line/dx* GTS2 ,&skipx JNZ
|
.line/e2 PEK2 .line/dx PEK2 GTS2 ,&skipx JNZ
|
||||||
line/e1* line/dx* ADD2 line/e1=
|
.line/e1 PEK2 .line/dx PEK2 ADD2 .line/e1 POK2
|
||||||
line/y* line/sy* ADD2 line/y=
|
.line/y PEK2 .line/sy PEK2 ADD2 .line/y POK2
|
||||||
&skipx
|
&skipx
|
||||||
,&loop JMP
|
,&loop JMP
|
||||||
&end
|
&end
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
( GUI Animation )
|
( GUI Animation )
|
||||||
|
|
||||||
%%^! { .% DEI } %%~! { .% DEO }
|
|
||||||
%%*! { .% DEI2 } %%=! { .% DEO2 }
|
|
||||||
%%^ { .% PEK } %%~ { .% POK }
|
|
||||||
%%* { .% PEK2 } %%= { .% POK2 }
|
|
||||||
|
|
||||||
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|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 &color $1 ]
|
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|
||||||
|
|
||||||
|
@ -17,14 +12,14 @@
|
||||||
|0100 ( -> )
|
|0100 ( -> )
|
||||||
|
|
||||||
( theme )
|
( theme )
|
||||||
#4cfd System/r=!
|
#4cfd .System/r DEO2
|
||||||
#4cf3 System/g=!
|
#4cf3 .System/g DEO2
|
||||||
#dcf2 System/b=!
|
#dcf2 .System/b DEO2
|
||||||
( vectors )
|
( vectors )
|
||||||
;on-frame Screen/vector=!
|
;on-frame .Screen/vector DEO2
|
||||||
( starting position )
|
( starting position )
|
||||||
Screen/width*! #0002 DIV2 dvd/x=
|
.Screen/width DEI2 #0002 DIV2 .dvd/x POK2
|
||||||
Screen/height*! #0002 DIV2 dvd/y=
|
.Screen/height DEI2 #0002 DIV2 .dvd/y POK2
|
||||||
#21 ;draw-dvd JSR2
|
#21 ;draw-dvd JSR2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
@ -32,16 +27,16 @@ BRK
|
||||||
@on-frame ( -> )
|
@on-frame ( -> )
|
||||||
|
|
||||||
( clear ) #20 ;draw-dvd JSR2
|
( clear ) #20 ;draw-dvd JSR2
|
||||||
( case: hit-right ) dvd/x* Screen/width*! #0020 SUB2 EQU2
|
( case: hit-right ) .dvd/x PEK2 .Screen/width DEI2 #0020 SUB2 EQU2
|
||||||
( case: hit-left ) dvd/x* #0000 EQU2
|
( case: hit-left ) .dvd/x PEK2 #0000 EQU2
|
||||||
#0000 EQU2 ,&no-flipx JNZ
|
#0000 EQU2 ,&no-flipx JNZ
|
||||||
dvd/dx^ #00 EQU dvd/dx~ &no-flipx
|
.dvd/dx PEK #00 EQU .dvd/dx POK &no-flipx
|
||||||
( case: hit-bottom ) dvd/y* Screen/height*! #0010 SUB2 EQU2
|
( case: hit-bottom ) .dvd/y PEK2 .Screen/height DEI2 #0010 SUB2 EQU2
|
||||||
( case: hit-top ) dvd/y* #0000 EQU2
|
( case: hit-top ) .dvd/y PEK2 #0000 EQU2
|
||||||
#0000 EQU2 ,&no-flipy JNZ
|
#0000 EQU2 ,&no-flipy JNZ
|
||||||
dvd/dy^ #00 EQU dvd/dy~ &no-flipy
|
.dvd/dy PEK #00 EQU .dvd/dy POK &no-flipy
|
||||||
( incr ) dvd/x* #0001 #00 dvd/dx^ #00 EQU #fffe MUL2 ADD2 ADD2 dvd/x=
|
( incr ) .dvd/x PEK2 #0001 #00 .dvd/dx PEK #00 EQU #fffe MUL2 ADD2 ADD2 .dvd/x POK2
|
||||||
( incr ) dvd/y* #0001 #00 dvd/dy^ #00 EQU #fffe MUL2 ADD2 ADD2 dvd/y=
|
( incr ) .dvd/y PEK2 #0001 #00 .dvd/dy PEK #00 EQU #fffe MUL2 ADD2 ADD2 .dvd/y POK2
|
||||||
( draw ) #21 ;draw-dvd JSR2
|
( draw ) #21 ;draw-dvd JSR2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
@ -49,15 +44,15 @@ BRK
|
||||||
@draw-dvd ( color -- )
|
@draw-dvd ( color -- )
|
||||||
|
|
||||||
( stash ) STH
|
( stash ) STH
|
||||||
;dvd_icn Screen/addr=!
|
;dvd_icn .Screen/addr DEO2
|
||||||
dvd/y* [ dvd/y* #0010 ADD2 ]
|
.dvd/y PEK2 [ .dvd/y PEK2 #0010 ADD2 ]
|
||||||
&ver
|
&ver
|
||||||
OVR2 Screen/y=!
|
OVR2 .Screen/y DEO2
|
||||||
dvd/x* [ dvd/x* #0020 ADD2 ]
|
.dvd/x PEK2 [ .dvd/x PEK2 #0020 ADD2 ]
|
||||||
&hor
|
&hor
|
||||||
OVR2 Screen/x=!
|
OVR2 .Screen/x DEO2
|
||||||
( draw ) DUPr STHr Screen/color~!
|
( draw ) DUPr STHr .Screen/color DEO
|
||||||
( next ) Screen/addr*! #0008 ADD2 Screen/addr=!
|
( next ) .Screen/addr DEI2 #0008 ADD2 .Screen/addr DEO2
|
||||||
( incr ) SWP2 #0008 ADD2 SWP2
|
( incr ) SWP2 #0008 ADD2 SWP2
|
||||||
OVR2 OVR2 LTH2 ,&hor JNZ
|
OVR2 OVR2 LTH2 ,&hor JNZ
|
||||||
POP2 POP2
|
POP2 POP2
|
||||||
|
|
Loading…
Reference in New Issue