| ... | ... |
@@ -1,13 +1,11 @@ |
| 1 | 1 |
( piano ) |
| 2 | 2 |
|
| 3 | 3 |
%RTN { JMP2r }
|
| 4 |
-%8+ { #0008 ADD2 } %8- { #0008 SUB2 }
|
|
| 5 |
-%8* { #0008 MUL2 } %8/ { #0008 DIV2 }
|
|
| 4 |
+%8+ { #0008 ADD2 }
|
|
| 5 |
+%8/ { #0008 DIV2 }
|
|
| 6 | 6 |
%2/ { #0002 DIV2 }
|
| 7 | 7 |
%++ { #0001 ADD2 }
|
| 8 |
-%MOD { DUP2 DIV MUL SUB }
|
|
| 9 | 8 |
%TOS { #00 SWP }
|
| 10 |
-%PRINT-SHORT { .Console/short DEO2 #0d .Console/char DEO }
|
|
| 11 | 9 |
|
| 12 | 10 |
( devices ) |
| 13 | 11 |
|
| ... | ... |
@@ -30,7 +28,6 @@ |
| 30 | 28 |
|
| 31 | 29 |
@pointer [ &x $2 &y $2 ] |
| 32 | 30 |
@color $1 |
| 33 |
-@rect [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 34 | 31 |
|
| 35 | 32 |
@adsr-view [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
| 36 | 33 |
@wave-view [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
| ... | ... |
@@ -81,9 +78,10 @@ |
| 81 | 78 |
;sine-wave .Audio/addr DEO2 |
| 82 | 79 |
;sine-wave/end ;sine-wave SUB2 #0001 SFT2 .Audio/length DEO2 |
| 83 | 80 |
|
| 84 |
- |
|
| 85 |
- ( background ) |
|
| 86 |
- ;redraw JSR2 |
|
| 81 |
+ ( inital drawing ) |
|
| 82 |
+ ;draw-octave JSR2 |
|
| 83 |
+ ;draw-adsr JSR2 |
|
| 84 |
+ ;draw-wave JSR2 |
|
| 87 | 85 |
|
| 88 | 86 |
BRK |
| 89 | 87 |
|
| ... | ... |
@@ -123,11 +121,9 @@ BRK |
| 123 | 121 |
.Mouse/x DEI2 .octave-view/x1 PEK2 SUB2 #0008 DIV2 SWP POP #08 NEQ ,&no-mod JNZ |
| 124 | 122 |
.Mouse/y DEI2 .octave-view/y1 PEK2 SUB2 #0008 DIV2 SWP POP |
| 125 | 123 |
DUP #00 NEQ ,&no-incr JNZ |
| 126 |
- .octave PEK #01 ADD .octave POK |
|
| 127 |
- &no-incr |
|
| 124 |
+ .octave PEK #01 ADD .octave POK &no-incr |
|
| 128 | 125 |
DUP #02 NEQ ,&no-decr JNZ |
| 129 |
- .octave PEK #01 SUB .octave POK |
|
| 130 |
- &no-decr |
|
| 126 |
+ .octave PEK #01 SUB .octave POK &no-decr |
|
| 131 | 127 |
POP |
| 132 | 128 |
( release ) #00 .Mouse/state DEO |
| 133 | 129 |
;draw-octave JSR2 |
| ... | ... |
@@ -161,6 +157,7 @@ BRK |
| 161 | 157 |
DUP #f0 AND STH #01 .Mouse/state DEI #10 EQU #0e MUL ADD ADD #0f AND STHr ADD |
| 162 | 158 |
.Audio/adsr #01 ADD DEO &no-r |
| 163 | 159 |
POP |
| 160 |
+ |
|
| 164 | 161 |
( release ) #00 .Mouse/state DEO |
| 165 | 162 |
;draw-adsr JSR2 |
| 166 | 163 |
;draw-cursor JSR2 |
| ... | ... |
@@ -205,7 +202,7 @@ BRK |
| 205 | 202 |
( move ) .Audio/addr DEI2 #0001 ADD2 .Audio/addr DEO2 &no-right |
| 206 | 203 |
POP |
| 207 | 204 |
|
| 208 |
- ;redraw JSR2 |
|
| 205 |
+ ;draw-octave JSR2 |
|
| 209 | 206 |
|
| 210 | 207 |
BRK |
| 211 | 208 |
|
| ... | ... |
@@ -215,14 +212,6 @@ BRK |
| 215 | 212 |
|
| 216 | 213 |
RTN |
| 217 | 214 |
|
| 218 |
-@redraw ( -- ) |
|
| 219 |
- |
|
| 220 |
- ;draw-octave JSR2 |
|
| 221 |
- ;draw-adsr JSR2 |
|
| 222 |
- ;draw-wave JSR2 |
|
| 223 |
- |
|
| 224 |
-RTN |
|
| 225 |
- |
|
| 226 | 215 |
@draw-cursor ( -- ) |
| 227 | 216 |
|
| 228 | 217 |
( clear last cursor ) |
| ... | ... |
@@ -413,28 +402,6 @@ RTN |
| 413 | 402 |
|
| 414 | 403 |
RTN |
| 415 | 404 |
|
| 416 |
-@line-rect ( x1 y1 x2 y2 color -- ) |
|
| 417 |
- |
|
| 418 |
- ( load ) .color POK DUP2 STH2 .rect/y2 POK2 .rect/x2 POK2 DUP2 STH2 .rect/y1 POK2 .rect/x1 POK2 |
|
| 419 |
- STH2r STH2r |
|
| 420 |
- &ver |
|
| 421 |
- ( save ) OVR2 .Screen/y DEO2 |
|
| 422 |
- ( draw ) .rect/x1 PEK2 .Screen/x DEO2 .color PEK DUP .Screen/color DEO |
|
| 423 |
- ( draw ) .rect/x2 PEK2 .Screen/x DEO2 .Screen/color DEO |
|
| 424 |
- ( incr ) SWP2 ++ SWP2 |
|
| 425 |
- OVR2 OVR2 LTS2 ,&ver JNZ |
|
| 426 |
- POP2 POP2 |
|
| 427 |
- .rect/x1 PEK2 .rect/x2 PEK2 |
|
| 428 |
- &hor |
|
| 429 |
- ( save ) OVR2 .Screen/x DEO2 |
|
| 430 |
- ( draw ) .rect/y1 PEK2 .Screen/y DEO2 .color PEK DUP .Screen/color DEO |
|
| 431 |
- ( draw ) .rect/y2 PEK2 .Screen/y DEO2 .Screen/color DEO |
|
| 432 |
- ( incr ) SWP2 ++ SWP2 |
|
| 433 |
- OVR2 OVR2 ++ LTS2 ,&hor JNZ |
|
| 434 |
- POP2 POP2 |
|
| 435 |
- |
|
| 436 |
-RTN |
|
| 437 |
- |
|
| 438 | 405 |
@clear [ |
| 439 | 406 |
0000 0000 0000 0000 ] |
| 440 | 407 |
|