| ... | ... |
@@ -1,15 +1,14 @@ |
| 1 |
-( Dev/Controller ) |
|
| 1 |
+( dev/controller/buttons ) |
|
| 2 | 2 |
|
| 3 |
-%++ { #0001 ADD2 } %-- { #0001 SUB2 }
|
|
| 4 |
-%2/ { #0002 DIV2 }
|
|
| 5 |
- |
|
| 6 |
-%=>SC/ADDR { .Screen/addr IOW2 }
|
|
| 3 |
+%=>SC/ADDR { .Screen/addr IOW2 }
|
|
| 7 | 4 |
%->SC/COLR { .Screen/color IOW }
|
| 5 |
+%++ { #0001 ADD2 }
|
|
| 6 |
+%-- { #0001 SUB2 }
|
|
| 7 |
+%2/ { #0002 DIV2 }
|
|
| 8 | 8 |
|
| 9 | 9 |
( devices ) |
| 10 | 10 |
|
| 11 | 11 |
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |
| 12 |
-|10 @Console [ &pad $8 &char $1 &byte $1 &short $2 &string $2 ] |
|
| 13 | 12 |
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ] |
| 14 | 13 |
|40 @Controller [ &vector $2 &button $1 &key $1 ] |
| 15 | 14 |
|
| ... | ... |
@@ -32,6 +31,7 @@ |
| 32 | 31 |
( set origin ) |
| 33 | 32 |
.Screen/width IOR2 2/ .Screen/x IOW2 |
| 34 | 33 |
.Screen/height IOR2 2/ .Screen/y IOW2 |
| 34 |
+ |
|
| 35 | 35 |
;default_icn =>SC/ADDR |
| 36 | 36 |
#31 ->SC/COLR |
| 37 | 37 |
#2a .slime POK |
| 38 | 38 |
similarity index 74% |
| 39 | 39 |
rename from projects/examples/dev.controller.keys-old.usm |
| 40 | 40 |
rename to projects/examples/dev.controller.keys.usm |
| ... | ... |
@@ -1,56 +1,64 @@ |
| 1 |
-( Dev/Keys ) |
|
| 1 |
+( dev/controller/keys ) |
|
| 2 | 2 |
|
| 3 | 3 |
%RTN { JMP2r }
|
| 4 | 4 |
%8+ { #0008 ADD2 }
|
| 5 | 5 |
%8* { #0030 SFT2 }
|
| 6 | 6 |
|
| 7 |
-|0100 ;System { vector 2 pad 6 r 2 g 2 b 2 }
|
|
| 8 |
-|0110 ;Console { vector 2 pad 6 char 1 byte 1 short 2 string 2 }
|
|
| 9 |
-|0120 ;Screen { vector 2 width 2 height 2 pad 2 x 2 y 2 addr 2 color 1 }
|
|
| 10 |
-|0140 ;Controller { vector 2 button 1 key 1 }
|
|
| 7 |
+( devices ) |
|
| 11 | 8 |
|
| 12 |
-( program ) |
|
| 9 |
+|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |
|
| 10 |
+|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ] |
|
| 11 |
+|40 @Controller [ &vector $2 &button $1 &key $1 ] |
|
| 13 | 12 |
|
| 14 |
-|0200 |
|
| 13 |
+( variables ) |
|
| 15 | 14 |
|
| 16 |
- ( theme ) #0f73 =System.r #0fe3 =System.g #0fc3 =System.b |
|
| 17 |
- ( vectors ) ,on-button =Controller.vector |
|
| 18 |
- ,draw-cursor JSR2 |
|
| 15 |
+|0000 |
|
| 16 |
+ |
|
| 17 |
+@slime $1 |
|
| 18 |
+ |
|
| 19 |
+|0100 |
|
| 20 |
+ |
|
| 21 |
+ ( theme ) |
|
| 22 |
+ #0f73 .System/r IOW2 |
|
| 23 |
+ #0fe3 .System/g IOW2 |
|
| 24 |
+ #0fc3 .System/b IOW2 |
|
| 25 |
+ |
|
| 26 |
+ ( vectors ) ;on-button .Controller/vector IOW2 |
|
| 27 |
+ |
|
| 28 |
+ ;draw-cursor JSR2 |
|
| 19 | 29 |
|
| 20 | 30 |
BRK |
| 21 | 31 |
|
| 22 | 32 |
@on-button |
| 23 | 33 |
|
| 24 |
- ~Controller.key #00 NEQ ^$skip JNZ BRK $skip |
|
| 34 |
+ .Controller/key IOR #00 NEQ ,&skip JNZ BRK &skip |
|
| 25 | 35 |
|
| 26 |
- ~Controller.key #0d NEQ ^$no-return JNZ |
|
| 27 |
- #20 =Screen.color |
|
| 28 |
- #0000 =Screen.x |
|
| 29 |
- ( incr ) ~Screen.y 8+ =Screen.y |
|
| 30 |
- ,draw-cursor JSR2 |
|
| 36 |
+ .Controller/key IOR #0d NEQ ,&no-return JNZ |
|
| 37 |
+ ( draw ) #20 .Screen/color IOW |
|
| 38 |
+ ( reset ) #0000 .Screen/x IOW2 |
|
| 39 |
+ ( incr ) .Screen/y IOR2 8+ .Screen/y IOW2 |
|
| 40 |
+ ;draw-cursor JSR2 |
|
| 31 | 41 |
BRK |
| 32 |
- $no-return |
|
| 42 |
+ &no-return |
|
| 33 | 43 |
|
| 34 |
- ~Controller.key =Console.char |
|
| 44 |
+ ;font #00 .Controller/key IOR 8* ADD2 .Screen/addr IOW2 |
|
| 45 |
+ ( draw ) #21 .Screen/color IOW |
|
| 46 |
+ ( incr ) .Screen/x IOR2 8+ .Screen/x IOW2 |
|
| 35 | 47 |
|
| 36 |
- ,cursor_icn =Screen.addr |
|
| 37 |
- ,font #00 ~Controller.key 8* ADD2 =Screen.addr |
|
| 38 |
- ( draw ) #21 =Screen.color |
|
| 39 |
- ~Screen.x 8+ =Screen.x |
|
| 40 |
- ,draw-cursor JSR2 |
|
| 48 |
+ ;draw-cursor JSR2 |
|
| 41 | 49 |
|
| 42 | 50 |
BRK |
| 43 | 51 |
|
| 44 | 52 |
@draw-cursor |
| 45 | 53 |
|
| 46 |
- ,cursor_icn =Screen.addr #22 =Screen.color |
|
| 54 |
+ ;cursor .Screen/addr IOW2 #22 .Screen/color IOW |
|
| 47 | 55 |
|
| 48 | 56 |
RTN |
| 49 | 57 |
|
| 50 |
-@cursor_icn [ ffff ffff ffff ffff ] |
|
| 58 |
+@cursor |
|
| 59 |
+ ffff ffff ffff ffff |
|
| 51 | 60 |
|
| 52 | 61 |
@font ( spectrum-zx font ) |
| 53 |
-[ |
|
| 54 | 62 |
0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000 |
| 55 | 63 |
0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000 |
| 56 | 64 |
007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000 |
| ... | ... |
@@ -83,4 +91,3 @@ RTN |
| 83 | 91 |
0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800 |
| 84 | 92 |
0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00 |
| 85 | 93 |
0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c |
| 86 |
-] |