uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 0c188ef3fafa7e3a248f14a6f4eef48b5ba2bad4
parent 514b2f7f588e0e738eba92404f6c863bd65771e1
Author: neauoire <aliceffekt@gmail.com>
Date:   Wed, 12 May 2021 12:08:51 -0700

Minor optimizations to the examples

Diffstat:
Mbuild.sh | 2+-
Mprojects/examples/devices/console.usm | 4++--
Mprojects/examples/devices/file.usm | 4++--
Mprojects/examples/devices/mouse.usm | 1-
Mprojects/examples/devices/screen.usm | 4++--
Mprojects/examples/gui/animation.usm | 6+++---
Mprojects/examples/gui/picture.usm | 12++++++------
7 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/build.sh b/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' ]; diff --git a/projects/examples/devices/console.usm b/projects/examples/devices/console.usm @@ -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 diff --git a/projects/examples/devices/file.usm b/projects/examples/devices/file.usm @@ -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 ) diff --git a/projects/examples/devices/mouse.usm b/projects/examples/devices/mouse.usm @@ -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 diff --git a/projects/examples/devices/screen.usm b/projects/examples/devices/screen.usm @@ -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 diff --git a/projects/examples/gui/animation.usm b/projects/examples/gui/animation.usm @@ -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 diff --git a/projects/examples/gui/picture.usm b/projects/examples/gui/picture.usm @@ -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