| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,148 +0,0 @@ |
| 1 |
-( dev/controller/keys ) |
|
| 2 |
- |
|
| 3 |
-%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
|
|
| 4 |
-%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
|
|
| 5 |
-%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
|
|
| 6 |
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
|
|
| 7 |
- |
|
| 8 |
-%RTN { JMP2r }
|
|
| 9 |
-%TOS { #00 SWP }
|
|
| 10 |
- |
|
| 11 |
-%DEBUG { ;print-hex JSR2 #0a .Console/write DEO }
|
|
| 12 |
-%DEBUG2 { SWP ;print-hex JSR2 ;print-hex JSR2 #0a .Console/write DEO }
|
|
| 13 |
- |
|
| 14 |
-( devices ) |
|
| 15 |
- |
|
| 16 |
-|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |
|
| 17 |
-|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 ] |
|
| 18 |
-|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] |
|
| 19 |
-|80 @Controller [ &vector $2 &button $1 &key $1 ] |
|
| 20 |
-|a0 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ] |
|
| 21 |
- |
|
| 22 |
-( variables ) |
|
| 23 |
- |
|
| 24 |
-|0000 |
|
| 25 |
- |
|
| 26 |
-@position |
|
| 27 |
- &x $2 |
|
| 28 |
- &y $2 |
|
| 29 |
- |
|
| 30 |
-( init ) |
|
| 31 |
- |
|
| 32 |
-|0100 ( -> ) |
|
| 33 |
- |
|
| 34 |
- ( theme ) |
|
| 35 |
- #0f73 .System/r DEO2 |
|
| 36 |
- #0fe3 .System/g DEO2 |
|
| 37 |
- #0fc3 .System/b DEO2 |
|
| 38 |
- |
|
| 39 |
- ( vectors ) |
|
| 40 |
- ;on-button .Controller/vector DEO2 |
|
| 41 |
- |
|
| 42 |
- ( load font ) |
|
| 43 |
- #1000 .File/length DEO2 |
|
| 44 |
- ;fontpath .File/name DEO2 |
|
| 45 |
- ;font-data .File/load DEO2 |
|
| 46 |
- |
|
| 47 |
- ;draw-cursor JSR2 |
|
| 48 |
- |
|
| 49 |
-BRK |
|
| 50 |
- |
|
| 51 |
-@on-button ( -> ) |
|
| 52 |
- |
|
| 53 |
- ( skip ) .Controller/key DEI #01 JCN [ BRK ] |
|
| 54 |
- |
|
| 55 |
- ( print button-key code ) |
|
| 56 |
- #0000 .Screen/x DEO2 |
|
| 57 |
- .Screen/height DEI2 #0008 -- .Screen/y DEO2 |
|
| 58 |
- .Controller/button DEI2 #01 ;draw-short JSR2 |
|
| 59 |
- |
|
| 60 |
- .position/x LDZ2 .Screen/x DEO2 |
|
| 61 |
- .position/y LDZ2 .Screen/y DEO2 |
|
| 62 |
- |
|
| 63 |
- ( linebreak ) |
|
| 64 |
- .Controller/key DEI #0d NEQ ,&no-return JCN |
|
| 65 |
- ( draw ) #00 .Screen/sprite DEO |
|
| 66 |
- ( reset ) #0000 .position/x STZ2 |
|
| 67 |
- ( incr ) .position/y LDZ2 #0010 ++ .position/y STZ2 |
|
| 68 |
- ;draw-cursor JSR2 |
|
| 69 |
- BRK |
|
| 70 |
- &no-return |
|
| 71 |
- |
|
| 72 |
- .Controller/key DEI TOS #0020 ** DEBUG2 |
|
| 73 |
- |
|
| 74 |
- ;font-data .Controller/key DEI TOS #0010 ** ++ .Screen/addr DEO2 |
|
| 75 |
- .Controller/button DEI ;mod-color JSR2 .Screen/sprite DEO |
|
| 76 |
- .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
| 77 |
- .Screen/addr DEI2 #0008 ++ .Screen/addr DEO2 |
|
| 78 |
- .Controller/button DEI ;mod-color JSR2 .Screen/sprite DEO |
|
| 79 |
- ( incr ) .position/x LDZ2 #0008 ++ .position/x STZ2 |
|
| 80 |
- ,draw-cursor JSR |
|
| 81 |
- |
|
| 82 |
-BRK |
|
| 83 |
- |
|
| 84 |
-@mod-color ( mod -- color ) |
|
| 85 |
- |
|
| 86 |
- ( ctrl ) DUP #01 = #01 * STH |
|
| 87 |
- ( alt ) DUP #02 = #03 * STH |
|
| 88 |
- ( shift ) #04 = #05 * STH2r + + |
|
| 89 |
- #01 + |
|
| 90 |
- |
|
| 91 |
-RTN |
|
| 92 |
- |
|
| 93 |
-@draw-cursor ( -- ) |
|
| 94 |
- |
|
| 95 |
- .position/x LDZ2 .Screen/x DEO2 |
|
| 96 |
- .position/y LDZ2 .Screen/y DEO2 |
|
| 97 |
- ;cursor .Screen/addr DEO2 |
|
| 98 |
- #02 .Screen/sprite DEO |
|
| 99 |
- |
|
| 100 |
- .position/y LDZ2 #0008 ++ .Screen/y DEO2 |
|
| 101 |
- #02 .Screen/sprite DEO |
|
| 102 |
- |
|
| 103 |
-RTN |
|
| 104 |
- |
|
| 105 |
-@draw-short ( short* color -- ) |
|
| 106 |
- |
|
| 107 |
- STH SWP |
|
| 108 |
- DUP #04 SFT TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 |
|
| 109 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 110 |
- #0f AND TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 |
|
| 111 |
- .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
| 112 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 113 |
- DUP #04 SFT TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 |
|
| 114 |
- .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
| 115 |
- ( draw ) STHkr .Screen/sprite DEO |
|
| 116 |
- #0f AND TOS #0008 ** ;font-hex ++ .Screen/addr DEO2 |
|
| 117 |
- .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
| 118 |
- ( draw ) STHr .Screen/sprite DEO |
|
| 119 |
- |
|
| 120 |
-RTN |
|
| 121 |
- |
|
| 122 |
-@print-hex ( value -- ) |
|
| 123 |
- |
|
| 124 |
- STHk #04 SFT ,&parse JSR .Console/write DEO |
|
| 125 |
- STHr #0f AND ,&parse JSR .Console/write DEO |
|
| 126 |
- RTN |
|
| 127 |
- &parse ( value -- char ) |
|
| 128 |
- DUP #09 GTH ,&above JCN #30 ADD RTN &above #09 SUB #60 ADD RTN |
|
| 129 |
- |
|
| 130 |
-RTN |
|
| 131 |
- |
|
| 132 |
-@cursor |
|
| 133 |
- ffff ffff ffff ffff |
|
| 134 |
- |
|
| 135 |
-@font-hex |
|
| 136 |
- 003c 464a 5262 3c00 0018 0808 0808 1c00 |
|
| 137 |
- 003c 4202 3c40 7e00 003c 421c 0242 3c00 |
|
| 138 |
- 000c 1424 447e 0400 007e 407c 0242 3c00 |
|
| 139 |
- 003c 407c 4242 3c00 007e 0204 0810 1000 |
|
| 140 |
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 |
|
| 141 |
- 003c 4242 7e42 4200 007c 427c 4242 7c00 |
|
| 142 |
- 003c 4240 4042 3c00 007c 4242 4242 7c00 |
|
| 143 |
- 007e 4078 4040 7e00 007e 4078 4040 4000 |
|
| 144 |
- |
|
| 145 |
- |
|
| 146 |
-@fontpath "projects/fonts/437dos8x16.bit |
|
| 147 |
- |
|
| 148 |
-@font-data |
|
| 149 | 0 |
\ No newline at end of file |