Replaced trivial multiplications with shifts and additions

This commit is contained in:
Andrew Alderwick 2021-08-17 20:16:39 +01:00
parent fd907e87d6
commit ad07c29935
18 changed files with 111 additions and 110 deletions

View File

@ -1,8 +1,8 @@
( a blank file ) ( a blank file )
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV } %+ { ADD } %- { SUB } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ } %< { LTH } %> { GTH } %= { EQU } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 } %++ { ADD2 } %-- { SUB2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 } %<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
%DEBUG { ;print-hex JSR2 #0a .Console/write DEO } %DEBUG { ;print-hex JSR2 #0a .Console/write DEO }

View File

@ -65,7 +65,7 @@ BRK
.Mouse/state DEI #00 EQU ,&no-touch JCN .Mouse/state DEI #00 EQU ,&no-touch JCN
( incr ) .style LDZ #01 ADD #03 MOD .style STZ ( incr ) .style LDZ #01 ADD #03 MOD .style STZ
( bg ) ;tiles .style LDZ #10 MUL TOS ADD2 ;cover-pattern JSR2 ( bg ) ;tiles .style LDZ #40 SFT TOS ADD2 ;cover-pattern JSR2
( fg ) ;redraw JSR2 ( fg ) ;redraw JSR2
( release ) #00 .Mouse/state DEO ( release ) #00 .Mouse/state DEO
&no-touch &no-touch
@ -108,10 +108,10 @@ RTN
&loop &loop
( save-x ) OVR #03 MOD TOS 8** .anchor/x LDZ2 ADD2 .Screen/x DEO2 ( save-x ) OVR #03 MOD TOS 8** .anchor/x LDZ2 ADD2 .Screen/x DEO2
( save-y ) OVR #03 DIV TOS 8** .anchor/y LDZ2 ADD2 .Screen/y DEO2 ( save-y ) OVR #03 DIV TOS 8** .anchor/y LDZ2 ADD2 .Screen/y DEO2
( get digit* ) OVR STHkr #02 MUL TOS ;digits ADD2 LDA2 ( get digit* ) OVR STHkr DUP ADD TOS ;digits ADD2 LDA2
( get bit ) ROT #0e SWP SUB SFT2 #0001 AND2 ( get bit ) ROT #0e SWP SUB SFT2 #0001 AND2
( set tile ) 8** ;tiles ADD2 ( set tile ) 8** ;tiles ADD2
( set style ) .style LDZ #10 MUL TOS ADD2 ( set style ) .style LDZ #40 SFT TOS ADD2
.Screen/addr DEO2 .Screen/addr DEO2
( draw ) #01 .Screen/sprite DEO ( draw ) #01 .Screen/sprite DEO
( incr ) SWP #01 ADD SWP ( incr ) SWP #01 ADD SWP

View File

@ -436,7 +436,7 @@ JMP2r
JMP2r JMP2r
@draw_c ( draw character ) @draw_c ( draw character )
#00 ;c_state LDA get_nibble_h #08 MUL #00 ;c_state LDA get_nibble_h #30 SFT
;c_sprite LDA2 ADD2 .Screen/addr DEO2 ;c_sprite LDA2 ADD2 .Screen/addr DEO2
;c_pos/x out_screen_x ;c_pos/x out_screen_x
;c_pos/y out_screen_y ;c_pos/y out_screen_y

View File

@ -8,6 +8,7 @@
%2** { #10 SFT2 } %2// { #01 SFT2 } %2** { #10 SFT2 } %2// { #01 SFT2 }
%4** { #20 SFT2 } %4// { #02 SFT2 } %4** { #20 SFT2 } %4// { #02 SFT2 }
%8** { #30 SFT2 } %8// { #03 SFT2 } %8** { #30 SFT2 } %8// { #03 SFT2 }
%10** { #40 SFT2 }
%TOB { NIP } %TOS { #00 SWP } %TOB { NIP } %TOS { #00 SWP }
%RTN { JMP2r } %RTN { JMP2r }
@ -135,7 +136,7 @@
&draw-pads &draw-pads
( load sample ) ( load sample )
OVR TOS #0019 ** ;pad-path ++ .File/name DEO2 OVR TOS #0019 ** ;pad-path ++ .File/name DEO2
OVR #04 / #10 * .Audio0/length + DEI2 .File/length DEO2 OVR #04 / #40 SFT .Audio0/length + DEI2 .File/length DEO2
OVR TOS 2** ;pad-addr ++ LDA2 .File/load DEO2 OVR TOS 2** ;pad-addr ++ LDA2 .File/load DEO2
( draw pad ) ( draw pad )
OVR #01 ;draw-pad JSR2 OVR #01 ;draw-pad JSR2
@ -163,7 +164,7 @@ BRK
OVR STH OVR STH
( x ) .mix-view/x1 LDZ2 #0074 ++ ( x ) .mix-view/x1 LDZ2 #0074 ++
( y ) .mix-view/y1 LDZ2 PAD-HEIGHT STHkr TOS ** ++ #0002 ++ ( y ) .mix-view/y1 LDZ2 PAD-HEIGHT STHkr TOS ** ++ #0002 ++
( output ) .Audio0/output STHr #10 * + DEI ( output ) .Audio0/output STHr #40 SFT + DEI
;draw-monitor JSR2 ;draw-monitor JSR2
( incr ) SWP #01 + SWP ( incr ) SWP #01 + SWP
LTHk ,&loop JCN LTHk ,&loop JCN
@ -219,7 +220,7 @@ BRK
@on-touch-pad ( -> ) @on-touch-pad ( -> )
( x ) .Mouse/x DEI2 .pad-view/x1 LDZ2 -- PAD-WIDTH // TOB ( x ) .Mouse/x DEI2 .pad-view/x1 LDZ2 -- PAD-WIDTH // TOB
( y ) .Mouse/y DEI2 .pad-view/y1 LDZ2 -- PAD-HEIGHT // TOB #04 * + ( y ) .Mouse/y DEI2 .pad-view/y1 LDZ2 -- PAD-HEIGHT // TOB #20 SFT +
DUP SWP ;play-pad JSR2 DUP SWP ;play-pad JSR2
@ -235,21 +236,21 @@ BRK
( knob ) .Mouse/x DEI2 .mix-view/x1 LDZ2 -- #0010 // TOB ( knob ) .Mouse/x DEI2 .mix-view/x1 LDZ2 -- #0010 // TOB
( adsr ) ( adsr )
DUP #00 ! ,&no-a JCN DUP #00 ! ,&no-a JCN
.Audio0/adsr [ STHkr #10 * + ] DEI .Audio0/adsr [ STHkr #40 SFT + ] DEI
#10 .Mouse/state DEI #10 = #e0 * + + #10 .Mouse/state DEI #10 = #e0 * + +
.Audio0/adsr [ STHkr #10 * + ] DEO &no-a .Audio0/adsr [ STHkr #40 SFT + ] DEO &no-a
DUP #01 ! ,&no-d JCN DUP #01 ! ,&no-d JCN
.Audio0/adsr [ STHkr #10 * + ] DEI .Audio0/adsr [ STHkr #40 SFT + ] DEI
DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr +
.Audio0/adsr [ STHkr #10 * + ] DEO &no-d .Audio0/adsr [ STHkr #40 SFT + ] DEO &no-d
DUP #02 ! ,&no-s JCN DUP #02 ! ,&no-s JCN
.Audio0/adsr [ STHkr #10 * + ] #01 + DEI .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI
#10 .Mouse/state DEI #10 = #e0 * + + #10 .Mouse/state DEI #10 = #e0 * + +
.Audio0/adsr [ STHkr #10 * + ] #01 + DEO &no-s .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEO &no-s
DUP #03 ! ,&no-r JCN DUP #03 ! ,&no-r JCN
.Audio0/adsr [ STHkr #10 * + ] #01 + DEI .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI
DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr +
.Audio0/adsr [ STHkr #10 * + ] #01 + DEO &no-r .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEO &no-r
( modes ) ( modes )
DUP #04 ! ,&no-repeat JCN DUP #04 ! ,&no-repeat JCN
.modes [ STHkr + ] LDZ .modes [ STHkr + ] LDZ
@ -257,13 +258,13 @@ BRK
.modes [ STHkr + ] STZ &no-repeat .modes [ STHkr + ] STZ &no-repeat
( volume ) ( volume )
DUP #05 ! ,&no-left JCN DUP #05 ! ,&no-left JCN
.Audio0/volume [ STHkr #10 * + ] DEI .Audio0/volume [ STHkr #40 SFT + ] DEI
#10 .Mouse/state DEI #10 = #e0 * + + #10 .Mouse/state DEI #10 = #e0 * + +
.Audio0/volume [ STHkr #10 * + ] DEO &no-left .Audio0/volume [ STHkr #40 SFT + ] DEO &no-left
DUP #06 ! ,&no-right JCN DUP #06 ! ,&no-right JCN
.Audio0/volume [ STHkr #10 * + ] DEI .Audio0/volume [ STHkr #40 SFT + ] DEI
DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr +
.Audio0/volume [ STHkr #10 * + ] DEO &no-right .Audio0/volume [ STHkr #40 SFT + ] DEO &no-right
POP POP
( release ) #00 .Mouse/state DEO ( release ) #00 .Mouse/state DEO
@ -311,11 +312,11 @@ BRK
DUP #02 ;draw-pad JSR2 DUP #02 ;draw-pad JSR2
( addr ) ( addr )
DUP TOS 2** ;pad-addr ++ LDA2 STH2 DUP TOS 2** ;pad-addr ++ LDA2 STH2
DUP #04 / #10 * .Audio0/addr + STH2r ROT DEO2 DUP #04 / #40 SFT .Audio0/addr + STH2r ROT DEO2
( pitch ) ( pitch )
DUP TOS ;pad-pitch ++ LDA STH DUP TOS ;pad-pitch ++ LDA STH
DUP #04 / .modes + LDZ #00 = #80 * STH ADDr DUP #04 / .modes + LDZ #00 = #70 SFT STH ADDr
DUP #04 / #10 * .Audio0/pitch + STHr SWP DEO DUP #04 / #40 SFT .Audio0/pitch + STHr SWP DEO
#04 / ;draw-mixer JSR2 #04 / ;draw-mixer JSR2
RTN RTN
@ -323,7 +324,7 @@ RTN
@draw-waveform ( pad -- ) @draw-waveform ( pad -- )
( stash address ) ( stash address )
#02 * #00 SWP ;pad-addr ++ LDA2 STH2 DUP ADD #00 SWP ;pad-addr ++ LDA2 STH2
( clear ) ( clear )
.wav-view/x1 LDZ2 #0002 ++ .wav-view/x1 LDZ2 #0002 ++
@ -342,7 +343,7 @@ RTN
.wav-view/y1 LDZ2 #0010 ++ .Screen/y DEO2 .wav-view/y1 LDZ2 #0010 ++ .Screen/y DEO2
#01 .Screen/pixel DEO #01 .Screen/pixel DEO
&no-dot &no-dot
OVR TOS #0010 ** [ DUP2r STH2r ] ++ LDA OVR TOS 10** [ DUP2r STH2r ] ++ LDA
#02 / #02 /
TOS 4// .wav-view/y1 LDZ2 ++ .Screen/y DEO2 TOS 4// .wav-view/y1 LDZ2 ++ .Screen/y DEO2
.Screen/x DEI2 #0001 ++ .Screen/x DEO2 .Screen/x DEI2 #0001 ++ .Screen/x DEO2
@ -360,21 +361,21 @@ RTN
( adsr ) ( adsr )
DUP2 .mix-view/x1 LDZ2 SWP2 DUP2 .mix-view/x1 LDZ2 SWP2
.Audio0/adsr [ STHkr #10 * + ] DEI #04 SFT ;draw-knob JSR2 .Audio0/adsr [ STHkr #40 SFT + ] DEI #04 SFT ;draw-knob JSR2
DUP2 .mix-view/x1 LDZ2 #0010 ++ SWP2 DUP2 .mix-view/x1 LDZ2 #0010 ++ SWP2
.Audio0/adsr [ STHkr #10 * + ] DEI #0f AND ;draw-knob JSR2 .Audio0/adsr [ STHkr #40 SFT + ] DEI #0f AND ;draw-knob JSR2
DUP2 .mix-view/x1 LDZ2 #0020 ++ SWP2 DUP2 .mix-view/x1 LDZ2 #0020 ++ SWP2
.Audio0/adsr [ STHkr #10 * + ] #01 + DEI #04 SFT ;draw-knob JSR2 .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI #04 SFT ;draw-knob JSR2
DUP2 .mix-view/x1 LDZ2 #0030 ++ SWP2 DUP2 .mix-view/x1 LDZ2 #0030 ++ SWP2
.Audio0/adsr [ STHkr #10 * + ] #01 + DEI #0f AND ;draw-knob JSR2 .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI #0f AND ;draw-knob JSR2
( once/repeat ) ( once/repeat )
DUP2 .mix-view/x1 LDZ2 #0040 ++ SWP2 DUP2 .mix-view/x1 LDZ2 #0040 ++ SWP2
.modes [ STHkr + ] LDZ ;draw-switch JSR2 .modes [ STHkr + ] LDZ ;draw-switch JSR2
( volume ) ( volume )
DUP2 .mix-view/x1 LDZ2 #0050 ++ SWP2 DUP2 .mix-view/x1 LDZ2 #0050 ++ SWP2
.Audio0/volume [ STHkr #10 * + ] DEI #04 SFT ;draw-knob JSR2 .Audio0/volume [ STHkr #40 SFT + ] DEI #04 SFT ;draw-knob JSR2
DUP2 .mix-view/x1 LDZ2 #0060 ++ SWP2 DUP2 .mix-view/x1 LDZ2 #0060 ++ SWP2
.Audio0/volume [ STHkr #10 * + ] DEI #0f AND ;draw-knob JSR2 .Audio0/volume [ STHkr #40 SFT + ] DEI #0f AND ;draw-knob JSR2
POP2 POP2
POPr POPr
@ -520,7 +521,7 @@ RTN
( draw ) #01 .Screen/sprite DEO ( draw ) #01 .Screen/sprite DEO
.Screen/x DEI2 #0004 ++ .Screen/x DEO2 .Screen/x DEI2 #0004 ++ .Screen/x DEO2
.Screen/y DEI2 #0008 ++ .Screen/y DEO2 .Screen/y DEI2 #0008 ++ .Screen/y DEO2
;font-hex #00 STHkr #08 * ++ .Screen/addr DEO2 ;font-hex #00 STHkr #30 SFT ++ .Screen/addr DEO2
( draw ) #01 .Screen/sprite DEO ( draw ) #01 .Screen/sprite DEO
.Screen/x DEI2 #0004 -- #00 #00 STHkr ;knob-offsetx ++ LDA ++ .Screen/x DEO2 .Screen/x DEI2 #0004 -- #00 #00 STHkr ;knob-offsetx ++ LDA ++ .Screen/x DEO2
.Screen/y DEI2 #0010 -- #00 #00 STHr ;knob-offsety ++ LDA ++ .Screen/y DEO2 .Screen/y DEI2 #0010 -- #00 #00 STHr ;knob-offsety ++ LDA ++ .Screen/y DEO2
@ -532,7 +533,7 @@ RTN
@draw-switch ( x* y* value -- ) @draw-switch ( x* y* value -- )
STH .Screen/y DEO2 .Screen/x DEO2 STH .Screen/y DEO2 .Screen/x DEO2
STHkr #20 * #00 SWP ;switch-icns ++ STHkr #50 SFT #00 SWP ;switch-icns ++
DUP2 .Screen/addr DEO2 DUP2 .Screen/addr DEO2
( draw ) #01 STHkr + .Screen/sprite DEO ( draw ) #01 STHkr + .Screen/sprite DEO
.Screen/x DEI2 #0008 ++ .Screen/x DEO2 .Screen/x DEI2 #0008 ++ .Screen/x DEO2

View File

@ -62,7 +62,7 @@ BRK
( move down ) STH OVR2 .Screen/x DEO2 STHr ( move down ) STH OVR2 .Screen/x DEO2 STHr
( incr y ) .Screen/y DEI2 #0010 ++ .Screen/y DEO2 ( incr y ) .Screen/y DEI2 #0010 ++ .Screen/y DEO2
POP ,&continue JMP &no-linebreak POP ,&continue JMP &no-linebreak
( get addr ) STHk TOS #0008 ** ;font-data #0100 ++ ++ .Screen/addr DEO2 ( get addr ) STHk TOS #30 SFT2 ;font-data #0100 ++ ++ .Screen/addr DEO2
( get width ) STHr TOS ;font-data ++ LDA TOS ( get width ) STHr TOS ;font-data ++ LDA TOS
( draw ) STHkr .Screen/sprite DEO ( draw ) STHkr .Screen/sprite DEO
( use width ) .Screen/x DEI2 ++ .Screen/x DEO2 ( use width ) .Screen/x DEI2 ++ .Screen/x DEO2
@ -93,7 +93,7 @@ RTN
&sprite ( char color -- ) &sprite ( char color -- )
STH STH
( get addr ) STHk TOS #0020 ** ;font-data #0100 ++ ++ .Screen/addr DEO2 ( get addr ) STHk TOS #50 SFT2 ;font-data #0100 ++ ++ .Screen/addr DEO2
( get width ) STHkr TOS ;font-data ++ LDA TOS ( get width ) STHkr TOS ;font-data ++ LDA TOS
SWPr SWPr
( left-top ) STHkr .Screen/sprite DEO ( left-top ) STHkr .Screen/sprite DEO

View File

@ -160,8 +160,8 @@ RTN
.Mouse/state DEI #00 ! #01 JCN [ BRK ] .Mouse/state DEI #00 ! #01 JCN [ BRK ]
.Mouse/x DEI2 DUP2 .anchor/x LDZ2 >> ROT ROT .anchor/x LDZ2 WIDTH #02 * TOS ++ #0001 ++ << #0101 == .Mouse/x DEI2 DUP2 .anchor/x LDZ2 >> ROT ROT .anchor/x LDZ2 WIDTH DUP ADD TOS ++ #0001 ++ << #0101 ==
.Mouse/y DEI2 DUP2 .anchor/y LDZ2 >> ROT ROT .anchor/y LDZ2 HEIGHT #02 * TOS ++ << #0101 == .Mouse/y DEI2 DUP2 .anchor/y LDZ2 >> ROT ROT .anchor/y LDZ2 HEIGHT DUP ADD TOS ++ << #0101 ==
#0101 == #01 JCN [ BRK ] #0101 == #01 JCN [ BRK ]
.Mouse/x DEI2 .anchor/x LDZ2 SUB2 #02 / TOB .Mouse/x DEI2 .anchor/x LDZ2 SUB2 #02 / TOB
@ -190,7 +190,7 @@ BRK
( draw cell count ) ( draw cell count )
.anchor/x LDZ2 .Screen/x DEO2 .anchor/x LDZ2 .Screen/x DEO2
.anchor/y LDZ2 HEIGHT #02 * TOS ++ .Screen/y DEO2 .anchor/y LDZ2 HEIGHT DUP ADD TOS ++ .Screen/y DEO2
.world/count LDZ2 #03 ;draw-short JSR2 .world/count LDZ2 #03 ;draw-short JSR2
HEIGHT #00 HEIGHT #00

View File

@ -159,29 +159,29 @@ BRK
.Mouse/x DEI2 .ctlframe/x1 LDZ2 SUB2 8-- 8// NIP #02 DIV .Mouse/x DEI2 .ctlframe/x1 LDZ2 SUB2 8-- 8// NIP #02 DIV
DUP ,&no-a JCN DUP ,&no-a JCN
.Audio0/adsr .track/active LDZ #10 MUL ADD DEI .Audio0/adsr .track/active LDZ #40 SFT 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 #40 SFT ADD DEO &no-a
DUP #01 NEQ ,&no-d JCN DUP #01 NEQ ,&no-d JCN
.Audio0/adsr .track/active LDZ #10 MUL ADD DEI .Audio0/adsr .track/active LDZ #40 SFT ADD DEI
DUP #f0 AND STH #01 .Mouse/state DEI #10 EQU #0e MUL ADD ADD #0f AND STHr ADD DUP #f0 AND STH #01 .Mouse/state DEI #10 EQU #0e MUL ADD ADD #0f AND STHr ADD
.Audio0/adsr .track/active LDZ #10 MUL ADD DEO &no-d .Audio0/adsr .track/active LDZ #40 SFT ADD DEO &no-d
DUP #02 NEQ ,&no-s JCN DUP #02 NEQ ,&no-s JCN
.Audio0/adsr .track/active LDZ #10 MUL ADD #01 ADD DEI .Audio0/adsr .track/active LDZ #40 SFT ADD #01 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 #01 ADD DEO &no-s .Audio0/adsr .track/active LDZ #40 SFT ADD #01 ADD DEO &no-s
DUP #03 NEQ ,&no-r JCN DUP #03 NEQ ,&no-r JCN
.Audio0/adsr .track/active LDZ #10 MUL ADD #01 ADD DEI .Audio0/adsr .track/active LDZ #40 SFT ADD #01 ADD DEI
DUP #f0 AND STH #01 .Mouse/state DEI #10 EQU #0e MUL ADD ADD #0f AND STHr ADD DUP #f0 AND STH #01 .Mouse/state DEI #10 EQU #0e MUL ADD ADD #0f AND STHr ADD
.Audio0/adsr .track/active LDZ #10 MUL ADD #01 ADD DEO &no-r .Audio0/adsr .track/active LDZ #40 SFT ADD #01 ADD DEO &no-r
DUP #05 NEQ ,&no-left JCN DUP #05 NEQ ,&no-left JCN
.Audio0/volume .track/active LDZ #10 MUL ADD DEI .Audio0/volume .track/active LDZ #40 SFT ADD DEI
#10 .Mouse/state DEI #10 EQU #e0 MUL ADD ADD #10 .Mouse/state DEI #10 EQU #e0 MUL ADD ADD
.Audio0/volume .track/active LDZ #10 MUL ADD DEO &no-left .Audio0/volume .track/active LDZ #40 SFT ADD DEO &no-left
DUP #06 NEQ ,&no-right JCN DUP #06 NEQ ,&no-right JCN
.Audio0/volume .track/active LDZ #10 MUL ADD DEI .Audio0/volume .track/active LDZ #40 SFT ADD DEI
DUP #f0 AND STH #01 .Mouse/state DEI #10 EQU #0e MUL ADD ADD #0f AND STHr ADD DUP #f0 AND STH #01 .Mouse/state DEI #10 EQU #0e MUL ADD ADD #0f AND STHr ADD
.Audio0/volume .track/active LDZ #10 MUL ADD DEO &no-right .Audio0/volume .track/active LDZ #40 SFT ADD DEO &no-right
POP POP
( release ) #00 .Mouse/state DEO ( release ) #00 .Mouse/state DEO
;draw-controls JSR2 ;draw-controls JSR2
@ -361,7 +361,7 @@ RTN
#05 .Screen/sprite DEO #05 .Screen/sprite DEO
.knob/x LDZ2 #0004 ADD2 .Screen/x DEO2 .knob/x LDZ2 #0004 ADD2 .Screen/x DEO2
.knob/y LDZ2 #0010 ADD2 .Screen/y DEO2 .knob/y LDZ2 #0010 ADD2 .Screen/y DEO2
;font_hex #00 .knob/value LDZ #08 MUL ADD2 .Screen/addr DEO2 ;font_hex #00 .knob/value LDZ #30 SFT ADD2 .Screen/addr DEO2
#01 .Screen/sprite DEO #01 .Screen/sprite DEO
RTN RTN
@ -386,31 +386,31 @@ RTN
( env ) ( env )
.ctlframe/x1 LDZ2 8++ .ctlframe/y1 LDZ2 8++ #02 ;env_txt ;draw-label JSR2 .ctlframe/x1 LDZ2 8++ .ctlframe/y1 LDZ2 8++ #02 ;env_txt ;draw-label JSR2
.ctlframe/x1 LDZ2 8++ .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 8++ .ctlframe/y1 LDZ2 #0010 ADD2
.Audio0/adsr .track/active LDZ #10 MUL ADD DEI #04 SFT .Audio0/adsr .track/active LDZ #40 SFT ADD DEI #04 SFT
;draw-knob JSR2 ;draw-knob JSR2
.ctlframe/x1 LDZ2 #0018 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 #0018 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2
.Audio0/adsr .track/active LDZ #10 MUL ADD DEI #0f AND .Audio0/adsr .track/active LDZ #40 SFT ADD DEI #0f AND
;draw-knob JSR2 ;draw-knob JSR2
.ctlframe/x1 LDZ2 #0028 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 #0028 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2
.Audio0/adsr .track/active LDZ #10 MUL ADD #01 ADD DEI #04 SFT .Audio0/adsr .track/active LDZ #40 SFT ADD #01 ADD DEI #04 SFT
;draw-knob JSR2 ;draw-knob JSR2
.ctlframe/x1 LDZ2 #0038 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 #0038 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2
.Audio0/adsr .track/active LDZ #10 MUL ADD #01 ADD DEI #0f AND .Audio0/adsr .track/active LDZ #40 SFT ADD #01 ADD DEI #0f AND
;draw-knob JSR2 ;draw-knob JSR2
( vol ) ( vol )
.ctlframe/x1 LDZ2 #0058 ADD2 .ctlframe/y1 LDZ2 8++ #02 ;vol_txt ;draw-label JSR2 .ctlframe/x1 LDZ2 #0058 ADD2 .ctlframe/y1 LDZ2 8++ #02 ;vol_txt ;draw-label JSR2
.ctlframe/x1 LDZ2 #0058 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 #0058 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2
.Audio0/volume .track/active LDZ #10 MUL ADD DEI #04 SFT .Audio0/volume .track/active LDZ #40 SFT ADD DEI #04 SFT
;draw-knob/force JSR2 ;draw-knob/force JSR2
.ctlframe/x1 LDZ2 #0068 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 #0068 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2
.Audio0/volume .track/active LDZ #10 MUL ADD DEI #0f AND .Audio0/volume .track/active LDZ #40 SFT ADD DEI #0f AND
;draw-knob/force JSR2 ;draw-knob/force JSR2
RTN RTN
@draw-vu ( -- ) @draw-vu ( -- )
.ctlframe/x1 LDZ2 #0088 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 #0088 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2
.Audio0/output .track/active LDZ #10 MUL ADD DEI DUP STH #04 SFT .Audio0/output .track/active LDZ #40 SFT ADD DEI DUP STH #04 SFT
;draw-knob/force JSR2 ;draw-knob/force JSR2
.ctlframe/x1 LDZ2 #0098 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2 .ctlframe/x1 LDZ2 #0098 ADD2 .ctlframe/y1 LDZ2 #0010 ADD2
STHr #0f AND STHr #0f AND

View File

@ -359,7 +359,7 @@ RTN
.Screen/x DEI2 #0001 ++ .Screen/x DEO2 .Screen/x DEI2 #0001 ++ .Screen/x DEO2
( draw ) DUP ( draw ) DUP
.Audio0/length DEI2 NIP > .Audio0/length DEI2 NIP >
.Audio0/length DEI2 #0100 !! #0101 == #02 * #01 + .Screen/pixel DEO .Audio0/length DEI2 #0100 !! #0101 == DUP ADD #01 + .Screen/pixel DEO
#01 + GTHk ,&loop JCN #01 + GTHk ,&loop JCN
POP2 POP2
@ -402,7 +402,7 @@ RTN
( draw ) #01 .Screen/sprite DEO ( draw ) #01 .Screen/sprite DEO
.Screen/x DEI2 #0004 ++ .Screen/x DEO2 .Screen/x DEI2 #0004 ++ .Screen/x DEO2
.Screen/y DEI2 #0008 ++ .Screen/y DEO2 .Screen/y DEI2 #0008 ++ .Screen/y DEO2
;font-hex #00 STHkr #08 * ++ .Screen/addr DEO2 ;font-hex #00 STHkr #30 SFT ++ .Screen/addr DEO2
( draw ) #01 .Screen/sprite DEO ( draw ) #01 .Screen/sprite DEO
.Screen/x DEI2 #0004 -- #00 #00 STHkr ;knob-offsetx ++ LDA ++ .Screen/x DEO2 .Screen/x DEI2 #0004 -- #00 #00 STHkr ;knob-offsetx ++ LDA ++ .Screen/x DEO2
.Screen/y DEI2 #0010 -- #00 #00 STHr ;knob-offsety ++ LDA ++ .Screen/y DEO2 .Screen/y DEI2 #0010 -- #00 #00 STHr ;knob-offsety ++ LDA ++ .Screen/y DEO2

View File

@ -29,7 +29,7 @@
( find center ) ( find center )
.Screen/width DEI2 2// #0008 SUB2 .cat/x STZ2 .Screen/width DEI2 2// #0008 SUB2 .cat/x STZ2
.Screen/height DEI2 4// #0003 MUL2 #0018 SUB2 .cat/y STZ2 .Screen/height DEI2 4// DUP2k ADD2 ADD2 #0018 SUB2 .cat/y STZ2
( vectors ) ( vectors )
;on-mouse .Mouse/vector DEO2 ;on-mouse .Mouse/vector DEO2
@ -44,8 +44,8 @@ BRK
;draw-cursor JSR2 ;draw-cursor JSR2
.Mouse/x DEI2 .cat/x LDZ2 GTH2 #20 MUL .Mouse/x DEI2 .cat/x LDZ2 GTH2 #50 SFT
.Mouse/y DEI2 .cat/y LDZ2 GTH2 #40 MUL .Mouse/y DEI2 .cat/y LDZ2 GTH2 #60 SFT
ADD #00 SWP ;draw-eye JSR2 ADD #00 SWP ;draw-eye JSR2
BRK BRK
@ -98,7 +98,7 @@ RTN
;body .Screen/addr DEO2 ;body .Screen/addr DEO2
( draw ) #81 .Screen/sprite DEO ( draw ) #81 .Screen/sprite DEO
STH2r .Screen/x DEO2 STH2r .Screen/x DEO2
#0010 MUL2 ;body #0010 ADD2 ADD2 .Screen/addr DEO2 #40 SFT2 ;body #0010 ADD2 ADD2 .Screen/addr DEO2
( draw ) #81 .Screen/sprite DEO ( draw ) #81 .Screen/sprite DEO
RTN RTN

View File

@ -147,7 +147,7 @@ RTN
#0010 .Screen/y DEO2 #0010 .Screen/y DEO2
#00 #08 #00 #08
&draw-pixel1 &draw-pixel1
( move ) OVR #08 MUL #00 SWP #0010 ADD2 .Screen/x DEO2 ( move ) OVR #30 SFT #00 SWP #0010 ADD2 .Screen/x DEO2
( draw ) OVR .Screen/pixel DEO ( draw ) OVR .Screen/pixel DEO
( incr ) SWP #01 ADD SWP ( incr ) SWP #01 ADD SWP
LTHk ,&draw-pixel1 JCN LTHk ,&draw-pixel1 JCN
@ -155,7 +155,7 @@ RTN
#0018 .Screen/y DEO2 #0018 .Screen/y DEO2
#00 #08 #00 #08
&draw-pixel2 &draw-pixel2
( move ) OVR #08 MUL #00 SWP #0010 ADD2 .Screen/x DEO2 ( move ) OVR #30 SFT #00 SWP #0010 ADD2 .Screen/x DEO2
( draw ) OVR #08 ADD .Screen/pixel DEO ( draw ) OVR #08 ADD .Screen/pixel DEO
( incr ) SWP #01 ADD SWP ( incr ) SWP #01 ADD SWP
LTHk ,&draw-pixel2 JCN LTHk ,&draw-pixel2 JCN
@ -163,7 +163,7 @@ RTN
#0020 .Screen/y DEO2 #0020 .Screen/y DEO2
#00 #08 #00 #08
&draw-icn1 &draw-icn1
( move ) OVR #08 MUL #00 SWP #0010 ADD2 .Screen/x DEO2 ( move ) OVR #30 SFT #00 SWP #0010 ADD2 .Screen/x DEO2
( draw ) OVR #00 ADD .Screen/sprite DEO ( draw ) OVR #00 ADD .Screen/sprite DEO
( incr ) SWP #01 ADD SWP ( incr ) SWP #01 ADD SWP
LTHk ,&draw-icn1 JCN LTHk ,&draw-icn1 JCN
@ -171,7 +171,7 @@ RTN
#0028 .Screen/y DEO2 #0028 .Screen/y DEO2
#00 #08 #00 #08
&draw-icn2 &draw-icn2
( move ) OVR #08 MUL #00 SWP #0010 ADD2 .Screen/x DEO2 ( move ) OVR #30 SFT #00 SWP #0010 ADD2 .Screen/x DEO2
( draw ) OVR #08 ADD .Screen/sprite DEO ( draw ) OVR #08 ADD .Screen/sprite DEO
( incr ) SWP #01 ADD SWP ( incr ) SWP #01 ADD SWP
LTHk ,&draw-icn2 JCN LTHk ,&draw-icn2 JCN
@ -179,7 +179,7 @@ RTN
#0030 .Screen/y DEO2 #0030 .Screen/y DEO2
#00 #08 #00 #08
&draw-chr1 &draw-chr1
( move ) OVR #08 MUL #00 SWP #0010 ADD2 .Screen/x DEO2 ( move ) OVR #30 SFT #00 SWP #0010 ADD2 .Screen/x DEO2
( draw ) OVR #80 ADD .Screen/sprite DEO ( draw ) OVR #80 ADD .Screen/sprite DEO
( incr ) SWP #01 ADD SWP ( incr ) SWP #01 ADD SWP
LTHk ,&draw-chr1 JCN LTHk ,&draw-chr1 JCN
@ -187,7 +187,7 @@ RTN
#0038 .Screen/y DEO2 #0038 .Screen/y DEO2
#00 #08 #00 #08
&draw-chr2 &draw-chr2
( move ) OVR #08 MUL #00 SWP #0010 ADD2 .Screen/x DEO2 ( move ) OVR #30 SFT #00 SWP #0010 ADD2 .Screen/x DEO2
( draw ) OVR #88 ADD .Screen/sprite DEO ( draw ) OVR #88 ADD .Screen/sprite DEO
( incr ) SWP #01 ADD SWP ( incr ) SWP #01 ADD SWP
LTHk ,&draw-chr2 JCN LTHk ,&draw-chr2 JCN
@ -253,7 +253,7 @@ RTN
.Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2 .Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2
.Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2 .Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2
#43 .Mouse/state DEI #00 NEQ #02 MUL SUB .Screen/sprite DEO #43 .Mouse/state DEI #00 NEQ DUP ADD SUB .Screen/sprite DEO
RTN RTN

View File

@ -60,7 +60,7 @@ BRK
( get note ) ( get note )
.counter LDZ #18 MOD #30 ADD .counter LDZ #18 MOD #30 ADD
.Audio0/pitch .counter LDZ #04 MOD #10 MUL ADD DEO .Audio0/pitch .counter LDZ #04 MOD #40 SFT ADD DEO
.counter LDZ #01 ADD .counter STZ .counter LDZ #01 ADD .counter STZ
#00 .timer STZ #00 .timer STZ

View File

@ -1,8 +1,8 @@
( dev/controller/keys ) ( dev/controller/keys )
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV } %+ { ADD } %- { SUB } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ } %< { LTH } %> { GTH } %= { EQU } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 } %++ { ADD2 } %-- { SUB2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 } %<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
%RTN { JMP2r } %RTN { JMP2r }
@ -77,17 +77,17 @@ BRK
.frame/x0 LDZ2 #0010 ++ .Screen/x DEO2 .frame/x0 LDZ2 #0010 ++ .Screen/x DEO2
.frame/y0 LDZ2 #0010 ++ .Screen/y DEO2 .frame/y0 LDZ2 #0010 ++ .Screen/y DEO2
;controller-icn/dpad-up .Screen/addr DEO2 ;controller-icn/dpad-up .Screen/addr DEO2
#03 [ STHkr #04 SFT #01 AND #02 * - ] .Screen/sprite DEO #03 [ STHkr #04 SFT #01 AND DUP + - ] .Screen/sprite DEO
.Screen/y DEI2 #0010 ++ .Screen/y DEO2 .Screen/y DEI2 #0010 ++ .Screen/y DEO2
;controller-icn/dpad-down .Screen/addr DEO2 ;controller-icn/dpad-down .Screen/addr DEO2
#03 [ STHkr #05 SFT #01 AND #02 * - ] .Screen/sprite DEO #03 [ STHkr #05 SFT #01 AND DUP + - ] .Screen/sprite DEO
.Screen/y DEI2 #0008 -- .Screen/y DEO2 .Screen/y DEI2 #0008 -- .Screen/y DEO2
.Screen/x DEI2 #0008 -- .Screen/x DEO2 .Screen/x DEI2 #0008 -- .Screen/x DEO2
;controller-icn/dpad-left .Screen/addr DEO2 ;controller-icn/dpad-left .Screen/addr DEO2
#03 [ STHkr #06 SFT #01 AND #02 * - ] .Screen/sprite DEO #03 [ STHkr #06 SFT #01 AND DUP + - ] .Screen/sprite DEO
.Screen/x DEI2 #0010 ++ .Screen/x DEO2 .Screen/x DEI2 #0010 ++ .Screen/x DEO2
;controller-icn/dpad-right .Screen/addr DEO2 ;controller-icn/dpad-right .Screen/addr DEO2
#03 [ STHkr #07 SFT #01 AND #02 * - ] .Screen/sprite DEO #03 [ STHkr #07 SFT #01 AND DUP + - ] .Screen/sprite DEO
.Screen/x DEI2 #0008 -- .Screen/x DEO2 .Screen/x DEI2 #0008 -- .Screen/x DEO2
;controller-icn/dpad .Screen/addr DEO2 ;controller-icn/dpad .Screen/addr DEO2
#03 .Screen/sprite DEO #03 .Screen/sprite DEO
@ -96,10 +96,10 @@ BRK
.center/y LDZ2 #0009 ++ .Screen/y DEO2 .center/y LDZ2 #0009 ++ .Screen/y DEO2
.center/x LDZ2 #0009 -- .Screen/x DEO2 .center/x LDZ2 #0009 -- .Screen/x DEO2
;controller-icn/option .Screen/addr DEO2 ;controller-icn/option .Screen/addr DEO2
#03 [ STHkr #02 SFT #01 AND #02 * - ] .Screen/sprite DEO #03 [ STHkr #02 SFT #01 AND DUP + - ] .Screen/sprite DEO
.center/x LDZ2 #0004 ++ .Screen/x DEO2 .center/x LDZ2 #0004 ++ .Screen/x DEO2
;controller-icn/option .Screen/addr DEO2 ;controller-icn/option .Screen/addr DEO2
#03 [ STHkr #03 SFT #01 AND #02 * - ] .Screen/sprite DEO #03 [ STHkr #03 SFT #01 AND DUP + - ] .Screen/sprite DEO
( buttons ) ( buttons )
.center/y LDZ2 #0000 ++ .Screen/y DEO2 .center/y LDZ2 #0000 ++ .Screen/y DEO2
@ -107,7 +107,7 @@ BRK
;controller-icn/button .Screen/addr DEO2 ;controller-icn/button .Screen/addr DEO2
#03 [ STHkr #01 SFT #01 AND - ] .Screen/sprite DEO #03 [ STHkr #01 SFT #01 AND - ] .Screen/sprite DEO
.Screen/y DEI2 #000a ++ .Screen/y DEO2 .Screen/y DEI2 #000a ++ .Screen/y DEO2
;font-hex #000b #0008 ** ++ .Screen/addr DEO2 ;font-hex #000b #30 SFT2 ++ .Screen/addr DEO2
#03 .Screen/sprite DEO #03 .Screen/sprite DEO
.center/y LDZ2 #0000 ++ .Screen/y DEO2 .center/y LDZ2 #0000 ++ .Screen/y DEO2
@ -115,7 +115,7 @@ BRK
;controller-icn/button .Screen/addr DEO2 ;controller-icn/button .Screen/addr DEO2
#03 [ STHr #01 AND - ] .Screen/sprite DEO #03 [ STHr #01 AND - ] .Screen/sprite DEO
.Screen/y DEI2 #000a ++ .Screen/y DEO2 .Screen/y DEI2 #000a ++ .Screen/y DEO2
;font-hex #000a #0008 ** ++ .Screen/addr DEO2 ;font-hex #000a #30 SFT2 ++ .Screen/addr DEO2
#03 .Screen/sprite DEO #03 .Screen/sprite DEO
.center/x LDZ2 #0010 -- .Screen/x DEO2 .center/x LDZ2 #0010 -- .Screen/x DEO2
@ -129,15 +129,15 @@ RTN
@draw-short ( short* color -- ) @draw-short ( short* color -- )
STH SWP STH SWP
DUP #04 SFT TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 DUP #04 SFT TOS #30 SFT2 ;font-hex ++ .Screen/addr DEO2
( draw ) STHkr .Screen/sprite DEO ( draw ) STHkr .Screen/sprite DEO
#0f AND TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 #0f AND TOS #30 SFT2 ;font-hex ++ .Screen/addr DEO2
.Screen/x DEI2 #0008 ++ .Screen/x DEO2 .Screen/x DEI2 #0008 ++ .Screen/x DEO2
( draw ) STHkr .Screen/sprite DEO ( draw ) STHkr .Screen/sprite DEO
DUP #04 SFT TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 DUP #04 SFT TOS #30 SFT2 ;font-hex ++ .Screen/addr DEO2
.Screen/x DEI2 #0008 ++ .Screen/x DEO2 .Screen/x DEI2 #0008 ++ .Screen/x DEO2
( draw ) STHkr .Screen/sprite DEO ( draw ) STHkr .Screen/sprite DEO
#0f AND TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 #0f AND TOS #30 SFT2 ;font-hex ++ .Screen/addr DEO2
.Screen/x DEI2 #0008 ++ .Screen/x DEO2 .Screen/x DEI2 #0008 ++ .Screen/x DEO2
( draw ) STHr .Screen/sprite DEO ( draw ) STHr .Screen/sprite DEO

View File

@ -6,7 +6,7 @@
%RTN { JMP2r } %RTN { JMP2r }
%MOD { DUP2 DIV MUL SUB } %MOD { DUP2 DIV MUL SUB }
%ABS2 { DUP2 #0f SFT2 EQU #04 JCN #ffff MUL2 } %ABS2 { DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 }
%SCALEX { 2// .Screen/width DEI2 2// ADD2 #0040 SUB2 } %SCALEX { 2// .Screen/width DEI2 2// ADD2 #0040 SUB2 }
%SCALEY { 2// .Screen/height DEI2 2// ADD2 #0040 SUB2 } %SCALEY { 2// .Screen/height DEI2 2// ADD2 #0040 SUB2 }
%12HOURS { DUP #0c GTH #0c MUL SUB } %12HOURS { DUP #0c GTH #0c MUL SUB }
@ -59,8 +59,8 @@ BRK
#00 SWP SCALEY .needles/sy STZ2 #00 SWP SCALEY .needles/sy STZ2
#00 SWP SCALEX .needles/sx STZ2 #00 SWP SCALEX .needles/sx STZ2
#00 .DateTime/minute DEI 2** ;table ADD2 LDA2 #00 .DateTime/minute DEI 2** ;table ADD2 LDA2
#00 SWP 4// #0003 MUL2 #0020 ADD2 SCALEY .needles/my STZ2 #00 SWP 4// DUP2k ADD2 ADD2 #0020 ADD2 SCALEY .needles/my STZ2
#00 SWP 4// #0003 MUL2 #0020 ADD2 SCALEX .needles/mx STZ2 #00 SWP 4// DUP2k ADD2 ADD2 #0020 ADD2 SCALEX .needles/mx STZ2
#00 .DateTime/hour DEI 12HOURS #05 MUL 2** ;table ADD2 LDA2 #00 .DateTime/hour DEI 12HOURS #05 MUL 2** ;table ADD2 LDA2
#00 SWP 2// #0040 ADD2 SCALEY .needles/hy STZ2 #00 SWP 2// #0040 ADD2 SCALEY .needles/hy STZ2
#00 SWP 2// #0040 ADD2 SCALEX .needles/hx STZ2 #00 SWP 2// #0040 ADD2 SCALEX .needles/hx STZ2
@ -90,22 +90,22 @@ BRK
.Screen/height DEI2 2// #0048 ADD2 .Screen/y DEO2 .Screen/height DEI2 2// #0048 ADD2 .Screen/y DEO2
.Screen/width DEI2 2// .Screen/width DEI2 2//
DUP2 #0020 SUB2 .Screen/x DEO2 DUP2 #0020 SUB2 .Screen/x DEO2
;font-hex #00 .DateTime/hour DEI #0a DIV #08 MUL ADD2 .Screen/addr DEO2 ;font-hex #00 .DateTime/hour DEI #0a DIV #30 SFT ADD2 .Screen/addr DEO2
#02 .Screen/sprite DEO #02 .Screen/sprite DEO
DUP2 #0018 SUB2 .Screen/x DEO2 DUP2 #0018 SUB2 .Screen/x DEO2
;font-hex #00 .DateTime/hour DEI #0a MOD #08 MUL ADD2 .Screen/addr DEO2 ;font-hex #00 .DateTime/hour DEI #0a MOD #30 SFT ADD2 .Screen/addr DEO2
#02 .Screen/sprite DEO #02 .Screen/sprite DEO
DUP2 #0008 SUB2 .Screen/x DEO2 DUP2 #0008 SUB2 .Screen/x DEO2
;font-hex #00 .DateTime/minute DEI #0a DIV #08 MUL ADD2 .Screen/addr DEO2 ;font-hex #00 .DateTime/minute DEI #0a DIV #30 SFT ADD2 .Screen/addr DEO2
#02 .Screen/sprite DEO #02 .Screen/sprite DEO
DUP2 .Screen/x DEO2 DUP2 .Screen/x DEO2
;font-hex #00 .DateTime/minute DEI #0a MOD #08 MUL ADD2 .Screen/addr DEO2 ;font-hex #00 .DateTime/minute DEI #0a MOD #30 SFT ADD2 .Screen/addr DEO2
#02 .Screen/sprite DEO #02 .Screen/sprite DEO
DUP2 #0010 ADD2 .Screen/x DEO2 DUP2 #0010 ADD2 .Screen/x DEO2
;font-hex #00 .DateTime/second DEI #0a DIV #08 MUL ADD2 .Screen/addr DEO2 ;font-hex #00 .DateTime/second DEI #0a DIV #30 SFT ADD2 .Screen/addr DEO2
#02 .Screen/sprite DEO #02 .Screen/sprite DEO
DUP2 #0018 ADD2 .Screen/x DEO2 DUP2 #0018 ADD2 .Screen/x DEO2
;font-hex #00 .DateTime/second DEI #0a MOD #08 MUL ADD2 .Screen/addr DEO2 ;font-hex #00 .DateTime/second DEI #0a MOD #30 SFT ADD2 .Screen/addr DEO2
#02 .Screen/sprite DEO #02 .Screen/sprite DEO
POP2 POP2

View File

@ -1,7 +1,7 @@
( dev/mouse ) ( dev/mouse )
%RTN { JMP2r } %RTN { JMP2r }
%ABS2 { DUP2 #0f SFT2 EQU #04 JCN #ffff MUL2 } %ABS2 { DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 }
%LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 } %LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 } %GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }
%2** { #10 SFT2 } %2** { #10 SFT2 }
@ -61,7 +61,7 @@ BRK
.pointer/lasty LDZ2 .pointer/lasty LDZ2
.pointer/x LDZ2 .pointer/x LDZ2
.pointer/y LDZ2 .pointer/y LDZ2
#01 [ .Mouse/state DEI #10 EQU #02 MUL ADD ] #01 [ .Mouse/state DEI #10 EQU DUP ADD ADD ]
;draw-line JSR2 ;draw-line JSR2
( record last position ) ( record last position )
@ -86,7 +86,7 @@ BRK
( draw new cursor ) ( draw new cursor )
.pointer/x LDZ2 .Screen/x DEO2 .pointer/x LDZ2 .Screen/x DEO2
.pointer/y LDZ2 .Screen/y DEO2 .pointer/y LDZ2 .Screen/y DEO2
#43 .Mouse/state DEI #00 NEQ #02 MUL SUB .Screen/sprite DEO #43 .Mouse/state DEI #00 NEQ DUP ADD SUB .Screen/sprite DEO
RTN RTN

View File

@ -68,14 +68,14 @@ BRK
#10 #00 #10 #00
&loop &loop
DUP #08 MUL #00 SWP ;font-hex ADD2 .Screen/addr DEO2 DUP #30 SFT #00 SWP ;font-hex ADD2 .Screen/addr DEO2
( x-axis ) ( x-axis )
DUP #08 MUL #00 SWP DUP #30 SFT #00 SWP
.center/x LDZ2 #0040 SUB2 ADD2 .Screen/x DEO2 .center/x LDZ2 #0040 SUB2 ADD2 .Screen/x DEO2
.center/y LDZ2 #0050 SUB2 .Screen/y DEO2 .center/y LDZ2 #0050 SUB2 .Screen/y DEO2
( draw ) #01 .Screen/sprite DEO ( draw ) #01 .Screen/sprite DEO
( y-axis ) ( y-axis )
DUP #08 MUL #00 SWP DUP #30 SFT #00 SWP
.center/y LDZ2 #0040 SUB2 ADD2 .Screen/y DEO2 .center/y LDZ2 #0040 SUB2 ADD2 .Screen/y DEO2
.center/x LDZ2 #0050 SUB2 .Screen/x DEO2 .center/x LDZ2 #0050 SUB2 .Screen/x DEO2
( draw ) #01 .Screen/sprite DEO ( draw ) #01 .Screen/sprite DEO
@ -104,9 +104,9 @@ RTN
#10 #00 #10 #00
&loop &loop
( color ) STHk ( color ) STHk
( y ) DUP #04 DIV [ #00 SWP ] #0010 MUL2 ( y ) DUP #04 DIV [ #00 SWP ] #40 SFT2
[ .center/y LDZ2 #0040 SUB2 ADD2 ] STH2 [ .center/y LDZ2 #0040 SUB2 ADD2 ] STH2
( x ) DUP #03 AND [ #00 SWP ] #0010 MUL2 #0040 ADD2 ( x ) DUP #03 AND [ #00 SWP ] #40 SFT2 #0040 ADD2
[ .center/x LDZ2 #0008 ADD2 ADD2 ] [ .center/x LDZ2 #0008 ADD2 ADD2 ]
STH2r STHr #00 ;draw-circle JSR2 STH2r STHr #00 ;draw-circle JSR2
#01 ADD GTHk ,&loop JCN #01 ADD GTHk ,&loop JCN
@ -119,9 +119,9 @@ RTN
#10 #00 #10 #00
&loop &loop
( color ) STHk ( color ) STHk
( y ) DUP #04 DIV [ #00 SWP ] #0010 MUL2 ( y ) DUP #04 DIV [ #00 SWP ] #40 SFT2
[ .center/y LDZ2 ADD2 ] STH2 [ .center/y LDZ2 ADD2 ] STH2
( x ) DUP #03 AND [ #00 SWP ] #0010 MUL2 #0040 ADD2 ( x ) DUP #03 AND [ #00 SWP ] #40 SFT2 #0040 ADD2
[ .center/x LDZ2 #0008 ADD2 ADD2 ] [ .center/x LDZ2 #0008 ADD2 ADD2 ]
STH2r STHr #80 ;draw-circle JSR2 STH2r STHr #80 ;draw-circle JSR2
#01 ADD GTHk ,&loop JCN #01 ADD GTHk ,&loop JCN

View File

@ -42,8 +42,8 @@ BRK
( case: hit-top ) .dvd/y LDZ2 #0000 EQU2 ( case: hit-top ) .dvd/y LDZ2 #0000 EQU2
#0000 EQU2 ,&no-flipy JCN #0000 EQU2 ,&no-flipy JCN
.dvd/dy LDZ #00 EQU .dvd/dy STZ &no-flipy .dvd/dy LDZ #00 EQU .dvd/dy STZ &no-flipy
( incr ) .dvd/x LDZ2 #0001 #00 .dvd/dx LDZ #00 EQU #fffe MUL2 ADD2 ADD2 .dvd/x STZ2 ( incr ) .dvd/x LDZ2 #0001 #00 .dvd/dx LDZ #00 EQU DUP2 ADD2 SUB2 ADD2 .dvd/x STZ2
( incr ) .dvd/y LDZ2 #0001 #00 .dvd/dy LDZ #00 EQU #fffe MUL2 ADD2 ADD2 .dvd/y STZ2 ( incr ) .dvd/y LDZ2 #0001 #00 .dvd/dy LDZ #00 EQU DUP2 ADD2 SUB2 ADD2 .dvd/y STZ2
( draw ) #01 ;draw-dvd JSR2 ( draw ) #01 ;draw-dvd JSR2
BRK BRK

View File

@ -6,7 +6,7 @@
%8++ { #0008 ADD2 } %8++ { #0008 ADD2 }
%2** { #10 SFT2 } %2** { #10 SFT2 }
%4** { #20 SFT2 } %4** { #20 SFT2 }
%ABS2 { DUP2 #0f SFT2 EQU #04 JCN #ffff MUL2 } %ABS2 { DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 }
%LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 } %LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 } %GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }

View File

@ -412,7 +412,7 @@
LDAk LDAk
DUP ,&not-end JCN DUP ,&not-end JCN
POP POP2 POP POP2
STH2r ROT #01 ADD #03 MUL STH2r ROT #01 ADD DUPk ADD ADD
JMP2r JMP2r
&not-end &not-end