uxn

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

commit f407f1b4262c5c51d221efed4070747fea62a1c9
parent 3109ca3bdd4f45fa03050dd8a4c147d3ffb91b99
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Thu, 13 May 2021 07:31:42 +0100

Optimized out #00 NEQ when used with JCN

Diffstat:
Mprojects/demos/musictracker.usm | 8++++----
Mprojects/demos/polycat.usm | 2+-
Mprojects/demos/theme.usm | 4++--
Mprojects/examples/devices/console.usm | 2+-
Mprojects/examples/devices/controller.keys.usm | 2+-
Mprojects/examples/devices/mouse.usm | 2+-
Mprojects/examples/gui/label.usm | 8++++----
Mprojects/software/left.usm | 16++++++++--------
Mprojects/software/noodle.usm | 18+++++++++---------
Mprojects/software/orca.usm | 4++--
10 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/projects/demos/musictracker.usm b/projects/demos/musictracker.usm @@ -79,7 +79,7 @@ BRK ;move-head JSR2 ;draw-vu JSR2 - .head/pos LDZ #08 MOD #00 NEQ ,&skip JCN + .head/pos LDZ #08 MOD ,&skip JCN ;bang JSR2 &skip @@ -159,7 +159,7 @@ BRK @touch-ctl ( -- ) .Mouse/x DEI2 .ctlframe/x1 LDZ2 SUB2 8- 8/ SWP POP #02 DIV - DUP #00 NEQ ,&no-a JCN + DUP ,&no-a JCN .Audio0/adsr .track/active LDZ #10 MUL ADD DEI #10 .Mouse/state DEI #10 EQU #e0 MUL ADD ADD .Audio0/adsr .track/active LDZ #10 MUL ADD DEO &no-a @@ -279,7 +279,7 @@ RTN ;font_hex .Screen/addr DEO2 #0000 #0100 &loop - OVR2 SWP POP #02 DIV #0f AND #00 NEQ ,&skip JCN + OVR2 SWP POP #02 DIV #0f AND ,&skip JCN OVR2 .trkframe/x1 LDZ2 ADD2 .Screen/x DEO2 .trkframe/y1 LDZ2 #0010 SUB2 .Screen/y DEO2 #22 .Screen/color DEO @@ -456,7 +456,7 @@ RTN ( draw ) DUP2 LDA #00 SWP 8* ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( incr ) ++ ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 - DUP2 LDA #00 NEQ ,&loop JCN + DUP2 LDA ,&loop JCN POP2 RTN diff --git a/projects/demos/polycat.usm b/projects/demos/polycat.usm @@ -50,7 +50,7 @@ BRK @on-frame ( -> ) .cat/timer LDZ #01 ADD [ DUP ] .cat/timer STZ - DUP #00 NEQ ,&skip0 JCN #0000 ;draw-tail JSR2 &skip0 + DUP ,&skip0 JCN #0000 ;draw-tail JSR2 &skip0 DUP #10 NEQ ,&skip1 JCN #0001 ;draw-tail JSR2 &skip1 DUP #20 NEQ ,&skip2 JCN #0002 ;draw-tail JSR2 &skip2 DUP #30 NEQ ,&skip3 JCN #0003 ;draw-tail JSR2 &skip3 diff --git a/projects/demos/theme.usm b/projects/demos/theme.usm @@ -70,7 +70,7 @@ BRK ;draw-cursor JSR2 - .Mouse/state DEI #00 NEQ #01 JCN [ BRK ] + .Mouse/state DEI #01 JCN [ BRK ] .Mouse/y DEI2 .window/y1 LDZ2 SUB2 STEP8 DUP2 #0010 NEQ2 ,&no-touch-red JCN @@ -330,7 +330,7 @@ RTN ( draw ) STHkr .Screen/color DEO ( incr ) ++ ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 - DUP2 LDA #00 NEQ ,&loop JCN + DUP2 LDA ,&loop JCN POP2 POPr RTN diff --git a/projects/examples/devices/console.usm b/projects/examples/devices/console.usm @@ -19,7 +19,7 @@ BRK &loop ( send ) LDAk .Console/char DEO ( incr ) #0001 ADD2 - ( loop ) LDAk #00 NEQ ,&loop JCN + ( loop ) LDAk ,&loop JCN POP2 RTN diff --git a/projects/examples/devices/controller.keys.usm b/projects/examples/devices/controller.keys.usm @@ -27,7 +27,7 @@ BRK @on-button ( -> ) - ( skip ) .Controller/key DEI #00 NEQ #01 JCN [ BRK ] + ( skip ) .Controller/key DEI #01 JCN [ BRK ] .Controller/key DEI #0d NEQ ,&no-return JCN ( draw ) #20 .Screen/color DEO diff --git a/projects/examples/devices/mouse.usm b/projects/examples/devices/mouse.usm @@ -39,7 +39,7 @@ BRK .Mouse/state DEI #00 NEQ .pointer/state LDZ #00 EQU #0101 EQU2 ,on-mouse-down JCN ( on drag ) - .Mouse/state DEI #00 NEQ ,on-mouse-drag JCN + .Mouse/state DEI ,on-mouse-drag JCN .Mouse/state DEI .pointer/state STZ BRK diff --git a/projects/examples/gui/label.usm b/projects/examples/gui/label.usm @@ -53,7 +53,7 @@ RTN ( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( incr ) #0001 ADD2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 - DUP2 LDA #00 NEQ ,&loop JCN + DUP2 LDA ,&loop JCN POP2 RTN @@ -67,7 +67,7 @@ RTN ( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( incr ) #0001 ADD2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 - DUP2 LDA #00 NEQ ,&loop JCN + DUP2 LDA ,&loop JCN POP2 RTN @@ -81,7 +81,7 @@ RTN ( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( incr ) #0001 ADD2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 - DUP2 LDA #00 NEQ ,&loop JCN + DUP2 LDA ,&loop JCN POP2 RTN @@ -91,7 +91,7 @@ RTN #0000 ( counter ) &loop ( incr ) #0001 ADD2 OVR2 OVR2 ADD2 - LDA #00 NEQ ,&loop JCN + LDA ,&loop JCN SWP2 POP2 RTN diff --git a/projects/software/left.usm b/projects/software/left.usm @@ -237,7 +237,7 @@ BRK ;document/body ;document/eof STA2 &loop ( incr ) ;document/eof LDA2 ++ ;document/eof STA2 - ;document/eof LDA2 LDA #00 NEQ ,&loop JCN + ;document/eof LDA2 LDA ,&loop JCN RTN @@ -305,7 +305,7 @@ RTN .selection/from LDZ2 -- LDA #0a EQU RTN? .selection/from LDZ2 -- LDA #0d EQU RTN? ( decr ) .selection/from LDZ2 DUP2 .selection/to STZ2 -- .selection/from STZ2 - .selection/from LDZ2 LDA #00 NEQ ,&loop JCN + .selection/from LDZ2 LDA ,&loop JCN ( clamp at document body ) .selection/from LDZ2 ;document/body GTH2 RTN? ;document/body DUP2 .selection/from STZ2 ++ .selection/to STZ2 @@ -318,7 +318,7 @@ RTN .selection/from LDZ2 LDA #0a EQU RTN? .selection/from LDZ2 LDA #0d EQU RTN? ( incr ) .selection/from LDZ2 ++ DUP2 ++ .selection/to STZ2 .selection/from STZ2 - .selection/from LDZ2 LDA #00 NEQ ,&loop JCN + .selection/from LDZ2 LDA ,&loop JCN ( clamp at document body ) .selection/from LDZ2 ;document/eof LTH2 RTN? ;document/eof -- DUP2 .selection/from STZ2 ++ .selection/to STZ2 @@ -375,7 +375,7 @@ RTN ( incr ) .pt/y LDZ2 ++ .pt/y STZ2 &no-space ( incr ) .j LDZ2 ++ .j STZ2 - .j LDZ2 LDA #00 NEQ ,&loop JCN + .j LDZ2 LDA ,&loop JCN &end ( return ) .j LDZ2 @@ -441,7 +441,7 @@ RTN &no-reached ( incr ) .pt/x LDZ2 ++ .pt/x STZ2 ( incr ) .selection/from LDZ2 ++ .selection/from STZ2 - .selection/from LDZ2 LDA #00 NEQ ,&loop JCN + .selection/from LDZ2 LDA ,&loop JCN RTN @@ -522,7 +522,7 @@ RTN .textarea/addr LDZ2 LDA #0a NEQ .textarea/addr LDZ2 LDA #0d NEQ #0101 EQU2 ,&no-break JCN ( incr ) .j LDZ2 ++ .j STZ2 &no-break ( incr ) .textarea/addr LDZ2 ++ .textarea/addr STZ2 - .textarea/addr LDZ2 LDA #00 NEQ ,&find-offset JCN + .textarea/addr LDZ2 LDA ,&find-offset JCN &find-offset-end #0018 .Screen/x DEO2 #0000 .Screen/y DEO2 @@ -575,7 +575,7 @@ RTN ( incr ) .i LDZ2 ++ .i STZ2 ( incr ) .Screen/x DEI2 #0007 ADD2 .Screen/x DEO2 - .i LDZ2 LDA #00 NEQ ;&loop JCN2 + .i LDZ2 LDA ;&loop JCN2 &end @@ -619,7 +619,7 @@ RTN ( draw ) DUP2 LDA #00 SWP #20 SUB 8* ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( incr ) ++ ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 - DUP2 LDA #00 NEQ ,&loop JCN + DUP2 LDA ,&loop JCN POP2 ( selection ) .selection/from LDZ2 ;document/body SUB2 ;draw-short JSR2 diff --git a/projects/software/noodle.usm b/projects/software/noodle.usm @@ -136,7 +136,7 @@ BRK .Mouse/x DEI2 .cursor/dx STZ2 .Mouse/y DEI2 .cursor/dy STZ2 &no-touch-ondown - .Mouse/state DEI #00 NEQ ,&no-touch-onup JCN + .Mouse/state DEI ,&no-touch-onup JCN ( on up ) .brush/tool LDZ #02 NEQ ,&no-touch-line JCN .cursor/dx LDZ2 .canvas/x1 LDZ2 SUB2 .cursor/dy LDZ2 .canvas/y1 LDZ2 SUB2 .Mouse/x DEI2 .canvas/x1 LDZ2 SUB2 .Mouse/y DEI2 .canvas/y1 LDZ2 SUB2 ;paint-line JSR2 @@ -153,7 +153,7 @@ BRK ( drag ) .Controller/button DEI #02 NEQ ;&no-drag JCN2 - .brush/drag LDZ #00 NEQ ,&no-drag-start JCN + .brush/drag LDZ ,&no-drag-start JCN .canvas/x1 LDZ2 .origin/x1 STZ2 .canvas/y1 LDZ2 .origin/y1 STZ2 .canvas/x2 LDZ2 .origin/x2 STZ2 @@ -205,7 +205,7 @@ BRK ( clear ) .canvas/x1 LDZ2 #0002 SUB2 .canvas/y1 LDZ2 #0002 SUB2 .canvas/x2 LDZ2 #0002 ADD2 .canvas/y2 LDZ2 #0002 ADD2 #00 ;fill-rect JSR2 ;draw-background JSR2 .Mouse/x DEI2 .viewpane/x1 LDZ2 SUB2 8/ SWP POP - DUP #00 NEQ ,&no-incwidth JCN + DUP ,&no-incwidth JCN .canvas/w LDZ2 ++ .canvas/w STZ2 &no-incwidth DUP #01 NEQ ,&no-decwidth JCN @@ -230,7 +230,7 @@ BRK ( set cursor operation ) ;add-pixel .Mouse/state DEI #01 EQU ;&no-oper JCN2 POP2 ;remove-pixel &no-oper .brush/oper STZ2 - .brush/tool LDZ #00 NEQ ,&no-touch-pen JCN + .brush/tool LDZ ,&no-touch-pen JCN .cursor/x0 LDZ2 .canvas/x1 LDZ2 SUB2 .cursor/y0 LDZ2 .canvas/y1 LDZ2 SUB2 .Mouse/x DEI2 .canvas/x1 LDZ2 SUB2 .Mouse/y DEI2 .canvas/y1 LDZ2 SUB2 ;paint-line JSR2 ;&touch-end JMP2 &no-touch-pen @@ -254,7 +254,7 @@ BRK ( background interface ) .Mouse/y DEI2 STEP8 .Screen/height DEI2 #0010 SUB2 NEQ2 ,&no-touch-background JCN .Mouse/x DEI2 .Screen/width DEI2 #0028 SUB2 SUB2 8/ SWP POP - DUP #00 NEQ ,&no-eye-button JCN + DUP ,&no-eye-button JCN ;present JSR2 ( release ) #00 .Mouse/state DEO &no-eye-button @@ -388,7 +388,7 @@ RTN .document/presentation LDZ #00 EQU .document/presentation STZ .document/presentation LDZ - DUP #00 NEQ ,&skip0 JCN + DUP ,&skip0 JCN .theme/r0 LDZ2 .System/r DEO2 .theme/g0 LDZ2 .System/g DEO2 .theme/b0 LDZ2 .System/b DEO2 &skip0 DUP #01 NEQ ,&skip1 JCN @@ -514,7 +514,7 @@ RTN @patternize ( -- ) - .brush/patt LDZ #00 NEQ ,&noplain JCN + .brush/patt LDZ ,&noplain JCN #01 RTN &noplain .brush/patt LDZ #01 NEQ ,&notone1 JCN @@ -856,7 +856,7 @@ RTN ( draw ) .color LDZ #20 ADD .Screen/color DEO ( incr ) #0001 ADD2 ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 - ( loop ) DUP2 LDA #00 NEQ ,&loop JCN + ( loop ) DUP2 LDA ,&loop JCN POP2 RTN @@ -889,7 +889,7 @@ RTN ( copy src->dst ) OVR2 OVR2 SWP2 LDA ROT ROT STA ( incr dst ) ++ ( incr src ) SWP2 ++ SWP2 - OVR2 LDA #00 NEQ ,&loop JCN + OVR2 LDA ,&loop JCN #00 ROT ROT STA POP2 RTN diff --git a/projects/software/orca.usm b/projects/software/orca.usm @@ -304,7 +304,7 @@ RTN STH ( limit ) - DUP #00 NEQ ,&not-edge JCN + DUP ,&not-edge JCN #2a SET-CELL POP STHr RTN &not-edge ( collide ) @@ -373,7 +373,7 @@ RTN STH ( limit ) - OVR #00 NEQ ,&not-edge JCN + OVR ,&not-edge JCN #2a SET-CELL POP STHr RTN &not-edge ( collide )