Optimized out #00 NEQ when used with JCN

This commit is contained in:
Andrew Alderwick 2021-05-13 07:31:42 +01:00
parent 3109ca3bdd
commit f407f1b426
10 changed files with 33 additions and 33 deletions

View File

@ -79,7 +79,7 @@ BRK
;move-head JSR2 ;move-head JSR2
;draw-vu JSR2 ;draw-vu JSR2
.head/pos LDZ #08 MOD #00 NEQ ,&skip JCN .head/pos LDZ #08 MOD ,&skip JCN
;bang JSR2 ;bang JSR2
&skip &skip
@ -159,7 +159,7 @@ BRK
@touch-ctl ( -- ) @touch-ctl ( -- )
.Mouse/x DEI2 .ctlframe/x1 LDZ2 SUB2 8- 8/ SWP POP #02 DIV .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 .Audio0/adsr .track/active LDZ #10 MUL ADD DEI
#10 .Mouse/state DEI #10 EQU #e0 MUL ADD ADD #10 .Mouse/state DEI #10 EQU #e0 MUL ADD ADD
.Audio0/adsr .track/active LDZ #10 MUL ADD DEO &no-a .Audio0/adsr .track/active LDZ #10 MUL ADD DEO &no-a
@ -279,7 +279,7 @@ RTN
;font_hex .Screen/addr DEO2 ;font_hex .Screen/addr DEO2
#0000 #0100 #0000 #0100
&loop &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 OVR2 .trkframe/x1 LDZ2 ADD2 .Screen/x DEO2
.trkframe/y1 LDZ2 #0010 SUB2 .Screen/y DEO2 .trkframe/y1 LDZ2 #0010 SUB2 .Screen/y DEO2
#22 .Screen/color DEO #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 ( draw ) DUP2 LDA #00 SWP 8* ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO
( incr ) ++ ( incr ) ++
( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2
DUP2 LDA #00 NEQ ,&loop JCN DUP2 LDA ,&loop JCN
POP2 POP2
RTN RTN

View File

@ -50,7 +50,7 @@ BRK
@on-frame ( -> ) @on-frame ( -> )
.cat/timer LDZ #01 ADD [ DUP ] .cat/timer STZ .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 #10 NEQ ,&skip1 JCN #0001 ;draw-tail JSR2 &skip1
DUP #20 NEQ ,&skip2 JCN #0002 ;draw-tail JSR2 &skip2 DUP #20 NEQ ,&skip2 JCN #0002 ;draw-tail JSR2 &skip2
DUP #30 NEQ ,&skip3 JCN #0003 ;draw-tail JSR2 &skip3 DUP #30 NEQ ,&skip3 JCN #0003 ;draw-tail JSR2 &skip3

View File

@ -70,7 +70,7 @@ BRK
;draw-cursor JSR2 ;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 .Mouse/y DEI2 .window/y1 LDZ2 SUB2 STEP8
DUP2 #0010 NEQ2 ,&no-touch-red JCN DUP2 #0010 NEQ2 ,&no-touch-red JCN
@ -330,7 +330,7 @@ RTN
( draw ) STHkr .Screen/color DEO ( draw ) STHkr .Screen/color DEO
( incr ) ++ ( incr ) ++
( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2
DUP2 LDA #00 NEQ ,&loop JCN DUP2 LDA ,&loop JCN
POP2 POPr POP2 POPr
RTN RTN

View File

@ -19,7 +19,7 @@ BRK
&loop &loop
( send ) LDAk .Console/char DEO ( send ) LDAk .Console/char DEO
( incr ) #0001 ADD2 ( incr ) #0001 ADD2
( loop ) LDAk #00 NEQ ,&loop JCN ( loop ) LDAk ,&loop JCN
POP2 POP2
RTN RTN

View File

@ -27,7 +27,7 @@ BRK
@on-button ( -> ) @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 .Controller/key DEI #0d NEQ ,&no-return JCN
( draw ) #20 .Screen/color DEO ( draw ) #20 .Screen/color DEO

View File

@ -39,7 +39,7 @@ BRK
.Mouse/state DEI #00 NEQ .pointer/state LDZ #00 EQU #0101 EQU2 ,on-mouse-down JCN .Mouse/state DEI #00 NEQ .pointer/state LDZ #00 EQU #0101 EQU2 ,on-mouse-down JCN
( on drag ) ( on drag )
.Mouse/state DEI #00 NEQ ,on-mouse-drag JCN .Mouse/state DEI ,on-mouse-drag JCN
.Mouse/state DEI .pointer/state STZ .Mouse/state DEI .pointer/state STZ
BRK BRK

View File

@ -53,7 +53,7 @@ RTN
( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO
( incr ) #0001 ADD2 ( incr ) #0001 ADD2
( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
DUP2 LDA #00 NEQ ,&loop JCN DUP2 LDA ,&loop JCN
POP2 POP2
RTN RTN
@ -67,7 +67,7 @@ RTN
( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO
( incr ) #0001 ADD2 ( incr ) #0001 ADD2
( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
DUP2 LDA #00 NEQ ,&loop JCN DUP2 LDA ,&loop JCN
POP2 POP2
RTN RTN
@ -81,7 +81,7 @@ RTN
( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO ( draw ) DUP2 LDA #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO
( incr ) #0001 ADD2 ( incr ) #0001 ADD2
( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
DUP2 LDA #00 NEQ ,&loop JCN DUP2 LDA ,&loop JCN
POP2 POP2
RTN RTN
@ -91,7 +91,7 @@ RTN
#0000 ( counter ) #0000 ( counter )
&loop &loop
( incr ) #0001 ADD2 OVR2 OVR2 ADD2 ( incr ) #0001 ADD2 OVR2 OVR2 ADD2
LDA #00 NEQ ,&loop JCN LDA ,&loop JCN
SWP2 POP2 SWP2 POP2
RTN RTN

View File

@ -237,7 +237,7 @@ BRK
;document/body ;document/eof STA2 ;document/body ;document/eof STA2
&loop &loop
( incr ) ;document/eof LDA2 ++ ;document/eof STA2 ( incr ) ;document/eof LDA2 ++ ;document/eof STA2
;document/eof LDA2 LDA #00 NEQ ,&loop JCN ;document/eof LDA2 LDA ,&loop JCN
RTN RTN
@ -305,7 +305,7 @@ RTN
.selection/from LDZ2 -- LDA #0a EQU RTN? .selection/from LDZ2 -- LDA #0a EQU RTN?
.selection/from LDZ2 -- LDA #0d EQU RTN? .selection/from LDZ2 -- LDA #0d EQU RTN?
( decr ) .selection/from LDZ2 DUP2 .selection/to STZ2 -- .selection/from STZ2 ( 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 ) ( clamp at document body )
.selection/from LDZ2 ;document/body GTH2 RTN? .selection/from LDZ2 ;document/body GTH2 RTN?
;document/body DUP2 .selection/from STZ2 ++ .selection/to STZ2 ;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 #0a EQU RTN?
.selection/from LDZ2 LDA #0d EQU RTN? .selection/from LDZ2 LDA #0d EQU RTN?
( incr ) .selection/from LDZ2 ++ DUP2 ++ .selection/to STZ2 .selection/from STZ2 ( 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 ) ( clamp at document body )
.selection/from LDZ2 ;document/eof LTH2 RTN? .selection/from LDZ2 ;document/eof LTH2 RTN?
;document/eof -- DUP2 .selection/from STZ2 ++ .selection/to STZ2 ;document/eof -- DUP2 .selection/from STZ2 ++ .selection/to STZ2
@ -375,7 +375,7 @@ RTN
( incr ) .pt/y LDZ2 ++ .pt/y STZ2 ( incr ) .pt/y LDZ2 ++ .pt/y STZ2
&no-space &no-space
( incr ) .j LDZ2 ++ .j STZ2 ( incr ) .j LDZ2 ++ .j STZ2
.j LDZ2 LDA #00 NEQ ,&loop JCN .j LDZ2 LDA ,&loop JCN
&end &end
( return ) .j LDZ2 ( return ) .j LDZ2
@ -441,7 +441,7 @@ RTN
&no-reached &no-reached
( incr ) .pt/x LDZ2 ++ .pt/x STZ2 ( incr ) .pt/x LDZ2 ++ .pt/x STZ2
( incr ) .selection/from LDZ2 ++ .selection/from STZ2 ( incr ) .selection/from LDZ2 ++ .selection/from STZ2
.selection/from LDZ2 LDA #00 NEQ ,&loop JCN .selection/from LDZ2 LDA ,&loop JCN
RTN RTN
@ -522,7 +522,7 @@ RTN
.textarea/addr LDZ2 LDA #0a NEQ .textarea/addr LDZ2 LDA #0d NEQ #0101 EQU2 ,&no-break JCN .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 ) .j LDZ2 ++ .j STZ2 &no-break
( incr ) .textarea/addr LDZ2 ++ .textarea/addr STZ2 ( 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 &find-offset-end
#0018 .Screen/x DEO2 #0000 .Screen/y DEO2 #0018 .Screen/x DEO2 #0000 .Screen/y DEO2
@ -575,7 +575,7 @@ RTN
( incr ) .i LDZ2 ++ .i STZ2 ( incr ) .i LDZ2 ++ .i STZ2
( incr ) .Screen/x DEI2 #0007 ADD2 .Screen/x DEO2 ( incr ) .Screen/x DEI2 #0007 ADD2 .Screen/x DEO2
.i LDZ2 LDA #00 NEQ ;&loop JCN2 .i LDZ2 LDA ;&loop JCN2
&end &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 ( draw ) DUP2 LDA #00 SWP #20 SUB 8* ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO
( incr ) ++ ( incr ) ++
( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2
DUP2 LDA #00 NEQ ,&loop JCN DUP2 LDA ,&loop JCN
POP2 POP2
( selection ) ( selection )
.selection/from LDZ2 ;document/body SUB2 ;draw-short JSR2 .selection/from LDZ2 ;document/body SUB2 ;draw-short JSR2

View File

@ -136,7 +136,7 @@ BRK
.Mouse/x DEI2 .cursor/dx STZ2 .Mouse/x DEI2 .cursor/dx STZ2
.Mouse/y DEI2 .cursor/dy STZ2 .Mouse/y DEI2 .cursor/dy STZ2
&no-touch-ondown &no-touch-ondown
.Mouse/state DEI #00 NEQ ,&no-touch-onup JCN .Mouse/state DEI ,&no-touch-onup JCN
( on up ) ( on up )
.brush/tool LDZ #02 NEQ ,&no-touch-line JCN .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 .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 ) ( drag )
.Controller/button DEI #02 NEQ ;&no-drag JCN2 .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/x1 LDZ2 .origin/x1 STZ2
.canvas/y1 LDZ2 .origin/y1 STZ2 .canvas/y1 LDZ2 .origin/y1 STZ2
.canvas/x2 LDZ2 .origin/x2 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 ( 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 ;draw-background JSR2
.Mouse/x DEI2 .viewpane/x1 LDZ2 SUB2 8/ SWP POP .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 .canvas/w LDZ2 ++ .canvas/w STZ2
&no-incwidth &no-incwidth
DUP #01 NEQ ,&no-decwidth JCN DUP #01 NEQ ,&no-decwidth JCN
@ -230,7 +230,7 @@ BRK
( set cursor operation ) ( set cursor operation )
;add-pixel .Mouse/state DEI #01 EQU ;&no-oper JCN2 POP2 ;remove-pixel &no-oper .brush/oper STZ2 ;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 .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 ;&touch-end JMP2
&no-touch-pen &no-touch-pen
@ -254,7 +254,7 @@ BRK
( background interface ) ( background interface )
.Mouse/y DEI2 STEP8 .Screen/height DEI2 #0010 SUB2 NEQ2 ,&no-touch-background JCN .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 .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 ;present JSR2
( release ) #00 .Mouse/state DEO ( release ) #00 .Mouse/state DEO
&no-eye-button &no-eye-button
@ -388,7 +388,7 @@ RTN
.document/presentation LDZ #00 EQU .document/presentation STZ .document/presentation LDZ #00 EQU .document/presentation STZ
.document/presentation LDZ .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 .theme/r0 LDZ2 .System/r DEO2 .theme/g0 LDZ2 .System/g DEO2 .theme/b0 LDZ2 .System/b DEO2
&skip0 &skip0
DUP #01 NEQ ,&skip1 JCN DUP #01 NEQ ,&skip1 JCN
@ -514,7 +514,7 @@ RTN
@patternize ( -- ) @patternize ( -- )
.brush/patt LDZ #00 NEQ ,&noplain JCN .brush/patt LDZ ,&noplain JCN
#01 RTN &noplain #01 RTN &noplain
.brush/patt LDZ #01 NEQ ,&notone1 JCN .brush/patt LDZ #01 NEQ ,&notone1 JCN
@ -856,7 +856,7 @@ RTN
( draw ) .color LDZ #20 ADD .Screen/color DEO ( draw ) .color LDZ #20 ADD .Screen/color DEO
( incr ) #0001 ADD2 ( incr ) #0001 ADD2
( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2
( loop ) DUP2 LDA #00 NEQ ,&loop JCN ( loop ) DUP2 LDA ,&loop JCN
POP2 POP2
RTN RTN
@ -889,7 +889,7 @@ RTN
( copy src->dst ) OVR2 OVR2 SWP2 LDA ROT ROT STA ( copy src->dst ) OVR2 OVR2 SWP2 LDA ROT ROT STA
( incr dst ) ++ ( incr dst ) ++
( incr src ) SWP2 ++ SWP2 ( incr src ) SWP2 ++ SWP2
OVR2 LDA #00 NEQ ,&loop JCN OVR2 LDA ,&loop JCN
#00 ROT ROT STA POP2 #00 ROT ROT STA POP2
RTN RTN

View File

@ -304,7 +304,7 @@ RTN
STH STH
( limit ) ( limit )
DUP #00 NEQ ,&not-edge JCN DUP ,&not-edge JCN
#2a SET-CELL POP STHr RTN #2a SET-CELL POP STHr RTN
&not-edge &not-edge
( collide ) ( collide )
@ -373,7 +373,7 @@ RTN
STH STH
( limit ) ( limit )
OVR #00 NEQ ,&not-edge JCN OVR ,&not-edge JCN
#2a SET-CELL POP STHr RTN #2a SET-CELL POP STHr RTN
&not-edge &not-edge
( collide ) ( collide )