2021-04-27 23:53:39 -04:00
|
|
|
( a blank file )
|
|
|
|
|
|
|
|
%RTN { JMP2r }
|
|
|
|
%8+ { #0008 ADD2 }
|
|
|
|
%8/ { #0008 DIV2 }
|
|
|
|
%2/ { #0002 DIV2 }
|
|
|
|
%2* { #0002 MUL2 }
|
|
|
|
%8* { #0008 MUL2 }
|
|
|
|
%++ { #0001 ADD2 }
|
|
|
|
%TOS { #00 SWP }
|
|
|
|
%MOD { DUP2 DIV MUL SUB }
|
2021-05-01 12:59:57 -04:00
|
|
|
%LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
|
|
|
|
%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
%PAD-WIDTH { #0030 }
|
|
|
|
%PAD-HEIGHT { #0020 }
|
|
|
|
%STATE-LENGTH { #04 }
|
|
|
|
|
|
|
|
( devices )
|
|
|
|
|
|
|
|
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|
|
|
|10 @Console [ &pad $8 &char $1 &byte $1 &short $2 &string $2 ]
|
|
|
|
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|
|
|
|
|30 @Audio0 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|
|
|
|
|40 @Audio1 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|
|
|
|
|50 @Audio2 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|
|
|
|
|60 @Audio3 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|
|
|
|
|70 @Midi [ &vector $2 &channel $1 ¬e $1 &velocity $1 ]
|
|
|
|
|80 @Controller [ &vector $2 &button $1 &key $1 ]
|
|
|
|
|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &chord $1 ]
|
|
|
|
|a0 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ]
|
|
|
|
|b0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ]
|
|
|
|
|
|
|
|
( variables )
|
|
|
|
|
|
|
|
|0000
|
|
|
|
|
|
|
|
@last $1
|
|
|
|
@color $1
|
|
|
|
@center [ &x $2 &y $2 ]
|
|
|
|
@pointer [ &x $2 &y $2 ]
|
2021-05-02 13:40:24 -04:00
|
|
|
@knob [ &x $2 &y $2 &value $1 ]
|
|
|
|
@rect [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
|
|
|
|
@frame [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
|
|
|
|
@label [ &x $2 &y $2 &color $1 &addr $2 ]
|
|
|
|
@pos [ &x $2 &y $2 ]
|
|
|
|
@padview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
|
|
|
|
@mixview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
|
2021-05-03 12:57:39 -04:00
|
|
|
@wavview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
@state [ ( addr length )
|
|
|
|
$4 $4 $4 $4
|
|
|
|
$4 $4 $4 $4
|
|
|
|
$4 $4 $4 $4
|
|
|
|
$4 $4 $4 $4
|
|
|
|
]
|
|
|
|
|
|
|
|
( program )
|
|
|
|
|
|
|
|
|0100 ( -> )
|
|
|
|
|
|
|
|
( theme )
|
2021-05-03 12:57:39 -04:00
|
|
|
#0aff .System/r DEO2
|
|
|
|
#0af2 .System/g DEO2
|
|
|
|
#0af3 .System/b DEO2
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
( vectors )
|
|
|
|
;on-control .Controller/vector DEO2
|
|
|
|
;on-mouse .Mouse/vector DEO2
|
|
|
|
;on-frame .Screen/vector DEO2
|
|
|
|
;on-midi .Midi/vector DEO2
|
|
|
|
|
|
|
|
( store location/length )
|
|
|
|
#88 .Audio0/volume DEO #011c .Audio0/adsr DEO2
|
|
|
|
#88 .Audio1/volume DEO #011c .Audio1/adsr DEO2
|
|
|
|
#88 .Audio2/volume DEO #011c .Audio2/adsr DEO2
|
|
|
|
#88 .Audio3/volume DEO #111c .Audio3/adsr DEO2
|
|
|
|
|
|
|
|
;load-samples JSR2
|
|
|
|
|
|
|
|
( find center )
|
|
|
|
.Screen/width DEI2 2/ .center/x POK2
|
|
|
|
.Screen/height DEI2 2/ .center/y POK2
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
( place frame )
|
2021-05-02 13:40:24 -04:00
|
|
|
.center/x PEK2 PAD-WIDTH #0003 MUL2 SUB2 #0010 SUB2 .frame/x1 POK2
|
2021-05-03 12:57:39 -04:00
|
|
|
.center/y PEK2 #0050 SUB2 .frame/y1 POK2
|
2021-05-02 13:40:24 -04:00
|
|
|
.center/x PEK2 PAD-WIDTH #0003 MUL2 ADD2 #0010 ADD2 .frame/x2 POK2
|
2021-05-03 12:57:39 -04:00
|
|
|
.frame/y1 PEK2 PAD-HEIGHT #0004 MUL2 ADD2 #0030 ADD2 .frame/y2 POK2
|
2021-04-27 23:53:39 -04:00
|
|
|
|
2021-05-02 13:40:24 -04:00
|
|
|
( place padview )
|
|
|
|
.frame/x1 PEK2 .padview/x1 POK2
|
|
|
|
.frame/y1 PEK2 .padview/y1 POK2
|
|
|
|
.padview/x1 PEK2 #0004 PAD-WIDTH MUL2 ADD2 .padview/x2 POK2
|
|
|
|
.padview/y1 PEK2 #0004 PAD-HEIGHT MUL2 ADD2 .padview/y2 POK2
|
|
|
|
|
|
|
|
( place mixview )
|
|
|
|
.padview/x2 PEK2 .mixview/x1 POK2
|
|
|
|
.padview/y1 PEK2 .mixview/y1 POK2
|
|
|
|
.mixview/x1 PEK2 #0080 ADD2 .mixview/x2 POK2
|
|
|
|
.padview/y2 PEK2 .mixview/y2 POK2
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
( place wavview )
|
|
|
|
.frame/x1 PEK2 .wavview/x1 POK2
|
|
|
|
.mixview/y2 PEK2 #0008 ADD2 .wavview/y1 POK2
|
|
|
|
.frame/x2 PEK2 .wavview/x2 POK2
|
|
|
|
.wavview/y1 PEK2 #0020 ADD2 .wavview/y2 POK2
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
;draw-pads JSR2
|
2021-05-02 13:40:24 -04:00
|
|
|
;draw-mixers JSR2
|
|
|
|
|
|
|
|
.frame/x1 PEK2 #0004 SUB2
|
|
|
|
.frame/y1 PEK2 #0004 SUB2
|
|
|
|
.frame/x2 PEK2 #0002 ADD2
|
|
|
|
.frame/y2 PEK2 #0002 ADD2
|
2021-05-03 12:57:39 -04:00
|
|
|
#01
|
2021-05-02 13:40:24 -04:00
|
|
|
;line-rect JSR2
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
.mixview/x1 PEK2 #0002 ADD2
|
|
|
|
.mixview/y1 PEK2 #0000 SUB2
|
|
|
|
.mixview/x2 PEK2 #0002 SUB2
|
|
|
|
.mixview/y2 PEK2 #0002 SUB2
|
|
|
|
#01
|
2021-05-02 13:40:24 -04:00
|
|
|
;line-rect JSR2
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
BRK
|
|
|
|
|
|
|
|
@on-frame ( -> )
|
|
|
|
|
|
|
|
.frame/y2 PEK2 .Screen/y DEO2
|
|
|
|
|
|
|
|
.center/x PEK2 PAD-WIDTH 2* SUB2 .Screen/x DEO2
|
|
|
|
.Audio0/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
.center/x PEK2 PAD-WIDTH 2* SUB2 #0008 ADD2 .Screen/x DEO2
|
|
|
|
.Audio1/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
.center/x PEK2 PAD-WIDTH 2* SUB2 #0010 ADD2 .Screen/x DEO2
|
|
|
|
.Audio2/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
.center/x PEK2 PAD-WIDTH 2* SUB2 #0018 ADD2 .Screen/x DEO2
|
|
|
|
.Audio3/output DEI #04 SFT TOS #0008 MUL2 ;meter ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
( TODO: draw in mixer )
|
|
|
|
( TODO: draw global )
|
|
|
|
|
|
|
|
BRK
|
|
|
|
|
|
|
|
@on-mouse ( -> )
|
|
|
|
|
|
|
|
;draw-cursor JSR2
|
|
|
|
|
|
|
|
.Mouse/state DEI #00 NEQ ,&on-touch JNZ BRK &on-touch
|
|
|
|
|
2021-05-02 13:40:24 -04:00
|
|
|
.Mouse/x DEI2 DUP2 .padview/x1 PEK2 GTH2 ROT ROT .padview/x2 PEK2 #0001 ADD2 LTH2 #0101 EQU2
|
|
|
|
.Mouse/y DEI2 DUP2 .padview/y1 PEK2 GTH2 ROT ROT .padview/y2 PEK2 LTH2 #0101 EQU2
|
|
|
|
#0101 EQU2 ;on-touch-pad JNZ2
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
BRK
|
|
|
|
|
|
|
|
@on-midi ( -> )
|
|
|
|
|
|
|
|
.Midi/note DEI #00 NEQ ,¬e-on JNZ BRK ¬e-on
|
|
|
|
|
|
|
|
.Midi/channel DEI #90 NEQ ,&no-drum JNZ
|
|
|
|
.Midi/note DEI DUP #80 ADD SWP #10 MOD ;play-pad JSR2
|
|
|
|
BRK
|
|
|
|
&no-drum
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
;pad-addr #0008 ADD2 LDA2 .Audio0/addr DEO2
|
2021-04-27 23:53:39 -04:00
|
|
|
#0008 .Audio0/length DEO2
|
|
|
|
.Midi/note DEI .Audio0/pitch DEO
|
|
|
|
|
|
|
|
BRK
|
|
|
|
|
|
|
|
@on-control ( -> )
|
|
|
|
|
|
|
|
.Controller/key DEI #00 NEQ ,&key-down JNZ BRK &key-down
|
|
|
|
|
|
|
|
.Controller/key DEI
|
|
|
|
DUP #31 NEQ ,&no-0 JNZ #b0 #00 ;play-pad JSR2 &no-0
|
|
|
|
DUP #32 NEQ ,&no-1 JNZ #b0 #01 ;play-pad JSR2 &no-1
|
|
|
|
DUP #33 NEQ ,&no-2 JNZ #b0 #02 ;play-pad JSR2 &no-2
|
|
|
|
DUP #34 NEQ ,&no-3 JNZ #b0 #03 ;play-pad JSR2 &no-3
|
|
|
|
DUP #71 NEQ ,&no-4 JNZ #b0 #04 ;play-pad JSR2 &no-4
|
|
|
|
DUP #77 NEQ ,&no-5 JNZ #b0 #05 ;play-pad JSR2 &no-5
|
|
|
|
DUP #65 NEQ ,&no-6 JNZ #b0 #06 ;play-pad JSR2 &no-6
|
|
|
|
DUP #72 NEQ ,&no-7 JNZ #b0 #07 ;play-pad JSR2 &no-7
|
|
|
|
DUP #61 NEQ ,&no-8 JNZ #b0 #08 ;play-pad JSR2 &no-8
|
|
|
|
DUP #73 NEQ ,&no-9 JNZ #b0 #09 ;play-pad JSR2 &no-9
|
|
|
|
DUP #64 NEQ ,&no-a JNZ #b0 #0a ;play-pad JSR2 &no-a
|
|
|
|
DUP #66 NEQ ,&no-b JNZ #b0 #0b ;play-pad JSR2 &no-b
|
|
|
|
DUP #7a NEQ ,&no-c JNZ #b0 #0c ;play-pad JSR2 &no-c
|
|
|
|
DUP #78 NEQ ,&no-d JNZ #b0 #0d ;play-pad JSR2 &no-d
|
|
|
|
DUP #63 NEQ ,&no-e JNZ #b0 #0e ;play-pad JSR2 &no-e
|
|
|
|
DUP #76 NEQ ,&no-f JNZ #b0 #0f ;play-pad JSR2 &no-f
|
|
|
|
POP
|
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2021-05-02 13:40:24 -04:00
|
|
|
@on-touch-pad ( -> )
|
|
|
|
|
|
|
|
( x ) .Mouse/x DEI2 .padview/x1 PEK2 SUB2 PAD-WIDTH DIV2 SWP POP
|
|
|
|
( y ) .Mouse/y DEI2 .padview/y1 PEK2 SUB2 PAD-HEIGHT DIV2 SWP POP #04 MUL ADD
|
2021-05-03 12:57:39 -04:00
|
|
|
|
|
|
|
DUP #b0 SWP ;play-pad JSR2
|
2021-05-02 13:40:24 -04:00
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
DUP ;draw-editor JSR2
|
|
|
|
DUP ;draw-waveform JSR2
|
2021-05-02 13:40:24 -04:00
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
POP
|
2021-05-02 13:40:24 -04:00
|
|
|
( release ) #00 .Mouse/state DEO
|
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
@load-samples ( -- )
|
|
|
|
|
|
|
|
#00 #10
|
|
|
|
&loop
|
|
|
|
( name ) OVR TOS #0019 MUL2 ;pad-path ADD2 .File/name DEO2
|
2021-05-03 12:57:39 -04:00
|
|
|
( length ) OVR TOS #0002 MUL2 ;pad-length ADD2 LDA2 .File/length DEO2
|
|
|
|
( load ) OVR TOS #0002 MUL2 ;pad-addr ADD2 LDA2 .File/load DEO2
|
2021-04-27 23:53:39 -04:00
|
|
|
( incr ) SWP #01 ADD SWP
|
|
|
|
DUP2 LTH ,&loop JNZ
|
|
|
|
POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@play-pad ( note pad -- )
|
|
|
|
|
|
|
|
STH
|
|
|
|
( unseslect last )
|
|
|
|
.last PEK #01 ;draw-pad JSR2
|
|
|
|
DUPr STHr .last POK
|
|
|
|
|
|
|
|
( highlight )
|
|
|
|
DUPr STHr #02 ;draw-pad JSR2
|
|
|
|
|
|
|
|
( length )
|
2021-05-03 12:57:39 -04:00
|
|
|
DUPr STHr TOS #0002 MUL2 ;pad-addr ADD2 DUP2 LDA2 SWP2 #0002 ADD2 LDA2 SWP2 SUB2
|
2021-04-27 23:53:39 -04:00
|
|
|
DUPr STHr #04 DIV #10 MUL .Audio0/length ADD DEO2
|
|
|
|
|
|
|
|
( addr )
|
2021-05-03 12:57:39 -04:00
|
|
|
DUPr STHr TOS #0002 MUL2 ;pad-addr ADD2 LDA2
|
2021-04-27 23:53:39 -04:00
|
|
|
DUPr STHr #04 DIV #10 MUL .Audio0/addr ADD DEO2
|
|
|
|
|
|
|
|
( pitch )
|
|
|
|
DUPr STHr #04 DIV #10 MUL .Audio0/pitch ADD DEO
|
|
|
|
|
|
|
|
DUPr STHr #04 DIV ;draw-mixer JSR2
|
|
|
|
|
|
|
|
POPr
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
@draw-waveform ( pad -- )
|
|
|
|
|
|
|
|
#02 MUL #00 SWP ;pad-addr ADD2 LDA2 STH2
|
|
|
|
|
|
|
|
.wavview/x1 PEK2
|
|
|
|
.wavview/y1 PEK2
|
|
|
|
.wavview/x2 PEK2 ++
|
|
|
|
.wavview/y2 PEK2
|
|
|
|
#00 ;fill-rect JSR2
|
|
|
|
|
|
|
|
.wavview/x1 PEK2 .Screen/x DEO2
|
|
|
|
|
|
|
|
( waveform )
|
|
|
|
#00 #ff
|
|
|
|
&loop
|
|
|
|
( dotted line )
|
|
|
|
OVR #01 AND ,&no-dot JNZ
|
|
|
|
.wavview/y1 PEK2 #0010 ADD2 .Screen/y DEO2
|
|
|
|
#03 .Screen/color DEO
|
|
|
|
&no-dot
|
|
|
|
OVR TOS #0010 MUL2 [ DUP2r STH2r ] ADD2 LDA
|
|
|
|
#02 DIV #40 ADD DUP #07 SFT #80 MUL SUB
|
|
|
|
TOS #0004 DIV2 .wavview/y1 PEK2 ADD2 .Screen/y DEO2
|
|
|
|
.Screen/x DEI2 ++ .Screen/x DEO2
|
|
|
|
( draw ) OVR .Audio0/length DEI2 SWP POP GTH #02 MUL #01 ADD .Screen/color DEO
|
|
|
|
( incr ) SWP #01 ADD SWP
|
|
|
|
DUP2 LTH ,&loop JNZ
|
|
|
|
POP2
|
|
|
|
|
|
|
|
POP2r
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
@draw-editor ( pad -- )
|
|
|
|
|
|
|
|
( get state )
|
|
|
|
|
|
|
|
.frame/y2 PEK2 #0008 ADD2 .Screen/y DEO2
|
|
|
|
|
|
|
|
.frame/x1 PEK2 .Screen/x DEO2
|
2021-05-03 12:57:39 -04:00
|
|
|
DUP #02 MUL TOS ;pad-addr ADD2 LDA2
|
2021-04-27 23:53:39 -04:00
|
|
|
( addr ) #21 ;draw-short JSR2
|
|
|
|
|
|
|
|
.frame/x1 PEK2 #0028 ADD2 .Screen/x DEO2
|
2021-05-03 12:57:39 -04:00
|
|
|
DUP #02 MUL TOS ;pad-length ADD2 LDA2
|
2021-04-27 23:53:39 -04:00
|
|
|
( addr ) #21 ;draw-short JSR2
|
|
|
|
|
|
|
|
POP
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-mixer ( mixer -- )
|
|
|
|
|
|
|
|
;cursor .Screen/addr DEO2
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
DUP #00 SWP PAD-HEIGHT MUL2 .mixview/y1 PEK2 ADD2 #0002 ADD2 STH2
|
2021-05-02 13:40:24 -04:00
|
|
|
|
|
|
|
( adsr )
|
|
|
|
.mixview/x1 PEK2 #0008 ADD2 DUP2r STH2r
|
|
|
|
.Audio0/adsr DEI #04 SFT
|
|
|
|
;draw-knob JSR2
|
|
|
|
.mixview/x1 PEK2 #0018 ADD2 DUP2r STH2r
|
|
|
|
.Audio0/adsr DEI #0f AND
|
|
|
|
;draw-knob JSR2
|
|
|
|
.mixview/x1 PEK2 #0028 ADD2 DUP2r STH2r
|
|
|
|
.Audio0/adsr #01 ADD DEI #04 SFT
|
|
|
|
;draw-knob JSR2
|
|
|
|
.mixview/x1 PEK2 #0038 ADD2 DUP2r STH2r
|
|
|
|
.Audio0/adsr #01 ADD DEI #0f AND
|
|
|
|
;draw-knob JSR2
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
.mixview/x1 PEK2 #0048 ADD2 DUP2r STH2r
|
|
|
|
#00 ;draw-switch JSR2
|
|
|
|
|
2021-05-02 13:40:24 -04:00
|
|
|
( volume )
|
|
|
|
.mixview/x1 PEK2 #0058 ADD2 DUP2r STH2r
|
|
|
|
.Audio0/volume DEI #04 SFT
|
|
|
|
;draw-knob JSR2
|
|
|
|
.mixview/x1 PEK2 #0068 ADD2 DUP2r STH2r
|
|
|
|
.Audio0/volume DEI #0f AND
|
|
|
|
;draw-knob JSR2
|
2021-04-27 23:53:39 -04:00
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
POP
|
2021-05-02 13:40:24 -04:00
|
|
|
POP2r
|
2021-04-27 23:53:39 -04:00
|
|
|
( once/repeat interface )
|
2021-05-02 13:40:24 -04:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-knob ( x* y* value -- )
|
|
|
|
|
|
|
|
( load ) .knob/value POK .knob/y POK2 .knob/x POK2
|
|
|
|
|
|
|
|
.knob/x PEK2 .Screen/x DEO2
|
|
|
|
.knob/y PEK2 .Screen/y DEO2 ;knob_icns .Screen/addr DEO2 #21 .Screen/color DEO
|
|
|
|
.knob/x PEK2 8+ .Screen/x DEO2 ;knob_icns 8+ .Screen/addr DEO2 #21 .Screen/color DEO
|
|
|
|
.knob/y PEK2 8+ .Screen/y DEO2 ;knob_icns #0018 ADD2 .Screen/addr DEO2 #21 .Screen/color DEO
|
|
|
|
.knob/x PEK2 .Screen/x DEO2 ;knob_icns #0010 ADD2 .Screen/addr DEO2 #21 .Screen/color DEO
|
2021-05-03 12:57:39 -04:00
|
|
|
.knob/x PEK2 #00 #00 .knob/value PEK ;knob-offsetx ADD2 LDA ADD2 .Screen/x DEO2
|
|
|
|
.knob/y PEK2 #00 #00 .knob/value PEK ;knob-offsety ADD2 LDA ADD2 .Screen/y DEO2
|
2021-05-02 13:40:24 -04:00
|
|
|
;knob_icns #0020 ADD2 .Screen/addr DEO2
|
|
|
|
#25 .Screen/color DEO
|
|
|
|
.knob/x PEK2 #0004 ADD2 .Screen/x DEO2
|
|
|
|
.knob/y PEK2 #0010 ADD2 .Screen/y DEO2
|
|
|
|
;font-hex #00 .knob/value PEK #08 MUL ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
@draw-switch ( x* y* value -- )
|
|
|
|
|
|
|
|
POP ( TODO: use value for toggle position )
|
|
|
|
.Screen/y DEO2
|
|
|
|
.Screen/x DEO2
|
|
|
|
;switch .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
|
|
|
|
;switch #0008 ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
.Screen/y DEI2 #0008 ADD2 .Screen/y DEO2
|
|
|
|
.Screen/x DEI2 #0008 SUB2 .Screen/x DEO2
|
|
|
|
;switch #0010 ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
|
|
|
|
;switch #0018 ADD2 .Screen/addr DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
@draw-pads ( -- )
|
|
|
|
|
|
|
|
#00 #10
|
|
|
|
&loop
|
|
|
|
OVR #01 ;draw-pad JSR2
|
|
|
|
SWP #01 ADD SWP
|
|
|
|
DUP2 LTH ,&loop JNZ
|
|
|
|
POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-05-02 13:40:24 -04:00
|
|
|
@draw-mixers ( -- )
|
|
|
|
|
|
|
|
#00 #04
|
|
|
|
&loop
|
|
|
|
OVR ;draw-mixer JSR2
|
|
|
|
SWP #01 ADD SWP
|
|
|
|
DUP2 LTH ,&loop JNZ
|
|
|
|
POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
@draw-pad ( pad color -- )
|
|
|
|
|
|
|
|
STH STH
|
|
|
|
|
|
|
|
DUPr STHr
|
|
|
|
|
2021-05-02 13:40:24 -04:00
|
|
|
DUP #04 DIV SWP #04 MOD TOS PAD-WIDTH MUL2 ( center ) .padview/x1 PEK2 ADD2
|
|
|
|
ROT TOS PAD-HEIGHT MUL2 ( center ) .padview/y1 PEK2 ADD2
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
( draw outline )
|
|
|
|
OVR2 OVR2
|
|
|
|
OVR2 PAD-WIDTH #0002 SUB2 ADD2
|
|
|
|
OVR2 PAD-HEIGHT #0002 SUB2 ADD2
|
|
|
|
OVRr STHr ;line-rect JSR2
|
|
|
|
|
|
|
|
( draw name )
|
|
|
|
OVR2 #0002 ADD2
|
|
|
|
OVR2 #0002 ADD2
|
|
|
|
#20 OVRr STHr ADD
|
|
|
|
;pad-name DUPr STHr TOS #0005 MUL2 ADD2
|
|
|
|
;draw-label-left JSR2
|
|
|
|
|
|
|
|
POP2 POP2
|
|
|
|
|
|
|
|
POPr POPr
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-cursor ( -- )
|
|
|
|
|
|
|
|
( clear last cursor )
|
|
|
|
;clear .Screen/addr DEO2
|
|
|
|
.pointer/x PEK2 .Screen/x DEO2
|
|
|
|
.pointer/y PEK2 .Screen/y DEO2
|
|
|
|
#30 .Screen/color DEO
|
|
|
|
( record pointer positions )
|
|
|
|
.Mouse/x DEI2 .pointer/x POK2
|
|
|
|
.Mouse/y DEI2 .pointer/y POK2
|
|
|
|
( draw new cursor )
|
|
|
|
;cursor .Screen/addr DEO2
|
|
|
|
.pointer/x PEK2 .Screen/x DEO2
|
|
|
|
.pointer/y PEK2 .Screen/y DEO2
|
|
|
|
( colorize on state )
|
2021-05-03 12:57:39 -04:00
|
|
|
#33 [ .Mouse/state DEI #00 NEQ ] SUB .Screen/color DEO
|
2021-04-27 23:53:39 -04:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-short ( addr color -- )
|
|
|
|
|
|
|
|
STH SWP
|
|
|
|
DUP #04 SFT TOS 8* ;font-hex ADD2 .Screen/addr DEO2
|
|
|
|
( draw ) DUPr STHr .Screen/color DEO
|
|
|
|
#0f AND TOS 8* ;font-hex ADD2 .Screen/addr DEO2
|
|
|
|
.Screen/x DEI2 8+ .Screen/x DEO2
|
|
|
|
( draw ) DUPr STHr .Screen/color DEO
|
|
|
|
DUP #04 SFT TOS 8* ;font-hex ADD2 .Screen/addr DEO2
|
|
|
|
.Screen/x DEI2 8+ .Screen/x DEO2
|
|
|
|
( draw ) DUPr STHr .Screen/color DEO
|
|
|
|
#0f AND TOS 8* ;font-hex ADD2 .Screen/addr DEO2
|
|
|
|
.Screen/x DEI2 8+ .Screen/x DEO2
|
|
|
|
( draw ) STHr .Screen/color DEO
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@line-rect ( x1 y1 x2 y2 color -- )
|
|
|
|
|
|
|
|
( load ) .color POK DUP2 STH2 .rect/y2 POK2 .rect/x2 POK2 DUP2 STH2 .rect/y1 POK2 .rect/x1 POK2
|
|
|
|
STH2r #0001 ADD2 STH2r
|
|
|
|
&ver
|
|
|
|
( save ) OVR2 .Screen/y DEO2
|
|
|
|
( draw ) .rect/x1 PEK2 .Screen/x DEO2 .color PEK DUP .Screen/color DEO
|
|
|
|
( draw ) .rect/x2 PEK2 .Screen/x DEO2 .Screen/color DEO
|
|
|
|
( incr ) SWP2 ++ SWP2
|
|
|
|
OVR2 OVR2 LTS2 ,&ver JNZ
|
|
|
|
POP2 POP2
|
|
|
|
.rect/x1 PEK2 #0001 ADD2 .rect/x2 PEK2 #0001 SUB2
|
|
|
|
&hor
|
|
|
|
( save ) OVR2 .Screen/x DEO2
|
|
|
|
( draw ) .rect/y1 PEK2 .Screen/y DEO2 .color PEK DUP .Screen/color DEO
|
|
|
|
( draw ) .rect/y2 PEK2 .Screen/y DEO2 .Screen/color DEO
|
|
|
|
( incr ) SWP2 ++ SWP2
|
|
|
|
OVR2 OVR2 ++ LTS2 ,&hor JNZ
|
|
|
|
POP2 POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-label-left ( x y color addr -- )
|
|
|
|
|
|
|
|
( load ) .label/addr POK2 .label/color POK .Screen/y DEO2 .Screen/x DEO2
|
|
|
|
.label/addr PEK2
|
|
|
|
&loop
|
2021-05-03 12:57:39 -04:00
|
|
|
( draw ) DUP2 LDA #00 SWP #0030 SUB2 #0008 MUL2 ;font-num-uc ADD2 .Screen/addr DEO2 .label/color PEK .Screen/color DEO
|
2021-04-27 23:53:39 -04:00
|
|
|
( incr ) #0001 ADD2
|
2021-05-03 12:57:39 -04:00
|
|
|
( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
|
|
|
|
DUP2 LDA #00 NEQ ,&loop JNZ
|
2021-04-27 23:53:39 -04:00
|
|
|
POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
@fill-rect ( x1* y1* x2* y2* color -- )
|
|
|
|
|
|
|
|
.color POK
|
|
|
|
( x1 x2 y1 y2 ) ROT2 SWP2
|
|
|
|
&ver
|
|
|
|
( save ) OVR2 .Screen/y DEO2
|
|
|
|
STH2 STH2 OVR2 OVR2
|
|
|
|
&hor
|
|
|
|
( save ) OVR2 .Screen/x DEO2
|
|
|
|
( draw ) .color PEK .Screen/color DEO
|
|
|
|
( incr ) SWP2 ++ SWP2
|
|
|
|
OVR2 OVR2 LTS2 ,&hor JNZ
|
|
|
|
POP2 POP2 STH2r STH2r
|
|
|
|
( incr ) SWP2 ++ SWP2
|
|
|
|
OVR2 OVR2 LTS2 ,&ver JNZ
|
|
|
|
POP2 POP2 POP2 POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
@pad-name [
|
|
|
|
"PAD1 $1 "SYN1 $1 "SYN2 $1 "CYM1 $1 ( short )
|
|
|
|
"HHAT $1 "OHAT $1 "CHAT $1 "RIDE $1
|
|
|
|
"SID1 $1 "SNR1 $1 "SNR2 $1 "SID2 $1 ( long )
|
|
|
|
"BDR1 $1 "KCK1 $1 "KCK2 $1 "BDR2 $1 ]
|
|
|
|
|
|
|
|
@pad-addr [
|
|
|
|
4000 4400 4800 4c00
|
|
|
|
5000 5800 6000 6800
|
|
|
|
7000 7800 8000 8800
|
|
|
|
9000 b000 d000 f000 $2 ]
|
|
|
|
|
|
|
|
@pad-length [
|
|
|
|
0800 0800 0800 0800
|
|
|
|
0800 0800 0800 0800
|
|
|
|
0800 0800 0800 0800
|
|
|
|
0800 0800 0800 0800 $2 ]
|
|
|
|
|
|
|
|
@pad-path [
|
|
|
|
"projects/sounds/pad1.ss8 $1 "projects/sounds/syn1.ss8 $1
|
|
|
|
"projects/sounds/syn2.ss8 $1 "projects/sounds/cym1.ss8 $1
|
|
|
|
"projects/sounds/hhat.ss8 $1 "projects/sounds/ohat.ss8 $1
|
|
|
|
"projects/sounds/chat.ss8 $1 "projects/sounds/ride.ss8 $1
|
|
|
|
"projects/sounds/sid1.ss8 $1 "projects/sounds/snr1.ss8 $1
|
|
|
|
"projects/sounds/snr2.ss8 $1 "projects/sounds/sid2.ss8 $1
|
|
|
|
"projects/sounds/bdr1.ss8 $1 "projects/sounds/kck1.ss8 $1
|
|
|
|
"projects/sounds/kck2.ss8 $1 "projects/sounds/bdr2.ss8 $1 ]
|
|
|
|
|
2021-05-02 13:40:24 -04:00
|
|
|
@knob_icns [
|
|
|
|
0003 0c10 2020 4040
|
|
|
|
00c0 3008 0404 0202
|
|
|
|
4040 2020 100c 0300
|
|
|
|
0202 0404 0830 c000
|
|
|
|
0000 183c 3c18 0000 ]
|
|
|
|
|
|
|
|
@knob-offsetx [
|
|
|
|
01 00 00 00 00 01 02 03
|
|
|
|
05 06 07 08 08 08 08 07 ]
|
|
|
|
|
|
|
|
@knob-offsety [
|
|
|
|
07 06 05 03 02 01 00 00
|
|
|
|
00 00 01 02 03 05 06 07 ]
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
@clear [
|
|
|
|
0000 0000 0000 0000 ]
|
|
|
|
|
|
|
|
@cursor [
|
|
|
|
80c0 e0f0 f8e0 1000 ]
|
|
|
|
|
|
|
|
@meter [
|
|
|
|
0000 0000 0000 0000
|
|
|
|
0000 0000 0000 0070
|
|
|
|
0000 0000 0000 007e
|
|
|
|
0000 0000 0000 707e
|
|
|
|
0000 0000 0070 7e7e
|
|
|
|
0000 0000 007e 7e7e
|
|
|
|
0000 0000 707e 7e7e
|
|
|
|
0000 0000 7e7e 7e7e
|
|
|
|
0000 0070 7e7e 7e7e
|
|
|
|
0000 007e 7e7e 7e7e
|
|
|
|
0000 707e 7e7e 7e7e
|
|
|
|
0000 7e7e 7e7e 7e7e
|
|
|
|
0070 7e7e 7e7e 7e7e
|
|
|
|
007e 7e7e 7e7e 7e7e
|
|
|
|
707e 7e7e 7e7e 7e7e
|
|
|
|
7e7e 7e7e 7e7e 7e7e ]
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
@switch [
|
|
|
|
001f 204f 5f5f 4f40
|
|
|
|
00f8 04f2 fafa f202
|
|
|
|
4040 4040 4020 1f00
|
|
|
|
0202 0202 0204 f800
|
|
|
|
0000 0000 0000 0000
|
|
|
|
0000 0000 0000 0000
|
|
|
|
0000 0000 0000 0000
|
|
|
|
0000 0000 0000 0000
|
|
|
|
]
|
|
|
|
|
2021-04-27 23:53:39 -04:00
|
|
|
@font-hex ( 0-F )
|
|
|
|
[
|
|
|
|
007c 8282 8282 827c 0030 1010 1010 1010
|
|
|
|
007c 8202 7c80 80fe 007c 8202 1c02 827c
|
|
|
|
000c 1424 4484 fe04 00fe 8080 7c02 827c
|
|
|
|
007c 8280 fc82 827c 007c 8202 1e02 0202
|
|
|
|
007c 8282 7c82 827c 007c 8282 7e02 827c
|
|
|
|
007c 8202 7e82 827e 00fc 8282 fc82 82fc
|
|
|
|
007c 8280 8080 827c 00fc 8282 8282 82fc
|
|
|
|
007c 8280 f080 827c 007c 8280 f080 8080
|
|
|
|
]
|
|
|
|
|
2021-05-03 12:57:39 -04:00
|
|
|
@font-num-uc [
|
|
|
|
003e 4141 4141 413e 0018 0808 0808 081c
|
|
|
|
003e 4101 3e40 407f 003e 4101 1f01 413e
|
|
|
|
0011 2141 7f01 0101 007f 4040 7e01 413e
|
|
|
|
003e 4140 7e41 413e 003e 4101 0102 0408
|
|
|
|
003e 4141 3e41 413e 003e 4141 3f01 0102
|
|
|
|
0000 0800 0000 0800 0000 0800 0000 0800
|
|
|
|
0000 0800 0000 0810 0000 0408 1008 0400
|
|
|
|
0000 001c 001c 0000 0000 1008 0408 1000
|
|
|
|
0000 0000 0000 0000 003e 4101 3f41 413f
|
|
|
|
007e 4141 7e41 417e 003e 4140 4040 413e
|
|
|
|
007e 4141 4141 417e 007f 4040 7e40 407f
|
|
|
|
007f 4040 7e40 4040 003e 4140 5e41 413e
|
|
|
|
0041 4141 7f41 4141 0008 0808 0808 0808
|
|
|
|
007f 0101 0101 413e 0041 4244 7844 4241
|
|
|
|
0040 4040 4040 403f 0076 4949 4949 4949
|
|
|
|
005e 6141 4141 4141 003e 4141 4141 413e
|
|
|
|
007e 4141 7e40 4040 003e 4141 4145 423d
|
|
|
|
007e 4141 7e41 4141 003e 4140 3e01 413e
|
|
|
|
007f 0808 0808 0808 0041 4141 4141 433d
|
|
|
|
0041 4141 4122 1408 0049 4949 4949 4976
|
|
|
|
0041 2214 0814 2241 0041 4141 3f01 413e
|
|
|
|
007f 0101 3e40 407f ]
|