| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,186 @@ |
| 1 |
+( A little program to see a rom's metadata ) |
|
| 2 |
+ |
|
| 3 |
+|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 |
|
| 4 |
+|10 @Console &vector $2 &read $1 &pad $5 &write $1 |
|
| 5 |
+|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
| 6 |
+|b0 @Disk &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |
|
| 7 |
+ |
|
| 8 |
+|0000 |
|
| 9 |
+ |
|
| 10 |
+ @src $40 |
|
| 11 |
+ |
|
| 12 |
+|0100 ( -> ) |
|
| 13 |
+ |
|
| 14 |
+ ( theme ) |
|
| 15 |
+ #f0af .System/r DEO2 |
|
| 16 |
+ #f0af .System/g DEO2 |
|
| 17 |
+ #f0af .System/b DEO2 |
|
| 18 |
+ |
|
| 19 |
+ ( 800x520 | 64:41 ) |
|
| 20 |
+ #0120 .Screen/width DEO2 |
|
| 21 |
+ #0050 .Screen/height DEO2 |
|
| 22 |
+ |
|
| 23 |
+ ;await-src .Console/vector DEO2 |
|
| 24 |
+ ;dict/input ;pstr JSR2 |
|
| 25 |
+ |
|
| 26 |
+BRK |
|
| 27 |
+ |
|
| 28 |
+@await-src ( -> ) |
|
| 29 |
+ |
|
| 30 |
+ .Console/read DEI .src ;skey JSR2 |
|
| 31 |
+ ,on-ready JCN |
|
| 32 |
+ |
|
| 33 |
+BRK |
|
| 34 |
+ |
|
| 35 |
+@on-ready ( -> ) |
|
| 36 |
+ |
|
| 37 |
+ ;src |
|
| 38 |
+ DUP2 ;pstr JSR2 #0a18 DEO |
|
| 39 |
+ ;draw-metadata JSR2 |
|
| 40 |
+ |
|
| 41 |
+BRK |
|
| 42 |
+ |
|
| 43 |
+@draw-metadata ( str* -- ) |
|
| 44 |
+ |
|
| 45 |
+ .Disk/name DEO2 |
|
| 46 |
+ ( read ) |
|
| 47 |
+ #0003 .Disk/length DEO2 |
|
| 48 |
+ ;&header .Disk/read DEO2 |
|
| 49 |
+ ;&start LDA2 #0100 SUB2 ;seek JSR2 |
|
| 50 |
+ #0004 .Disk/length DEO2 |
|
| 51 |
+ ;&end |
|
| 52 |
+ DUP2 .Disk/read DEO2 |
|
| 53 |
+ LDA2 ;&start LDA2 SUB2 .Disk/length DEO2 |
|
| 54 |
+ ;data |
|
| 55 |
+ DUP2 .Disk/read DEO2 |
|
| 56 |
+ ( draw ) |
|
| 57 |
+ #0058 STH2k .Screen/x DEO2 |
|
| 58 |
+ #0018 .Screen/y DEO2 |
|
| 59 |
+ ( body ) |
|
| 60 |
+ ;draw-str JSR2 |
|
| 61 |
+ #20 ;draw-chr JSR2 |
|
| 62 |
+ #02 ;draw-str-color JSR2 ;draw-lb JSR2 |
|
| 63 |
+ STH2kr .Screen/x DEO2 |
|
| 64 |
+ #01 ;draw-str-color JSR2 ;draw-lb JSR2 |
|
| 65 |
+ STH2r .Screen/x DEO2 |
|
| 66 |
+ ;draw-str JSR2 ;draw-lb JSR2 |
|
| 67 |
+ POP2 |
|
| 68 |
+ ( icon ) |
|
| 69 |
+ #0008 |
|
| 70 |
+ DUP2 .Screen/x DEO2 |
|
| 71 |
+ .Screen/y DEO2 |
|
| 72 |
+ ;&icon LDA2 #0100 SUB2 ;seek JSR2 |
|
| 73 |
+ #0200 .Disk/length DEO2 |
|
| 74 |
+ ;data |
|
| 75 |
+ DUP2 .Disk/read DEO2 |
|
| 76 |
+ .Screen/addr DEO2 |
|
| 77 |
+ #76 .Screen/auto DEO |
|
| 78 |
+ #01 .Screen/sprite |
|
| 79 |
+ DEOk DEOk DEOk DEOk |
|
| 80 |
+ DEOk DEOk DEOk DEO |
|
| 81 |
+ |
|
| 82 |
+JMP2r |
|
| 83 |
+ &header $1 &start $2 &end $2 &icon $2 |
|
| 84 |
+ |
|
| 85 |
+@draw-lb ( -- ) |
|
| 86 |
+ |
|
| 87 |
+ .Screen/y DEI2k #000c ADD2 ROT DEO2 |
|
| 88 |
+ |
|
| 89 |
+JMP2r |
|
| 90 |
+ |
|
| 91 |
+@draw-str-color ( str* color -- str* ) |
|
| 92 |
+ |
|
| 93 |
+ ;draw-chr/color STA |
|
| 94 |
+ |
|
| 95 |
+@draw-str ( str* -- str* ) |
|
| 96 |
+ |
|
| 97 |
+ LDAk #00 EQU ,&skip JCN |
|
| 98 |
+ #01 .Screen/auto DEO |
|
| 99 |
+ &while |
|
| 100 |
+ LDAk ,draw-chr JSR |
|
| 101 |
+ INC2 LDAk ,&while JCN |
|
| 102 |
+ &skip |
|
| 103 |
+ INC2 |
|
| 104 |
+ |
|
| 105 |
+JMP2r |
|
| 106 |
+ |
|
| 107 |
+@draw-chr ( char -- ) |
|
| 108 |
+ |
|
| 109 |
+ #20 SUB #00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2 |
|
| 110 |
+ [ LIT &color 01 ] .Screen/sprite DEO |
|
| 111 |
+ |
|
| 112 |
+JMP2r |
|
| 113 |
+ |
|
| 114 |
+@seek ( length* -- ) |
|
| 115 |
+ |
|
| 116 |
+ .Disk/name DEI2k ROT DEO2 |
|
| 117 |
+ #0001 .Disk/length DEO2 |
|
| 118 |
+ #0000 |
|
| 119 |
+ &l |
|
| 120 |
+ ;&b .Disk/read DEO2 |
|
| 121 |
+ INC2 GTH2k ,&l JCN |
|
| 122 |
+ POP2 POP2 |
|
| 123 |
+ |
|
| 124 |
+JMP2r |
|
| 125 |
+ &b $1 |
|
| 126 |
+ |
|
| 127 |
+@scap ( str* -- end* ) LDAk #00 NEQ JMP JMP2r &w INC2 LDAk ,&w JCN JMP2r |
|
| 128 |
+@sput ( chr str* -- ) ,scap JSR STA JMP2r |
|
| 129 |
+@skey ( key buf -- proc ) OVR #21 LTH ,&eval JCN #00 SWP ;sput JSR2 #00 JMP2r &eval POP2 #01 JMP2r |
|
| 130 |
+@pstr ( str* -- ) &w LDAk #18 DEO INC2 LDAk ,&w JCN POP2 JMP2r |
|
| 131 |
+ |
|
| 132 |
+@dict |
|
| 133 |
+ &input "Input(.tal): 20 $1 |
|
| 134 |
+ |
|
| 135 |
+@font ( atari8 ) |
|
| 136 |
+0000 0000 0000 0000 6060 6060 6000 6000 |
|
| 137 |
+6666 6600 0000 0000 006c fe6c 6cfe 6c00 |
|
| 138 |
+183e 603c 067c 1800 0066 6c18 3066 4600 |
|
| 139 |
+386c 3870 decc 7600 6060 6000 0000 0000 |
|
| 140 |
+1c30 3030 3030 1c00 380c 0c0c 0c0c 3800 |
|
| 141 |
+0066 3cff 3c66 0000 0018 187e 1818 0000 |
|
| 142 |
+0000 0000 0030 3060 0000 007e 0000 0000 |
|
| 143 |
+0000 0000 0018 1800 0306 0c18 3060 c000 |
|
| 144 |
+3c66 6e76 6666 3c00 1838 1818 1818 7e00 |
|
| 145 |
+3c66 060c 1830 7e00 7e0c 180c 0666 3c00 |
|
| 146 |
+0c1c 3c6c 7e0c 0c00 7e60 7c06 0666 3c00 |
|
| 147 |
+3c60 607c 6666 3c00 7e06 0c18 3030 3000 |
|
| 148 |
+3c66 663c 6666 3c00 3c66 663e 060c 3800 |
|
| 149 |
+0018 1800 0018 1800 0018 1800 1818 3000 |
|
| 150 |
+0c18 3060 3018 0c00 0000 7e00 007e 0000 |
|
| 151 |
+3018 0c06 0c18 3000 3c66 060c 1800 1800 |
|
| 152 |
+3c66 6e6a 6e60 3e00 183c 6666 7e66 6600 |
|
| 153 |
+7c66 667c 6666 7c00 3c66 6060 6066 3c00 |
|
| 154 |
+786c 6666 666c 7800 7e60 607c 6060 7e00 |
|
| 155 |
+7e60 607c 6060 6000 3e60 606e 6666 3e00 |
|
| 156 |
+6666 667e 6666 6600 3c18 1818 1818 3c00 |
|
| 157 |
+3e06 0606 0666 3c00 666c 7870 786c 6600 |
|
| 158 |
+6060 6060 6060 7e00 c6ee fed6 c6c6 c600 |
|
| 159 |
+6676 7e7e 6e66 6600 3c66 6666 6666 3c00 |
|
| 160 |
+7c66 667c 6060 6000 3c66 6666 766c 3600 |
|
| 161 |
+7c66 667c 6c66 6600 3c66 603c 0666 3c00 |
|
| 162 |
+7e18 1818 1818 1800 6666 6666 6666 3e00 |
|
| 163 |
+6666 6666 663c 1800 c6c6 c6d6 feee c600 |
|
| 164 |
+6666 3c18 3c66 6600 6666 663c 1818 1800 |
|
| 165 |
+7e06 0c18 3060 7e00 3c30 3030 3030 3c00 |
|
| 166 |
+c060 3018 0c06 0300 3c0c 0c0c 0c0c 3c00 |
|
| 167 |
+1038 6cc6 0000 0000 0000 0000 0000 fe00 |
|
| 168 |
+0060 3018 0000 0000 0000 3c06 3e66 3e00 |
|
| 169 |
+6060 7c66 6666 7c00 0000 3c60 6060 3c00 |
|
| 170 |
+0606 3e66 6666 3e00 0000 3c66 7e60 3c00 |
|
| 171 |
+1c30 7c30 3030 3000 0000 3e66 663e 067c |
|
| 172 |
+6060 7c66 6666 6600 1800 3818 1818 3c00 |
|
| 173 |
+1800 1818 1818 1870 6060 666c 786c 6600 |
|
| 174 |
+3818 1818 1818 3c00 0000 ecfe d6c6 c600 |
|
| 175 |
+0000 7c66 6666 6600 0000 3c66 6666 3c00 |
|
| 176 |
+0000 7c66 6666 7c60 0000 3e66 6666 3e06 |
|
| 177 |
+0000 7c66 6060 6000 0000 3e60 3c06 7c00 |
|
| 178 |
+0018 7e18 1818 0e00 0000 6666 6666 3e00 |
|
| 179 |
+0000 6666 663c 1800 0000 c6c6 d67c 6c00 |
|
| 180 |
+0000 663c 183c 6600 0000 6666 663e 067c |
|
| 181 |
+0000 7e0c 1830 7e00 1c30 3060 3030 1c00 |
|
| 182 |
+1818 1818 1818 1818 380c 0c06 0c0c 3800 |
|
| 183 |
+0000 60f2 9e0c 0000 3c42 9985 8599 423c |
|
| 184 |
+ |
|
| 185 |
+@data |
|
| 186 |
+ |