Minor optimizations to the examples
This commit is contained in:
parent
514b2f7f58
commit
0c188ef3fa
2
build.sh
2
build.sh
|
@ -42,7 +42,7 @@ then
|
|||
fi
|
||||
|
||||
echo "Assembling.."
|
||||
./bin/uxnasm projects/demos/drum-rack.usm bin/boot.rom
|
||||
./bin/uxnasm projects/examples/devices/screen.usm bin/boot.rom
|
||||
|
||||
echo "Running.."
|
||||
if [ "${2}" = '--cli' ];
|
||||
|
|
|
@ -17,9 +17,9 @@ BRK
|
|||
@print ( addr* -- )
|
||||
|
||||
&loop
|
||||
( send ) DUP2 LDA .Console/char DEO
|
||||
( send ) LDAk .Console/char DEO
|
||||
( incr ) #0001 ADD2
|
||||
( loop ) DUP2 LDA #00 NEQ ,&loop JCN
|
||||
( loop ) LDAk #00 NEQ ,&loop JCN
|
||||
POP2
|
||||
|
||||
RTN
|
||||
|
|
|
@ -49,10 +49,10 @@ BRK
|
|||
( draw ) #41 .Screen/color DEO
|
||||
( incr ) .Screen/addr DEI2 #0010 ADD2 .Screen/addr DEO2
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&hor JCN
|
||||
LTH2k ,&hor JCN
|
||||
POP2 POP2
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&ver JCN
|
||||
LTH2k ,&ver JCN
|
||||
POP2 POP2
|
||||
|
||||
( save file )
|
||||
|
|
|
@ -73,7 +73,6 @@ BRK
|
|||
@draw-cursor ( -- )
|
||||
|
||||
( clear last cursor )
|
||||
#fff8 .Screen/addr DEO2
|
||||
.pointer/x LDZ2 .Screen/x DEO2
|
||||
.pointer/y LDZ2 .Screen/y DEO2
|
||||
#30 .Screen/color DEO
|
||||
|
|
|
@ -45,7 +45,7 @@ BRK
|
|||
.center/y LDZ2 #0040 SUB2 ADD2 .Screen/y DEO2
|
||||
( draw ) OVR .Screen/color DEO
|
||||
( incr ) SWP #01 ADD SWP
|
||||
DUP2 NEQ ,&loop JCN
|
||||
NEQk ,&loop JCN
|
||||
POP2
|
||||
|
||||
RTN
|
||||
|
@ -69,7 +69,7 @@ RTN
|
|||
( draw ) #21 .Screen/color DEO
|
||||
|
||||
( incr ) SWP #01 ADD SWP
|
||||
DUP2 LTH ,&loop JCN
|
||||
LTHk ,&loop JCN
|
||||
POP2
|
||||
|
||||
RTN
|
||||
|
|
|
@ -54,13 +54,13 @@ BRK
|
|||
.dvd/x LDZ2 [ .dvd/x LDZ2 #0020 ADD2 ]
|
||||
&hor
|
||||
OVR2 .Screen/x DEO2
|
||||
( draw ) DUPr STHr .Screen/color DEO
|
||||
( draw ) STHkr .Screen/color DEO
|
||||
( next ) .Screen/addr DEI2 #0008 ADD2 .Screen/addr DEO2
|
||||
( incr ) SWP2 #0008 ADD2 SWP2
|
||||
OVR2 OVR2 LTH2 ,&hor JCN
|
||||
LTH2k ,&hor JCN
|
||||
POP2 POP2
|
||||
( incr ) SWP2 #0008 ADD2 SWP2
|
||||
OVR2 OVR2 LTH2 ,&ver JCN
|
||||
LTH2k ,&ver JCN
|
||||
POP2 POP2
|
||||
( destroy ) POPr
|
||||
|
||||
|
|
|
@ -52,10 +52,10 @@ BRK
|
|||
( draw ) .color LDZ .Screen/color DEO
|
||||
( incr ) .Screen/addr DEI2 8+ .Screen/addr DEO2
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&hor JCN
|
||||
LTH2k ,&hor JCN
|
||||
POP2 POP2
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&ver JCN
|
||||
LTH2k ,&ver JCN
|
||||
POP2 POP2
|
||||
|
||||
RTN
|
||||
|
@ -72,10 +72,10 @@ RTN
|
|||
( draw ) .color LDZ .Screen/color DEO
|
||||
( incr ) .Screen/addr DEI2 #0010 ADD2 .Screen/addr DEO2
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&hor JCN
|
||||
LTH2k ,&hor JCN
|
||||
POP2 POP2
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&ver JCN
|
||||
LTH2k ,&ver JCN
|
||||
POP2 POP2
|
||||
|
||||
RTN
|
||||
|
@ -91,10 +91,10 @@ RTN
|
|||
( save ) OVR2 .Screen/x DEO2
|
||||
( draw ) .color LDZ .Screen/color DEO
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&hor JCN
|
||||
LTH2k ,&hor JCN
|
||||
POP2 POP2
|
||||
( incr ) SWP2 8+ SWP2
|
||||
OVR2 OVR2 LTH2 ,&ver JCN
|
||||
LTH2k ,&ver JCN
|
||||
POP2 POP2
|
||||
|
||||
RTN
|
||||
|
|
Loading…
Reference in New Issue