| ... | ... |
@@ -41,14 +41,14 @@ BRK |
| 41 | 41 |
@print ( addr -- ) |
| 42 | 42 |
|
| 43 | 43 |
&loop |
| 44 |
- ( send ) DUP2 GET .Console/char IOW |
|
| 44 |
+ ( send ) DUP2 GET .Console/char DEO |
|
| 45 | 45 |
( incr ) #0001 ADD2 |
| 46 | 46 |
( loop ) DUP2 GET #00 NEQ ,&loop JNZ |
| 47 | 47 |
POP2 |
| 48 | 48 |
|
| 49 | 49 |
RTN |
| 50 | 50 |
|
| 51 |
-@hello-word [ 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 ] |
|
| 51 |
+@hello-word "hello 20 "World! |
|
| 52 | 52 |
``` |
| 53 | 53 |
|
| 54 | 54 |
## TODOs |
| ... | ... |
@@ -17,11 +17,11 @@ BRK |
| 17 | 17 |
@print ( addr -- ) |
| 18 | 18 |
|
| 19 | 19 |
&loop |
| 20 |
- ( send ) DUP2 GET .Console/char IOW |
|
| 20 |
+ ( send ) DUP2 GET .Console/char DEO |
|
| 21 | 21 |
( incr ) #0001 ADD2 |
| 22 | 22 |
( loop ) DUP2 GET #00 NEQ ,&loop JNZ |
| 23 | 23 |
POP2 |
| 24 | 24 |
|
| 25 | 25 |
RTN |
| 26 | 26 |
|
| 27 |
-@hello-word [ 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 ] |
|
| 27 |
+@hello-word "hello 20 "World! |
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
( dev/controller/buttons ) |
| 2 | 2 |
|
| 3 |
-%=>SC/ADDR { .Screen/addr IOW2 }
|
|
| 4 |
-%->SC/COLR { .Screen/color IOW }
|
|
| 3 |
+%=>SC/ADDR { .Screen/addr DEO2 }
|
|
| 4 |
+%->SC/COLR { .Screen/color DEO }
|
|
| 5 | 5 |
%++ { #0001 ADD2 }
|
| 6 | 6 |
%-- { #0001 SUB2 }
|
| 7 | 7 |
%2/ { #0002 DIV2 }
|
| ... | ... |
@@ -23,16 +23,16 @@ |
| 23 | 23 |
|0100 ( -> ) |
| 24 | 24 |
|
| 25 | 25 |
( theme ) |
| 26 |
- #0daf .System/r IOW2 |
|
| 27 |
- #02ff .System/g IOW2 |
|
| 28 |
- #035f .System/b IOW2 |
|
| 26 |
+ #0daf .System/r DEO2 |
|
| 27 |
+ #02ff .System/g DEO2 |
|
| 28 |
+ #035f .System/b DEO2 |
|
| 29 | 29 |
|
| 30 | 30 |
( vectors ) |
| 31 |
- ;on-frame .Screen/vector IOW2 |
|
| 31 |
+ ;on-frame .Screen/vector DEO2 |
|
| 32 | 32 |
|
| 33 | 33 |
( set origin ) |
| 34 |
- .Screen/width IOR2 2/ .Screen/x IOW2 |
|
| 35 |
- .Screen/height IOR2 2/ .Screen/y IOW2 |
|
| 34 |
+ .Screen/width DEI2 2/ .Screen/x DEO2 |
|
| 35 |
+ .Screen/height DEI2 2/ .Screen/y DEO2 |
|
| 36 | 36 |
|
| 37 | 37 |
;default_icn =>SC/ADDR |
| 38 | 38 |
#31 ->SC/COLR |
| ... | ... |
@@ -46,7 +46,7 @@ BRK |
| 46 | 46 |
;default_icn =>SC/ADDR |
| 47 | 47 |
|
| 48 | 48 |
( hold ctrl key to change slime color ) |
| 49 |
- .Controller/button IOR #0f AND |
|
| 49 |
+ .Controller/button DEI #0f AND |
|
| 50 | 50 |
DUP #01 NEQ ,&no-ctrl JNZ #25 .slime POK &no-ctrl |
| 51 | 51 |
DUP #02 NEQ ,&no-alt JNZ #2f .slime POK &no-alt |
| 52 | 52 |
POP |
| ... | ... |
@@ -54,22 +54,22 @@ BRK |
| 54 | 54 |
( clear ) #30 ->SC/COLR |
| 55 | 55 |
|
| 56 | 56 |
( detect movement ) |
| 57 |
- .Controller/button IOR #f0 AND |
|
| 57 |
+ .Controller/button DEI #f0 AND |
|
| 58 | 58 |
DUP #04 SFT #01 AND #01 NEQ ,&no-up JNZ |
| 59 | 59 |
( move ) |
| 60 |
- .Screen/y IOR2 -- .Screen/y IOW2 |
|
| 60 |
+ .Screen/y DEI2 -- .Screen/y DEO2 |
|
| 61 | 61 |
;up_icn =>SC/ADDR &no-up |
| 62 | 62 |
DUP #05 SFT #01 AND #01 NEQ ,&no-down JNZ |
| 63 | 63 |
( move ) |
| 64 |
- .Screen/y IOR2 ++ .Screen/y IOW2 |
|
| 64 |
+ .Screen/y DEI2 ++ .Screen/y DEO2 |
|
| 65 | 65 |
;down_icn =>SC/ADDR &no-down |
| 66 | 66 |
DUP #06 SFT #01 AND #01 NEQ ,&no-left JNZ |
| 67 | 67 |
( move ) |
| 68 |
- .Screen/x IOR2 -- .Screen/x IOW2 |
|
| 68 |
+ .Screen/x DEI2 -- .Screen/x DEO2 |
|
| 69 | 69 |
;left_icn =>SC/ADDR &no-left |
| 70 | 70 |
DUP #07 SFT #01 AND #01 NEQ ,&no-right JNZ |
| 71 | 71 |
( move ) |
| 72 |
- .Screen/x IOR2 ++ .Screen/x IOW2 |
|
| 72 |
+ .Screen/x DEI2 ++ .Screen/x DEO2 |
|
| 73 | 73 |
;right_icn =>SC/ADDR &no-right |
| 74 | 74 |
POP |
| 75 | 75 |
|
| ... | ... |
@@ -15,11 +15,11 @@ |
| 15 | 15 |
|0100 ( -> ) |
| 16 | 16 |
|
| 17 | 17 |
( theme ) |
| 18 |
- #0f73 .System/r IOW2 |
|
| 19 |
- #0fe3 .System/g IOW2 |
|
| 20 |
- #0fc3 .System/b IOW2 |
|
| 18 |
+ #0f73 .System/r DEO2 |
|
| 19 |
+ #0fe3 .System/g DEO2 |
|
| 20 |
+ #0fc3 .System/b DEO2 |
|
| 21 | 21 |
|
| 22 |
- ( vectors ) ;on-button .Controller/vector IOW2 |
|
| 22 |
+ ( vectors ) ;on-button .Controller/vector DEO2 |
|
| 23 | 23 |
|
| 24 | 24 |
;draw-cursor JSR2 |
| 25 | 25 |
|
| ... | ... |
@@ -27,19 +27,19 @@ BRK |
| 27 | 27 |
|
| 28 | 28 |
@on-button ( -> ) |
| 29 | 29 |
|
| 30 |
- .Controller/key IOR #00 NEQ ,&skip JNZ BRK &skip |
|
| 30 |
+ .Controller/key DEI #00 NEQ ,&skip JNZ BRK &skip |
|
| 31 | 31 |
|
| 32 |
- .Controller/key IOR #0d NEQ ,&no-return JNZ |
|
| 33 |
- ( draw ) #20 .Screen/color IOW |
|
| 34 |
- ( reset ) #0000 .Screen/x IOW2 |
|
| 35 |
- ( incr ) .Screen/y IOR2 8+ .Screen/y IOW2 |
|
| 32 |
+ .Controller/key DEI #0d NEQ ,&no-return JNZ |
|
| 33 |
+ ( draw ) #20 .Screen/color DEO |
|
| 34 |
+ ( reset ) #0000 .Screen/x DEO2 |
|
| 35 |
+ ( incr ) .Screen/y DEI2 8+ .Screen/y DEO2 |
|
| 36 | 36 |
;draw-cursor JSR2 |
| 37 | 37 |
BRK |
| 38 | 38 |
&no-return |
| 39 | 39 |
|
| 40 |
- ;font #00 .Controller/key IOR 8* ADD2 .Screen/addr IOW2 |
|
| 41 |
- ( draw ) #21 .Screen/color IOW |
|
| 42 |
- ( incr ) .Screen/x IOR2 8+ .Screen/x IOW2 |
|
| 40 |
+ ;font #00 .Controller/key DEI 8* ADD2 .Screen/addr DEO2 |
|
| 41 |
+ ( draw ) #21 .Screen/color DEO |
|
| 42 |
+ ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 |
|
| 43 | 43 |
|
| 44 | 44 |
;draw-cursor JSR2 |
| 45 | 45 |
|
| ... | ... |
@@ -47,7 +47,7 @@ BRK |
| 47 | 47 |
|
| 48 | 48 |
@draw-cursor ( -- ) |
| 49 | 49 |
|
| 50 |
- ;cursor .Screen/addr IOW2 #22 .Screen/color IOW |
|
| 50 |
+ ;cursor .Screen/addr DEO2 #22 .Screen/color DEO |
|
| 51 | 51 |
|
| 52 | 52 |
RTN |
| 53 | 53 |
|
| ... | ... |
@@ -4,16 +4,6 @@ |
| 4 | 4 |
%STEP8 { #0033 SFT2 }
|
| 5 | 5 |
%++ { #01 ADD }
|
| 6 | 6 |
|
| 7 |
-%->MS/STAT { .Mouse/state IOW }
|
|
| 8 |
-%<-MS/STAT { .Mouse/state IOR }
|
|
| 9 |
-%->SC/COLR { .Screen/color IOW }
|
|
| 10 |
-%=>SC/ADDR { .Screen/addr IOW2 }
|
|
| 11 |
-%=>SC/X { .Screen/x IOW2 }
|
|
| 12 |
-%=>SC/Y { .Screen/y IOW2 }
|
|
| 13 |
-%<=SC/X { .Screen/x IOR2 }
|
|
| 14 |
-%<=MS/X { .Mouse/x IOR2 }
|
|
| 15 |
-%<=MS/Y { .Mouse/y IOR2 }
|
|
| 16 |
- |
|
| 17 | 7 |
%MEMORY { #1000 }
|
| 18 | 8 |
|
| 19 | 9 |
( devices ) |
| ... | ... |
@@ -29,178 +19,30 @@ |
| 29 | 19 |
|
| 30 | 20 |
|0000 |
| 31 | 21 |
|
| 32 |
-@loadbtn [ &x $2 &y $2 ] |
|
| 33 |
-@output [ &x $2 &y $2 ] |
|
| 34 |
-@pointer [ &x $2 &y $2 ] |
|
| 35 |
-@label [ &x $2 &y $2 &color $1 &addr $2 ] |
|
| 36 |
- |
|
| 37 | 22 |
( init ) |
| 38 | 23 |
|
| 39 | 24 |
|0100 ( -> ) |
| 40 | 25 |
|
| 41 | 26 |
( theme ) |
| 42 |
- #804b .System/r IOW2 |
|
| 43 |
- #804b .System/g IOW2 |
|
| 44 |
- #e0bb .System/b IOW2 |
|
| 45 |
- |
|
| 46 |
- ( vectors ) |
|
| 47 |
- ;on-mouse .Mouse/vector IOW2 |
|
| 48 |
- |
|
| 49 |
- #0020 .loadbtn/x STR |
|
| 50 |
- #0020 .loadbtn/y STR |
|
| 51 |
- #0020 .output/x STR |
|
| 52 |
- #0030 .output/y STR |
|
| 27 |
+ #804b .System/r DEO2 |
|
| 28 |
+ #804b .System/g DEO2 |
|
| 29 |
+ #e0bb .System/b DEO2 |
|
| 53 | 30 |
|
| 54 |
- .loadbtn/x LDR .loadbtn/y LDR #26 ;load_txt ;draw-label JSR2 |
|
| 31 |
+ ( load file ) |
|
| 32 |
+ #0100 .File/length DEO2 |
|
| 33 |
+ ;srcpath .File/name DEO2 |
|
| 34 |
+ MEMORY .File/load DEO2 |
|
| 55 | 35 |
|
| 56 |
- ;draw-file JSR2 |
|
| 36 |
+ .File/success DEI2 #0000 NEQ2 ;on-success JNZ2 |
|
| 57 | 37 |
|
| 58 | 38 |
BRK |
| 59 | 39 |
|
| 60 |
-@on-mouse ( -> ) |
|
| 61 |
- |
|
| 62 |
- .loadbtn/x LDR .loadbtn/y LDR #26 ;load_txt ;draw-label JSR2 |
|
| 63 |
- .loadbtn/x LDR #0028 ADD2 .loadbtn/y LDR #23 ;srcpath ;draw-label JSR2 |
|
| 64 |
- |
|
| 65 |
- <-MS/STAT #00 EQU ,&touch-end JNZ |
|
| 66 |
- |
|
| 67 |
- <=MS/Y STEP8 .loadbtn/y LDR NEQ2 ,&no-touch-load JNZ |
|
| 68 |
- .loadbtn/x LDR .loadbtn/y LDR #27 ;load_txt ;draw-label JSR2 |
|
| 69 |
- ;srcpath #0100 ;load-file JSR2 |
|
| 70 |
- ( release ) #00 ->MS/STAT |
|
| 71 |
- &no-touch-load |
|
| 72 |
- |
|
| 73 |
- &touch-end |
|
| 74 |
- |
|
| 75 |
- ;draw-cursor JSR2 |
|
| 76 |
- |
|
| 77 |
-BRK |
|
| 78 |
- |
|
| 79 |
-@draw-file ( -- ) |
|
| 80 |
- |
|
| 81 |
- #00 #10 |
|
| 82 |
- &ver |
|
| 83 |
- ( pos-y ) OVR #00 SWP #0008 MUL2 .output/y LDR ADD2 =>SC/Y |
|
| 84 |
- #00 #10 |
|
| 85 |
- &hor |
|
| 86 |
- ( pos-x ) OVR #00 SWP #0008 MUL2 .output/x LDR ADD2 =>SC/X |
|
| 87 |
- ( get x,y ) SWP2 OVR STH SWP2 OVR STHr |
|
| 88 |
- ( get id ) #10 MUL ADD |
|
| 89 |
- ( get data ) #00 SWP MEMORY ADD2 PEK2 |
|
| 90 |
- ( get sprite ) #20 SUB #00 SWP #0008 MUL2 ;font ADD2 =>SC/ADDR |
|
| 91 |
- ( draw ) #2d ->SC/COLR |
|
| 92 |
- ( incr ) SWP ++ SWP |
|
| 93 |
- DUP2 NEQ ,&hor JNZ |
|
| 94 |
- POP2 |
|
| 95 |
- ( incr ) SWP ++ SWP |
|
| 96 |
- DUP2 NEQ ,&ver JNZ |
|
| 97 |
- POP2 |
|
| 98 |
- |
|
| 99 |
-RTN |
|
| 100 |
- |
|
| 101 |
-@load-file ( path length -- ) |
|
| 40 |
+@on-success ( -> ) |
|
| 102 | 41 |
|
| 103 |
- .File/length IOW2 .File/name IOW2 MEMORY .File/load IOW2 |
|
| 104 |
- .File/success IOR2 #0000 EQU2 ,&no-success JNZ |
|
| 105 |
- |
|
| 106 |
- ;draw-file JSR2 |
|
| 107 |
- .output/x LDR .output/y LDR #0088 ADD2 #23 ;done_txt ;draw-label JSR2 |
|
| 108 |
- ( release ) #00 ->MS/STAT |
|
| 42 |
+ ;srcpath .Console/string DEO2 |
|
| 43 |
+ ;dstpath .Console/string DEO2 |
|
| 109 | 44 |
|
| 110 |
- &no-success |
|
| 111 |
- |
|
| 112 |
-RTN |
|
| 113 |
- |
|
| 114 |
-@draw-cursor ( -- ) |
|
| 115 |
- |
|
| 116 |
- ( clear last cursor ) |
|
| 117 |
- ;clear_icn =>SC/ADDR |
|
| 118 |
- .pointer/x LDR =>SC/X |
|
| 119 |
- .pointer/y LDR =>SC/Y |
|
| 120 |
- #30 ->SC/COLR |
|
| 121 |
- |
|
| 122 |
- ( record pointer positions ) |
|
| 123 |
- <=MS/X .pointer/x STR <=MS/Y .pointer/y STR |
|
| 124 |
- |
|
| 125 |
- ( draw new cursor ) |
|
| 126 |
- ;cursor_icn =>SC/ADDR |
|
| 127 |
- .pointer/x LDR =>SC/X |
|
| 128 |
- .pointer/y LDR =>SC/Y |
|
| 129 |
- #32 <-MS/STAT #00 NEQ ADD ->SC/COLR |
|
| 130 |
- |
|
| 131 |
-RTN |
|
| 132 |
- |
|
| 133 |
-@draw-label ( x y color addr -- ) |
|
| 134 |
- |
|
| 135 |
- ( load ) .label/addr STR .label/color POK =>SC/Y =>SC/X |
|
| 136 |
- .label/addr LDR |
|
| 137 |
- &loop |
|
| 138 |
- ( draw ) DUP2 PEK2 #20 SUB #00 SWP #0008 MUL2 ;font ADD2 =>SC/ADDR .label/color PEK ->SC/COLR |
|
| 139 |
- ( incr ) #0001 ADD2 |
|
| 140 |
- ( incr ) <=SC/X #0008 ADD2 =>SC/X |
|
| 141 |
- DUP2 PEK2 #00 NEQ ,&loop JNZ |
|
| 142 |
- POP2 |
|
| 143 |
- |
|
| 144 |
-RTN |
|
| 145 |
- |
|
| 146 |
-@clear_icn [ 0000 0000 0000 0000 ] |
|
| 147 |
-@cursor_icn [ 80c0 e0f0 f8e0 1000 ] |
|
| 148 |
- |
|
| 149 |
-@done_txt [ 4c4f 4144 2053 5543 4345 5353 2100 ] ( LOAD SUCCESS! ) |
|
| 150 |
-@load_txt [ 4c4f 4144 00 ] ( LOAD ) |
|
| 151 |
-@save_txt [ 5341 5645 00 ] ( SAVE ) |
|
| 152 |
- |
|
| 153 |
-@srcpath [ 5245 4144 4d45 2e6d 6400 ] ( README.md ) |
|
| 154 |
-@dstpath [ 6269 6e2f 6578 706f 7274 2e6d 6400 ] ( bin/export.md ) |
|
| 45 |
+BRK |
|
| 155 | 46 |
|
| 156 |
-@font ( specter8-frag font ) |
|
| 157 |
-[ |
|
| 158 |
- 0000 0000 0000 0000 0008 0808 0800 0800 |
|
| 159 |
- 0014 1400 0000 0000 0024 7e24 247e 2400 |
|
| 160 |
- 0008 1e28 1c0a 3c08 0000 2204 0810 2200 |
|
| 161 |
- 0030 4832 4c44 3a00 0008 1000 0000 0000 |
|
| 162 |
- 0004 0808 0808 0400 0020 1010 1010 2000 |
|
| 163 |
- 0000 2214 0814 2200 0000 0808 3e08 0800 |
|
| 164 |
- 0000 0000 0000 0810 0000 0000 3e00 0000 |
|
| 165 |
- 0000 0000 0000 0800 0000 0204 0810 2000 |
|
| 166 |
- 003c 464a 5262 3c00 0018 0808 0808 1c00 |
|
| 167 |
- 003c 4202 3c40 7e00 003c 421c 0242 3c00 |
|
| 168 |
- 000c 1424 447e 0400 007e 407c 0242 3c00 |
|
| 169 |
- 003c 407c 4242 3c00 007e 0204 0810 1000 |
|
| 170 |
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 |
|
| 171 |
- 0000 0010 0000 1000 0000 1000 0010 1020 |
|
| 172 |
- 0000 0810 2010 0800 0000 003e 003e 0000 |
|
| 173 |
- 0000 1008 0408 1000 003c 420c 1000 1000 |
|
| 174 |
- 003c 4232 4a42 3c00 003c 4242 7e42 4200 |
|
| 175 |
- 007c 427c 4242 7c00 003c 4240 4042 3c00 |
|
| 176 |
- 007c 4242 4242 7c00 007e 4078 4040 7e00 |
|
| 177 |
- 007e 4078 4040 4000 003c 4240 4642 3c00 |
|
| 178 |
- 0042 427e 4242 4200 001c 0808 0808 1c00 |
|
| 179 |
- 007e 0202 0242 3c00 0042 4478 4442 4200 |
|
| 180 |
- 0040 4040 4040 7e00 0042 665a 4242 4200 |
|
| 181 |
- 0042 6252 4a46 4200 003c 4242 4242 3c00 |
|
| 182 |
- 007c 4242 7c40 4000 003c 4242 4244 3a00 |
|
| 183 |
- 007c 4242 7c44 4200 003e 403c 0242 3c00 |
|
| 184 |
- 007e 0808 0808 1000 0042 4242 4244 3a00 |
|
| 185 |
- 0042 4242 4224 1800 0042 4242 5a66 4200 |
|
| 186 |
- 0042 423c 4242 4200 0042 423e 0242 3c00 |
|
| 187 |
- 007e 020c 3040 7e00 000c 0808 0808 0c00 |
|
| 188 |
- 0040 2010 0804 0200 0030 1010 1010 3000 |
|
| 189 |
- 0008 1400 0000 0000 0000 0000 0000 7e00 |
|
| 190 |
- 0008 0400 0000 0000 0000 3c02 3e42 3a00 |
|
| 191 |
- 0040 407c 4242 7c00 0000 3c42 4042 3c00 |
|
| 192 |
- 0002 023e 4242 3e00 0000 3c42 7e40 3e00 |
|
| 193 |
- 0000 3e40 7840 4000 0000 3c42 3e02 3c00 |
|
| 194 |
- 0040 405c 6242 4200 0008 0018 0808 0400 |
|
| 195 |
- 0008 0018 0808 4830 0040 4244 7844 4200 |
|
| 196 |
- 0010 1010 1010 0c00 0000 6c52 5252 5200 |
|
| 197 |
- 0000 5c62 4242 4200 0000 3c42 4242 3c00 |
|
| 198 |
- 0000 7c42 427c 4040 0000 3e42 423e 0202 |
|
| 199 |
- 0000 5c62 4040 4000 0000 3e40 3c02 7c00 |
|
| 200 |
- 0008 7e08 0808 1000 0000 4242 4244 3a00 |
|
| 201 |
- 0000 4242 4224 1800 0000 5252 5252 2e00 |
|
| 202 |
- 0000 4224 1824 4200 0000 4242 3e02 7c00 |
|
| 203 |
- 0000 7e02 3c40 7e00 000c 0810 1008 0c00 |
|
| 204 |
- 0008 0808 0808 0800 0030 1008 0810 3000 |
|
| 205 |
- 0000 0032 4c00 0000 3c42 99a1 a199 423c |
|
| 206 |
-] |
|
| 47 |
+@srcpath "README.md $1 |
|
| 48 |
+@dstpath "bin/export.md $1 |
| 207 | 49 |
deleted file mode 100644 |
| ... | ... |
@@ -1,140 +0,0 @@ |
| 1 |
-( Dev/Mouse ) |
|
| 2 |
- |
|
| 3 |
-%RTN { JMP2r }
|
|
| 4 |
-%8+ { #0008 ADD2 }
|
|
| 5 |
-%++ { #0001 ADD2 }
|
|
| 6 |
-%-- { #0001 SUB2 }
|
|
| 7 |
- |
|
| 8 |
-;touch1 { xc 2 yc 2 r 2 }
|
|
| 9 |
-;touch2 { xc 2 yc 2 r 2 }
|
|
| 10 |
- |
|
| 11 |
-;color { byte 1 }
|
|
| 12 |
-;addr { short 2 }
|
|
| 13 |
-;pointer { x 2 y 2 }
|
|
| 14 |
-;circle { xc 2 yc 2 x 2 y 2 r 2 d 2 }
|
|
| 15 |
- |
|
| 16 |
-( devices ) |
|
| 17 |
- |
|
| 18 |
-|0100 ;System { vector 2 pad 6 r 2 g 2 b 2 }
|
|
| 19 |
-|0120 ;Screen { vector 2 width 2 height 2 pad 2 x 2 y 2 addr 2 color 1 }
|
|
| 20 |
-|0160 ;Mouse { vector 2 x 2 y 2 state 1 chord 1 }
|
|
| 21 |
- |
|
| 22 |
-( program ) |
|
| 23 |
- |
|
| 24 |
-|0200 |
|
| 25 |
- |
|
| 26 |
- ( theme ) #03fd =System.r #0ef3 =System.g #0bf2 =System.b |
|
| 27 |
- ( vectors ) ,on-screen =Screen.vector |
|
| 28 |
- ( vectors ) ,on-mouse =Mouse.vector |
|
| 29 |
- |
|
| 30 |
-BRK |
|
| 31 |
- |
|
| 32 |
-@on-screen |
|
| 33 |
- |
|
| 34 |
- ( clear ) ~touch1.xc ~touch1.yc ~touch1.r #00 ,draw-circle JSR2 |
|
| 35 |
- ( clear ) ~touch2.xc ~touch2.yc ~touch2.r #00 ,draw-circle JSR2 |
|
| 36 |
- |
|
| 37 |
- ~touch1.r ++ =touch1.r |
|
| 38 |
- ~touch2.r ++ =touch2.r |
|
| 39 |
- |
|
| 40 |
- ( draw ) ~touch1.xc ~touch1.yc ~touch1.r #03 ,draw-circle JSR2 |
|
| 41 |
- ( draw ) ~touch2.xc ~touch2.yc ~touch2.r #02 ,draw-circle JSR2 |
|
| 42 |
- |
|
| 43 |
- ~touch1.xc ~touch1.yc #23 ,touch1.r #0001 ADD2 ,draw-byte JSR2 |
|
| 44 |
- ~touch2.xc ~touch2.yc #28 ,touch2.r #0001 ADD2 ,draw-byte JSR2 |
|
| 45 |
- |
|
| 46 |
-BRK |
|
| 47 |
- |
|
| 48 |
-@on-mouse |
|
| 49 |
- |
|
| 50 |
- ,draw-cursor JSR2 |
|
| 51 |
- |
|
| 52 |
- ~Mouse.state #01 NEQ ,$no-touch1 JNZ2 |
|
| 53 |
- ( clear ) ~touch1.xc ~touch1.yc ~touch1.r #00 ,draw-circle JSR2 |
|
| 54 |
- ( update ) ~Mouse.x =touch1.xc ~Mouse.y =touch1.yc #0000 =touch1.r |
|
| 55 |
- ( release ) #00 =Mouse.state |
|
| 56 |
- $no-touch1 |
|
| 57 |
- ~Mouse.state #10 NEQ ,$no-touch2 JNZ2 |
|
| 58 |
- ( clear ) ~touch2.xc ~touch2.yc ~touch2.r #00 ,draw-circle JSR2 |
|
| 59 |
- ( update ) ~Mouse.x =touch2.xc ~Mouse.y =touch2.yc #0000 =touch2.r |
|
| 60 |
- ( release ) #00 =Mouse.state |
|
| 61 |
- $no-touch2 |
|
| 62 |
- |
|
| 63 |
-BRK |
|
| 64 |
- |
|
| 65 |
-@draw-cursor ( -- ) |
|
| 66 |
- |
|
| 67 |
- ( clear last cursor ) |
|
| 68 |
- ,clear_icn =Screen.addr |
|
| 69 |
- ~pointer.x =Screen.x |
|
| 70 |
- ~pointer.y =Screen.y |
|
| 71 |
- #30 =Screen.color |
|
| 72 |
- |
|
| 73 |
- ( record pointer positions ) |
|
| 74 |
- ~Mouse.x =pointer.x ~Mouse.y =pointer.y |
|
| 75 |
- |
|
| 76 |
- ( draw new cursor ) |
|
| 77 |
- ,cursor_icn =Screen.addr |
|
| 78 |
- ~pointer.x =Screen.x |
|
| 79 |
- ~pointer.y =Screen.y |
|
| 80 |
- #31 ~Mouse.state #00 NEQ ADD =Screen.color |
|
| 81 |
- |
|
| 82 |
-RTN |
|
| 83 |
- |
|
| 84 |
-@draw-circle ( xc yc r color ) |
|
| 85 |
- |
|
| 86 |
- ( load ) =color =circle.r =circle.yc =circle.xc |
|
| 87 |
- #0000 =circle.x ~circle.r =circle.y |
|
| 88 |
- ~circle.r #0002 MUL2 #0003 SUB2 =circle.d |
|
| 89 |
- ( draw ) ,$seg JSR2 |
|
| 90 |
- $loop |
|
| 91 |
- ( incr ) ~circle.x ++ =circle.x |
|
| 92 |
- ~circle.d #0000 #0001 ADD2 LTS2 ^$else JNZ |
|
| 93 |
- ( decr ) ~circle.y -- =circle.y |
|
| 94 |
- ~circle.x ~circle.y SUB2 #0004 MUL2 ~circle.d ADD2 #000a ADD2 =circle.d |
|
| 95 |
- ,$end JMP2 |
|
| 96 |
- $else |
|
| 97 |
- ~circle.x #0004 MUL2 ~circle.d ADD2 #0006 ADD2 =circle.d |
|
| 98 |
- $end |
|
| 99 |
- ( draw ) ,$seg JSR2 |
|
| 100 |
- ~circle.y ~circle.x #0001 SUB2 GTS2 ^$loop JNZ |
|
| 101 |
- RTN |
|
| 102 |
- $seg |
|
| 103 |
- ~circle.xc ~circle.x ADD2 =Screen.x ~circle.yc ~circle.y ADD2 =Screen.y ~color =Screen.color |
|
| 104 |
- ~circle.xc ~circle.x SUB2 =Screen.x ~circle.yc ~circle.y ADD2 =Screen.y ~color =Screen.color |
|
| 105 |
- ~circle.xc ~circle.x ADD2 =Screen.x ~circle.yc ~circle.y SUB2 =Screen.y ~color =Screen.color |
|
| 106 |
- ~circle.xc ~circle.x SUB2 =Screen.x ~circle.yc ~circle.y SUB2 =Screen.y ~color =Screen.color |
|
| 107 |
- ~circle.xc ~circle.y ADD2 =Screen.x ~circle.yc ~circle.x ADD2 =Screen.y ~color =Screen.color |
|
| 108 |
- ~circle.xc ~circle.y SUB2 =Screen.x ~circle.yc ~circle.x ADD2 =Screen.y ~color =Screen.color |
|
| 109 |
- ~circle.xc ~circle.y ADD2 =Screen.x ~circle.yc ~circle.x SUB2 =Screen.y ~color =Screen.color |
|
| 110 |
- ~circle.xc ~circle.y SUB2 =Screen.x ~circle.yc ~circle.x SUB2 =Screen.y ~color =Screen.color |
|
| 111 |
- |
|
| 112 |
-RTN |
|
| 113 |
- |
|
| 114 |
-@draw-byte ( x y color addr -- ) |
|
| 115 |
- |
|
| 116 |
- =addr STH |
|
| 117 |
- =Screen.y |
|
| 118 |
- =Screen.x |
|
| 119 |
- ,font_hex #00 ~addr PEK2 #04 SFT #0008 MUL2 ADD2 =Screen.addr |
|
| 120 |
- STHr DUP STH =Screen.color |
|
| 121 |
- ,font_hex #00 ~addr PEK2 #0f AND #0008 MUL2 ADD2 =Screen.addr |
|
| 122 |
- ~Screen.x 8+ =Screen.x |
|
| 123 |
- STHr =Screen.color |
|
| 124 |
- |
|
| 125 |
-RTN |
|
| 126 |
- |
|
| 127 |
-@clear_icn [ 0000 0000 0000 0000 ] |
|
| 128 |
-@cursor_icn [ 80c0 e0f0 f8e0 1000 ] |
|
| 129 |
- |
|
| 130 |
-@font_hex |
|
| 131 |
-[ |
|
| 132 |
- 003c 464a 5262 3c00 0018 0808 0808 1c00 |
|
| 133 |
- 003c 4202 3c40 7e00 003c 421c 0242 3c00 |
|
| 134 |
- 000c 1424 447e 0400 007e 407c 0242 3c00 |
|
| 135 |
- 003c 407c 4242 3c00 007e 0204 0810 1000 |
|
| 136 |
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 |
|
| 137 |
- 003c 4242 7e42 4200 007c 427c 4242 7c00 |
|
| 138 |
- 003c 4240 4042 3c00 007c 4242 4242 7c00 |
|
| 139 |
- 007e 4078 4040 7e00 007e 4078 4040 4000 |
|
| 140 |
-] |
|
| 141 | 0 |
\ No newline at end of file |
| ... | ... |
@@ -22,11 +22,11 @@ |
| 22 | 22 |
|0100 ( -> ) |
| 23 | 23 |
|
| 24 | 24 |
( theme ) |
| 25 |
- #03fd .System/r IOW2 |
|
| 26 |
- #0ef3 .System/g IOW2 |
|
| 27 |
- #0bf2 .System/b IOW2 |
|
| 25 |
+ #03fd .System/r DEO2 |
|
| 26 |
+ #0ef3 .System/g DEO2 |
|
| 27 |
+ #0bf2 .System/b DEO2 |
|
| 28 | 28 |
|
| 29 |
- ( vectors ) ;on-mouse .Mouse/vector IOW2 |
|
| 29 |
+ ( vectors ) ;on-mouse .Mouse/vector DEO2 |
|
| 30 | 30 |
|
| 31 | 31 |
BRK |
| 32 | 32 |
|
| ... | ... |
@@ -39,23 +39,23 @@ BRK |
| 39 | 39 |
@draw-cursor ( -- ) |
| 40 | 40 |
|
| 41 | 41 |
( clear last cursor ) |
| 42 |
- ;clear .Screen/addr IOW2 |
|
| 43 |
- .pointer/x PEK2 .Screen/x IOW2 |
|
| 44 |
- .pointer/y PEK2 .Screen/y IOW2 |
|
| 45 |
- #30 .Screen/color IOW |
|
| 42 |
+ ;clear .Screen/addr DEO2 |
|
| 43 |
+ .pointer/x PEK2 .Screen/x DEO2 |
|
| 44 |
+ .pointer/y PEK2 .Screen/y DEO2 |
|
| 45 |
+ #30 .Screen/color DEO |
|
| 46 | 46 |
|
| 47 | 47 |
( record pointer positions ) |
| 48 |
- .Mouse/x IOR2 .pointer/x POK2 |
|
| 49 |
- .Mouse/y IOR2 .pointer/y POK2 |
|
| 48 |
+ .Mouse/x DEI2 .pointer/x POK2 |
|
| 49 |
+ .Mouse/y DEI2 .pointer/y POK2 |
|
| 50 | 50 |
|
| 51 | 51 |
( draw new cursor ) |
| 52 |
- ;cursor .Screen/addr IOW2 |
|
| 53 |
- .pointer/x PEK2 .Screen/x IOW2 |
|
| 54 |
- .pointer/y PEK2 .Screen/y IOW2 |
|
| 52 |
+ ;cursor .Screen/addr DEO2 |
|
| 53 |
+ .pointer/x PEK2 .Screen/x DEO2 |
|
| 54 |
+ .pointer/y PEK2 .Screen/y DEO2 |
|
| 55 | 55 |
|
| 56 | 56 |
( colorize on state ) |
| 57 |
- .Mouse/state IOR #00 NEQ |
|
| 58 |
- #31 ADD .Screen/color IOW |
|
| 57 |
+ .Mouse/state DEI #00 NEQ |
|
| 58 |
+ #31 ADD .Screen/color DEO |
|
| 59 | 59 |
|
| 60 | 60 |
RTN |
| 61 | 61 |
|
| ... | ... |
@@ -41,7 +41,7 @@ Program p; |
| 41 | 41 |
|
| 42 | 42 |
char ops[][4] = {
|
| 43 | 43 |
"BRK", "LIT", "NOP", "POP", "DUP", "SWP", "OVR", "ROT", |
| 44 |
- "EQU", "NEQ", "GTH", "LTH", "GTS", "LTS", "IOR", "IOW", |
|
| 44 |
+ "EQU", "NEQ", "GTH", "LTH", "GTS", "LTS", "DEI", "DEO", |
|
| 45 | 45 |
"PEK", "POK", "GET", "PUT", "JMP", "JNZ", "JSR", "STH", |
| 46 | 46 |
"ADD", "SUB", "MUL", "DIV", "AND", "ORA", "EOR", "SFT" |
| 47 | 47 |
}; |
| ... | ... |
@@ -76,11 +76,10 @@ pushshort(Uint16 s, int lit) |
| 76 | 76 |
} |
| 77 | 77 |
|
| 78 | 78 |
void |
| 79 |
-pushtext(char *s, int lit) |
|
| 79 |
+pushword(char *s) |
|
| 80 | 80 |
{
|
| 81 | 81 |
int i = 0; |
| 82 | 82 |
char c; |
| 83 |
- if(lit) pushbyte(0x21, 0); |
|
| 84 | 83 |
while((c = s[i++])) pushbyte(c, 0); |
| 85 | 84 |
} |
| 86 | 85 |
|
| ... | ... |
@@ -210,12 +209,14 @@ walktoken(char *w) |
| 210 | 209 |
switch(w[0]) {
|
| 211 | 210 |
case '[': return 0; |
| 212 | 211 |
case ']': return 0; |
| 212 |
+ case '\'': return 1; |
|
| 213 | 213 |
case '.': return 2; /* zero-page: LIT addr-lb */ |
| 214 | 214 |
case ',': return 2; /* relative: LIT addr-rel */ |
| 215 | 215 |
case ':': return 2; /* absolute: addr-hb addr-lb */ |
| 216 | 216 |
case ';': return 3; /* absolute: LIT addr-hb addr-lb */ |
| 217 | 217 |
case '$': return shex(w + 1); |
| 218 | 218 |
case '#': return slen(w + 1) == 4 ? 3 : 2; |
| 219 |
+ case '"': return slen(w + 1); |
|
| 219 | 220 |
} |
| 220 | 221 |
if((m = findmacro(w))) {
|
| 221 | 222 |
int i, res = 0; |
| ... | ... |
@@ -249,6 +250,12 @@ parsetoken(char *w) |
| 249 | 250 |
} else if(findopcode(w) || scmp(w, "BRK", 4)) {
|
| 250 | 251 |
pushbyte(findopcode(w), 0); |
| 251 | 252 |
return 1; |
| 253 |
+ } else if(w[0] == '"') {
|
|
| 254 |
+ pushword(w + 1); |
|
| 255 |
+ return 1; |
|
| 256 |
+ } else if(w[0] == '\'') {
|
|
| 257 |
+ pushbyte((Uint8)w[1], 0); |
|
| 258 |
+ return 1; |
|
| 252 | 259 |
} else if(w[0] == '#') {
|
| 253 | 260 |
if(slen(w + 1) == 1) |
| 254 | 261 |
pushbyte((Uint8)w[1], 1); |
| ... | ... |
@@ -46,8 +46,8 @@ void op_gth(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b
|
| 46 | 46 |
void op_lth(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b < a); }
|
| 47 | 47 |
void op_gts(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, (Sint8)b > (Sint8)a); }
|
| 48 | 48 |
void op_lts(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, (Sint8)b < (Sint8)a); }
|
| 49 |
-void op_ior(Uxn *u) { Uint8 a = pop8(u->src); push8(u->src, devpeek8(&u->dev[a >> 4], a)); }
|
|
| 50 |
-void op_iow(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); devpoke8(&u->dev[a >> 4], a, b); }
|
|
| 49 |
+void op_dei(Uxn *u) { Uint8 a = pop8(u->src); push8(u->src, devpeek8(&u->dev[a >> 4], a)); }
|
|
| 50 |
+void op_deo(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); devpoke8(&u->dev[a >> 4], a, b); }
|
|
| 51 | 51 |
/* Memory */ |
| 52 | 52 |
void op_pek(Uxn *u) { Uint8 a = pop8(u->src); push8(u->src, mempeek8(u->ram.dat, a)); }
|
| 53 | 53 |
void op_pok(Uxn *u) { Uint8 a = pop8(u->src); Uint8 b = pop8(u->src); mempoke8(u->ram.dat, a, b); }
|
| ... | ... |
@@ -80,8 +80,8 @@ void op_gth16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push8(u->sr
|
| 80 | 80 |
void op_lth16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push8(u->src, b < a); }
|
| 81 | 81 |
void op_gts16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push8(u->src, (Sint16)b > (Sint16)a); }
|
| 82 | 82 |
void op_lts16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push8(u->src, (Sint16)b < (Sint16)a); }
|
| 83 |
-void op_ior16(Uxn *u) { Uint8 a = pop8(u->src); push16(u->src, devpeek16(&u->dev[a >> 4], a)); }
|
|
| 84 |
-void op_iow16(Uxn *u) { Uint8 a = pop8(u->src); Uint16 b = pop16(u->src); devpoke16(&u->dev[a >> 4], a, b); }
|
|
| 83 |
+void op_dei16(Uxn *u) { Uint8 a = pop8(u->src); push16(u->src, devpeek16(&u->dev[a >> 4], a)); }
|
|
| 84 |
+void op_deo16(Uxn *u) { Uint8 a = pop8(u->src); Uint16 b = pop16(u->src); devpoke16(&u->dev[a >> 4], a, b); }
|
|
| 85 | 85 |
/* Memory(16-bits) */ |
| 86 | 86 |
void op_pek16(Uxn *u) { Uint8 a = pop8(u->src); push16(u->src, mempeek16(u->ram.dat, a)); }
|
| 87 | 87 |
void op_pok16(Uxn *u) { Uint8 a = pop8(u->src); Uint16 b = pop16(u->src); mempoke16(u->ram.dat, a, b); }
|
| ... | ... |
@@ -103,12 +103,12 @@ void op_sft16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->s
|
| 103 | 103 |
|
| 104 | 104 |
void (*ops[])(Uxn *u) = {
|
| 105 | 105 |
op_brk, op_lit, op_nop, op_pop, op_dup, op_swp, op_ovr, op_rot, |
| 106 |
- op_equ, op_neq, op_gth, op_lth, op_gts, op_lts, op_ior, op_iow, |
|
| 106 |
+ op_equ, op_neq, op_gth, op_lth, op_gts, op_lts, op_dei, op_deo, |
|
| 107 | 107 |
op_pek, op_pok, op_get, op_put, op_jmp, op_jnz, op_jsr, op_sth, |
| 108 | 108 |
op_add, op_sub, op_mul, op_div, op_and, op_ora, op_eor, op_sft, |
| 109 | 109 |
/* 16-bit */ |
| 110 | 110 |
op_brk, op_lit16, op_nop, op_pop16, op_dup16, op_swp16, op_ovr16, op_rot16, |
| 111 |
- op_equ16, op_neq16, op_gth16, op_lth16, op_gts16, op_lts16, op_ior16, op_iow16, |
|
| 111 |
+ op_equ16, op_neq16, op_gth16, op_lth16, op_gts16, op_lts16, op_dei16, op_deo16, |
|
| 112 | 112 |
op_pek16, op_pok16, op_get16, op_put16, op_jmp16, op_jnz16, op_jsr16, op_sth16, |
| 113 | 113 |
op_add16, op_sub16, op_mul16, op_div16, op_and16, op_ora16, op_eor16, op_sft16 |
| 114 | 114 |
}; |