| ... | ... |
@@ -1,59 +1,29 @@ |
| 1 |
-( isometric cube ) |
|
| 1 |
+( Cube3d: |
|
| 2 |
+ Just a cube, y'know ) |
|
| 2 | 3 |
|
| 3 |
-%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
|
|
| 4 |
-%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
|
|
| 5 |
-%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
|
|
| 6 |
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
|
|
| 7 |
- |
|
| 8 |
-%2* { #10 SFT } %2/ { #01 SFT } %2** { #10 SFT2 } %2// { #01 SFT2 }
|
|
| 9 |
-%4* { #20 SFT } %4/ { #02 SFT } %4** { #20 SFT2 } %4// { #02 SFT2 }
|
|
| 10 |
-%8* { #30 SFT } %8/ { #03 SFT } %8** { #30 SFT2 } %8// { #03 SFT2 }
|
|
| 11 |
-%10* { #40 SFT } %10/ { #04 SFT } %10** { #40 SFT2 } %10// { #04 SFT2 }
|
|
| 12 |
-%20* { #50 SFT } %20/ { #05 SFT } %20** { #50 SFT2 } %20// { #05 SFT2 }
|
|
| 13 |
- |
|
| 14 |
-%ABS2 { DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 }
|
|
| 15 |
-%LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
|
|
| 16 |
-%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }
|
|
| 17 |
- |
|
| 18 |
-%DEBUG { ;print-hex/byte JSR2 #0a18 DEO }
|
|
| 19 |
-%DEBUG2 { ;print-hex JSR2 #0a18 DEO }
|
|
| 20 |
-%RTN { JMP2r }
|
|
| 21 |
- |
|
| 22 |
-( devices ) |
|
| 23 |
- |
|
| 24 |
-|00 @System &vector $2 &wst $1 &rst $1 &eaddr $2 &ecode $1 &pad $1 &r $2 &g $2 &b $2 &debug $1 &halt $1 |
|
| 25 |
-|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
| 26 |
- |
|
| 27 |
-( variables ) |
|
| 4 |
+|00 @System &vector $2 &wst $1 &rst $1 &eaddr $2 &ecode $1 &pad $1 &r $2 &g $2 &b $2 &debug $1 &halt $1 |
|
| 5 |
+|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
| 28 | 6 |
|
| 29 | 7 |
|0000 |
| 30 | 8 |
|
| 31 |
-@cube |
|
| 32 |
- &v0 $8 |
|
| 33 |
- &v4 $8 |
|
| 34 | 9 |
@timer $1 |
| 35 | 10 |
@color $1 |
| 36 |
-@line |
|
| 37 |
- &x0 $2 &y0 $2 |
|
| 38 |
- &x $2 &y $2 |
|
| 39 |
- &sx $2 &sy $2 |
|
| 40 |
- &dx $2 &dy $2 |
|
| 41 |
- &e1 $2 &e2 $2 |
|
| 42 |
-@center |
|
| 43 |
- &x $2 &y $2 |
|
| 11 |
+@cube &v0 $8 &v4 $8 |
|
| 12 |
+@line &x $2 &y $2 &dx $2 &dy $2 &e1 $2 |
|
| 13 |
+@center &x $2 &y $2 |
|
| 44 | 14 |
|
| 45 | 15 |
( program ) |
| 46 | 16 |
|
| 47 | 17 |
|0100 ( -> ) |
| 48 | 18 |
|
| 49 | 19 |
( theme ) |
| 50 |
- #0fe5 .System/r DEO2 |
|
| 51 |
- #0fc5 .System/g DEO2 |
|
| 52 |
- #0f25 .System/b DEO2 |
|
| 53 |
- |
|
| 54 |
- .Screen/width DEI2 2// #0040 -- .center/x STZ2 |
|
| 55 |
- .Screen/height DEI2 2// #0040 -- .center/y STZ2 |
|
| 56 |
- |
|
| 20 |
+ #4fcd .System/r DEO2 |
|
| 21 |
+ #4fc3 .System/g DEO2 |
|
| 22 |
+ #dfc2 .System/b DEO2 |
|
| 23 |
+ ( center ) |
|
| 24 |
+ .Screen/width DEI2 #01 SFT2 #0040 SUB2 .center/x STZ2 |
|
| 25 |
+ .Screen/height DEI2 #01 SFT2 #0040 SUB2 .center/y STZ2 |
|
| 26 |
+ ( begin. ) |
|
| 57 | 27 |
;on-frame .Screen/vector DEO2 |
| 58 | 28 |
|
| 59 | 29 |
@on-frame ( -> ) |
| ... | ... |
@@ -71,73 +41,79 @@ BRK |
| 71 | 41 |
#0800 |
| 72 | 42 |
&loop |
| 73 | 43 |
STHk |
| 74 |
- #00 .timer LDZ [ #00 STHkr INC #07 AND #60 SFT ++ ] #00ff AND2 ;table ++ LDA 2/ |
|
| 75 |
- #00 .timer LDZ [ #00 STHkr #60 SFT ++ ] #00ff AND2 ;table ++ LDA 4/ [ #00 STHkr #62 SFT2 ++ ] |
|
| 76 |
- .cube/v0 STHr 2* + STZ2 |
|
| 44 |
+ #00 .timer LDZ [ #00 STHkr INC #07 AND #60 SFT ADD2 ] #00ff AND2 ;table ADD2 LDA #01 SFT |
|
| 45 |
+ #00 .timer LDZ [ #00 STHkr #60 SFT ADD2 ] #00ff AND2 ;table ADD2 LDA #02 SFT [ #00 STHkr #62 SFT2 ADD2 ] |
|
| 46 |
+ .cube/v0 STHr #10 SFT ADD STZ2 |
|
| 77 | 47 |
INC GTHk ,&loop JCN |
| 78 | 48 |
POP2 |
| 79 | 49 |
( vertices ) |
| 80 | 50 |
#0800 |
| 81 | 51 |
&ver-loop |
| 82 |
- DUP 2* .cube + LDZ2 ;draw-vertex JSR2 |
|
| 52 |
+ DUP #10 SFT .cube ADD LDZ2 ;draw-vertex JSR2 |
|
| 83 | 53 |
INC GTHk ,&ver-loop JCN |
| 84 | 54 |
POP2 |
| 85 | 55 |
( lines ) |
| 86 | 56 |
#0400 |
| 87 | 57 |
&line-loop |
| 88 | 58 |
STHk |
| 89 |
- .cube/v0 STHkr 2* + .cube/v0 STHkr INC #03 AND 2* + ;draw-line JSR2 |
|
| 90 |
- .cube/v0 STHkr 2* + .cube/v4 STHkr 2* + ;draw-line JSR2 |
|
| 91 |
- .cube/v4 STHkr 2* + .cube/v4 STHr INC #03 AND 2* + ;draw-line JSR2 |
|
| 59 |
+ .cube/v0 STHkr #10 SFT ADD .cube/v0 STHkr INC #03 AND #10 SFT ADD ,trace JSR |
|
| 60 |
+ .cube/v0 STHkr #10 SFT ADD .cube/v4 STHkr #10 SFT ADD ,trace JSR |
|
| 61 |
+ .cube/v4 STHkr #10 SFT ADD .cube/v4 STHr INC #03 AND #10 SFT ADD ,trace JSR |
|
| 92 | 62 |
INC GTHk ,&line-loop JCN |
| 93 | 63 |
POP2 |
| 94 | 64 |
|
| 95 |
-RTN |
|
| 65 |
+JMP2r |
|
| 96 | 66 |
|
| 97 |
-@draw-line ( a b -- ) |
|
| 67 |
+@trace ( a b -- ) |
|
| 98 | 68 |
|
| 99 | 69 |
STH STH |
| 100 |
- #00 STHkr LDZ .center/x LDZ2 ++ #00 STHr INC LDZ .center/y LDZ2 ++ |
|
| 101 |
- #00 STHkr LDZ .center/x LDZ2 ++ #00 STHr INC LDZ .center/y LDZ2 ++ |
|
| 102 |
- .color LDZ ;line-slow JSR2 |
|
| 70 |
+ #00 STHkr LDZ .center/x LDZ2 ADD2 #00 STHr INC LDZ .center/y LDZ2 ADD2 |
|
| 71 |
+ #00 STHkr LDZ .center/x LDZ2 ADD2 #00 STHr INC LDZ .center/y LDZ2 ADD2 |
|
| 72 |
+ .color LDZ ;draw-line JSR2 |
|
| 103 | 73 |
|
| 104 |
-RTN |
|
| 74 |
+JMP2r |
|
| 105 | 75 |
|
| 106 | 76 |
@draw-vertex ( x y -- ) |
| 107 | 77 |
|
| 108 |
- #00 SWP #0004 -- .center/y LDZ2 ++ .Screen/y DEO2 |
|
| 109 |
- #00 SWP #0003 -- .center/x LDZ2 ++ .Screen/x DEO2 |
|
| 78 |
+ #00 SWP #0004 SUB2 .center/y LDZ2 ADD2 .Screen/y DEO2 |
|
| 79 |
+ #00 SWP #0003 SUB2 .center/x LDZ2 ADD2 .Screen/x DEO2 |
|
| 110 | 80 |
;&icn .Screen/addr DEO2 |
| 111 |
- .color LDZ 2* .Screen/sprite DEO |
|
| 81 |
+ .color LDZ .Screen/sprite DEO |
|
| 112 | 82 |
|
| 113 |
-RTN |
|
| 83 |
+JMP2r |
|
| 114 | 84 |
&icn 0000 387c 7c7c 3800 |
| 115 | 85 |
|
| 116 |
-@line-slow ( x1 y1 x2 y2 color -- ) |
|
| 117 |
- |
|
| 118 |
- ( load ) .color STZ #0001 SUB2 .line/y0 STZ2 #0001 SUB2 .line/x0 STZ2 .line/y STZ2 .line/x STZ2 |
|
| 119 |
- .line/x0 LDZ2 .line/x LDZ2 SUB2 ABS2 .line/dx STZ2 |
|
| 120 |
- .line/y0 LDZ2 .line/y LDZ2 SUB2 ABS2 #0000 SWP2 SUB2 .line/dy STZ2 |
|
| 121 |
- #ffff #00 .line/x LDZ2 .line/x0 LDZ2 LTS2 2** ADD2 .line/sx STZ2 |
|
| 122 |
- #ffff #00 .line/y LDZ2 .line/y0 LDZ2 LTS2 2** ADD2 .line/sy STZ2 |
|
| 86 |
+@draw-line ( x1* y1* x2* y2* color -- ) |
|
| 87 |
+ |
|
| 88 |
+ ( load ) STH ,&y STR2 ,&x STR2 .line/y STZ2 .line/x STZ2 |
|
| 89 |
+ ,&x LDR2 .line/x LDZ2 SUB2 ;abs2 JSR2 .line/dx STZ2 |
|
| 90 |
+ #0000 ,&y LDR2 .line/y LDZ2 SUB2 ;abs2 JSR2 SUB2 .line/dy STZ2 |
|
| 91 |
+ #ffff #00 .line/x LDZ2 ,&x LDR2 ;lts2 JSR2 #10 SFT2 ADD2 ,&sx STR2 |
|
| 92 |
+ #ffff #00 .line/y LDZ2 ,&y LDR2 ;lts2 JSR2 #10 SFT2 ADD2 ,&sy STR2 |
|
| 123 | 93 |
.line/dx LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2 |
| 124 | 94 |
&loop |
| 125 |
- .line/x LDZ2 .Screen/x DEO2 .line/y LDZ2 .Screen/y DEO2 .color LDZ .Screen/pixel DEO |
|
| 126 |
- .line/x LDZ2 .line/x0 LDZ2 EQU2 .line/y LDZ2 .line/y0 LDZ2 EQU2 #0101 EQU2 ,&end JCN |
|
| 127 |
- .line/e1 LDZ2 2** .line/e2 STZ2 |
|
| 128 |
- .line/e2 LDZ2 .line/dy LDZ2 LTS2 ,&skipy JCN |
|
| 95 |
+ .line/x LDZ2 DUP2 .Screen/x DEO2 [ LIT2 &x $2 ] EQU2 |
|
| 96 |
+ .line/y LDZ2 DUP2 .Screen/y DEO2 [ LIT2 &y $2 ] EQU2 |
|
| 97 |
+ STHkr .Screen/pixel DEO |
|
| 98 |
+ AND ,&end JCN |
|
| 99 |
+ .line/e1 LDZ2 #10 SFT2 DUP2 |
|
| 100 |
+ .line/dy LDZ2 ;lts2 JSR2 ,&skipy JCN |
|
| 129 | 101 |
.line/e1 LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2 |
| 130 |
- .line/x LDZ2 .line/sx LDZ2 ADD2 .line/x STZ2 |
|
| 102 |
+ .line/x LDZ2 [ LIT2 &sx $2 ] ADD2 .line/x STZ2 |
|
| 131 | 103 |
&skipy |
| 132 |
- .line/e2 LDZ2 .line/dx LDZ2 GTS2 ,&skipx JCN |
|
| 104 |
+ .line/dx LDZ2 ;gts2 JSR2 ,&skipx JCN |
|
| 133 | 105 |
.line/e1 LDZ2 .line/dx LDZ2 ADD2 .line/e1 STZ2 |
| 134 |
- .line/y LDZ2 .line/sy LDZ2 ADD2 .line/y STZ2 |
|
| 106 |
+ .line/y LDZ2 [ LIT2 &sy $2 ] ADD2 .line/y STZ2 |
|
| 135 | 107 |
&skipx |
| 136 |
- ;&loop JMP2 |
|
| 137 |
- |
|
| 108 |
+ ,&loop JMP |
|
| 138 | 109 |
&end |
| 110 |
+ POPr |
|
| 111 |
+ |
|
| 112 |
+JMP2r |
|
| 139 | 113 |
|
| 140 |
-RTN |
|
| 114 |
+@abs2 DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 JMP2r |
|
| 115 |
+@lts2 #8000 ADD2 SWP2 #8000 ADD2 GTH2 JMP2r |
|
| 116 |
+@gts2 #8000 ADD2 SWP2 #8000 ADD2 LTH2 JMP2r |
|
| 141 | 117 |
|
| 142 | 118 |
@table ( 256 xy ) |
| 143 | 119 |
f7f8 f9fa fbfc fcfd fefe ffff ffff ffff |
| 144 | 120 |
deleted file mode 100644 |
| ... | ... |
@@ -1,731 +0,0 @@ |
| 1 |
-( drum rack ) |
|
| 2 |
- |
|
| 3 |
-%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
|
|
| 4 |
-%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
|
|
| 5 |
-%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
|
|
| 6 |
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
|
|
| 7 |
- |
|
| 8 |
-%2** { #10 SFT2 } %2// { #01 SFT2 }
|
|
| 9 |
-%4** { #20 SFT2 } %4// { #02 SFT2 }
|
|
| 10 |
-%8** { #30 SFT2 } %8// { #03 SFT2 }
|
|
| 11 |
-%10** { #40 SFT2 }
|
|
| 12 |
- |
|
| 13 |
-%TOB { NIP } %TOS { #00 SWP }
|
|
| 14 |
-%RTN { JMP2r }
|
|
| 15 |
-%MOD { DUP2 / * - }
|
|
| 16 |
-%LTS2 { #8000 ++ SWP2 #8000 ++ >> } %GTS2 { #8000 ++ SWP2 #8000 ++ << }
|
|
| 17 |
- |
|
| 18 |
-%PAD-WIDTH { #0030 }
|
|
| 19 |
-%PAD-HEIGHT { #0020 }
|
|
| 20 |
- |
|
| 21 |
-( devices ) |
|
| 22 |
- |
|
| 23 |
-|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |
|
| 24 |
-|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 ] |
|
| 25 |
-|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] |
|
| 26 |
-|30 @Audio0 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |
|
| 27 |
-|40 @Audio1 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |
|
| 28 |
-|50 @Audio2 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |
|
| 29 |
-|60 @Audio3 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |
|
| 30 |
-|70 @Midi [ &vector $2 &channel $1 ¬e $1 &velocity $1 ] |
|
| 31 |
-|80 @Controller [ &vector $2 &button $1 &key $1 ] |
|
| 32 |
-|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] |
|
| 33 |
-|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 ] |
|
| 34 |
- |
|
| 35 |
-( variables ) |
|
| 36 |
- |
|
| 37 |
-|0000 |
|
| 38 |
- |
|
| 39 |
-@center [ &x $2 &y $2 ] |
|
| 40 |
-@pointer [ &x $2 &y $2 ] |
|
| 41 |
-@piano [ &last $1 &octave $1 ] |
|
| 42 |
-@pads [ &last $1 ] |
|
| 43 |
-@frame [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 44 |
-@pad-view [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 45 |
-@mix-view [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 46 |
-@oct-view [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 47 |
-@wav-view [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 48 |
- |
|
| 49 |
-( TODO: remove ) |
|
| 50 |
-@color $1 |
|
| 51 |
-@rect [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 52 |
- |
|
| 53 |
-@modes [ $1 $1 $1 $1 ] ( single/repeat ) |
|
| 54 |
- |
|
| 55 |
-( program ) |
|
| 56 |
- |
|
| 57 |
-|0100 ( -> ) |
|
| 58 |
- |
|
| 59 |
- ( theme ) |
|
| 60 |
- #0fe5 .System/r DEO2 |
|
| 61 |
- #0fc5 .System/g DEO2 |
|
| 62 |
- #0f25 .System/b DEO2 |
|
| 63 |
- |
|
| 64 |
- ( vectors ) |
|
| 65 |
- ;on-control .Controller/vector DEO2 |
|
| 66 |
- ;on-mouse .Mouse/vector DEO2 |
|
| 67 |
- ;on-frame .Screen/vector DEO2 |
|
| 68 |
- ;on-message .Console/vector DEO2 |
|
| 69 |
- |
|
| 70 |
- ( channel defaults ) |
|
| 71 |
- #dd .Audio0/volume DEO |
|
| 72 |
- #0118 .Audio0/adsr DEO2 |
|
| 73 |
- #0200 .Audio0/length DEO2 |
|
| 74 |
- #ce .Audio1/volume DEO |
|
| 75 |
- #0334 .Audio1/adsr DEO2 |
|
| 76 |
- #0800 .Audio1/length DEO2 |
|
| 77 |
- #ec .Audio2/volume DEO |
|
| 78 |
- #0414 .Audio2/adsr DEO2 |
|
| 79 |
- #0800 .Audio2/length DEO2 |
|
| 80 |
- #ee .Audio3/volume DEO |
|
| 81 |
- #022c .Audio3/adsr DEO2 |
|
| 82 |
- #1000 .Audio3/length DEO2 |
|
| 83 |
- |
|
| 84 |
- ( defaults ) |
|
| 85 |
- #01 .modes STZ |
|
| 86 |
- #01 .piano/octave STZ |
|
| 87 |
- |
|
| 88 |
- ( find center ) |
|
| 89 |
- .Screen/width DEI2 2// .center/x STZ2 |
|
| 90 |
- .Screen/height DEI2 2// .center/y STZ2 |
|
| 91 |
- |
|
| 92 |
- ( place frame ) |
|
| 93 |
- .center/x LDZ2 PAD-WIDTH #0003 ** -- #0010 -- .frame/x1 STZ2 |
|
| 94 |
- .center/y LDZ2 #0050 -- .frame/y1 STZ2 |
|
| 95 |
- .center/x LDZ2 PAD-WIDTH #0003 ** ++ #0010 ++ .frame/x2 STZ2 |
|
| 96 |
- .frame/y1 LDZ2 PAD-HEIGHT 4** ++ #0028 ++ .frame/y2 STZ2 |
|
| 97 |
- |
|
| 98 |
- ( place pad-view ) |
|
| 99 |
- .frame/x1 LDZ2 .pad-view/x1 STZ2 |
|
| 100 |
- .frame/y1 LDZ2 .pad-view/y1 STZ2 |
|
| 101 |
- .pad-view/x1 LDZ2 #0004 PAD-WIDTH ** ++ .pad-view/x2 STZ2 |
|
| 102 |
- .pad-view/y1 LDZ2 #0004 PAD-HEIGHT ** ++ .pad-view/y2 STZ2 |
|
| 103 |
- |
|
| 104 |
- ( place mix-view ) |
|
| 105 |
- .pad-view/x2 LDZ2 #0006 ++ .mix-view/x1 STZ2 |
|
| 106 |
- .pad-view/y1 LDZ2 .mix-view/y1 STZ2 |
|
| 107 |
- .mix-view/x1 LDZ2 #007a ++ .mix-view/x2 STZ2 |
|
| 108 |
- .pad-view/y2 LDZ2 .mix-view/y2 STZ2 |
|
| 109 |
- |
|
| 110 |
- ( place oct-view ) |
|
| 111 |
- .frame/x1 LDZ2 .oct-view/x1 STZ2 |
|
| 112 |
- .mix-view/y2 LDZ2 #0004 ++ .oct-view/y1 STZ2 |
|
| 113 |
- .oct-view/x1 LDZ2 #0050 ++ .oct-view/x2 STZ2 |
|
| 114 |
- .oct-view/y1 LDZ2 #0018 ++ .oct-view/y2 STZ2 |
|
| 115 |
- |
|
| 116 |
- ( place wav-view ) |
|
| 117 |
- .oct-view/x2 LDZ2 .wav-view/x1 STZ2 |
|
| 118 |
- .mix-view/y2 LDZ2 #0004 ++ .wav-view/y1 STZ2 |
|
| 119 |
- .frame/x2 LDZ2 .wav-view/x2 STZ2 |
|
| 120 |
- .wav-view/y1 LDZ2 #0020 ++ .wav-view/y2 STZ2 |
|
| 121 |
- |
|
| 122 |
- ( draw outlines ) |
|
| 123 |
- .mix-view/x1 LDZ2 #0004 -- |
|
| 124 |
- .mix-view/y1 LDZ2 #0000 -- |
|
| 125 |
- .mix-view/x2 LDZ2 #0002 -- |
|
| 126 |
- .mix-view/y2 LDZ2 #0002 -- |
|
| 127 |
- #01 ;line-rect JSR2 |
|
| 128 |
- .wav-view/x1 LDZ2 #0000 -- |
|
| 129 |
- .wav-view/y1 LDZ2 #0002 -- |
|
| 130 |
- .wav-view/x2 LDZ2 #0002 -- |
|
| 131 |
- .wav-view/y2 LDZ2 #0002 ++ |
|
| 132 |
- #01 ;line-rect JSR2 |
|
| 133 |
- |
|
| 134 |
- ( initial draw ) |
|
| 135 |
- #00 #10 |
|
| 136 |
- &draw-pads |
|
| 137 |
- ( load sample ) |
|
| 138 |
- OVR TOS #0019 ** ;pad-path ++ .File/name DEO2 |
|
| 139 |
- OVR #04 / #40 SFT .Audio0/length + DEI2 .File/length DEO2 |
|
| 140 |
- OVR TOS 2** ;pad-addr ++ LDA2 .File/read DEO2 |
|
| 141 |
- ( draw pad ) |
|
| 142 |
- OVR #01 ;draw-pad JSR2 |
|
| 143 |
- ( draw mixer ) |
|
| 144 |
- OVR #04 / ;draw-mixer JSR2 |
|
| 145 |
- ( incr ) SWP INC SWP |
|
| 146 |
- LTHk ,&draw-pads JCN |
|
| 147 |
- POP2 |
|
| 148 |
- |
|
| 149 |
- ;draw-octave JSR2 |
|
| 150 |
- |
|
| 151 |
-BRK |
|
| 152 |
- |
|
| 153 |
-@on-message ( -> ) |
|
| 154 |
- |
|
| 155 |
- .Console/read DEI #0f AND ;play-pad JSR2 |
|
| 156 |
- |
|
| 157 |
-BRK |
|
| 158 |
- |
|
| 159 |
-@on-frame ( -> ) |
|
| 160 |
- |
|
| 161 |
- ( update VU monitors ) |
|
| 162 |
- #00 #04 |
|
| 163 |
- &loop |
|
| 164 |
- OVR STH |
|
| 165 |
- ( x ) .mix-view/x1 LDZ2 #0074 ++ |
|
| 166 |
- ( y ) .mix-view/y1 LDZ2 PAD-HEIGHT STHkr TOS ** ++ #0002 ++ |
|
| 167 |
- ( output ) .Audio0/output STHr #40 SFT + DEI |
|
| 168 |
- ;draw-monitor JSR2 |
|
| 169 |
- ( incr ) SWP INC SWP |
|
| 170 |
- LTHk ,&loop JCN |
|
| 171 |
- POP2 |
|
| 172 |
- |
|
| 173 |
-BRK |
|
| 174 |
- |
|
| 175 |
-@on-mouse ( -> ) |
|
| 176 |
- |
|
| 177 |
- ;draw-cursor JSR2 |
|
| 178 |
- |
|
| 179 |
- .Mouse/state DEI #00 ! #01 JCN [ BRK ] |
|
| 180 |
- |
|
| 181 |
- .Mouse/x DEI2 DUP2 .pad-view/x1 LDZ2 >> ROT ROT .pad-view/x2 LDZ2 INC2 << #0101 == |
|
| 182 |
- .Mouse/y DEI2 DUP2 .pad-view/y1 LDZ2 >> ROT ROT .pad-view/y2 LDZ2 << #0101 == |
|
| 183 |
- #0101 == ;on-touch-pad JCN2 |
|
| 184 |
- |
|
| 185 |
- .Mouse/x DEI2 DUP2 .mix-view/x1 LDZ2 >> ROT ROT .mix-view/x2 LDZ2 INC2 << #0101 == |
|
| 186 |
- .Mouse/y DEI2 DUP2 .mix-view/y1 LDZ2 >> ROT ROT .mix-view/y2 LDZ2 << #0101 == |
|
| 187 |
- #0101 == ;on-touch-mix JCN2 |
|
| 188 |
- |
|
| 189 |
- .Mouse/x DEI2 DUP2 .oct-view/x1 LDZ2 >> ROT ROT .oct-view/x2 LDZ2 INC2 << #0101 == |
|
| 190 |
- .Mouse/y DEI2 DUP2 .oct-view/y1 LDZ2 >> ROT ROT .oct-view/y2 LDZ2 << #0101 == |
|
| 191 |
- #0101 == ;on-touch-oct JCN2 |
|
| 192 |
- |
|
| 193 |
-BRK |
|
| 194 |
- |
|
| 195 |
-@on-control ( -> ) |
|
| 196 |
- |
|
| 197 |
- .Controller/key DEI #00 ! #01 JCN [ BRK ] |
|
| 198 |
- |
|
| 199 |
- .Controller/key DEI |
|
| 200 |
- DUP #31 ! ,&no-0 JCN #00 ;play-pad JSR2 &no-0 |
|
| 201 |
- DUP #32 ! ,&no-1 JCN #01 ;play-pad JSR2 &no-1 |
|
| 202 |
- DUP #33 ! ,&no-2 JCN #02 ;play-pad JSR2 &no-2 |
|
| 203 |
- DUP #34 ! ,&no-3 JCN #03 ;play-pad JSR2 &no-3 |
|
| 204 |
- DUP #71 ! ,&no-4 JCN #04 ;play-pad JSR2 &no-4 |
|
| 205 |
- DUP #77 ! ,&no-5 JCN #05 ;play-pad JSR2 &no-5 |
|
| 206 |
- DUP #65 ! ,&no-6 JCN #06 ;play-pad JSR2 &no-6 |
|
| 207 |
- DUP #72 ! ,&no-7 JCN #07 ;play-pad JSR2 &no-7 |
|
| 208 |
- DUP #61 ! ,&no-8 JCN #08 ;play-pad JSR2 &no-8 |
|
| 209 |
- DUP #73 ! ,&no-9 JCN #09 ;play-pad JSR2 &no-9 |
|
| 210 |
- DUP #64 ! ,&no-a JCN #0a ;play-pad JSR2 &no-a |
|
| 211 |
- DUP #66 ! ,&no-b JCN #0b ;play-pad JSR2 &no-b |
|
| 212 |
- DUP #7a ! ,&no-c JCN #0c ;play-pad JSR2 &no-c |
|
| 213 |
- DUP #78 ! ,&no-d JCN #0d ;play-pad JSR2 &no-d |
|
| 214 |
- DUP #63 ! ,&no-e JCN #0e ;play-pad JSR2 &no-e |
|
| 215 |
- DUP #76 ! ,&no-f JCN #0f ;play-pad JSR2 &no-f |
|
| 216 |
- POP |
|
| 217 |
- |
|
| 218 |
-BRK |
|
| 219 |
- |
|
| 220 |
-@on-touch-pad ( -> ) |
|
| 221 |
- |
|
| 222 |
- ( x ) .Mouse/x DEI2 .pad-view/x1 LDZ2 -- PAD-WIDTH // TOB |
|
| 223 |
- ( y ) .Mouse/y DEI2 .pad-view/y1 LDZ2 -- PAD-HEIGHT // TOB #20 SFT + |
|
| 224 |
- |
|
| 225 |
- DUP SWP ;play-pad JSR2 |
|
| 226 |
- |
|
| 227 |
- ;draw-waveform JSR2 |
|
| 228 |
- |
|
| 229 |
- ( release ) #00 .Mouse/state DEO |
|
| 230 |
- |
|
| 231 |
-BRK |
|
| 232 |
- |
|
| 233 |
-@on-touch-mix ( -> ) |
|
| 234 |
- |
|
| 235 |
- ( channel ) .Mouse/y DEI2 .mix-view/y1 LDZ2 -- PAD-HEIGHT // TOB STH |
|
| 236 |
- ( knob ) .Mouse/x DEI2 .mix-view/x1 LDZ2 -- #0010 // TOB |
|
| 237 |
- ( adsr ) |
|
| 238 |
- DUP #00 ! ,&no-a JCN |
|
| 239 |
- .Audio0/adsr [ STHkr #40 SFT + ] DEI |
|
| 240 |
- #10 .Mouse/state DEI #10 = #e0 * + + |
|
| 241 |
- .Audio0/adsr [ STHkr #40 SFT + ] DEO &no-a |
|
| 242 |
- DUP #01 ! ,&no-d JCN |
|
| 243 |
- .Audio0/adsr [ STHkr #40 SFT + ] DEI |
|
| 244 |
- DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + |
|
| 245 |
- .Audio0/adsr [ STHkr #40 SFT + ] DEO &no-d |
|
| 246 |
- DUP #02 ! ,&no-s JCN |
|
| 247 |
- .Audio0/adsr [ STHkr #40 SFT + ] INC DEI |
|
| 248 |
- #10 .Mouse/state DEI #10 = #e0 * + + |
|
| 249 |
- .Audio0/adsr [ STHkr #40 SFT + ] INC DEO &no-s |
|
| 250 |
- DUP #03 ! ,&no-r JCN |
|
| 251 |
- .Audio0/adsr [ STHkr #40 SFT + ] INC DEI |
|
| 252 |
- DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + |
|
| 253 |
- .Audio0/adsr [ STHkr #40 SFT + ] INC DEO &no-r |
|
| 254 |
- ( modes ) |
|
| 255 |
- DUP #04 ! ,&no-repeat JCN |
|
| 256 |
- .modes [ STHkr + ] LDZ |
|
| 257 |
- #00 = |
|
| 258 |
- .modes [ STHkr + ] STZ &no-repeat |
|
| 259 |
- ( volume ) |
|
| 260 |
- DUP #05 ! ,&no-left JCN |
|
| 261 |
- .Audio0/volume [ STHkr #40 SFT + ] DEI |
|
| 262 |
- #10 .Mouse/state DEI #10 = #e0 * + + |
|
| 263 |
- .Audio0/volume [ STHkr #40 SFT + ] DEO &no-left |
|
| 264 |
- DUP #06 ! ,&no-right JCN |
|
| 265 |
- .Audio0/volume [ STHkr #40 SFT + ] DEI |
|
| 266 |
- DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + |
|
| 267 |
- .Audio0/volume [ STHkr #40 SFT + ] DEO &no-right |
|
| 268 |
- POP |
|
| 269 |
- |
|
| 270 |
- ( release ) #00 .Mouse/state DEO |
|
| 271 |
- |
|
| 272 |
- STHkr ;draw-mixer JSR2 |
|
| 273 |
- |
|
| 274 |
- POPr |
|
| 275 |
- |
|
| 276 |
-BRK |
|
| 277 |
- |
|
| 278 |
-@on-touch-oct ( -> ) |
|
| 279 |
- |
|
| 280 |
- .Mouse/x DEI2 .oct-view/x1 LDZ2 -- 8// TOB #08 ! ,&no-mod JCN |
|
| 281 |
- .Mouse/y DEI2 .oct-view/y1 LDZ2 -- 8// TOB |
|
| 282 |
- DUP #00 ! ,&no-incr JCN |
|
| 283 |
- .piano/octave LDZ INC .piano/octave STZ &no-incr |
|
| 284 |
- DUP #02 ! ,&no-decr JCN |
|
| 285 |
- .piano/octave LDZ #01 - .piano/octave STZ &no-decr |
|
| 286 |
- POP |
|
| 287 |
- ( release ) #00 .Mouse/state DEO |
|
| 288 |
- ;draw-octave JSR2 |
|
| 289 |
- BRK |
|
| 290 |
- &no-mod |
|
| 291 |
- |
|
| 292 |
- .Mouse/x DEI2 .oct-view/x1 LDZ2 -- 8// TOB #06 GTH ,&no-key JCN |
|
| 293 |
- .Mouse/x DEI2 .oct-view/x1 LDZ2 -- 8// |
|
| 294 |
- ( set pitch of pad ) |
|
| 295 |
- DUP2 ;notes ++ LDA .pads/last LDZ SWP .piano/octave LDZ #02 - #0c * + |
|
| 296 |
- ( save ) SWP TOS ;pad-pitch ++ STA |
|
| 297 |
- ( record last note ) |
|
| 298 |
- TOB .piano/last STZ |
|
| 299 |
- .pads/last LDZ ;play-pad JSR2 |
|
| 300 |
- ( release ) #00 .Mouse/state DEO |
|
| 301 |
- ;draw-octave JSR2 |
|
| 302 |
- &no-key |
|
| 303 |
- |
|
| 304 |
-BRK |
|
| 305 |
- |
|
| 306 |
-@play-pad ( pad -- ) |
|
| 307 |
- |
|
| 308 |
- ( unselect last ) |
|
| 309 |
- .pads/last LDZ #01 ;draw-pad JSR2 |
|
| 310 |
- DUP .pads/last STZ |
|
| 311 |
- ( highlight ) |
|
| 312 |
- DUP #02 ;draw-pad JSR2 |
|
| 313 |
- ( addr ) |
|
| 314 |
- DUP TOS 2** ;pad-addr ++ LDA2 STH2 |
|
| 315 |
- DUP #04 / #40 SFT .Audio0/addr + STH2r ROT DEO2 |
|
| 316 |
- ( pitch ) |
|
| 317 |
- DUP TOS ;pad-pitch ++ LDA STH |
|
| 318 |
- DUP #04 / .modes + LDZ #00 = #70 SFT STH ADDr |
|
| 319 |
- DUP #04 / #40 SFT .Audio0/pitch + STHr SWP DEO |
|
| 320 |
- #04 / ;draw-mixer JSR2 |
|
| 321 |
- |
|
| 322 |
-RTN |
|
| 323 |
- |
|
| 324 |
-@draw-waveform ( pad -- ) |
|
| 325 |
- |
|
| 326 |
- ( stash address ) |
|
| 327 |
- DUP ADD #00 SWP ;pad-addr ++ LDA2 STH2 |
|
| 328 |
- |
|
| 329 |
- ( clear ) |
|
| 330 |
- .wav-view/x1 LDZ2 #0002 ++ |
|
| 331 |
- .wav-view/y1 LDZ2 |
|
| 332 |
- .wav-view/x2 LDZ2 #0002 -- |
|
| 333 |
- .wav-view/y2 LDZ2 |
|
| 334 |
- #00 ;fill-rect JSR2 |
|
| 335 |
- |
|
| 336 |
- .wav-view/x1 LDZ2 #0002 ++ .Screen/x DEO2 |
|
| 337 |
- |
|
| 338 |
- ( waveform ) |
|
| 339 |
- #00 #e8 |
|
| 340 |
- &loop |
|
| 341 |
- ( dotted line ) |
|
| 342 |
- OVR #01 AND ,&no-dot JCN |
|
| 343 |
- .wav-view/y1 LDZ2 #0010 ++ .Screen/y DEO2 |
|
| 344 |
- #01 .Screen/pixel DEO |
|
| 345 |
- &no-dot |
|
| 346 |
- OVR TOS 10** [ DUP2r STH2r ] ++ LDA |
|
| 347 |
- #02 / |
|
| 348 |
- TOS 4// .wav-view/y1 LDZ2 ++ .Screen/y DEO2 |
|
| 349 |
- .Screen/x DEI2 INC2 .Screen/x DEO2 |
|
| 350 |
- ( draw ) #02 .Screen/pixel DEO |
|
| 351 |
- ( incr ) SWP INC SWP |
|
| 352 |
- LTHk ,&loop JCN |
|
| 353 |
- POP2 |
|
| 354 |
- POP2r |
|
| 355 |
- |
|
| 356 |
-RTN |
|
| 357 |
- |
|
| 358 |
-@draw-mixer ( mixer -- ) |
|
| 359 |
- |
|
| 360 |
- STHk #00 SWP PAD-HEIGHT ** .mix-view/y1 LDZ2 ++ #0003 ++ |
|
| 361 |
- |
|
| 362 |
- ( adsr ) |
|
| 363 |
- DUP2 .mix-view/x1 LDZ2 SWP2 |
|
| 364 |
- .Audio0/adsr [ STHkr #40 SFT + ] DEI #04 SFT ;draw-knob JSR2 |
|
| 365 |
- DUP2 .mix-view/x1 LDZ2 #0010 ++ SWP2 |
|
| 366 |
- .Audio0/adsr [ STHkr #40 SFT + ] DEI #0f AND ;draw-knob JSR2 |
|
| 367 |
- DUP2 .mix-view/x1 LDZ2 #0020 ++ SWP2 |
|
| 368 |
- .Audio0/adsr [ STHkr #40 SFT + ] INC DEI #04 SFT ;draw-knob JSR2 |
|
| 369 |
- DUP2 .mix-view/x1 LDZ2 #0030 ++ SWP2 |
|
| 370 |
- .Audio0/adsr [ STHkr #40 SFT + ] INC DEI #0f AND ;draw-knob JSR2 |
|
| 371 |
- ( once/repeat ) |
|
| 372 |
- DUP2 .mix-view/x1 LDZ2 #0040 ++ SWP2 |
|
| 373 |
- .modes [ STHkr + ] LDZ ;draw-switch JSR2 |
|
| 374 |
- ( volume ) |
|
| 375 |
- DUP2 .mix-view/x1 LDZ2 #0050 ++ SWP2 |
|
| 376 |
- .Audio0/volume [ STHkr #40 SFT + ] DEI #04 SFT ;draw-knob JSR2 |
|
| 377 |
- DUP2 .mix-view/x1 LDZ2 #0060 ++ SWP2 |
|
| 378 |
- .Audio0/volume [ STHkr #40 SFT + ] DEI #0f AND ;draw-knob JSR2 |
|
| 379 |
- POP2 |
|
| 380 |
- POPr |
|
| 381 |
- |
|
| 382 |
-RTN |
|
| 383 |
- |
|
| 384 |
-@draw-pad ( pad color -- ) |
|
| 385 |
- |
|
| 386 |
- STH STH |
|
| 387 |
- |
|
| 388 |
- STHkr |
|
| 389 |
- |
|
| 390 |
- DUP #04 / SWP #03 AND TOS PAD-WIDTH ** ( center ) .pad-view/x1 LDZ2 ++ |
|
| 391 |
- ROT TOS PAD-HEIGHT ** ( center ) .pad-view/y1 LDZ2 ++ |
|
| 392 |
- |
|
| 393 |
- ( draw outline ) |
|
| 394 |
- OVR2 OVR2 |
|
| 395 |
- OVR2 PAD-WIDTH #0002 -- ++ |
|
| 396 |
- OVR2 PAD-HEIGHT #0002 -- ++ |
|
| 397 |
- OVRr STHr ;line-rect JSR2 |
|
| 398 |
- |
|
| 399 |
- ( draw name ) |
|
| 400 |
- OVR2 #0002 ++ |
|
| 401 |
- OVR2 #0002 ++ |
|
| 402 |
- ;pad-name STHkr TOS #0005 ** ++ |
|
| 403 |
- #00 OVRr STHr + |
|
| 404 |
- ;draw-label JSR2 |
|
| 405 |
- |
|
| 406 |
- ( draw note ) |
|
| 407 |
- OVR2 #0003 ++ .Screen/x DEO2 |
|
| 408 |
- DUP2 #0014 ++ .Screen/y DEO2 |
|
| 409 |
- ( get pitch ) STHkr TOS ;pad-pitch ++ LDA |
|
| 410 |
- #0c / TOS 8** ;font-hex ++ .Screen/addr DEO2 |
|
| 411 |
- #01 .Screen/sprite DEO |
|
| 412 |
- |
|
| 413 |
- ( draw octave ) |
|
| 414 |
- OVR2 #000b ++ .Screen/x DEO2 |
|
| 415 |
- DUP2 #0014 ++ .Screen/y DEO2 |
|
| 416 |
- ( get pitch ) STHkr TOS ;pad-pitch ++ LDA |
|
| 417 |
- #0c MOD TOS 8** ;font-notes ++ .Screen/addr DEO2 |
|
| 418 |
- #01 .Screen/sprite DEO |
|
| 419 |
- |
|
| 420 |
- POP2 POP2 |
|
| 421 |
- |
|
| 422 |
- POPr POPr |
|
| 423 |
- |
|
| 424 |
-RTN |
|
| 425 |
- |
|
| 426 |
-@draw-octave ( -- ) |
|
| 427 |
- |
|
| 428 |
- .oct-view/x1 LDZ2 .oct-view/y1 LDZ2 |
|
| 429 |
- |
|
| 430 |
- OVR2 OVR2 ;keys-left-icns #01 .piano/last LDZ #00 = + ;draw-key JSR2 |
|
| 431 |
- OVR2 #0008 ++ OVR2 ;keys-middle-icns #01 .piano/last LDZ #01 = + ;draw-key JSR2 |
|
| 432 |
- OVR2 #0010 ++ OVR2 ;keys-right-icns #01 .piano/last LDZ #02 = + ;draw-key JSR2 |
|
| 433 |
- OVR2 #0018 ++ OVR2 ;keys-left-icns #01 .piano/last LDZ #03 = + ;draw-key JSR2 |
|
| 434 |
- OVR2 #0020 ++ OVR2 ;keys-middle-icns #01 .piano/last LDZ #04 = + ;draw-key JSR2 |
|
| 435 |
- OVR2 #0028 ++ OVR2 ;keys-middle-icns #01 .piano/last LDZ #05 = + ;draw-key JSR2 |
|
| 436 |
- SWP2 #0030 ++ SWP2 ;keys-right-icns #01 .piano/last LDZ #06 = + ;draw-key JSR2 |
|
| 437 |
- |
|
| 438 |
- .oct-view/x1 LDZ2 #0040 ++ .Screen/x DEO2 |
|
| 439 |
- |
|
| 440 |
- ;arrow-icns .Screen/addr DEO2 |
|
| 441 |
- .oct-view/y1 LDZ2 .Screen/y DEO2 |
|
| 442 |
- #01 .Screen/sprite DEO |
|
| 443 |
- |
|
| 444 |
- ;arrow-icns #0008 ++ .Screen/addr DEO2 |
|
| 445 |
- .oct-view/y1 LDZ2 #0010 ++ .Screen/y DEO2 |
|
| 446 |
- #01 .Screen/sprite DEO |
|
| 447 |
- |
|
| 448 |
- ;font-hex .piano/octave LDZ #03 + #00 SWP 8** ++ .Screen/addr DEO2 |
|
| 449 |
- .oct-view/y1 LDZ2 #0008 ++ .Screen/y DEO2 |
|
| 450 |
- #03 .Screen/sprite DEO |
|
| 451 |
- |
|
| 452 |
-RTN |
|
| 453 |
- |
|
| 454 |
-@draw-monitor ( x* y* stereo -- ) |
|
| 455 |
- |
|
| 456 |
- STH |
|
| 457 |
- |
|
| 458 |
- .Screen/y DEO2 |
|
| 459 |
- .Screen/x DEO2 |
|
| 460 |
- |
|
| 461 |
- #00 #0f |
|
| 462 |
- &loop |
|
| 463 |
- OVR #10 SWP - STHkr #0f AND < INC .Screen/pixel DEO |
|
| 464 |
- .Screen/x DEI2 #0002 ++ .Screen/x DEO2 |
|
| 465 |
- OVR #10 SWP - STHkr #04 SFT < INC .Screen/pixel DEO |
|
| 466 |
- .Screen/x DEI2 #0002 -- .Screen/x DEO2 |
|
| 467 |
- .Screen/y DEI2 #0002 ++ .Screen/y DEO2 |
|
| 468 |
- ( incr ) SWP INC SWP |
|
| 469 |
- LTHk ,&loop JCN |
|
| 470 |
- POP2 |
|
| 471 |
- |
|
| 472 |
- POPr |
|
| 473 |
- |
|
| 474 |
-RTN |
|
| 475 |
- |
|
| 476 |
-@draw-key ( x* y* addr* color -- ) |
|
| 477 |
- |
|
| 478 |
- STH |
|
| 479 |
- .Screen/addr DEO2 |
|
| 480 |
- SWP2 .Screen/x DEO2 |
|
| 481 |
- DUP2 #0018 ++ |
|
| 482 |
- &loop |
|
| 483 |
- ( move ) OVR2 .Screen/y DEO2 |
|
| 484 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 485 |
- ( incr ) .Screen/addr DEI2 #0008 ++ .Screen/addr DEO2 |
|
| 486 |
- ( incr ) SWP2 #0008 ++ SWP2 |
|
| 487 |
- LTH2k ,&loop JCN |
|
| 488 |
- POP2 POP2 |
|
| 489 |
- POPr |
|
| 490 |
- |
|
| 491 |
-RTN |
|
| 492 |
- |
|
| 493 |
-@draw-cursor ( -- ) |
|
| 494 |
- |
|
| 495 |
- ( clear last cursor ) |
|
| 496 |
- ;cursor-icn .Screen/addr DEO2 |
|
| 497 |
- .pointer/x LDZ2 .Screen/x DEO2 |
|
| 498 |
- .pointer/y LDZ2 .Screen/y DEO2 |
|
| 499 |
- #40 .Screen/sprite DEO |
|
| 500 |
- ( record pointer positions ) |
|
| 501 |
- .Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2 |
|
| 502 |
- .Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2 |
|
| 503 |
- ( colorize on state ) |
|
| 504 |
- #43 [ .Mouse/state DEI #00 ! ] - .Screen/sprite DEO |
|
| 505 |
- |
|
| 506 |
-RTN |
|
| 507 |
- |
|
| 508 |
-@draw-knob ( x* y* value -- ) |
|
| 509 |
- |
|
| 510 |
- ( load ) STH .Screen/y DEO2 .Screen/x DEO2 |
|
| 511 |
- ;knob-icns .Screen/addr DEO2 |
|
| 512 |
- ( draw ) #01 .Screen/sprite DEO |
|
| 513 |
- .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
| 514 |
- ;knob-icns #0008 ++ .Screen/addr DEO2 |
|
| 515 |
- ( draw ) #01 .Screen/sprite DEO |
|
| 516 |
- .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
| 517 |
- ;knob-icns #0018 ++ .Screen/addr DEO2 |
|
| 518 |
- ( draw ) #01 .Screen/sprite DEO |
|
| 519 |
- .Screen/x DEI2 #0008 -- .Screen/x DEO2 |
|
| 520 |
- ;knob-icns #0010 ++ .Screen/addr DEO2 |
|
| 521 |
- ( draw ) #01 .Screen/sprite DEO |
|
| 522 |
- .Screen/x DEI2 #0004 ++ .Screen/x DEO2 |
|
| 523 |
- .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
| 524 |
- ;font-hex #00 STHkr #30 SFT ++ .Screen/addr DEO2 |
|
| 525 |
- ( draw ) #01 .Screen/sprite DEO |
|
| 526 |
- .Screen/x DEI2 #0004 -- #00 #00 STHkr ;knob-offsetx ++ LDA ++ .Screen/x DEO2 |
|
| 527 |
- .Screen/y DEI2 #0010 -- #00 #00 STHr ;knob-offsety ++ LDA ++ .Screen/y DEO2 |
|
| 528 |
- ;knob-icns #0020 ++ .Screen/addr DEO2 |
|
| 529 |
- ( draw ) #05 .Screen/sprite DEO |
|
| 530 |
- |
|
| 531 |
-RTN |
|
| 532 |
- |
|
| 533 |
-@draw-switch ( x* y* value -- ) |
|
| 534 |
- |
|
| 535 |
- STH .Screen/y DEO2 .Screen/x DEO2 |
|
| 536 |
- STHkr #50 SFT #00 SWP ;switch-icns ++ |
|
| 537 |
- DUP2 .Screen/addr DEO2 |
|
| 538 |
- ( draw ) #01 STHkr + .Screen/sprite DEO |
|
| 539 |
- .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
| 540 |
- DUP2 #0008 ++ .Screen/addr DEO2 |
|
| 541 |
- ( draw ) #01 STHkr + .Screen/sprite DEO |
|
| 542 |
- .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
| 543 |
- .Screen/x DEI2 #0008 -- .Screen/x DEO2 |
|
| 544 |
- DUP2 #0010 ++ .Screen/addr DEO2 |
|
| 545 |
- ( draw ) #01 STHkr + .Screen/sprite DEO |
|
| 546 |
- .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
| 547 |
- #0018 ++ .Screen/addr DEO2 |
|
| 548 |
- ( draw ) #01 STHr + .Screen/sprite DEO |
|
| 549 |
- |
|
| 550 |
-RTN |
|
| 551 |
- |
|
| 552 |
-@line-rect ( x1* y1* x2* y2* color -- ) |
|
| 553 |
- |
|
| 554 |
- STH |
|
| 555 |
- DUP2 ,&ver-y2 STR2 ,&hor-y2 STR2 |
|
| 556 |
- DUP2 ,&ver-x2 STR2 ,&hor-x2 STR2 |
|
| 557 |
- DUP2 ,&ver-y1 STR2 ,&hor-y1 STR2 |
|
| 558 |
- DUP2 ,&ver-x1 STR2 ,&hor-x1 STR2 |
|
| 559 |
- ( horizontal ) |
|
| 560 |
- [ LIT2 &hor-x2 $2 ] INC2 [ LIT2 &hor-x1 $2 ] |
|
| 561 |
- &hor |
|
| 562 |
- DUP2 .Screen/x DEO2 |
|
| 563 |
- [ LIT2 &hor-y1 $2 ] .Screen/y DEO2 STHkr .Screen/pixel DEOk |
|
| 564 |
- [ LIT2 &hor-y2 $2 ] .Screen/y DEO2 DEO |
|
| 565 |
- INC2 GTH2k ,&hor JCN |
|
| 566 |
- POP2 POP2 |
|
| 567 |
- ( vertical ) |
|
| 568 |
- [ LIT2 &ver-y2 $2 ] [ LIT2 &ver-y1 $2 ] |
|
| 569 |
- &ver |
|
| 570 |
- DUP2 .Screen/y DEO2 |
|
| 571 |
- [ LIT2 &ver-x1 $2 ] .Screen/x DEO2 STHkr .Screen/pixel DEOk |
|
| 572 |
- [ LIT2 &ver-x2 $2 ] .Screen/x DEO2 DEO |
|
| 573 |
- INC2 GTH2k ,&ver JCN |
|
| 574 |
- POP2 POP2 |
|
| 575 |
- POPr |
|
| 576 |
- |
|
| 577 |
-RTN |
|
| 578 |
- |
|
| 579 |
-@draw-label ( x* y* addr* color -- ) |
|
| 580 |
- |
|
| 581 |
- ( load ) STH STH2 .Screen/y DEO2 .Screen/x DEO2 |
|
| 582 |
- STH2r |
|
| 583 |
- &loop |
|
| 584 |
- LDAk #00 SWP #0030 -- 8** ;font-num-uc ++ .Screen/addr DEO2 |
|
| 585 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 586 |
- ( incr ) INC2 |
|
| 587 |
- ( incr ) .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
| 588 |
- LDAk #00 ! ,&loop JCN |
|
| 589 |
- POP2 |
|
| 590 |
- POPr |
|
| 591 |
- |
|
| 592 |
-RTN |
|
| 593 |
- |
|
| 594 |
-@fill-rect ( x1* y1* x2* y2* color -- ) |
|
| 595 |
- |
|
| 596 |
- .color STZ |
|
| 597 |
- ( x1 x2 y1 y2 ) ROT2 SWP2 |
|
| 598 |
- &ver |
|
| 599 |
- ( save ) OVR2 .Screen/y DEO2 |
|
| 600 |
- STH2 STH2 OVR2 OVR2 |
|
| 601 |
- &hor |
|
| 602 |
- ( save ) OVR2 .Screen/x DEO2 |
|
| 603 |
- ( draw ) .color LDZ .Screen/pixel DEO |
|
| 604 |
- ( incr ) SWP2 INC2 SWP2 |
|
| 605 |
- OVR2 OVR2 LTS2 ,&hor JCN |
|
| 606 |
- POP2 POP2 STH2r STH2r |
|
| 607 |
- ( incr ) SWP2 INC2 SWP2 |
|
| 608 |
- OVR2 OVR2 LTS2 ,&ver JCN |
|
| 609 |
- POP2 POP2 POP2 POP2 |
|
| 610 |
- |
|
| 611 |
-RTN |
|
| 612 |
- |
|
| 613 |
-@pad-name [ |
|
| 614 |
- "PAD1 $1 "SYN1 $1 "SYN2 $1 "CYM1 $1 ( short ) |
|
| 615 |
- "HHAT $1 "OHAT $1 "CHAT $1 "RIDE $1 |
|
| 616 |
- "SID1 $1 "SNR1 $1 "SNR2 $1 "SID2 $1 ( long ) |
|
| 617 |
- "BDR1 $1 "KCK1 $1 "KCK2 $1 "SUB1 $1 ] |
|
| 618 |
- |
|
| 619 |
-@pad-addr [ |
|
| 620 |
- 6000 6400 6800 6c00 |
|
| 621 |
- 7000 7800 8000 8800 |
|
| 622 |
- 9000 9800 a000 a800 |
|
| 623 |
- b000 c000 d000 e000 $2 ] |
|
| 624 |
- |
|
| 625 |
-@pad-pitch [ |
|
| 626 |
- 30 30 30 30 |
|
| 627 |
- 30 30 30 30 |
|
| 628 |
- 30 30 30 30 |
|
| 629 |
- 30 30 30 30 ] |
|
| 630 |
- |
|
| 631 |
-@pad-path [ |
|
| 632 |
- "projects/sounds/pad1.pcm $1 "projects/sounds/syn1.pcm $1 "projects/sounds/syn2.pcm $1 "projects/sounds/pad2.pcm $1 |
|
| 633 |
- "projects/sounds/hhat.pcm $1 "projects/sounds/ohat.pcm $1 "projects/sounds/chat.pcm $1 "projects/sounds/ride.pcm $1 |
|
| 634 |
- "projects/sounds/sid1.pcm $1 "projects/sounds/snr1.pcm $1 "projects/sounds/snr2.pcm $1 "projects/sounds/sid2.pcm $1 |
|
| 635 |
- "projects/sounds/bdr1.pcm $1 "projects/sounds/kck1.pcm $1 "projects/sounds/kck2.pcm $1 "projects/sounds/sub1.pcm $1 ] |
|
| 636 |
- |
|
| 637 |
-@notes [ |
|
| 638 |
- 3c 3e 40 41 43 45 47 |
|
| 639 |
- 48 4a 4c 4d 4f 51 53 ] |
|
| 640 |
- |
|
| 641 |
-@cursor-icn [ |
|
| 642 |
- 80c0 e0f0 f8e0 1000 ] |
|
| 643 |
- |
|
| 644 |
-@keys-left-icns [ |
|
| 645 |
- 7c7c 7c7c 7c7c 7c7c |
|
| 646 |
- 7c7c 7c7c 7c7c 7e7f |
|
| 647 |
- 7f7f 7f7f 7f7f 3e00 ] |
|
| 648 |
- |
|
| 649 |
-@keys-middle-icns [ |
|
| 650 |
- 1c1c 1c1c 1c1c 1c1c |
|
| 651 |
- 1c1c 1c1c 1c1c 3e7f |
|
| 652 |
- 7f7f 7f7f 7f7f 3e00 ] |
|
| 653 |
- |
|
| 654 |
-@keys-right-icns [ |
|
| 655 |
- 1f1f 1f1f 1f1f 1f1f |
|
| 656 |
- 1f1f 1f1f 1f1f 3f7f |
|
| 657 |
- 7f7f 7f7f 7f7f 3e00 ] |
|
| 658 |
- |
|
| 659 |
-@arrow-icns [ |
|
| 660 |
- 0010 387c fe10 1000 |
|
| 661 |
- 0010 1010 fe7c 3810 ] |
|
| 662 |
- |
|
| 663 |
-@switch-icns [ |
|
| 664 |
- 001f 2040 4040 4040 |
|
| 665 |
- 00f8 0402 0202 0202 |
|
| 666 |
- 404f 5f5f 4f20 1f00 |
|
| 667 |
- 02f2 fafa f204 f800 |
|
| 668 |
- 001f 204f 5f5f 4f40 |
|
| 669 |
- 00f8 04f2 fafa f202 |
|
| 670 |
- 4040 4040 4020 1f00 |
|
| 671 |
- 0202 0202 0204 f800 ] |
|
| 672 |
- |
|
| 673 |
-@knob-icns [ |
|
| 674 |
- 0003 0c10 2020 4040 |
|
| 675 |
- 00c0 3008 0404 0202 |
|
| 676 |
- 4040 2020 100c 0300 |
|
| 677 |
- 0202 0404 0830 c000 |
|
| 678 |
- 0000 183c 3c18 0000 ] |
|
| 679 |
- |
|
| 680 |
-@knob-offsetx [ |
|
| 681 |
- 01 00 00 00 00 01 02 03 |
|
| 682 |
- 05 06 07 08 08 08 08 07 ] |
|
| 683 |
- |
|
| 684 |
-@knob-offsety [ |
|
| 685 |
- 07 06 05 03 02 01 00 00 |
|
| 686 |
- 00 00 01 02 03 05 06 07 ] |
|
| 687 |
- |
|
| 688 |
-@font-notes [ |
|
| 689 |
- 003e 4140 4040 413e 40ae 4100 4040 413e |
|
| 690 |
- 007e 4141 4141 417e 40ae 4101 4141 417e |
|
| 691 |
- 003e 4140 7c40 413e 003f 4040 7e40 4040 |
|
| 692 |
- 40af 4000 7e40 4040 003e 4140 5f41 413e |
|
| 693 |
- 40ae 4100 5f41 413e 003e 4141 7f41 4141 |
|
| 694 |
- 40ae 4101 7f41 4141 007e 4141 7e41 417e |
|
| 695 |
-] |
|
| 696 |
- |
|
| 697 |
-@font-hex ( 0-F ) |
|
| 698 |
-[ |
|
| 699 |
- 007c 8282 8282 827c 0030 1010 1010 1010 |
|
| 700 |
- 007c 8202 7c80 80fe 007c 8202 1c02 827c |
|
| 701 |
- 000c 1424 4484 fe04 00fe 8080 7c02 827c |
|
| 702 |
- 007c 8280 fc82 827c 007c 8202 1e02 0202 |
|
| 703 |
- 007c 8282 7c82 827c 007c 8282 7e02 827c |
|
| 704 |
- 007c 8202 7e82 827e 00fc 8282 fc82 82fc |
|
| 705 |
- 007c 8280 8080 827c 00fc 8282 8282 82fc |
|
| 706 |
- 007c 8280 f080 827c 007c 8280 f080 8080 |
|
| 707 |
-] |
|
| 708 |
- |
|
| 709 |
-@font-num-uc [ |
|
| 710 |
- 003e 4141 4141 413e 0018 0808 0808 081c |
|
| 711 |
- 003e 4101 3e40 407f 003e 4101 1f01 413e |
|
| 712 |
- 0011 2141 7f01 0101 007f 4040 7e01 413e |
|
| 713 |
- 003e 4140 7e41 413e 003e 4101 0102 0408 |
|
| 714 |
- 003e 4141 3e41 413e 003e 4141 3f01 0102 |
|
| 715 |
- 0000 0800 0000 0800 0000 0800 0000 0800 |
|
| 716 |
- 0000 0800 0000 0810 0000 0408 1008 0400 |
|
| 717 |
- 0000 001c 001c 0000 0000 1008 0408 1000 |
|
| 718 |
- 0000 0000 0000 0000 003e 4101 3f41 413f |
|
| 719 |
- 007e 4141 7e41 417e 003e 4140 4040 413e |
|
| 720 |
- 007e 4141 4141 417e 007f 4040 7e40 407f |
|
| 721 |
- 007f 4040 7e40 4040 003e 4140 5e41 413e |
|
| 722 |
- 0041 4141 7f41 4141 0008 0808 0808 0808 |
|
| 723 |
- 007f 0101 0101 413e 0041 4244 7844 4241 |
|
| 724 |
- 0040 4040 4040 403f 0076 4949 4949 4949 |
|
| 725 |
- 005e 6141 4141 4141 003e 4141 4141 413e |
|
| 726 |
- 007e 4141 7e40 4040 003e 4141 4145 423d |
|
| 727 |
- 007e 4141 7e41 4141 003e 4140 3e01 413e |
|
| 728 |
- 007f 0808 0808 0808 0041 4141 4141 433d |
|
| 729 |
- 0041 4141 4122 1408 0049 4949 4949 4976 |
|
| 730 |
- 0041 2214 0814 2241 0041 4141 3f01 413e |
|
| 731 |
- 007f 0101 3e40 407f ] |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-( Game Of Life |
|
| 1 |
+( Game Of Life: |
|
| 2 | 2 |
Any live cell with fewer than two live neighbours dies, as if by underpopulation. |
| 3 | 3 |
Any live cell with two or three live neighbours lives on to the next generation. |
| 4 | 4 |
Any live cell with more than three live neighbours dies, as if by overpopulation. |
| ... | ... |
@@ -1,74 +1,73 @@ |
| 1 |
-( devices ) |
|
| 1 |
+( Move: |
|
| 2 |
+ Use controller arrows, leave a slime. ) |
|
| 2 | 3 |
|
| 3 |
-|0000 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 |
|
| 4 |
-|0020 @Screen &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
| 5 |
-|0080 @Controller &vector $2 &button $1 &key $1 |
|
| 4 |
+|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 |
|
| 5 |
+|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
| 6 |
+|80 @Controller &vector $2 &button $1 &key $1 |
|
| 6 | 7 |
|
| 7 | 8 |
|0000 |
| 8 | 9 |
|
| 9 |
-@slime $1 |
|
| 10 |
+@hello &x $2 &y $2 |
|
| 10 | 11 |
|
| 11 |
-|0100 ( -> ) @program |
|
| 12 |
+|0100 ( -> ) |
|
| 12 | 13 |
|
| 13 | 14 |
( theme ) |
| 14 |
- #0daf .System/r DEO2 |
|
| 15 |
- #02ff .System/g DEO2 |
|
| 16 |
- #035f .System/b DEO2 |
|
| 15 |
+ #c0f4 .System/r DEO2 |
|
| 16 |
+ #c0fc .System/g DEO2 |
|
| 17 |
+ #c0f7 .System/b DEO2 |
|
| 17 | 18 |
( vectors ) |
| 18 | 19 |
;on-frame .Screen/vector DEO2 |
| 19 | 20 |
( set origin ) |
| 20 |
- .Screen/width DEI2 #01 SFT2 .Screen/x DEO2 |
|
| 21 |
- .Screen/height DEI2 #01 SFT2 .Screen/y DEO2 |
|
| 21 |
+ .Screen/width DEI2 #01 SFT2 .hello/x STZ2 |
|
| 22 |
+ .Screen/height DEI2 #01 SFT2 .hello/y STZ2 |
|
| 23 |
+ ( drawing mode ) |
|
| 24 |
+ #16 .Screen/auto DEO |
|
| 22 | 25 |
( defaults ) |
| 23 |
- ;default-icn .Screen/addr DEO2 |
|
| 24 |
- #41 .Screen/sprite DEO |
|
| 25 |
- #0a .slime STZ |
|
| 26 |
+ #00 ;on-frame/draw JMP2 |
|
| 26 | 27 |
|
| 27 | 28 |
BRK |
| 28 | 29 |
|
| 29 | 30 |
@on-frame ( -> ) |
| 30 | 31 |
|
| 31 |
- #0a .slime STZ |
|
| 32 |
- ;default-icn .Screen/addr DEO2 |
|
| 33 |
- ( hold ctrl key to change slime color ) |
|
| 34 |
- .Controller/button DEI #0f AND |
|
| 35 |
- DUP #01 NEQ ,&no-ctrl JCN #05 .slime STZ &no-ctrl |
|
| 36 |
- DUP #02 NEQ ,&no-alt JCN #0f .slime STZ &no-alt |
|
| 37 |
- POP |
|
| 38 |
- ( clear ) |
|
| 32 |
+ .Controller/button DEI |
|
| 33 |
+ DUP #00 NEQ ,&continue JCN |
|
| 34 |
+ POP BRK |
|
| 35 |
+ &continue |
|
| 36 |
+ ( clear ) |
|
| 39 | 37 |
#40 .Screen/sprite DEO |
| 40 |
- ( detect movement ) |
|
| 41 |
- .Controller/button DEI |
|
| 42 |
- DUP #10 AND #00 EQU ,&no-up JCN |
|
| 43 |
- .Screen/y DEI2 #0001 SUB2 .Screen/y DEO2 |
|
| 44 |
- ;up-icn .Screen/addr DEO2 &no-up |
|
| 45 |
- DUP #20 AND #00 EQU ,&no-down JCN |
|
| 46 |
- .Screen/y DEI2 INC2 .Screen/y DEO2 |
|
| 47 |
- ;down-icn .Screen/addr DEO2 &no-down |
|
| 48 |
- DUP #40 AND #00 EQU ,&no-left JCN |
|
| 49 |
- .Screen/x DEI2 #0001 SUB2 .Screen/x DEO2 |
|
| 50 |
- ;left-icn .Screen/addr DEO2 &no-left |
|
| 51 |
- DUP #80 AND #00 EQU ,&no-right JCN |
|
| 52 |
- .Screen/x DEI2 INC2 .Screen/x DEO2 |
|
| 53 |
- ;right-icn .Screen/addr DEO2 &no-right |
|
| 54 |
- POP |
|
| 55 |
- ( draw face ) |
|
| 56 |
- #41 .Screen/sprite DEO |
|
| 38 |
+ ( movement ) |
|
| 39 |
+ DUP #10 AND #00 EQU ,&no-u JCN .hello/y LDZ2k #0001 SUB2 ROT STZ2 &no-u |
|
| 40 |
+ DUP #20 AND #00 EQU ,&no-d JCN .hello/y LDZ2k INC2 ROT STZ2 &no-d |
|
| 41 |
+ DUP #40 AND #00 EQU ,&no-l JCN .hello/x LDZ2k #0001 SUB2 ROT STZ2 &no-l |
|
| 42 |
+ DUP #80 AND #00 EQU ,&no-r JCN .hello/x LDZ2k INC2 ROT STZ2 &no-r |
|
| 43 |
+ &draw |
|
| 44 |
+ ( draw hello ) |
|
| 45 |
+ .hello/x LDZ2 STH2k .Screen/x DEO2 |
|
| 46 |
+ .hello/y LDZ2 STH2k .Screen/y DEO2 |
|
| 47 |
+ ;hello-chr .Screen/addr DEO2 |
|
| 48 |
+ #c1 .Screen/sprite DEOk DEO |
|
| 57 | 49 |
( draw slime ) |
| 50 |
+ STH2r .Screen/y DEO2 |
|
| 51 |
+ STH2r .Screen/x DEO2 |
|
| 58 | 52 |
;slime-icn .Screen/addr DEO2 |
| 59 |
- .slime LDZ .Screen/sprite DEO |
|
| 53 |
+ ,get-slime JSR .Screen/sprite DEOk DEO |
|
| 60 | 54 |
|
| 61 | 55 |
BRK |
| 62 | 56 |
|
| 63 |
-@default-icn |
|
| 64 |
- 3c7e ffdb ffe7 7e3c |
|
| 65 |
-@up-icn |
|
| 66 |
- 2466 e7db ffff 7e3c |
|
| 67 |
-@down-icn |
|
| 68 |
- 3c7e ffff dbe7 6624 |
|
| 69 |
-@left-icn |
|
| 70 |
- 3c7e ef1f 1fef 7e3c |
|
| 71 |
-@right-icn |
|
| 72 |
- 3c7e f7f8 f8f7 7e3c |
|
| 73 |
-@slime-icn |
|
| 74 |
- 0000 183c 3c18 0000 |
|
| 57 |
+@get-slime ( button -- color ) |
|
| 58 |
+ |
|
| 59 |
+ #0f AND |
|
| 60 |
+ DUP #01 NEQ ,&no-ctrl JCN POP #05 JMP2r &no-ctrl |
|
| 61 |
+ DUP #02 NEQ ,&no-alt JCN POP #0a JMP2r &no-alt |
|
| 62 |
+ POP #0f |
|
| 63 |
+ |
|
| 64 |
+JMP2r |
|
| 65 |
+ |
|
| 66 |
+@hello-chr |
|
| 67 |
+ 0007 1820 2040 4044 0000 071f 1f3f 3f3b |
|
| 68 |
+ 00e0 1804 0402 0222 0000 e0f8 f8fc fcdc |
|
| 69 |
+ 4040 4423 2018 0700 3f3f 3b1c 1f07 0000 |
|
| 70 |
+ 0202 22c4 0418 e000 fcfc dc38 f8e0 0000 |
|
| 71 |
+@slime-icn |
|
| 72 |
+ 0000 0000 0003 0707 0000 0000 00c0 e0e0 |
|
| 73 |
+ 0707 0300 0000 0000 e0e0 c000 0000 0000 |
| 75 | 74 |
deleted file mode 100644 |
| ... | ... |
@@ -1,232 +0,0 @@ |
| 1 |
- |
|
| 2 |
-( |
|
| 3 |
- uxnasm projects/examples/demos/nametable.tal bin/nametable.rom |
|
| 4 |
- uxnemu bin/nametable.rom |
|
| 5 |
-) |
|
| 6 |
- |
|
| 7 |
-%+ { ADD } %- { SUB } %/ { DIV }
|
|
| 8 |
-%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
|
|
| 9 |
-%++ { ADD2 } %-- { SUB2 } %// { DIV2 }
|
|
| 10 |
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
|
|
| 11 |
- |
|
| 12 |
-%2** { #10 SFT2 } %2// { #01 SFT2 }
|
|
| 13 |
-%8** { #30 SFT2 } %8// { #03 SFT2 }
|
|
| 14 |
-%10** { #40 SFT2 } %10// { #04 SFT2 }
|
|
| 15 |
-%MOD2 { DIV2k MUL2 SUB2 }
|
|
| 16 |
-%MOD { DIVk MUL SUB }
|
|
| 17 |
-%RTN { JMP2r }
|
|
| 18 |
- |
|
| 19 |
-%WIDTH { #0037 }
|
|
| 20 |
-%HEIGHT { #0029 } ( 08cf )
|
|
| 21 |
-%LENGTH { WIDTH HEIGHT MUL2 10** }
|
|
| 22 |
- |
|
| 23 |
-( devices ) |
|
| 24 |
- |
|
| 25 |
-|00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 ] |
|
| 26 |
-|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 &error $1 ] |
|
| 27 |
-|20 @Screen [ &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] |
|
| 28 |
-|80 @Controller [ &vector $2 &button $1 &key $1 ] |
|
| 29 |
-|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] |
|
| 30 |
-|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 ] |
|
| 31 |
- |
|
| 32 |
-( variables ) |
|
| 33 |
- |
|
| 34 |
-|0000 |
|
| 35 |
- |
|
| 36 |
-( program ) |
|
| 37 |
- |
|
| 38 |
-@tiles-frame |
|
| 39 |
- &x $2 &y $2 |
|
| 40 |
-@nametable-frame |
|
| 41 |
- &x $2 &y $2 |
|
| 42 |
-@buffer $10 |
|
| 43 |
- |
|
| 44 |
-|0100 ( -> ) |
|
| 45 |
- |
|
| 46 |
- ( theme ) |
|
| 47 |
- #34cd .System/r DEO2 |
|
| 48 |
- #28ac .System/g DEO2 |
|
| 49 |
- #297b .System/b DEO2 |
|
| 50 |
- |
|
| 51 |
- WIDTH 8** #0010 ++ .Screen/width DEO2 |
|
| 52 |
- #01e8 .Screen/height DEO2 |
|
| 53 |
- |
|
| 54 |
- #0008 .tiles-frame/x STZ2 |
|
| 55 |
- HEIGHT 8** #0008 ++ .tiles-frame/y STZ2 |
|
| 56 |
- #0008 .nametable-frame/x STZ2 |
|
| 57 |
- #0008 .nametable-frame/y STZ2 |
|
| 58 |
- |
|
| 59 |
- ;input-name |
|
| 60 |
- DUP2 ,load JSR |
|
| 61 |
- ;assoc JSR2 |
|
| 62 |
- |
|
| 63 |
- ;draw-tiles JSR2 |
|
| 64 |
- ;draw-nametable JSR2 |
|
| 65 |
- ;draw-short JSR2 |
|
| 66 |
- |
|
| 67 |
-BRK |
|
| 68 |
- |
|
| 69 |
-@load ( filename* -- ) |
|
| 70 |
- |
|
| 71 |
- LIT2r 0000 |
|
| 72 |
- .File/name DEO2 |
|
| 73 |
- &stream |
|
| 74 |
- #0010 .File/length DEO2 |
|
| 75 |
- ;buffer |
|
| 76 |
- DUP2 .File/read DEO2 |
|
| 77 |
- ,find-tile JSR #ffff !! ,&skip JCN |
|
| 78 |
- ;buffer ;add-tile JSR2 |
|
| 79 |
- &skip |
|
| 80 |
- INC2r |
|
| 81 |
- .File/success DEI2 #0000 !! ,&stream JCN |
|
| 82 |
- STH2r #0001 -- ;result/tiles STA2 |
|
| 83 |
- |
|
| 84 |
-RTN |
|
| 85 |
- |
|
| 86 |
-@find-tile ( addr* -- addr* ) |
|
| 87 |
- |
|
| 88 |
- STH2 |
|
| 89 |
- ;result/length LDA2 #0000 |
|
| 90 |
- &loop |
|
| 91 |
- DUP2 10** ;result/data ++ STH2kr ;tiles-equal JSR2 #00 = ,&continue JCN |
|
| 92 |
- NIP2 POP2r RTN |
|
| 93 |
- &continue |
|
| 94 |
- INC2 GTH2k ,&loop JCN |
|
| 95 |
- POP2 POP2 POP2r |
|
| 96 |
- ( default ) #ffff |
|
| 97 |
- |
|
| 98 |
-RTN |
|
| 99 |
- |
|
| 100 |
-@tiles-equal ( a* b* -- bool ) |
|
| 101 |
- |
|
| 102 |
- STH2 |
|
| 103 |
- DUP2 #0010 ++ SWP2 |
|
| 104 |
- &loop |
|
| 105 |
- LDAk LDAkr STHr = ,&continue JCN |
|
| 106 |
- POP2 POP2 POP2r #00 RTN |
|
| 107 |
- &continue |
|
| 108 |
- INC2r |
|
| 109 |
- INC2 GTH2k ,&loop JCN |
|
| 110 |
- POP2 POP2 POP2r #01 |
|
| 111 |
- |
|
| 112 |
-RTN |
|
| 113 |
- |
|
| 114 |
-@add-tile ( addr* -- addr* ) |
|
| 115 |
- |
|
| 116 |
- STH2 |
|
| 117 |
- #0010 #0000 |
|
| 118 |
- &loop |
|
| 119 |
- ( addr* ) DUP2 ;result/length LDA2 10** ;result/data ++ ++ |
|
| 120 |
- ( data ) OVR2 STH2kr ++ LDA |
|
| 121 |
- ( order ) ROT ROT STA |
|
| 122 |
- INC2 GTH2k ,&loop JCN |
|
| 123 |
- POP2 POP2 |
|
| 124 |
- POP2r |
|
| 125 |
- ( incr ) ;result/length LDA2 INC2 ;result/length STA2 |
|
| 126 |
- |
|
| 127 |
-RTN |
|
| 128 |
- |
|
| 129 |
-@assoc ( -- length ) |
|
| 130 |
- |
|
| 131 |
- LIT2r 0000 |
|
| 132 |
- .File/name DEO2 |
|
| 133 |
- &stream |
|
| 134 |
- #0010 .File/length DEO2 |
|
| 135 |
- ;buffer |
|
| 136 |
- DUP2 .File/read DEO2 |
|
| 137 |
- ;find-tile JSR2 STH2kr SWP2 ;set-tile JSR2 |
|
| 138 |
- INC2r |
|
| 139 |
- .File/success DEI2 #0000 !! ,&stream JCN |
|
| 140 |
- POP2r |
|
| 141 |
- |
|
| 142 |
-RTN |
|
| 143 |
- |
|
| 144 |
-( draw ) |
|
| 145 |
- |
|
| 146 |
-@draw-tiles ( -- ) |
|
| 147 |
- |
|
| 148 |
- .tiles-frame/x LDZ2 .Screen/x DEO2 |
|
| 149 |
- .tiles-frame/y LDZ2 .Screen/y DEO2 |
|
| 150 |
- ;result/data .Screen/addr DEO2 |
|
| 151 |
- |
|
| 152 |
- ( width ) LITr 00 |
|
| 153 |
- ( auto x addr ) #05 .Screen/auto DEO |
|
| 154 |
- ;result/data ;result/length LDA2 10** ++ ;result/data |
|
| 155 |
- &loop |
|
| 156 |
- STHkr WIDTH NIP MOD ,&continue JCN |
|
| 157 |
- .tiles-frame/x LDZ2 .Screen/x DEO2 |
|
| 158 |
- .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
| 159 |
- POPr LITr 00 |
|
| 160 |
- &continue |
|
| 161 |
- INCr |
|
| 162 |
- #81 .Screen/sprite DEO |
|
| 163 |
- #0010 ++ GTH2k ,&loop JCN |
|
| 164 |
- POP2 POP2 |
|
| 165 |
- ( auto none ) #00 .Screen/auto DEO |
|
| 166 |
- POPr |
|
| 167 |
- |
|
| 168 |
-RTN |
|
| 169 |
- |
|
| 170 |
-@set-tile ( id* addr* -- ) |
|
| 171 |
- |
|
| 172 |
- SWP2 2** ;result/data ++ ;result/length LDA2 10** ++ STA2 |
|
| 173 |
- |
|
| 174 |
-RTN |
|
| 175 |
- |
|
| 176 |
-@get-tile ( id* -- addr* ) |
|
| 177 |
- |
|
| 178 |
- 2** ;result/length LDA2 10** ;result/data ++ ++ LDA2 |
|
| 179 |
- |
|
| 180 |
-RTN |
|
| 181 |
- |
|
| 182 |
-@draw-nametable ( -- ) |
|
| 183 |
- |
|
| 184 |
- ;result/tiles LDA2 #0000 |
|
| 185 |
- &loop |
|
| 186 |
- DUP2 WIDTH MOD2 8** .nametable-frame/x LDZ2 ++ .Screen/x DEO2 |
|
| 187 |
- DUP2 WIDTH DIV2 8** .nametable-frame/y LDZ2 ++ .Screen/y DEO2 |
|
| 188 |
- DUP2 ;get-tile JSR2 10** ;result/data ++ .Screen/addr DEO2 |
|
| 189 |
- #81 .Screen/sprite DEO |
|
| 190 |
- INC2 GTH2k ,&loop JCN |
|
| 191 |
- POP2 POP2 |
|
| 192 |
- |
|
| 193 |
-RTN |
|
| 194 |
- |
|
| 195 |
-@draw-short ( -- ) |
|
| 196 |
- |
|
| 197 |
- #0008 .Screen/x DEO2 |
|
| 198 |
- #0008 .Screen/y DEO2 |
|
| 199 |
- #01 .Screen/auto DEO |
|
| 200 |
- ;result/length LDA2 SWP |
|
| 201 |
- ( high ) ,&draw-byte JSR |
|
| 202 |
- ( low ) ,&draw-byte JSR |
|
| 203 |
- #05 .Screen/auto DEO |
|
| 204 |
- |
|
| 205 |
-RTN |
|
| 206 |
- |
|
| 207 |
- &draw-byte ( byte -- ) |
|
| 208 |
- DUP |
|
| 209 |
- ( high ) #04 SFT ,&draw-char JSR |
|
| 210 |
- ( low ) #0f AND ,&draw-char JSR |
|
| 211 |
- RTN |
|
| 212 |
- &draw-char ( num -- ) |
|
| 213 |
- #30 SFT #00 SWP ;font-hex ADD2 .Screen/addr DEO2 |
|
| 214 |
- #01 .Screen/sprite DEO |
|
| 215 |
- RTN |
|
| 216 |
- |
|
| 217 |
-@input-name "projects/pictures/bulma37x29.chr $1 |
|
| 218 |
- |
|
| 219 |
-@font-hex ( 0-F ) |
|
| 220 |
- 007c 8282 8282 827c 0030 1010 1010 1010 |
|
| 221 |
- 007c 8202 7c80 80fe 007c 8202 1c02 827c |
|
| 222 |
- 000c 1424 4484 fe04 00fe 8080 7c02 827c |
|
| 223 |
- 007c 8280 fc82 827c 007c 8202 1e02 0202 |
|
| 224 |
- 007c 8282 7c82 827c 007c 8282 7e02 827c |
|
| 225 |
- 007c 8202 7e82 827e 00fc 8282 fc82 82fc |
|
| 226 |
- 007c 8280 8080 827c 00fc 8282 8282 82fc |
|
| 227 |
- 007c 8280 f080 827c 007c 8280 f080 8080 |
|
| 228 |
- |
|
| 229 |
-@result |
|
| 230 |
- &length $2 |
|
| 231 |
- &tiles $2 |
|
| 232 |
- &data |
| ... | ... |
@@ -1,15 +1,15 @@ |
| 1 |
-( polycat ) |
|
| 1 |
+( Polycat: |
|
| 2 |
+ A cat with one eye, and the hind and tail of a lizard. |
|
| 3 |
+ Original character by Rekka Bellum ) |
|
| 2 | 4 |
|
| 3 |
-|00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 |
|
| 4 |
-|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
| 5 |
-|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2 |
|
| 5 |
+|00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 |
|
| 6 |
+|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixeld $1 &sprite $1 |
|
| 7 |
+|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2 |
|
| 6 | 8 |
|
| 7 | 9 |
|0000 |
| 8 | 10 |
|
| 9 |
-@cat |
|
| 10 |
- &x $2 &y $2 &timer $1 |
|
| 11 |
-@pointer |
|
| 12 |
- &x $2 &y $2 |
|
| 11 |
+@cat &x $2 &y $2 &timer $1 |
|
| 12 |
+@pointer &x $2 &y $2 |
|
| 13 | 13 |
|
| 14 | 14 |
|0100 ( -> ) |
| 15 | 15 |
|
| ... | ... |
@@ -25,29 +25,21 @@ |
| 25 | 25 |
( find center ) |
| 26 | 26 |
.Screen/width DEI2 #01 SFT2 .cat/x STZ2 |
| 27 | 27 |
.Screen/height DEI2 #01 SFT2 .cat/y STZ2 |
| 28 |
- ( set screen mode auto-x ) |
|
| 29 |
- #05 .Screen/auto DEO |
|
| 28 |
+ ( draw ground ) |
|
| 29 |
+ #f6 .Screen/auto DEO |
|
| 30 |
+ .cat/y LDZ2 #0018 ADD2 .Screen/y DEO2 |
|
| 31 |
+ .cat/x LDZ2 #0010 SUB2 .Screen/x DEO2 |
|
| 32 |
+ ;ground .Screen/addr DEO2 |
|
| 33 |
+ #01 .Screen/sprite DEO |
|
| 30 | 34 |
( init ) |
| 31 | 35 |
#ff ;draw-eye/last STA |
| 32 | 36 |
#ff ;draw-tail/last STA |
| 37 |
+ ( set screen mode auto-x ) |
|
| 38 |
+ #05 .Screen/auto DEO |
|
| 33 | 39 |
,draw-polycat JSR |
| 34 |
- ,draw-ground JSR |
|
| 35 | 40 |
|
| 36 | 41 |
BRK |
| 37 | 42 |
|
| 38 |
-@draw-ground ( -- ) |
|
| 39 |
- |
|
| 40 |
- .cat/y LDZ2 #0018 ADD2 .Screen/y DEO2 |
|
| 41 |
- .cat/x LDZ2 #0010 SUB2 .Screen/x DEO2 |
|
| 42 |
- ;ground .Screen/addr DEO2 |
|
| 43 |
- #1000 |
|
| 44 |
- &loop |
|
| 45 |
- #01 .Screen/sprite DEO |
|
| 46 |
- INC GTHk ,&loop JCN |
|
| 47 |
- POP2 |
|
| 48 |
- |
|
| 49 |
-JMP2r |
|
| 50 |
- |
|
| 51 | 43 |
@draw-polycat ( -- ) |
| 52 | 44 |
|
| 53 | 45 |
( ears ) |
| 54 | 46 |
deleted file mode 100644 |
| ... | ... |
@@ -1,427 +0,0 @@ |
| 1 |
-( Dev/Screen ) |
|
| 2 |
- |
|
| 3 |
-%RTN { JMP2r }
|
|
| 4 |
-%++ { INC2 }
|
|
| 5 |
-%2// { #01 SFT2 }
|
|
| 6 |
-%4// { #02 SFT2 }
|
|
| 7 |
-%4** { #20 SFT2 }
|
|
| 8 |
-%8** { #30 SFT2 }
|
|
| 9 |
-%8+ { #0008 ADD2 }
|
|
| 10 |
-%STEP8 { #33 SFT2 }
|
|
| 11 |
- |
|
| 12 |
-( devices ) |
|
| 13 |
- |
|
| 14 |
-|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |
|
| 15 |
-|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] |
|
| 16 |
-|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] |
|
| 17 |
- |
|
| 18 |
-( variables ) |
|
| 19 |
- |
|
| 20 |
-|0000 |
|
| 21 |
- |
|
| 22 |
-@color $1 |
|
| 23 |
-@selection $1 |
|
| 24 |
- |
|
| 25 |
-@center [ &x $2 &y $2 ] |
|
| 26 |
-@pointer [ &x $2 &y $2 ] |
|
| 27 |
-@rect [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] |
|
| 28 |
-@window [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 &w $2 &h $2 ] |
|
| 29 |
-@slider [ &x1 $2 &y $2 &x2 $2 &pos $2 ] |
|
| 30 |
- |
|
| 31 |
-@theme [ |
|
| 32 |
- &r1 $1 &r2 $1 &r3 $1 &r4 $1 |
|
| 33 |
- &g1 $1 &g2 $1 &g3 $1 &g4 $1 |
|
| 34 |
- &b1 $1 &b2 $1 &b3 $1 &b4 $1 |
|
| 35 |
-] |
|
| 36 |
- |
|
| 37 |
-( program ) |
|
| 38 |
- |
|
| 39 |
-|0100 ( -> ) |
|
| 40 |
- |
|
| 41 |
- ( theme ) |
|
| 42 |
- #027f .System/r DEO2 |
|
| 43 |
- #04e7 .System/g DEO2 |
|
| 44 |
- #06c4 .System/b DEO2 |
|
| 45 |
- |
|
| 46 |
- ( vectors ) |
|
| 47 |
- ;on-mouse .Mouse/vector DEO2 |
|
| 48 |
- |
|
| 49 |
- ( size window ) |
|
| 50 |
- #00b0 .window/w STZ2 |
|
| 51 |
- #0050 .window/h STZ2 |
|
| 52 |
- |
|
| 53 |
- ( center window ) |
|
| 54 |
- .Screen/width DEI2 2// .window/w LDZ2 2// SUB2 .window/x1 STZ2 |
|
| 55 |
- .Screen/height DEI2 2// .window/h LDZ2 2// SUB2 .window/y1 STZ2 |
|
| 56 |
- |
|
| 57 |
- #01 .theme/r1 STZ #02 .theme/g1 STZ #03 .theme/b1 STZ |
|
| 58 |
- #04 .theme/r2 STZ #06 .theme/g2 STZ #07 .theme/b2 STZ |
|
| 59 |
- #0a .theme/r3 STZ #09 .theme/g3 STZ #08 .theme/b3 STZ |
|
| 60 |
- #0c .theme/r4 STZ #0b .theme/g4 STZ #0d .theme/b4 STZ |
|
| 61 |
- |
|
| 62 |
- ( find screen center ) |
|
| 63 |
- .Screen/width DEI2 2// .center/x STZ2 |
|
| 64 |
- .Screen/height DEI2 2// .center/y STZ2 |
|
| 65 |
- |
|
| 66 |
- ;update-theme JSR2 |
|
| 67 |
- ;draw-background JSR2 |
|
| 68 |
- ;draw-window JSR2 |
|
| 69 |
- |
|
| 70 |
-BRK |
|
| 71 |
- |
|
| 72 |
-@on-mouse ( -> ) |
|
| 73 |
- |
|
| 74 |
- ;draw-cursor JSR2 |
|
| 75 |
- |
|
| 76 |
- .Mouse/state DEI #01 JCN [ BRK ] |
|
| 77 |
- |
|
| 78 |
- .Mouse/y DEI2 .window/y1 LDZ2 SUB2 STEP8 |
|
| 79 |
- DUP2 #0010 NEQ2 ,&no-touch-red JCN |
|
| 80 |
- .Mouse/x DEI2 .window/x1 LDZ2 #0060 ADD2 LTH2 ,&no-touch-red JCN |
|
| 81 |
- .Mouse/x DEI2 .window/x1 LDZ2 #009c ADD2 GTH2 ,&no-touch-red JCN |
|
| 82 |
- ( get new value ) .Mouse/x DEI2 .window/x1 LDZ2 SUB2 #0060 SUB2 4// NIP ;theme/r1 #00 .selection LDZ ADD2 STA |
|
| 83 |
- &no-touch-red |
|
| 84 |
- DUP2 #0020 NEQ2 ,&no-touch-green JCN |
|
| 85 |
- .Mouse/x DEI2 .window/x1 LDZ2 #0060 ADD2 LTH2 ,&no-touch-green JCN |
|
| 86 |
- .Mouse/x DEI2 .window/x1 LDZ2 #009c ADD2 GTH2 ,&no-touch-green JCN |
|
| 87 |
- ( get new value ) .Mouse/x DEI2 .window/x1 LDZ2 SUB2 #0060 SUB2 4// NIP ;theme/g1 #00 .selection LDZ ADD2 STA |
|
| 88 |
- &no-touch-green |
|
| 89 |
- DUP2 #0030 NEQ2 ,&no-touch-blue JCN |
|
| 90 |
- .Mouse/x DEI2 .window/x1 LDZ2 #0060 ADD2 LTH2 ,&no-touch-blue JCN |
|
| 91 |
- .Mouse/x DEI2 .window/x1 LDZ2 #009c ADD2 GTH2 ,&no-touch-blue JCN |
|
| 92 |
- ( get new value ) .Mouse/x DEI2 .window/x1 LDZ2 SUB2 #0060 SUB2 4// NIP ;theme/b1 #00 .selection LDZ ADD2 STA |
|
| 93 |
- &no-touch-blue |
|
| 94 |
- DUP2 #0040 NEQ2 ,&no-touch-radio JCN |
|
| 95 |
- .Mouse/x DEI2 .window/x1 LDZ2 #0050 ADD2 LTH2 ,&no-touch-radio JCN |
|
| 96 |
- .Mouse/x DEI2 .window/x1 LDZ2 #008c ADD2 GTH2 ,&no-touch-radio JCN |
|
| 97 |
- .Mouse/x DEI2 .window/x1 LDZ2 SUB2 #0050 SUB2 STEP8 2// #0008 DIV2 NIP .selection STZ |
|
| 98 |
- &no-touch-radio |
|
| 99 |
- POP2 |
|
| 100 |
- |
|
| 101 |
- ;update-theme JSR2 |
|
| 102 |
- ;draw-cursor JSR2 |
|
| 103 |
- ;draw-background JSR2 |
|
| 104 |
- ;draw-window JSR2 |
|
| 105 |
- |
|
| 106 |
-BRK |
|
| 107 |
- |
|
| 108 |
-@update-theme ( -- ) |
|
| 109 |
- |
|
| 110 |
- #08 DEI #0f AND .theme/r1 LDZ #40 SFT ADD #08 DEO |
|
| 111 |
- #0a DEI #0f AND .theme/g1 LDZ #40 SFT ADD #0a DEO |
|
| 112 |
- #0c DEI #0f AND .theme/b1 LDZ #40 SFT ADD #0c DEO |
|
| 113 |
- #08 DEI #f0 AND .theme/r2 LDZ ADD #08 DEO |
|
| 114 |
- #0a DEI #f0 AND .theme/g2 LDZ ADD #0a DEO |
|
| 115 |
- #0c DEI #f0 AND .theme/b2 LDZ ADD #0c DEO |
|
| 116 |
- #09 DEI #0f AND .theme/r3 LDZ #40 SFT ADD #09 DEO |
|
| 117 |
- #0b DEI #0f AND .theme/g3 LDZ #40 SFT ADD #0b DEO |
|
| 118 |
- #0d DEI #0f AND .theme/b3 LDZ #40 SFT ADD #0d DEO |
|
| 119 |
- #09 DEI #f0 AND .theme/r4 LDZ ADD #09 DEO |
|
| 120 |
- #0b DEI #f0 AND .theme/g4 LDZ ADD #0b DEO |
|
| 121 |
- #0d DEI #f0 AND .theme/b4 LDZ ADD #0d DEO |
|
| 122 |
- |
|
| 123 |
-RTN |
|
| 124 |
- |
|
| 125 |
-@draw-background ( -- ) |
|
| 126 |
- |
|
| 127 |
- ( draw hor line ) |
|
| 128 |
- #0000 .Screen/x DEO2 .center/y LDZ2 .Screen/y DEO2 |
|
| 129 |
- .Screen/width DEI2 #0000 ( to/from ) |
|
| 130 |
- &draw-hor |
|
| 131 |
- ( draw ) #01 .Screen/pixel DEO |
|
| 132 |
- ( incr ) #0002 ADD2 DUP2 .Screen/x DEO2 |
|
| 133 |
- GTH2k ,&draw-hor JCN |
|
| 134 |
- POP2 POP2 |
|
| 135 |
- |
|
| 136 |
- ( draw ver line ) |
|
| 137 |
- .center/x LDZ2 .Screen/x DEO2 #0000 .Screen/y DEO2 |
|
| 138 |
- .Screen/height DEI2 #0000 ( to/from ) |
|
| 139 |
- &draw-ver |
|
| 140 |
- ( draw ) #02 .Screen/pixel DEO |
|
| 141 |
- ( incr ) #0002 ADD2 DUP2 .Screen/y DEO2 |
|
| 142 |
- GTH2k ,&draw-ver JCN |
|
| 143 |
- POP2 POP2 |
|
| 144 |
- |
|
| 145 |
- ( draw blending modes ) |
|
| 146 |
- ;preview_icn .Screen/addr DEO2 |
|
| 147 |
- #0010 .Screen/y DEO2 |
|
| 148 |
- #0800 |
|
| 149 |
- &draw-pixel1 |
|
| 150 |
- ( move ) #00 OVR #30 SFT #0010 ADD2 .Screen/x DEO2 |
|
| 151 |
- ( draw ) DUP .Screen/pixel DEO |
|
| 152 |
- ( incr ) INC |
|
| 153 |
- GTHk ,&draw-pixel1 JCN |
|
| 154 |
- POP2 |
|
| 155 |
- #0018 .Screen/y DEO2 |
|
| 156 |
- #0800 |
|
| 157 |
- &draw-pixel2 |
|
| 158 |
- ( move ) #00 OVR #30 SFT #0010 ADD2 .Screen/x DEO2 |
|
| 159 |
- ( draw ) DUP #08 ADD .Screen/pixel DEO |
|
| 160 |
- ( incr ) INC |
|
| 161 |
- GTHk ,&draw-pixel2 JCN |
|
| 162 |
- POP2 |
|
| 163 |
- #0020 .Screen/y DEO2 |
|
| 164 |
- #0800 |
|
| 165 |
- &draw-icn1 |
|
| 166 |
- ( move ) #00 OVR #30 SFT #0010 ADD2 .Screen/x DEO2 |
|
| 167 |
- ( draw ) DUP .Screen/sprite DEO |
|
| 168 |
- ( incr ) INC |
|
| 169 |
- GTHk ,&draw-icn1 JCN |
|
| 170 |
- POP2 |
|
| 171 |
- #0028 .Screen/y DEO2 |
|
| 172 |
- #0800 |
|
| 173 |
- &draw-icn2 |
|
| 174 |
- ( move ) #00 OVR #30 SFT #0010 ADD2 .Screen/x DEO2 |
|
| 175 |
- ( draw ) DUP #08 ADD .Screen/sprite DEO |
|
| 176 |
- ( incr ) INC |
|
| 177 |
- GTHk ,&draw-icn2 JCN |
|
| 178 |
- POP2 |
|
| 179 |
- #0030 .Screen/y DEO2 |
|
| 180 |
- #0800 |
|
| 181 |
- &draw-chr1 |
|
| 182 |
- ( move ) #00 OVR #30 SFT #0010 ADD2 .Screen/x DEO2 |
|
| 183 |
- ( draw ) DUP #80 ADD .Screen/sprite DEO |
|
| 184 |
- ( incr ) INC |
|
| 185 |
- GTHk ,&draw-chr1 JCN |
|
| 186 |
- POP2 |
|
| 187 |
- #0038 .Screen/y DEO2 |
|
| 188 |
- #0800 |
|
| 189 |
- &draw-chr2 |
|
| 190 |
- ( move ) #00 OVR #30 SFT #0010 ADD2 .Screen/x DEO2 |
|
| 191 |
- ( draw ) DUP #88 ADD .Screen/sprite DEO |
|
| 192 |
- ( incr ) INC |
|
| 193 |
- GTHk ,&draw-chr2 JCN |
|
| 194 |
- POP2 |
|
| 195 |
- |
|
| 196 |
-RTN |
|
| 197 |
- |
|
| 198 |
-@draw-window ( -- ) |
|
| 199 |
- |
|
| 200 |
- .window/x1 LDZ2 .window/w LDZ2 ADD2 .window/x2 STZ2 |
|
| 201 |
- .window/y1 LDZ2 .window/h LDZ2 ADD2 .window/y2 STZ2 |
|
| 202 |
- .window/x1 LDZ2 .window/y1 LDZ2 .window/x2 LDZ2 .window/y2 LDZ2 #02 ;fill-rect JSR2 |
|
| 203 |
- .window/x1 LDZ2 .window/y1 LDZ2 .window/x2 LDZ2 .window/y2 LDZ2 #01 ;line-rect JSR2 |
|
| 204 |
- .window/x1 LDZ2 #0002 SUB2 .window/y1 LDZ2 #0002 SUB2 .window/x2 LDZ2 #0002 ADD2 .window/y2 LDZ2 #0002 ADD2 #01 ;line-rect JSR2 |
|
| 205 |
- |
|
| 206 |
- .window/x1 LDZ2 #0008 ADD2 .window/y1 LDZ2 #0010 ADD2 ;red_txt #05 ;draw-label JSR2 |
|
| 207 |
- .window/x1 LDZ2 #0038 ADD2 .Screen/x DEO2 |
|
| 208 |
- .System/r DEI2 #08 ;draw-short JSR2 |
|
| 209 |
- |
|
| 210 |
- .window/x1 LDZ2 #0008 ADD2 .window/y1 LDZ2 #0020 ADD2 ;green_txt #05 ;draw-label JSR2 |
|
| 211 |
- .window/x1 LDZ2 #0038 ADD2 .Screen/x DEO2 |
|
| 212 |
- .System/g DEI2 #08 ;draw-short JSR2 |
|
| 213 |
- |
|
| 214 |
- .window/x1 LDZ2 #0008 ADD2 .window/y1 LDZ2 #0030 ADD2 ;blue_txt #05 ;draw-label JSR2 |
|
| 215 |
- .window/x1 LDZ2 #0038 ADD2 .Screen/x DEO2 |
|
| 216 |
- .System/b DEI2 #08 ;draw-short JSR2 |
|
| 217 |
- |
|
| 218 |
- .window/x1 LDZ2 #0060 ADD2 .window/y1 LDZ2 #0010 ADD2 .window/x1 LDZ2 #0090 ADD2 #00 ;theme/r1 .selection LDZ ADD LDA 4** #01 ;draw-slider JSR2 |
|
| 219 |
- .window/x1 LDZ2 #0060 ADD2 .window/y1 LDZ2 #0020 ADD2 .window/x1 LDZ2 #0090 ADD2 #00 ;theme/g1 .selection LDZ ADD LDA 4** #01 ;draw-slider JSR2 |
|
| 220 |
- .window/x1 LDZ2 #0060 ADD2 .window/y1 LDZ2 #0030 ADD2 .window/x1 LDZ2 #0090 ADD2 #00 ;theme/b1 .selection LDZ ADD LDA 4** #01 ;draw-slider JSR2 |
|
| 221 |
- |
|
| 222 |
- .window/x1 LDZ2 #0050 ADD2 .Screen/x DEO2 |
|
| 223 |
- .window/y1 LDZ2 #0040 ADD2 .Screen/y DEO2 |
|
| 224 |
- ;radio_icns #00 .selection LDZ #00 EQU 8** ADD2 .Screen/addr DEO2 |
|
| 225 |
- #05 .Screen/sprite DEO |
|
| 226 |
- |
|
| 227 |
- .window/x1 LDZ2 #0060 ADD2 .Screen/x DEO2 |
|
| 228 |
- .window/y1 LDZ2 #0040 ADD2 .Screen/y DEO2 |
|
| 229 |
- ;radio_icns #00 .selection LDZ #01 EQU 8** ADD2 .Screen/addr DEO2 |
|
| 230 |
- #05 .Screen/sprite DEO |
|
| 231 |
- |
|
| 232 |
- .window/x1 LDZ2 #0070 ADD2 .Screen/x DEO2 |
|
| 233 |
- .window/y1 LDZ2 #0040 ADD2 .Screen/y DEO2 |
|
| 234 |
- ;radio_icns #00 .selection LDZ #02 EQU 8** ADD2 .Screen/addr DEO2 |
|
| 235 |
- #05 .Screen/sprite DEO |
|
| 236 |
- |
|
| 237 |
- .window/x1 LDZ2 #0080 ADD2 .Screen/x DEO2 |
|
| 238 |
- .window/y1 LDZ2 #0040 ADD2 .Screen/y DEO2 |
|
| 239 |
- ;radio_icns #00 .selection LDZ #03 EQU 8** ADD2 .Screen/addr DEO2 |
|
| 240 |
- #05 .Screen/sprite DEO |
|
| 241 |
- |
|
| 242 |
-RTN |
|
| 243 |
- |
|
| 244 |
-@draw-cursor ( -- ) |
|
| 245 |
- |
|
| 246 |
- ( clear last cursor ) |
|
| 247 |
- ;pointer_icn .Screen/addr DEO2 |
|
| 248 |
- .pointer/x LDZ2 .Screen/x DEO2 |
|
| 249 |
- .pointer/y LDZ2 .Screen/y DEO2 |
|
| 250 |
- #40 .Screen/sprite DEO |
|
| 251 |
- |
|
| 252 |
- ( record pointer positions ) |
|
| 253 |
- .Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2 |
|
| 254 |
- .Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2 |
|
| 255 |
- |
|
| 256 |
- #43 .Mouse/state DEI #00 NEQ DUP ADD SUB .Screen/sprite DEO |
|
| 257 |
- |
|
| 258 |
-RTN |
|
| 259 |
- |
|
| 260 |
-@draw-slider ( x1* y* x2* pos* color -- ) |
|
| 261 |
- |
|
| 262 |
- ( load ) .color STZ .slider/pos STZ2 .slider/x2 STZ2 .slider/y STZ2 .slider/x1 STZ2 |
|
| 263 |
- |
|
| 264 |
- .slider/x1 LDZ2 .Screen/x DEO2 |
|
| 265 |
- .slider/y LDZ2 .Screen/y DEO2 |
|
| 266 |
- ;halftone_icn .Screen/addr DEO2 |
|
| 267 |
- |
|
| 268 |
- ;slidera_icn .Screen/addr DEO2 |
|
| 269 |
- ( draw ) #05 .Screen/sprite DEO |
|
| 270 |
- ;sliderb_icn .Screen/addr DEO2 |
|
| 271 |
- |
|
| 272 |
- &loop |
|
| 273 |
- ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 |
|
| 274 |
- ( draw ) #05 .Screen/sprite DEO |
|
| 275 |
- .Screen/x DEI2 .slider/x2 LDZ2 #0008 ADD2 LTH2 ,&loop JCN |
|
| 276 |
- |
|
| 277 |
- ( incr ) .Screen/x DEI2 #0004 ADD2 .Screen/x DEO2 |
|
| 278 |
- ;sliderc_icn .Screen/addr DEO2 |
|
| 279 |
- ( draw ) #05 .Screen/sprite DEO |
|
| 280 |
- |
|
| 281 |
- .slider/x1 LDZ2 .slider/pos LDZ2 ADD2 .Screen/x DEO2 |
|
| 282 |
- ;sliderd_icn .Screen/addr DEO2 |
|
| 283 |
- ( draw ) #0a .Screen/sprite DEO |
|
| 284 |
- |
|
| 285 |
-RTN |
|
| 286 |
- |
|
| 287 |
-@fill-rect ( x1* y1* x2* y2* color -- ) |
|
| 288 |
- |
|
| 289 |
- .color STZ |
|
| 290 |
- STH2 ROT2 ROT2 STH2 ( x2 x1 / y2 y1 ) |
|
| 291 |
- &ver |
|
| 292 |
- ( save ) STH2kr .Screen/y DEO2 |
|
| 293 |
- OVR2 OVR2 |
|
| 294 |
- &hor |
|
| 295 |
- ( save ) DUP2 .Screen/x DEO2 |
|
| 296 |
- ( draw ) .color LDZ .Screen/pixel DEO |
|
| 297 |
- ( incr ) INC2 |
|
| 298 |
- GTH2k ,&hor JCN |
|
| 299 |
- POP2 POP2 |
|
| 300 |
- ( incr ) INC2r |
|
| 301 |
- GTH2kr STHr ,&ver JCN |
|
| 302 |
- POP2 POP2 POP2r POP2r |
|
| 303 |
- |
|
| 304 |
-RTN |
|
| 305 |
- |
|
| 306 |
-@line-rect ( x1* y1* x2* y2* color -- ) |
|
| 307 |
- |
|
| 308 |
- STH |
|
| 309 |
- DUP2 ,&ver-y2 STR2 ,&hor-y2 STR2 |
|
| 310 |
- DUP2 ,&ver-x2 STR2 ,&hor-x2 STR2 |
|
| 311 |
- DUP2 ,&ver-y1 STR2 ,&hor-y1 STR2 |
|
| 312 |
- DUP2 ,&ver-x1 STR2 ,&hor-x1 STR2 |
|
| 313 |
- ( horizontal ) |
|
| 314 |
- [ LIT2 &hor-x2 $2 ] INC2 [ LIT2 &hor-x1 $2 ] |
|
| 315 |
- &hor |
|
| 316 |
- DUP2 .Screen/x DEO2 |
|
| 317 |
- [ LIT2 &hor-y1 $2 ] .Screen/y DEO2 STHkr .Screen/pixel DEOk |
|
| 318 |
- [ LIT2 &hor-y2 $2 ] .Screen/y DEO2 DEO |
|
| 319 |
- INC2 GTH2k ,&hor JCN |
|
| 320 |
- POP2 POP2 |
|
| 321 |
- ( vertical ) |
|
| 322 |
- [ LIT2 &ver-y2 $2 ] [ LIT2 &ver-y1 $2 ] |
|
| 323 |
- &ver |
|
| 324 |
- DUP2 .Screen/y DEO2 |
|
| 325 |
- [ LIT2 &ver-x1 $2 ] .Screen/x DEO2 STHkr .Screen/pixel DEOk |
|
| 326 |
- [ LIT2 &ver-x2 $2 ] .Screen/x DEO2 DEO |
|
| 327 |
- INC2 GTH2k ,&ver JCN |
|
| 328 |
- POP2 POP2 |
|
| 329 |
- POPr |
|
| 330 |
- |
|
| 331 |
-RTN |
|
| 332 |
- |
|
| 333 |
-@draw-label ( x* y* addr* color -- ) |
|
| 334 |
- |
|
| 335 |
- STH STH2 |
|
| 336 |
- .Screen/y DEO2 |
|
| 337 |
- .Screen/x DEO2 |
|
| 338 |
- STH2r |
|
| 339 |
- &loop |
|
| 340 |
- LDAk #00 SWP 8** |
|
| 341 |
- ;font ADD2 .Screen/addr DEO2 |
|
| 342 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 343 |
- ( incr ) ++ |
|
| 344 |
- ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 |
|
| 345 |
- LDAk ,&loop JCN |
|
| 346 |
- POP2 POPr |
|
| 347 |
- |
|
| 348 |
-RTN |
|
| 349 |
- |
|
| 350 |
-@draw-short ( short* color -- ) |
|
| 351 |
- |
|
| 352 |
- STH SWP |
|
| 353 |
- DUP #04 SFT #00 SWP 8** ;font-hex ADD2 .Screen/addr DEO2 |
|
| 354 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 355 |
- #0f AND #00 SWP 8** ;font-hex ADD2 .Screen/addr DEO2 |
|
| 356 |
- .Screen/x DEI2 8+ .Screen/x DEO2 |
|
| 357 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 358 |
- DUP #04 SFT #00 SWP 8** ;font-hex ADD2 .Screen/addr DEO2 |
|
| 359 |
- .Screen/x DEI2 8+ .Screen/x DEO2 |
|
| 360 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 361 |
- #0f AND #00 SWP 8** ;font-hex ADD2 .Screen/addr DEO2 |
|
| 362 |
- .Screen/x DEI2 8+ .Screen/x DEO2 |
|
| 363 |
- ( draw ) STHr .Screen/sprite DEO |
|
| 364 |
- |
|
| 365 |
-RTN |
|
| 366 |
- |
|
| 367 |
-@red_txt [ "Red 00 ] |
|
| 368 |
-@green_txt [ "Green 00 ] |
|
| 369 |
-@blue_txt [ "Blue 00 ] |
|
| 370 |
- |
|
| 371 |
-@pointer_icn [ 80c0 e0f0 f8e0 1000 ] |
|
| 372 |
-@halftone_icn [ aa55 aa55 aa55 aa55 ] |
|
| 373 |
-@slidera_icn [ 3f7f ffff ffff 7f3f ] |
|
| 374 |
-@sliderb_icn [ ffff ffff ffff ffff ] |
|
| 375 |
-@sliderc_icn [ fcfe ffff ffff fefc ] |
|
| 376 |
-@sliderd_icn [ 003c 7e7e 7e7e 3c00 ] |
|
| 377 |
- |
|
| 378 |
-@preview_icn |
|
| 379 |
- 183c 66db db66 3c18 |
|
| 380 |
- 0000 183c 3c18 0000 |
|
| 381 |
-@radio_icns |
|
| 382 |
- 3c42 8181 8181 423c |
|
| 383 |
- 3c42 99bd bd99 423c |
|
| 384 |
- |
|
| 385 |
-@font-hex |
|
| 386 |
- 003c 464a 5262 3c00 0018 0808 0808 1c00 |
|
| 387 |
- 003c 4202 3c40 7e00 003c 421c 0242 3c00 |
|
| 388 |
- 000c 1424 447e 0400 007e 407c 0242 3c00 |
|
| 389 |
- 003c 407c 4242 3c00 007e 0204 0810 1000 |
|
| 390 |
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 |
|
| 391 |
- 003c 4242 7e42 4200 007c 427c 4242 7c00 |
|
| 392 |
- 003c 4240 4042 3c00 007c 4242 4242 7c00 |
|
| 393 |
- 007e 4078 4040 7e00 007e 4078 4040 4000 |
|
| 394 |
- |
|
| 395 |
-@font ( spectrum-zx font ) |
|
| 396 |
- 0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000 |
|
| 397 |
- 0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000 |
|
| 398 |
- 007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000 |
|
| 399 |
- 0038 446c 107c 1000 000c 0808 0838 3800 003e 2222 2266 6600 0000 0822 0022 0800 |
|
| 400 |
- 0000 1018 1c18 1000 0000 0818 3818 0800 0008 1c00 001c 0800 0028 2828 2800 2800 |
|
| 401 |
- 003e 4a4a 3a0a 0a00 000c 3046 620c 3000 0000 0000 0000 ffff 0010 3800 3810 0038 |
|
| 402 |
- 0008 1c2a 0808 0800 0008 0808 2a1c 0800 0000 0804 7e04 0800 0000 1020 7e20 1000 |
|
| 403 |
- 0000 4040 7e00 0000 0000 0024 6624 0000 0000 1038 7c00 0000 0000 007c 3810 0000 |
|
| 404 |
- 0000 0000 0000 0000 0008 0808 0800 0800 0014 1400 0000 0000 0024 7e24 247e 2400 |
|
| 405 |
- 0008 1e28 1c0a 3c08 0042 0408 1020 4200 0030 4832 4c44 3a00 0008 1000 0000 0000 |
|
| 406 |
- 0004 0808 0808 0400 0010 0808 0808 1000 0000 1408 3e08 1400 0000 0808 3e08 0800 |
|
| 407 |
- 0000 0000 0008 0810 0000 0000 3c00 0000 0000 0000 0000 0800 0000 0204 0810 2000 |
|
| 408 |
- 003c 464a 5262 3c00 0018 2808 0808 3e00 003c 4202 3c40 7e00 003c 421c 0242 3c00 |
|
| 409 |
- 0008 1828 487e 0800 007e 407c 0242 3c00 003c 407c 4242 3c00 007e 0204 0810 1000 |
|
| 410 |
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 0000 0008 0000 0800 0000 0800 0008 0810 |
|
| 411 |
- 0000 0810 2010 0800 0000 003e 003e 0000 0000 1008 0408 1000 003c 4202 0c00 0800 |
|
| 412 |
- 003c 425a 5442 3c00 0018 2442 7e42 4200 007c 427c 4242 7c00 003c 4240 4042 3c00 |
|
| 413 |
- 0078 4442 4244 7800 007e 407c 4040 7e00 003e 4040 7c40 4000 003c 4240 4e42 3c00 |
|
| 414 |
- 0042 427e 4242 4200 003e 0808 0808 3e00 0002 0202 4242 3c00 0044 4870 4844 4200 |
|
| 415 |
- 0040 4040 4040 7e00 0042 665a 4242 4200 0042 6252 4a46 4200 003c 4242 4242 3c00 |
|
| 416 |
- 007c 4242 7c40 4000 003c 4242 524a 3c00 007c 4242 7c44 4200 003c 403c 0242 3c00 |
|
| 417 |
- 00fe 1010 1010 1000 0042 4242 4242 3c00 0042 4242 4224 1800 0042 4242 5a66 4200 |
|
| 418 |
- 0042 2418 1824 4200 0082 4428 1010 1000 007e 0408 1020 7e00 000c 0808 0808 0c00 |
|
| 419 |
- 0040 2010 0804 0200 0018 0808 0808 1800 0008 1422 0000 0000 0000 0000 0000 7e00 |
|
| 420 |
- 0008 0400 0000 0000 0000 1c02 1e22 1e00 0020 203c 2222 3c00 0000 1e20 2020 1e00 |
|
| 421 |
- 0002 021e 2222 1e00 0000 1c22 3c20 1e00 000c 101c 1010 1000 0000 1c22 221e 021c |
|
| 422 |
- 0020 202c 3222 2200 0008 0018 0808 0400 0008 0008 0808 4830 0020 2428 3028 2400 |
|
| 423 |
- 0010 1010 1010 0c00 0000 6854 5454 5400 0000 5864 4444 4400 0000 3844 4444 3800 |
|
| 424 |
- 0000 7844 4478 4040 0000 3c44 443c 0406 0000 2c30 2020 2000 0000 3840 3804 7800 |
|
| 425 |
- 0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800 |
|
| 426 |
- 0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00 |
|
| 427 |
- 0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c |
| ... | ... |
@@ -7,7 +7,7 @@ |
| 7 | 7 |
|
| 8 | 8 |
|0000 |
| 9 | 9 |
|
| 10 |
-@last |
|
| 10 |
+@last |
|
| 11 | 11 |
&day $1 &sec $1 |
| 12 | 12 |
@center |
| 13 | 13 |
&x $2 &y $2 |
| ... | ... |
@@ -16,8 +16,8 @@ |
| 16 | 16 |
@time |
| 17 | 17 |
&x $2 &y $2 |
| 18 | 18 |
@needles |
| 19 |
- &hx $2 &hy $2 |
|
| 20 |
- &mx $2 &my $2 |
|
| 19 |
+ &hx $2 &hy $2 |
|
| 20 |
+ &mx $2 &my $2 |
|
| 21 | 21 |
&sx $2 &sy $2 |
| 22 | 22 |
&zx $2 &zy $2 |
| 23 | 23 |
@buf |
| ... | ... |
@@ -26,28 +26,28 @@ |
| 26 | 26 |
&x $2 &y $2 &dx $2 &dy $2 &e1 $2 |
| 27 | 27 |
|
| 28 | 28 |
|0100 ( -> ) |
| 29 |
- |
|
| 30 |
- ( theme ) |
|
| 31 |
- #0ff8 .System/r DEO2 |
|
| 32 |
- #0f08 .System/g DEO2 |
|
| 29 |
+ |
|
| 30 |
+ ( theme ) |
|
| 31 |
+ #0ff8 .System/r DEO2 |
|
| 32 |
+ #0f08 .System/g DEO2 |
|
| 33 | 33 |
#0f08 .System/b DEO2 |
| 34 | 34 |
( resize ) |
| 35 | 35 |
#00f0 .Screen/width DEO2 |
| 36 | 36 |
#0120 .Screen/height DEO2 |
| 37 |
- ( vectors ) |
|
| 37 |
+ ( vectors ) |
|
| 38 | 38 |
;on-frame .Screen/vector DEO2 |
| 39 | 39 |
( center ) |
| 40 |
- .Screen/width DEI2 #01 SFT2 |
|
| 40 |
+ .Screen/width DEI2 #01 SFT2 |
|
| 41 | 41 |
DUP2 .center/x STZ2 |
| 42 | 42 |
DUP2 #0028 SUB2 .date/x STZ2 |
| 43 | 43 |
#0020 SUB2 .time/x STZ2 |
| 44 |
- .Screen/height DEI2 #01 SFT2 |
|
| 44 |
+ .Screen/height DEI2 #01 SFT2 |
|
| 45 | 45 |
DUP2 .center/y STZ2 |
| 46 | 46 |
DUP2 #0078 SUB2 .date/y STZ2 |
| 47 | 47 |
#006c ADD2 .time/y STZ2 |
| 48 | 48 |
;draw-watchface JSR2 |
| 49 | 49 |
( time buffer ) |
| 50 |
- LIT ': |
|
| 50 |
+ LIT ': |
|
| 51 | 51 |
DUP .buf/s1 STZ |
| 52 | 52 |
.buf/s2 STZ |
| 53 | 53 |
|
| ... | ... |
@@ -56,7 +56,7 @@ |
| 56 | 56 |
@on-frame ( -> ) |
| 57 | 57 |
|
| 58 | 58 |
( once per second ) |
| 59 |
- .DateTime/second DEI |
|
| 59 |
+ .DateTime/second DEI |
|
| 60 | 60 |
DUP .last/sec LDZ EQU ,&same-sec JCN |
| 61 | 61 |
( make time ) |
| 62 | 62 |
.DateTime/hour DEI .buf/h ;decimal JSR2 |
| ... | ... |
@@ -75,7 +75,7 @@ |
| 75 | 75 |
POP |
| 76 | 76 |
|
| 77 | 77 |
( once per day ) |
| 78 |
- .DateTime/day DEI |
|
| 78 |
+ .DateTime/day DEI |
|
| 79 | 79 |
DUP .last/day LDZ EQU ,&same-day JCN |
| 80 | 80 |
( make date ) |
| 81 | 81 |
DUP .buf/d ;decimal JSR2 |
| ... | ... |
@@ -94,19 +94,19 @@ BRK |
| 94 | 94 |
@draw-needles ( draw -- ) |
| 95 | 95 |
|
| 96 | 96 |
STH |
| 97 |
- .center/x LDZ2 .center/y LDZ2 |
|
| 97 |
+ .center/x LDZ2 .center/y LDZ2 |
|
| 98 | 98 |
OVR2 OVR2 |
| 99 |
- .needles/mx LDZ2 .needles/my LDZ2 #01 STHkr MUL |
|
| 99 |
+ .needles/mx LDZ2 .needles/my LDZ2 #01 STHkr MUL |
|
| 100 | 100 |
;draw-line JSR2 |
| 101 | 101 |
OVR2 OVR2 |
| 102 |
- .needles/hx LDZ2 .needles/hy LDZ2 #01 STHkr MUL |
|
| 102 |
+ .needles/hx LDZ2 .needles/hy LDZ2 #01 STHkr MUL |
|
| 103 | 103 |
;draw-line JSR2 |
| 104 | 104 |
.needles/sx LDZ2 .needles/sy LDZ2 |
| 105 |
- .needles/zx LDZ2 .needles/zy LDZ2 #02 STHr MUL |
|
| 105 |
+ .needles/zx LDZ2 .needles/zy LDZ2 #02 STHr MUL |
|
| 106 | 106 |
;draw-line JSR2 |
| 107 | 107 |
|
| 108 | 108 |
( middle ) |
| 109 |
- #0001 SUB2 .Screen/y DEO2 |
|
| 109 |
+ #0001 SUB2 .Screen/y DEO2 |
|
| 110 | 110 |
#0001 SUB2 .Screen/x DEO2 |
| 111 | 111 |
;middle-icn .Screen/addr DEO2 |
| 112 | 112 |
#0a .Screen/sprite DEO |
| ... | ... |
@@ -140,7 +140,7 @@ JMP2r |
| 140 | 140 |
&colon POP ;font/colon ,&end JMP |
| 141 | 141 |
|
| 142 | 142 |
@draw-line ( x1* y1* x2* y2* color -- ) |
| 143 |
- |
|
| 143 |
+ |
|
| 144 | 144 |
( load ) STH ,&y STR2 ,&x STR2 .line/y STZ2 .line/x STZ2 |
| 145 | 145 |
,&x LDR2 .line/x LDZ2 SUB2 ;abs2 JSR2 .line/dx STZ2 |
| 146 | 146 |
#0000 ,&y LDR2 .line/y LDZ2 SUB2 ;abs2 JSR2 SUB2 .line/dy STZ2 |
| ... | ... |
@@ -148,8 +148,8 @@ JMP2r |
| 148 | 148 |
#ffff #00 .line/y LDZ2 ,&y LDR2 ;lts2 JSR2 #10 SFT2 ADD2 ,&sy STR2 |
| 149 | 149 |
.line/dx LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2 |
| 150 | 150 |
&loop |
| 151 |
- .line/x LDZ2 DUP2 .Screen/x DEO2 [ LIT2 &x $2 ] EQU2 |
|
| 152 |
- .line/y LDZ2 DUP2 .Screen/y DEO2 [ LIT2 &y $2 ] EQU2 |
|
| 151 |
+ .line/x LDZ2 DUP2 .Screen/x DEO2 [ LIT2 &x $2 ] EQU2 |
|
| 152 |
+ .line/y LDZ2 DUP2 .Screen/y DEO2 [ LIT2 &y $2 ] EQU2 |
|
| 153 | 153 |
STHkr .Screen/pixel DEO |
| 154 | 154 |
AND ,&end JCN |
| 155 | 155 |
.line/e1 LDZ2 #10 SFT2 DUP2 |
| ... | ... |
@@ -169,15 +169,15 @@ JMP2r |
| 169 | 169 |
|
| 170 | 170 |
@draw-watchface ( -- ) |
| 171 | 171 |
|
| 172 |
- #3c00 |
|
| 172 |
+ #3c00 |
|
| 173 | 173 |
&loop |
| 174 | 174 |
( dots ) |
| 175 |
- #00 OVR #10 SFT2 ;table ADD2 LDA2 |
|
| 175 |
+ #00 OVR #10 SFT2 ;table ADD2 LDA2 |
|
| 176 | 176 |
#0018 ;circle JSR2 |
| 177 | 177 |
.Screen/x DEO2 .Screen/y DEO2 #01 .Screen/pixel DEO |
| 178 | 178 |
( markers ) |
| 179 | 179 |
DUP #05 ;mod JSR2 ,&no-marker JCN |
| 180 |
- #00 OVR #10 SFT2 ;table ADD2 LDA2 |
|
| 180 |
+ #00 OVR #10 SFT2 ;table ADD2 LDA2 |
|
| 181 | 181 |
STH2k #0018 ;circle JSR2 SWP2 |
| 182 | 182 |
STH2r #001c ;circle JSR2 SWP2 |
| 183 | 183 |
#01 ;draw-line JSR2 |
| ... | ... |
@@ -192,9 +192,9 @@ JMP2r |
| 192 | 192 |
[ #00 .DateTime/second DEI #1e ADD #3c ;mod JSR2 ] #10 SFT2 ;table ADD2 LDA2 |
| 193 | 193 |
#00a0 ,circle JSR .needles/zx STZ2 .needles/zy STZ2 |
| 194 | 194 |
[ #00 .DateTime/second DEI ] #10 SFT2 ;table ADD2 LDA2 |
| 195 |
- #0020 ,circle JSR .needles/sx STZ2 .needles/sy STZ2 |
|
| 195 |
+ #0020 ,circle JSR .needles/sx STZ2 .needles/sy STZ2 |
|
| 196 | 196 |
[ #00 .DateTime/minute DEI ] #10 SFT2 ;table ADD2 LDA2 |
| 197 |
- #0022 ,circle JSR .needles/mx STZ2 .needles/my STZ2 |
|
| 197 |
+ #0022 ,circle JSR .needles/mx STZ2 .needles/my STZ2 |
|
| 198 | 198 |
[ #00 .DateTime/hour DEI #0c ;mod JSR2 #20 SFTk NIP ADD ] |
| 199 | 199 |
( minute offset ) [ #00 .DateTime/minute DEI #0f DIV ADD2 ] #10 SFT2 ;table ADD2 LDA2 |
| 200 | 200 |
#002a ,circle JSR .needles/hx STZ2 .needles/hy STZ2 |
| ... | ... |
@@ -228,7 +228,7 @@ JMP2r |
| 228 | 228 |
@is-num DUP #2f GTH SWP #3a LTH AND JMP2r |
| 229 | 229 |
|
| 230 | 230 |
@week-txt |
| 231 |
- "Sun $1 "Mon $1 "Tue $1 "Wed $1 "Thu $1 "Fri $1 |
|
| 231 |
+ "Sun $1 "Mon $1 "Tue $1 "Wed $1 "Thu $1 "Fri $1 |
|
| 232 | 232 |
"Sat $1 |
| 233 | 233 |
|
| 234 | 234 |
@month-txt |