[1] | 1 | #asm |
---|
| 2 | (main)test.asm |
---|
| 3 | |
---|
| 4 | _DKDRV EQU $6049 |
---|
| 5 | _DKOPC EQU $6048 |
---|
| 6 | _DKTRK EQU $604B |
---|
| 7 | _DKVAL EQU $6052 |
---|
| 8 | _DKSEC EQU $604C |
---|
| 9 | _DKERR EQU $604E |
---|
| 10 | |
---|
| 11 | ORG $8000 | debut de l'impementation en 9000 |
---|
| 12 | ORCC #$50 | Gel des interruptions |
---|
| 13 | |
---|
| 14 | TFR S,Y | store old S |
---|
| 15 | STY $62FE |
---|
| 16 | |
---|
| 17 | LDA #$60 | Fixe le |
---|
| 18 | TFR A,DP | DP a $60 |
---|
| 19 | LDS #$6600-_GLOBALS | share 6300-6400 for stack and globals |
---|
| 20 | TFR S,Y | Y is GLOBAL pointer |
---|
| 21 | |
---|
| 22 | CLR $6019 | Plus dinterruptions |
---|
| 23 | CLRB |
---|
| 24 | STB _DKDRV | drive 0 |
---|
| 25 | |
---|
| 26 | LDX #$6300 |
---|
| 27 | STX $604F | sector buffer |
---|
| 28 | #endasm |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | /* le main doit être en premier */ |
---|
| 33 | |
---|
| 34 | int |
---|
| 35 | main() { |
---|
| 36 | int ii,i,j,k; |
---|
| 37 | |
---|
| 38 | char *longname; |
---|
| 39 | int longOff; |
---|
| 40 | int longIdx; |
---|
| 41 | |
---|
| 42 | int nfic; |
---|
| 43 | int dirEnd; |
---|
| 44 | |
---|
| 45 | int t; |
---|
| 46 | int piste; |
---|
| 47 | |
---|
| 48 | char *p; |
---|
| 49 | char *buf; |
---|
| 50 | char *buf2; /* big dir buffer in A000 enough for 127 entries */ |
---|
| 51 | |
---|
| 52 | int ret; |
---|
| 53 | char c; |
---|
| 54 | char s2; |
---|
| 55 | int cfgnum; |
---|
| 56 | |
---|
| 57 | /* LBA, MBR and all (V)FAT stuff */ |
---|
| 58 | unsigned int lbaBeg_h; |
---|
| 59 | unsigned int lbaBeg_l; |
---|
| 60 | unsigned int f_clusz; |
---|
| 61 | unsigned int f_shift; |
---|
| 62 | unsigned int f_res; |
---|
| 63 | |
---|
| 64 | unsigned int f_nbfat; |
---|
| 65 | |
---|
| 66 | unsigned int f_fatsh; |
---|
| 67 | unsigned int f_fatsl; |
---|
| 68 | |
---|
| 69 | unsigned int f_rooth; |
---|
| 70 | unsigned int f_rootl; |
---|
| 71 | |
---|
| 72 | unsigned int f_firsth; |
---|
| 73 | unsigned int f_firstl; |
---|
| 74 | |
---|
| 75 | unsigned int f_tmph; |
---|
| 76 | unsigned int f_tmpl; |
---|
| 77 | |
---|
| 78 | unsigned int f_cfgh; |
---|
| 79 | unsigned int f_cfgl; |
---|
| 80 | |
---|
| 81 | int page,select,maxpage; |
---|
| 82 | |
---|
| 83 | border(0); |
---|
| 84 | |
---|
| 85 | cls(); |
---|
| 86 | |
---|
| 87 | cfgnum=-1; |
---|
| 88 | |
---|
| 89 | i=0x6300;buf=i; |
---|
| 90 | i=0xA000;buf2=i; |
---|
| 91 | i=(0xAFFF-17);longname=i; |
---|
| 92 | |
---|
| 93 | |
---|
| 94 | i=0x604E;p=i;*p=0; /* clear error */ |
---|
| 95 | ret=go_trk255(); |
---|
| 96 | border(1); |
---|
| 97 | /* dump16b(1,16,ret); */ |
---|
| 98 | border(2); |
---|
| 99 | ret=rd_lba(0,0); |
---|
| 100 | lbaBeg_l=mk_16(buf[446+9],buf[446+8]); |
---|
| 101 | lbaBeg_h=mk_16(buf[446+11],buf[446+10]); |
---|
| 102 | |
---|
| 103 | /* |
---|
| 104 | dump16b(0,17,lbaBeg_h); |
---|
| 105 | dump16b(4,17,lbaBeg_l); |
---|
| 106 | */ |
---|
| 107 | rd_lba(lbaBeg_h,lbaBeg_l); |
---|
| 108 | |
---|
| 109 | /* get all fat stuf */ |
---|
| 110 | f_clusz=buf[0x0D]; |
---|
| 111 | f_shift=siz2shif(f_clusz); |
---|
| 112 | f_res=mk_16(buf[0x0F],buf[0x0E]); |
---|
| 113 | f_nbfat=buf[0x10]; |
---|
| 114 | f_fatsl=mk_16(buf[0x25],buf[0x24]); |
---|
| 115 | f_fatsh=mk_16(buf[0x27],buf[0x26]); |
---|
| 116 | f_rootl=mk_16(buf[0x2D],buf[0x2C]); |
---|
| 117 | f_rooth=mk_16(buf[0x2F],buf[0x2E]); |
---|
| 118 | |
---|
| 119 | /* |
---|
| 120 | dump16b(0,18,f_rooth); |
---|
| 121 | dump16b(4,18,f_rootl); |
---|
| 122 | */ |
---|
| 123 | |
---|
| 124 | /* (unsigned long)cluster_begin_lba = Partition_LBA_Begin + Number_of_Reserved_Sectors + (Number_of_FATs * Sectors_Per_FAT); */ |
---|
| 125 | add_32(lbaBeg_h,lbaBeg_l,0,f_res,&f_firsth,&f_firstl); |
---|
| 126 | |
---|
| 127 | for (i=0;i<f_nbfat;i++) { |
---|
| 128 | add_32(f_firsth,f_firstl,f_fatsh,f_fatsl,&f_firsth,&f_firstl); |
---|
| 129 | } |
---|
| 130 | /* |
---|
| 131 | dump16b(0,19,f_firsth); |
---|
| 132 | dump16b(4,19,f_firstl); |
---|
| 133 | */ |
---|
| 134 | |
---|
| 135 | /* address = lba_start+((clust-2)*size) */ |
---|
| 136 | sub_32(f_rooth,f_rootl,0,2,&f_tmph,&f_tmpl); /* clu-2 */ |
---|
| 137 | clu2lba(f_tmph,f_tmpl,f_shift,&f_tmph,&f_tmpl); /* *size */ |
---|
| 138 | add_32(f_firsth,f_firstl,f_tmph,f_tmpl,&f_tmph,&f_tmpl); /* + lba_start */ |
---|
| 139 | |
---|
| 140 | /* |
---|
| 141 | dump16b(0,20,f_tmph); |
---|
| 142 | dump16b(4,20,f_tmpl); |
---|
| 143 | |
---|
| 144 | dump16b(10,18,f_clusz); |
---|
| 145 | dump16b(14,18,f_shift); |
---|
| 146 | */ |
---|
| 147 | |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | nfic=0; |
---|
| 151 | longname[0]='\0'; |
---|
| 152 | longname[13]='\0'; |
---|
| 153 | |
---|
| 154 | border(3); |
---|
| 155 | |
---|
| 156 | dirEnd=0; |
---|
| 157 | |
---|
| 158 | for (ii=0;ii<f_clusz;ii++) { |
---|
| 159 | if (dirEnd==1) { |
---|
| 160 | break; |
---|
| 161 | } |
---|
| 162 | /* read the directory sector */ |
---|
| 163 | rd_lba(f_tmph,f_tmpl); |
---|
| 164 | |
---|
| 165 | for (i=0;i<16;i++) { |
---|
| 166 | if ((buf[i<<5]&0xFF)==0x00) { |
---|
| 167 | dirEnd=1; |
---|
| 168 | break; |
---|
| 169 | } |
---|
| 170 | if ((buf[(i<<5)+11]&0x0F)==0x0F) { |
---|
| 171 | longIdx=buf[i<<5]&0xF; |
---|
| 172 | longOff=(longIdx-1)*13; |
---|
| 173 | for (j=0;j<5;j++) { |
---|
| 174 | if (longOff+j<17) { |
---|
| 175 | k=(i<<5)+(j<<1)+1; |
---|
| 176 | longname[longOff+j]=buf[k]; |
---|
| 177 | } |
---|
| 178 | } |
---|
| 179 | for (j=0;j<6;j++) { |
---|
| 180 | if (longOff+j+5<17) { |
---|
| 181 | k=(i<<5)+(j<<1)+0xE; |
---|
| 182 | longname[longOff+j+5]=buf[k]; |
---|
| 183 | } |
---|
| 184 | } |
---|
| 185 | for (j=0;j<2;j++) { |
---|
| 186 | if (longOff+j+11<17) { |
---|
| 187 | k=(i<<5)+(j<<1)+0x1C; |
---|
| 188 | longname[longOff+j+11]=buf[k]; |
---|
| 189 | } |
---|
| 190 | } |
---|
| 191 | continue; /* skip long filenames */ |
---|
| 192 | } |
---|
| 193 | |
---|
| 194 | if ((buf[i<<5]&0xFF)!=0xE5) { |
---|
| 195 | for (j=0;j<8;j++) { |
---|
| 196 | buf2[(nfic<<5)+j]=buf[(i<<5)+j]; |
---|
| 197 | } |
---|
| 198 | for (j=0;j<3;j++) { |
---|
| 199 | buf2[(nfic<<5)+j+8]=buf[(i<<5)+j+8]; |
---|
| 200 | } |
---|
| 201 | for (j=0;j<17;j++) { |
---|
| 202 | buf2[(nfic<<5)+11+j]=longname[j]; |
---|
| 203 | } |
---|
| 204 | longname[0]='\0'; |
---|
| 205 | longname[13]='\0'; |
---|
| 206 | |
---|
| 207 | /* also copy first cluster */ |
---|
| 208 | buf2[(nfic<<5)+31]=buf[(i<<5)+0x1A]; |
---|
| 209 | buf2[(nfic<<5)+30]=buf[(i<<5)+0x1B]; |
---|
| 210 | buf2[(nfic<<5)+29]=buf[(i<<5)+0x14]; |
---|
| 211 | buf2[(nfic<<5)+28]=buf[(i<<5)+0x15]; |
---|
| 212 | nfic++; |
---|
| 213 | if (nfic>126) { |
---|
| 214 | dirEnd=1; |
---|
| 215 | break; |
---|
| 216 | } |
---|
| 217 | } else { |
---|
| 218 | longname[0]='\0'; |
---|
| 219 | longname[13]='\0'; |
---|
| 220 | } |
---|
| 221 | } |
---|
| 222 | add_32(f_tmph,f_tmpl,0x0000,0x0001,&f_tmph,&f_tmpl); /* increment LBA */ |
---|
| 223 | |
---|
| 224 | } |
---|
| 225 | |
---|
| 226 | border(0); |
---|
| 227 | |
---|
| 228 | banner(); |
---|
| 229 | for (i=0;i<nfic;i++) { |
---|
| 230 | if (find83("HXCSDFE CFG",&buf2[i<<5])==0) { |
---|
| 231 | string(0,22,"Found cfg:",10); |
---|
| 232 | dump16b(11,22,i); |
---|
| 233 | cfgnum=i; |
---|
| 234 | f_cfgh=mk_16(buf2[(cfgnum<<5)+28],buf2[(cfgnum<<5)+29]); |
---|
| 235 | f_cfgl=mk_16(buf2[(cfgnum<<5)+30],buf2[(cfgnum<<5)+31]); |
---|
| 236 | break; |
---|
| 237 | } |
---|
| 238 | } |
---|
| 239 | |
---|
| 240 | |
---|
| 241 | select=0; |
---|
| 242 | page=0; |
---|
| 243 | maxpage=((nfic-1)>>4); |
---|
| 244 | fic_list(select,page,nfic); |
---|
| 245 | hi_line(select+4,0xC7); |
---|
| 246 | |
---|
| 247 | irq(); |
---|
| 248 | while (1) { |
---|
| 249 | i=getc(); |
---|
| 250 | dump16b(0,24,i); |
---|
| 251 | if ((i==0x08) && (page>0)) { |
---|
| 252 | page--; |
---|
| 253 | hi_line(select+4,0xF8); |
---|
| 254 | select=0; |
---|
| 255 | fic_list(select,page,nfic); |
---|
| 256 | hi_line(select+4,0xC7); |
---|
| 257 | } |
---|
| 258 | if ((i==0x09) && (page<maxpage)) { |
---|
| 259 | page++; |
---|
| 260 | hi_line(select+4,0xF8); |
---|
| 261 | select=0; |
---|
| 262 | fic_list(select,page,nfic); |
---|
| 263 | hi_line(select+4,0xC7); |
---|
| 264 | } |
---|
| 265 | if ((i==0x0B) && (select>0)) { |
---|
| 266 | hi_line(select+4,0xF8); |
---|
| 267 | select--; |
---|
| 268 | hi_line(select+4,0xC7); |
---|
| 269 | } |
---|
| 270 | else |
---|
| 271 | if ((i==0x0B) && (page>0)) { |
---|
| 272 | page--; |
---|
| 273 | hi_line(select+4,0xF8); |
---|
| 274 | select=15; |
---|
| 275 | fic_list(select,page,nfic); |
---|
| 276 | hi_line(select+4,0xC7); |
---|
| 277 | } |
---|
| 278 | |
---|
| 279 | if ((i==0x0A) && (select<15)) { |
---|
| 280 | hi_line(select+4,0xF8); |
---|
| 281 | if ((page<<4)+select+1<nfic) { |
---|
| 282 | select++; |
---|
| 283 | } |
---|
| 284 | hi_line(select+4,0xC7); |
---|
| 285 | } |
---|
| 286 | else |
---|
| 287 | if ((i==0x0A) && (page<maxpage)) { |
---|
| 288 | page++; |
---|
| 289 | hi_line(select+4,0xF8); |
---|
| 290 | select=0; |
---|
| 291 | fic_list(select,page,nfic); |
---|
| 292 | hi_line(select+4,0xC7); |
---|
| 293 | } |
---|
| 294 | if (i==0x0D) { |
---|
| 295 | |
---|
| 296 | if (cfgnum==-1) { |
---|
| 297 | cls(); |
---|
| 298 | string(0,2,"Sorry, no HXCSDFE.CFG found. read only..",40); |
---|
| 299 | k=getc(); |
---|
| 300 | cls(); |
---|
| 301 | banner(); |
---|
| 302 | fic_list(select,page,nfic); |
---|
| 303 | |
---|
| 304 | continue; |
---|
| 305 | } |
---|
| 306 | if (f_clusz<2) { |
---|
| 307 | cls(); |
---|
| 308 | string(0,2,"Sorry, cluster size 1 is unsupported..",38); |
---|
| 309 | k=getc(); |
---|
| 310 | cls(); |
---|
| 311 | banner(); |
---|
| 312 | fic_list(select,page,nfic); |
---|
| 313 | |
---|
| 314 | continue; |
---|
| 315 | } |
---|
| 316 | cls(); |
---|
| 317 | string(0,2,"Confirm loading of file ? (y/n)",31); |
---|
| 318 | |
---|
| 319 | j=(page<<4)+select; |
---|
| 320 | string(1,4,&buf2[j<<5],8); |
---|
| 321 | charxy(8,4,'.'); |
---|
| 322 | string(10,4,&buf2[(j<<5)+8],3); |
---|
| 323 | string(14,4,&buf2[(j<<5)+11],17); |
---|
| 324 | |
---|
| 325 | k=getc(); |
---|
| 326 | if ((k==0x79) || (k==0x59)) { |
---|
| 327 | /* go */ |
---|
| 328 | /* read config first sector */ |
---|
| 329 | /* address = lba_start+((clust-2)*size) */ |
---|
| 330 | sub_32(f_cfgh,f_cfgl,0,2,&f_tmph,&f_tmpl); /* clu-2 */ |
---|
| 331 | clu2lba(f_tmph,f_tmpl,f_shift,&f_tmph,&f_tmpl); /* *size */ |
---|
| 332 | add_32(f_firsth,f_firstl,f_tmph,f_tmpl,&f_tmph,&f_tmpl); /* + lba_start */ |
---|
| 333 | |
---|
| 334 | rd_lba(f_tmph,f_tmpl); |
---|
| 335 | string(0,5,"CFG SECTOR0",11); |
---|
| 336 | buf[22]=0x02; |
---|
| 337 | buf[23]=0x01; |
---|
| 338 | |
---|
| 339 | ret=wt_sec(1); |
---|
| 340 | |
---|
| 341 | |
---|
| 342 | string(0,5,&buf[0],32); |
---|
| 343 | add_32(f_tmph,f_tmpl,0x0000,0x0001,&f_tmph,&f_tmpl); /* increment LBA */ |
---|
| 344 | |
---|
| 345 | string(0,6,"CFG SECTOR1",11); |
---|
| 346 | rd_lba(f_tmph,f_tmpl); |
---|
| 347 | string(0,7,&buf[0],11);string(12,7,&buf[21],16); |
---|
| 348 | |
---|
| 349 | for (ii=0;ii<11;ii++) { |
---|
| 350 | buf[ii]=buf2[(j<<5)+ii]; |
---|
| 351 | } |
---|
| 352 | buf[11]='\0'; |
---|
| 353 | buf[12]='\0'; |
---|
| 354 | buf[13]=buf2[(j<<5)+31]; |
---|
| 355 | buf[14]=buf2[(j<<5)+30]; |
---|
| 356 | buf[15]=buf2[(j<<5)+29]; |
---|
| 357 | buf[16]=buf2[(j<<5)+28]; |
---|
| 358 | |
---|
| 359 | /* fixed size for HFE thomson */ |
---|
| 360 | buf[17]=0x00; |
---|
| 361 | buf[18]=0xA4; |
---|
| 362 | buf[19]=0x1E; |
---|
| 363 | buf[20]=0x00; |
---|
| 364 | for (ii=0;ii<16;ii++) { |
---|
| 365 | buf[21+ii]=buf2[(j<<5)+ii+11]; |
---|
| 366 | } |
---|
| 367 | buf[37]='\0'; |
---|
| 368 | for (ii=38;ii<0x40;ii++) { |
---|
| 369 | buf[ii]='\0'; |
---|
| 370 | } |
---|
| 371 | |
---|
| 372 | /* just write back sector (LBA is still correct) */ |
---|
| 373 | ret=wt_sec(1); |
---|
| 374 | dump16b(0,24,ret); |
---|
| 375 | string(0,8,"WRT SECTOR1",11); |
---|
| 376 | string(0,9,&buf[0],11);string(12,9,&buf[21],16); |
---|
| 377 | |
---|
| 378 | /* just write back sector (LBA is still correct) */ |
---|
| 379 | ret=rd_sec(1); |
---|
| 380 | dump16b(0,24,ret); |
---|
| 381 | string(0,10,"READ BACK SECTOR1",17); |
---|
| 382 | string(0,11,&buf[0],11);string(12,11,&buf[21],16); |
---|
| 383 | |
---|
| 384 | |
---|
| 385 | add_32(f_tmph,f_tmpl,0x0000,0x0001,&f_tmph,&f_tmpl); /* increment LBA */ |
---|
| 386 | rd_lba(f_tmph,f_tmpl); |
---|
| 387 | |
---|
| 388 | for (ii=0;ii<11;ii++) { |
---|
| 389 | buf[ii+0x80]=buf2[(j<<5)+ii]; |
---|
| 390 | } |
---|
| 391 | buf[11+0x80]='\0'; |
---|
| 392 | buf[12+0x80]='\0'; |
---|
| 393 | buf[13+0x80]=buf2[(j<<5)+31]; |
---|
| 394 | buf[14+0x80]=buf2[(j<<5)+30]; |
---|
| 395 | buf[15+0x80]=buf2[(j<<5)+29]; |
---|
| 396 | buf[16+0x80]=buf2[(j<<5)+28]; |
---|
| 397 | |
---|
| 398 | /* fixed size for HFE thomson */ |
---|
| 399 | buf[17+0x80]=0x00; |
---|
| 400 | buf[18+0x80]=0xA4; |
---|
| 401 | buf[19+0x80]=0x1E; |
---|
| 402 | buf[20+0x80]=0x00; |
---|
| 403 | for (ii=0;ii<16;ii++) { |
---|
| 404 | buf[21+ii+0x80]=buf2[(j<<5)+ii+11]; |
---|
| 405 | } |
---|
| 406 | buf[37+0x80]='\0'; |
---|
| 407 | for (ii=38;ii<0x40;ii++) { |
---|
| 408 | buf[ii]='\0'; |
---|
| 409 | } |
---|
| 410 | |
---|
| 411 | /* just write back sector (LBA is still correct) */ |
---|
| 412 | ret=wt_sec(1); |
---|
| 413 | dump16b(0,24,ret); |
---|
| 414 | |
---|
| 415 | string(0,13,"Press a key...",14); |
---|
| 416 | |
---|
| 417 | k=getc(); |
---|
| 418 | |
---|
| 419 | |
---|
| 420 | /* leave LBA (need 3 times) */ |
---|
| 421 | go_track(0); |
---|
| 422 | go_track(0); |
---|
| 423 | go_track(0); |
---|
| 424 | |
---|
| 425 | string(0,14,"... REBOOT ...",10); |
---|
| 426 | /* and reset */ |
---|
| 427 | { |
---|
| 428 | #asm |
---|
| 429 | TFR S,Y |
---|
| 430 | STY $62FC |
---|
| 431 | LDY $62FE |
---|
| 432 | TFR Y,S |
---|
| 433 | |
---|
| 434 | JMP [$FFFE] |
---|
| 435 | #endasm |
---|
| 436 | } |
---|
| 437 | |
---|
| 438 | } |
---|
| 439 | cls(); |
---|
| 440 | banner(); |
---|
| 441 | fic_list(select,page,nfic); |
---|
| 442 | |
---|
| 443 | } |
---|
| 444 | |
---|
| 445 | } |
---|
| 446 | return 0; |
---|
| 447 | } |
---|
| 448 | cls() |
---|
| 449 | { |
---|
| 450 | set_col(); |
---|
| 451 | fill(0xF8); |
---|
| 452 | set_pt(); |
---|
| 453 | fill(0x00); |
---|
| 454 | return 0; |
---|
| 455 | } |
---|
| 456 | banner() |
---|
| 457 | { |
---|
| 458 | string(0,0,"HxC TO8 File selector by VitalMotion",38); |
---|
| 459 | string(0,2,"Select your File:\0",17); |
---|
| 460 | return 0; |
---|
| 461 | } |
---|
| 462 | |
---|
| 463 | fic_list(select,page,nfic) |
---|
| 464 | int select; |
---|
| 465 | int page; |
---|
| 466 | int nfic; |
---|
| 467 | { |
---|
| 468 | int i,j; |
---|
| 469 | int start; |
---|
| 470 | int line; |
---|
| 471 | char *buf2; |
---|
| 472 | |
---|
| 473 | i=0xA000;buf2=i; |
---|
| 474 | |
---|
| 475 | start=(page<<4); |
---|
| 476 | |
---|
| 477 | line=0; |
---|
| 478 | for (i=start;i<(start+16);i++) { |
---|
| 479 | if (i>=nfic) { |
---|
| 480 | string(1,line+4," ",39); |
---|
| 481 | line++; |
---|
| 482 | continue; |
---|
| 483 | } |
---|
| 484 | |
---|
| 485 | string(1,line+4,&buf2[i<<5],8); |
---|
| 486 | charxy(9,line+4,'.'); |
---|
| 487 | string(10,line+4,&buf2[(i<<5)+8],3); |
---|
| 488 | |
---|
| 489 | string(14,line+4,&buf2[(i<<5)+11],17); |
---|
| 490 | |
---|
| 491 | dump16b(32,line+4,mk_16(buf2[(i<<5)+28],buf2[(i<<5)+29])); |
---|
| 492 | dump16b(36,line+4,mk_16(buf2[(i<<5)+30],buf2[(i<<5)+31])); |
---|
| 493 | line++; |
---|
| 494 | } |
---|
| 495 | return 0; |
---|
| 496 | } |
---|
| 497 | /* |
---|
| 498 | cfg is |
---|
| 499 | * |
---|
| 500 | |
---|
| 501 | |
---|
| 502 | struct ShortDirectoryEntry { |
---|
| 503 | unsigned char name[12]; |
---|
| 504 | unsigned char attributes; |
---|
| 505 | unsigned long firstCluster; |
---|
| 506 | unsigned long size; |
---|
| 507 | unsigned char longName[17]; // boolean |
---|
| 508 | }; |
---|
| 509 | |
---|
| 510 | extern struct DirectoryEntry directoryEntry; |
---|
| 511 | |
---|
| 512 | |
---|
| 513 | typedef struct disk_in_drive_ |
---|
| 514 | { |
---|
| 515 | struct ShortDirectoryEntry DirEnt; |
---|
| 516 | unsigned char numberoftrack; |
---|
| 517 | unsigned char numberofside; |
---|
| 518 | unsigned short rpm; |
---|
| 519 | unsigned short bitrate; |
---|
| 520 | unsigned short tracklistoffset; |
---|
| 521 | }disk_in_drive; |
---|
| 522 | |
---|
| 523 | at 0x100 (in first LBA sector) |
---|
| 524 | * |
---|
| 525 | */ |
---|
| 526 | string(x,y,s,sz) |
---|
| 527 | int x; |
---|
| 528 | int y; |
---|
| 529 | char *s; |
---|
| 530 | int sz; |
---|
| 531 | { |
---|
| 532 | int i; |
---|
| 533 | int ii; |
---|
| 534 | for (i=0;i<sz;i++) { |
---|
| 535 | if (s[i]=='\0') { |
---|
| 536 | for (ii=i;ii<sz;ii++) { |
---|
| 537 | charxy(x,y,' '); |
---|
| 538 | x++; |
---|
| 539 | } |
---|
| 540 | break; |
---|
| 541 | } |
---|
| 542 | charxy(x,y,s[i]); |
---|
| 543 | x++; |
---|
| 544 | } |
---|
| 545 | return 0; |
---|
| 546 | } |
---|
| 547 | |
---|
| 548 | |
---|
| 549 | find83(s1,s2) |
---|
| 550 | char *s1; |
---|
| 551 | char *s2; |
---|
| 552 | { |
---|
| 553 | int i; |
---|
| 554 | int ret; |
---|
| 555 | ret=0; |
---|
| 556 | for (i=0;i<11;i++) { |
---|
| 557 | if (s1[i]!=s2[i]) { |
---|
| 558 | ret=1; |
---|
| 559 | break; |
---|
| 560 | } |
---|
| 561 | } |
---|
| 562 | return ret; |
---|
| 563 | } |
---|
| 564 | |
---|
| 565 | char hexchar(c) |
---|
| 566 | char c; |
---|
| 567 | { |
---|
| 568 | if (c<10) { return '0'+c; } |
---|
| 569 | return 'A'+c-10; |
---|
| 570 | } |
---|
| 571 | |
---|
| 572 | dump16b(x,y,v) |
---|
| 573 | int x; |
---|
| 574 | int y; |
---|
| 575 | unsigned int v; |
---|
| 576 | { |
---|
| 577 | unsigned int ii,jj; |
---|
| 578 | jj=(v&0xF000)>>12; |
---|
| 579 | ii=hexchar(jj); |
---|
| 580 | charxy(x,y,ii); |
---|
| 581 | jj=(v&0xF00)>>8; |
---|
| 582 | ii=hexchar(jj); |
---|
| 583 | charxy(x+1,y,ii); |
---|
| 584 | jj=(v&0xF0)>>4; |
---|
| 585 | ii=hexchar(jj); |
---|
| 586 | charxy(x+2,y,ii); |
---|
| 587 | jj=v&0xF; |
---|
| 588 | ii=hexchar(jj); |
---|
| 589 | charxy(x+3,y,ii); |
---|
| 590 | return 0; |
---|
| 591 | } |
---|
| 592 | |
---|
| 593 | go_trk255() |
---|
| 594 | { |
---|
| 595 | { |
---|
| 596 | #asm |
---|
| 597 | LDA #$01 | reset lecteur |
---|
| 598 | STA _DKOPC |
---|
| 599 | JSR $E004 |
---|
| 600 | LDA #$20 | rech piste 0 |
---|
| 601 | STA _DKOPC |
---|
| 602 | JSR $E004 |
---|
| 603 | CLR _DKVAL |
---|
| 604 | LDA #$02 | read a sector to start motor |
---|
| 605 | STA _DKTRK |
---|
| 606 | LDA #$01 | read a sector to start motor |
---|
| 607 | STB _DKSEC |
---|
| 608 | LDA #$02 |
---|
| 609 | STA _DKOPC |
---|
| 610 | LDA #127 | goto 127 |
---|
| 611 | STA _DKTRK |
---|
| 612 | LDA #$40 |
---|
| 613 | STA _DKOPC |
---|
| 614 | JSR $E004 |
---|
| 615 | CLR _DKVAL |
---|
| 616 | LDA #127 | 127 more... |
---|
| 617 | STA _DKTRK |
---|
| 618 | LDA #$40 |
---|
| 619 | STA _DKOPC |
---|
| 620 | JSR $E004 |
---|
| 621 | CLR _DKVAL |
---|
| 622 | LDA #1 | 1 more... |
---|
| 623 | STA _DKTRK |
---|
| 624 | LDA #$40 |
---|
| 625 | STA _DKOPC |
---|
| 626 | JSR $E004 |
---|
| 627 | LDA #$FF |
---|
| 628 | STA _DKVAL | make monitor think we are in track 255 |
---|
| 629 | STA _DKTRK |
---|
| 630 | LDA #$00 |
---|
| 631 | LDB _DKERR |
---|
| 632 | TFR D,X | return in X |
---|
| 633 | #endasm |
---|
| 634 | } |
---|
| 635 | return 0; |
---|
| 636 | } |
---|
| 637 | |
---|
| 638 | go_track(track) |
---|
| 639 | char track; |
---|
| 640 | { |
---|
| 641 | { |
---|
| 642 | #asm |
---|
| 643 | LDA #$20 | rech piste 0 |
---|
| 644 | STA _DKOPC |
---|
| 645 | JSR $E004 |
---|
| 646 | CLR _DKVAL |
---|
| 647 | LDB 5,U |
---|
| 648 | STB _DKTRK |
---|
| 649 | LDA #$40 |
---|
| 650 | STA _DKOPC |
---|
| 651 | JSR $E004 |
---|
| 652 | LDA #$00 |
---|
| 653 | LDB _DKERR |
---|
| 654 | TFR D,X | return in X |
---|
| 655 | #endasm |
---|
| 656 | } |
---|
| 657 | } |
---|
| 658 | |
---|
| 659 | rd_lba(high,low) |
---|
| 660 | unsigned int high,low; |
---|
| 661 | { |
---|
| 662 | int i; |
---|
| 663 | char *p; |
---|
| 664 | |
---|
| 665 | for (i=0x6300;i<0x6500;i++) { |
---|
| 666 | p=i; |
---|
| 667 | *p=0x00; |
---|
| 668 | } |
---|
| 669 | i=0x6300;p=i; |
---|
| 670 | p[0]='H'; |
---|
| 671 | p[1]='x'; |
---|
| 672 | p[2]='C'; |
---|
| 673 | p[3]='F'; |
---|
| 674 | p[4]='E'; |
---|
| 675 | p[5]='D'; |
---|
| 676 | p[6]='A'; |
---|
| 677 | p[7]=0; |
---|
| 678 | |
---|
| 679 | p[8]=0x01; |
---|
| 680 | p[9]=(low & 0xFF); |
---|
| 681 | p[10]=((low >> 8) & 0xFF); |
---|
| 682 | p[11]=(high & 0xFF); |
---|
| 683 | p[12]=((high >> 8) & 0xFF); |
---|
| 684 | p[13]=0xA5; |
---|
| 685 | p[14]=0x08; |
---|
| 686 | |
---|
| 687 | /* init fields with a read */ |
---|
| 688 | wt_sec(0); |
---|
| 689 | i=rd_sec(1); |
---|
| 690 | return i; |
---|
| 691 | } |
---|
| 692 | |
---|
| 693 | mk_16(c1,c2) |
---|
| 694 | char c1; |
---|
| 695 | char c2; |
---|
| 696 | { |
---|
| 697 | { |
---|
| 698 | #asm |
---|
| 699 | LDA 5,U | read from stack |
---|
| 700 | LDB 7,U | read from stack |
---|
| 701 | TFR D,X | return in X |
---|
| 702 | #endasm |
---|
| 703 | } |
---|
| 704 | } |
---|
| 705 | |
---|
| 706 | add_32(h1,l1,h2,l2,rh,rl) |
---|
| 707 | unsigned int h1,l1; |
---|
| 708 | unsigned int h2,l2; |
---|
| 709 | unsigned int *rh,*rl; |
---|
| 710 | { |
---|
| 711 | { |
---|
| 712 | #asm |
---|
| 713 | LEAX 4,U | h1 |
---|
| 714 | LEAY 8,U | h2 |
---|
| 715 | ANDCC #$FE |
---|
| 716 | LDA 3,X |
---|
| 717 | ADCA 3,Y |
---|
| 718 | STA 3,Y |
---|
| 719 | LDA 2,X |
---|
| 720 | ADCA 2,Y |
---|
| 721 | STA 2,Y |
---|
| 722 | LDA 1,X |
---|
| 723 | ADCA 1,Y |
---|
| 724 | STA 1,Y |
---|
| 725 | LDA ,X |
---|
| 726 | ADCA ,Y |
---|
| 727 | STA ,Y |
---|
| 728 | |
---|
| 729 | LDX 8,U |
---|
| 730 | STX [12,U] | rh |
---|
| 731 | |
---|
| 732 | LDX 10,U |
---|
| 733 | STX [14,U] | rl |
---|
| 734 | #endasm |
---|
| 735 | } |
---|
| 736 | } |
---|
| 737 | |
---|
| 738 | sub_32(h1,l1,h2,l2,rh,rl) |
---|
| 739 | unsigned int h1,l1; |
---|
| 740 | unsigned int h2,l2; |
---|
| 741 | unsigned int *rh,*rl; |
---|
| 742 | { |
---|
| 743 | { |
---|
| 744 | #asm |
---|
| 745 | LEAX 4,U | h1 |
---|
| 746 | LEAY 8,U | h2 |
---|
| 747 | ANDCC #$FE |
---|
| 748 | LDA 3,X |
---|
| 749 | SBCA 3,Y |
---|
| 750 | STA 3,Y |
---|
| 751 | LDA 2,X |
---|
| 752 | SBCA 2,Y |
---|
| 753 | STA 2,Y |
---|
| 754 | LDA 1,X |
---|
| 755 | SBCA 1,Y |
---|
| 756 | STA 1,Y |
---|
| 757 | LDA ,X |
---|
| 758 | SBCA ,Y |
---|
| 759 | STA ,Y |
---|
| 760 | |
---|
| 761 | LDX 8,U |
---|
| 762 | STX [12,U] | rh |
---|
| 763 | |
---|
| 764 | LDX 10,U |
---|
| 765 | STX [14,U] | rl |
---|
| 766 | #endasm |
---|
| 767 | } |
---|
| 768 | } |
---|
| 769 | siz2shif(sz) |
---|
| 770 | int sz; |
---|
| 771 | { |
---|
| 772 | int i; |
---|
| 773 | switch (sz) { |
---|
| 774 | case 1 : i=0; |
---|
| 775 | break; |
---|
| 776 | case 2 : i=1; |
---|
| 777 | break; |
---|
| 778 | case 4 : i=2; |
---|
| 779 | break; |
---|
| 780 | case 8 : i=3; |
---|
| 781 | break; |
---|
| 782 | case 16 : i=4; |
---|
| 783 | break; |
---|
| 784 | case 32 : i=5; |
---|
| 785 | break; |
---|
| 786 | case 64 : i=6; |
---|
| 787 | break; |
---|
| 788 | case 128 : i=7; |
---|
| 789 | break; |
---|
| 790 | default : i=0; |
---|
| 791 | } |
---|
| 792 | return i; |
---|
| 793 | } |
---|
| 794 | |
---|
| 795 | clu2lba(h,l,shift,rh,rl) |
---|
| 796 | unsigned int h,l; |
---|
| 797 | unsigned int shift; |
---|
| 798 | unsigned int *rh,*rl; |
---|
| 799 | { |
---|
| 800 | { |
---|
| 801 | #asm |
---|
| 802 | LEAX 4,U | h (+l) |
---|
| 803 | |
---|
| 804 | LDB 9,U | shift |
---|
| 805 | L_CLU2LBA |
---|
| 806 | CMPB #$00 |
---|
| 807 | BEQ L_CLU2END |
---|
| 808 | ANDCC #$FE |
---|
| 809 | |
---|
| 810 | LDA 3,X |
---|
| 811 | LSLA |
---|
| 812 | STA 3,X |
---|
| 813 | LDA 2,X |
---|
| 814 | ROLA |
---|
| 815 | STA 2,X |
---|
| 816 | LDA 1,X |
---|
| 817 | ROLA |
---|
| 818 | STA 1,X |
---|
| 819 | LDA ,X |
---|
| 820 | ROLA |
---|
| 821 | STA ,X |
---|
| 822 | DECB |
---|
| 823 | BRA L_CLU2LBA |
---|
| 824 | |
---|
| 825 | L_CLU2END |
---|
| 826 | LDX 4,U |
---|
| 827 | STX [10,U] | rh |
---|
| 828 | |
---|
| 829 | LDX 6,U |
---|
| 830 | STX [12,U] | rl |
---|
| 831 | #endasm |
---|
| 832 | } |
---|
| 833 | } |
---|
| 834 | |
---|
| 835 | rd_sec(sect) |
---|
| 836 | char sect; |
---|
| 837 | { |
---|
| 838 | { |
---|
| 839 | #asm |
---|
| 840 | LDB 5,U | read from stack |
---|
| 841 | LDA #$02 | read sector (monitor) |
---|
| 842 | STA _DKOPC |
---|
| 843 | STB _DKSEC |
---|
| 844 | PSHS U,DP |
---|
| 845 | LDX #$6300 |
---|
| 846 | STX $604F | sector buffer |
---|
| 847 | JSR $789D |
---|
| 848 | JSR $78A7 |
---|
| 849 | PSHS A | |
---|
| 850 | JSR $7C5A | activate drive... |
---|
| 851 | JSR $7965 | wait some time |
---|
| 852 | JSR $7CA8 |
---|
| 853 | LDA #$FF |
---|
| 854 | STA 6,X | force track FF in THFMC reg |
---|
| 855 | JSR $7BAE |
---|
| 856 | PULS A | E0EE |
---|
| 857 | JSR $78B9 | motor off |
---|
| 858 | PULS DP,U |
---|
| 859 | LDA #$00 |
---|
| 860 | LDB _DKERR |
---|
| 861 | TFR D,X | return in X |
---|
| 862 | #endasm |
---|
| 863 | } |
---|
| 864 | } |
---|
| 865 | |
---|
| 866 | wt_sec(sect) |
---|
| 867 | char sect; |
---|
| 868 | { |
---|
| 869 | { |
---|
| 870 | #asm |
---|
| 871 | LDB 5,U | read from stack |
---|
| 872 | LDA #$08 | read sector (monitor) |
---|
| 873 | STA _DKOPC |
---|
| 874 | STB _DKSEC |
---|
| 875 | PSHS U,DP |
---|
| 876 | LDX #$6300 |
---|
| 877 | STX $604F | sector buffer |
---|
| 878 | JSR $789D |
---|
| 879 | JSR $78A7 |
---|
| 880 | PSHS A | |
---|
| 881 | JSR $7C5A | activate drive... |
---|
| 882 | JSR $7965 | wait some time |
---|
| 883 | JSR $7CA8 |
---|
| 884 | LDA #$FF |
---|
| 885 | STA 6,X | force track FF in THFMC reg |
---|
| 886 | JSR $797A |
---|
| 887 | PULS A | E0EE |
---|
| 888 | JSR $78B9 | motor off |
---|
| 889 | PULS DP,U |
---|
| 890 | LDA #$00 |
---|
| 891 | LDB _DKERR |
---|
| 892 | TFR D,X | return in X |
---|
| 893 | #endasm |
---|
| 894 | } |
---|
| 895 | } |
---|
| 896 | |
---|
| 897 | irq() |
---|
| 898 | { |
---|
| 899 | { |
---|
| 900 | #asm |
---|
| 901 | |
---|
| 902 | #endasm |
---|
| 903 | } |
---|
| 904 | } |
---|
| 905 | |
---|
| 906 | noirq() |
---|
| 907 | { |
---|
| 908 | { |
---|
| 909 | #asm |
---|
| 910 | |
---|
| 911 | #endasm |
---|
| 912 | } |
---|
| 913 | } |
---|
| 914 | |
---|
| 915 | getc() |
---|
| 916 | { |
---|
| 917 | { |
---|
| 918 | #asm |
---|
| 919 | TFR S,Y |
---|
| 920 | STY $62FC |
---|
| 921 | LDY $62FE |
---|
| 922 | TFR Y,S |
---|
| 923 | |
---|
| 924 | ANDCC #$EF |
---|
| 925 | |
---|
| 926 | L_GETC |
---|
| 927 | |
---|
| 928 | JSR $E806 | call monitor |
---|
| 929 | BCC L_GETC |
---|
| 930 | |
---|
| 931 | ORCC #$50 |
---|
| 932 | |
---|
| 933 | TFR S,Y |
---|
| 934 | STY $62FE |
---|
| 935 | LDY $62FC |
---|
| 936 | TFR Y,S |
---|
| 937 | |
---|
| 938 | |
---|
| 939 | LDA #$00 |
---|
| 940 | TFR D,X | return in X |
---|
| 941 | |
---|
| 942 | |
---|
| 943 | #endasm |
---|
| 944 | } |
---|
| 945 | } |
---|
| 946 | fill(v) |
---|
| 947 | char v; |
---|
| 948 | { |
---|
| 949 | { |
---|
| 950 | #asm |
---|
| 951 | LDB 5,U |
---|
| 952 | LDX #$4000 |
---|
| 953 | FILL_L |
---|
| 954 | STB ,X+ |
---|
| 955 | CMPX #$5F40 |
---|
| 956 | BNE FILL_L |
---|
| 957 | #endasm |
---|
| 958 | } |
---|
| 959 | } |
---|
| 960 | |
---|
| 961 | |
---|
| 962 | |
---|
| 963 | set_resolution(res) |
---|
| 964 | char res; |
---|
| 965 | { |
---|
| 966 | { |
---|
| 967 | #asm |
---|
| 968 | LDB 5,U |
---|
| 969 | STB $E7DC |
---|
| 970 | #endasm |
---|
| 971 | } |
---|
| 972 | } |
---|
| 973 | |
---|
| 974 | |
---|
| 975 | set_pt() |
---|
| 976 | { |
---|
| 977 | { |
---|
| 978 | #asm |
---|
| 979 | LDB #$01 |
---|
| 980 | ORB $E7C3 |
---|
| 981 | STB $E7C3 |
---|
| 982 | #endasm |
---|
| 983 | } |
---|
| 984 | } |
---|
| 985 | |
---|
| 986 | set_col() |
---|
| 987 | { |
---|
| 988 | { |
---|
| 989 | #asm |
---|
| 990 | LDB #$FE |
---|
| 991 | ANDB $E7C3 |
---|
| 992 | STB $E7C3 |
---|
| 993 | #endasm |
---|
| 994 | } |
---|
| 995 | } |
---|
| 996 | |
---|
| 997 | border(idx) |
---|
| 998 | int idx; |
---|
| 999 | { |
---|
| 1000 | { |
---|
| 1001 | #asm |
---|
| 1002 | LDB #$F0 |
---|
| 1003 | ANDB $E7E4 |
---|
| 1004 | ORB 5,U |
---|
| 1005 | STB $E7DD |
---|
| 1006 | #endasm |
---|
| 1007 | } |
---|
| 1008 | } |
---|
| 1009 | |
---|
| 1010 | hi_line(l,c) |
---|
| 1011 | int l; |
---|
| 1012 | int c; |
---|
| 1013 | { |
---|
| 1014 | set_col(); |
---|
| 1015 | { |
---|
| 1016 | #asm |
---|
| 1017 | * screen base address is x+y*40*8 -> Y |
---|
| 1018 | LDB 5,U |
---|
| 1019 | LSLB |
---|
| 1020 | LDX #BASE_TXT_ADR |
---|
| 1021 | LEAX [B,X] |
---|
| 1022 | LDB 7,U |
---|
| 1023 | LDY #320 |
---|
| 1024 | L_HILINE |
---|
| 1025 | STB ,X+ |
---|
| 1026 | |
---|
| 1027 | LEAY -1,Y |
---|
| 1028 | CMPY #$0000 |
---|
| 1029 | BNE L_HILINE |
---|
| 1030 | #endasm |
---|
| 1031 | } |
---|
| 1032 | set_pt(); |
---|
| 1033 | } |
---|
| 1034 | |
---|
| 1035 | charxy(x,y,c) |
---|
| 1036 | char x; |
---|
| 1037 | char y; |
---|
| 1038 | char c; |
---|
| 1039 | { |
---|
| 1040 | { |
---|
| 1041 | #asm |
---|
| 1042 | * screen base address is x+y*40*8 -> Y |
---|
| 1043 | LDB 7,U |
---|
| 1044 | LSLB |
---|
| 1045 | LDX #BASE_TXT_ADR |
---|
| 1046 | LEAX [B,X] |
---|
| 1047 | LDB 5,U |
---|
| 1048 | ABX |
---|
| 1049 | TFR X,Y |
---|
| 1050 | |
---|
| 1051 | * font base is font adress + 8*c -> X |
---|
| 1052 | LDB 9,U |
---|
| 1053 | ANDB #$7F |
---|
| 1054 | LDX #FONT8 |
---|
| 1055 | LDA #8 |
---|
| 1056 | MUL |
---|
| 1057 | LEAX D,X |
---|
| 1058 | |
---|
| 1059 | * put a byte every 40 screen byte |
---|
| 1060 | LDB #40 |
---|
| 1061 | LDA ,X+ |
---|
| 1062 | STA ,Y |
---|
| 1063 | LEAY B,Y |
---|
| 1064 | LDA ,X+ |
---|
| 1065 | STA ,Y |
---|
| 1066 | LEAY B,Y |
---|
| 1067 | LDA ,X+ |
---|
| 1068 | STA ,Y |
---|
| 1069 | LEAY B,Y |
---|
| 1070 | LDA ,X+ |
---|
| 1071 | STA ,Y |
---|
| 1072 | LEAY B,Y |
---|
| 1073 | LDA ,X+ |
---|
| 1074 | STA ,Y |
---|
| 1075 | LEAY B,Y |
---|
| 1076 | LDA ,X+ |
---|
| 1077 | STA ,Y |
---|
| 1078 | LEAY B,Y |
---|
| 1079 | LDA ,X+ |
---|
| 1080 | STA ,Y |
---|
| 1081 | LEAY B,Y |
---|
| 1082 | LDA ,X+ |
---|
| 1083 | STA ,Y |
---|
| 1084 | |
---|
| 1085 | PULS U,PC ; retour de fonction compatible mini C |
---|
| 1086 | |
---|
| 1087 | |
---|
| 1088 | BASE_TXT_ADR |
---|
| 1089 | FDB 0+$4000 |
---|
| 1090 | FDB 1*40*8+$4000 |
---|
| 1091 | FDB 2*40*8+$4000 |
---|
| 1092 | FDB 3*40*8+$4000 |
---|
| 1093 | FDB 4*40*8+$4000 |
---|
| 1094 | FDB 5*40*8+$4000 |
---|
| 1095 | FDB 6*40*8+$4000 |
---|
| 1096 | FDB 7*40*8+$4000 |
---|
| 1097 | FDB 8*40*8+$4000 |
---|
| 1098 | FDB 9*40*8+$4000 |
---|
| 1099 | FDB 10*40*8+$4000 |
---|
| 1100 | FDB 11*40*8+$4000 |
---|
| 1101 | FDB 12*40*8+$4000 |
---|
| 1102 | FDB 13*40*8+$4000 |
---|
| 1103 | FDB 14*40*8+$4000 |
---|
| 1104 | FDB 15*40*8+$4000 |
---|
| 1105 | FDB 16*40*8+$4000 |
---|
| 1106 | FDB 17*40*8+$4000 |
---|
| 1107 | FDB 18*40*8+$4000 |
---|
| 1108 | FDB 19*40*8+$4000 |
---|
| 1109 | FDB 20*40*8+$4000 |
---|
| 1110 | FDB 21*40*8+$4000 |
---|
| 1111 | FDB 22*40*8+$4000 |
---|
| 1112 | FDB 23*40*8+$4000 |
---|
| 1113 | FDB 24*40*8+$4000 |
---|
| 1114 | |
---|
| 1115 | FONT8 |
---|
| 1116 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1117 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1118 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1119 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1120 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1121 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1122 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1123 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1124 | |
---|
| 1125 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1126 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1127 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1128 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1129 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1130 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1131 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1132 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1133 | |
---|
| 1134 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1135 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1136 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1137 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1138 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1139 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1140 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1141 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1142 | |
---|
| 1143 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1144 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1145 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1146 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1147 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1148 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1149 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1150 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1151 | |
---|
| 1152 | |
---|
| 1153 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1154 | * ! |
---|
| 1155 | FCB $18,$18,$18,$18,$0,$18,$0,$0 |
---|
| 1156 | * " |
---|
| 1157 | FCB $66,$66,$0,$0,$0,$0,$0,$0 |
---|
| 1158 | * # |
---|
| 1159 | FCB $0,$24,$7E,$24,$7E,$24,$0,$0 |
---|
| 1160 | * $%& |
---|
| 1161 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1162 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1163 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1164 | * ' |
---|
| 1165 | FCB $18,$18,$0,$0,$0,$0,$0,$0 |
---|
| 1166 | * ( |
---|
| 1167 | FCB $C,$18,$30,$30,$30,$18,$C,$0 |
---|
| 1168 | * ) |
---|
| 1169 | FCB $30,$18,$C,$C,$C,$18,$30,$0 |
---|
| 1170 | * * |
---|
| 1171 | FCB $0,$18,$5A,$3C,$5A,$18,$0,$0 |
---|
| 1172 | * + |
---|
| 1173 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1174 | * , |
---|
| 1175 | FCB $0,$0,$0,$0,$0,$18,$30,$0 |
---|
| 1176 | * - |
---|
| 1177 | FCB $0,$0,$0,$7C,$0,$0,$0,$0 |
---|
| 1178 | * . |
---|
| 1179 | FCB $0,$0,$0,$0,$0,$18,$0,$0 |
---|
| 1180 | * / |
---|
| 1181 | FCB $6,$C,$18,$30,$60,$C0,$0,$0 |
---|
| 1182 | |
---|
| 1183 | |
---|
| 1184 | * 0-9 |
---|
| 1185 | FCB $7C,$C6,$C6,$C6,$FE,$7C,$0,$0 |
---|
| 1186 | FCB $38,$18,$18,$18,$18,$18,$0,$0 |
---|
| 1187 | FCB $FC,$E,$7C,$C0,$FE,$FE,$0,$0 |
---|
| 1188 | FCB $FC,$6,$FE,$6,$FE,$FC,$0,$0 |
---|
| 1189 | FCB $C6,$C6,$C6,$7E,$6,$6,$0,$0 |
---|
| 1190 | FCB $FE,$E0,$FC,$6,$FE,$FC,$0,$0 |
---|
| 1191 | FCB $7E,$E0,$FC,$C6,$FE,$7C,$0,$0 |
---|
| 1192 | FCB $FE,$6,$6,$6,$6,$6,$0,$0 |
---|
| 1193 | FCB $7C,$C6,$7C,$C6,$FE,$7C,$0,$0 |
---|
| 1194 | FCB $7C,$C6,$FE,$6,$FE,$FC,$0,$0 |
---|
| 1195 | |
---|
| 1196 | * : |
---|
| 1197 | FCB $0,$0,$18,$0,$0,$18,$0,$0 |
---|
| 1198 | * ; |
---|
| 1199 | FCB $0,$0,$0,$18,$0,$18,$30,$0 |
---|
| 1200 | * < |
---|
| 1201 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1202 | * = |
---|
| 1203 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1204 | * > |
---|
| 1205 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1206 | * ? |
---|
| 1207 | FCB $FC,$E,$3C,$30,$0,$30,$0,$0 |
---|
| 1208 | * @ |
---|
| 1209 | FCB $7C,$82,$9A,$BE,$80,$7C,$0,$0 |
---|
| 1210 | |
---|
| 1211 | * A-Z |
---|
| 1212 | FCB $7C,$C6,$C6,$FE,$C6,$C6,$0,$0 |
---|
| 1213 | FCB $FC,$C6,$FC,$C6,$FE,$FC,$0,$0 |
---|
| 1214 | FCB $7C,$C6,$C0,$C6,$FE,$7C,$0,$0 |
---|
| 1215 | FCB $FC,$C6,$C6,$C6,$FE,$FC,$0,$0 |
---|
| 1216 | FCB $7E,$C0,$FE,$C0,$FE,$7E,$0,$0 |
---|
| 1217 | FCB $7E,$C0,$FE,$C0,$C0,$C0,$0,$0 |
---|
| 1218 | FCB $7E,$C0,$C6,$C6,$FE,$7E,$0,$0 |
---|
| 1219 | FCB $C6,$C6,$FE,$C6,$C6,$C6,$0,$0 |
---|
| 1220 | FCB $18,$18,$18,$18,$18,$18,$0,$0 |
---|
| 1221 | FCB $E,$6,$C6,$C6,$FE,$7C,$0,$0 |
---|
| 1222 | FCB $C6,$C6,$FC,$C6,$C6,$C6,$0,$0 |
---|
| 1223 | FCB $C0,$C0,$C0,$C0,$FE,$7E,$0,$0 |
---|
| 1224 | FCB $FC,$D6,$D6,$D6,$D6,$D6,$0,$0 |
---|
| 1225 | FCB $FC,$C6,$C6,$C6,$C6,$C6,$0,$0 |
---|
| 1226 | FCB $7C,$C6,$C6,$C6,$FE,$7C,$0,$0 |
---|
| 1227 | FCB $FC,$C6,$C6,$FC,$C0,$C0,$0,$0 |
---|
| 1228 | FCB $7C,$C6,$C6,$D6,$FE,$7C,$18,$18 |
---|
| 1229 | FCB $FC,$C6,$C6,$FC,$C6,$C6,$0,$0 |
---|
| 1230 | FCB $7E,$E0,$7C,$6,$FE,$FC,$0,$0 |
---|
| 1231 | FCB $FC,$30,$30,$30,$30,$30,$0,$0 |
---|
| 1232 | FCB $C6,$C6,$C6,$C6,$FE,$7C,$0,$0 |
---|
| 1233 | FCB $C6,$C6,$C6,$EE,$7C,$38,$0,$0 |
---|
| 1234 | FCB $D6,$D6,$D6,$D6,$FC,$F8,$0,$0 |
---|
| 1235 | FCB $C6,$C6,$7C,$C6,$C6,$C6,$0,$0 |
---|
| 1236 | FCB $C6,$C6,$7E,$6,$FE,$FC,$0,$0 |
---|
| 1237 | FCB $FE,$E,$38,$E0,$FE,$FE,$0,$0 |
---|
| 1238 | |
---|
| 1239 | * [ |
---|
| 1240 | FCB $3C,$30,$30,$30,$30,$30,$3C,$00 |
---|
| 1241 | * \ |
---|
| 1242 | FCB $C0,$60,$30,$18,$C,$6,$0,$0 |
---|
| 1243 | * ] |
---|
| 1244 | FCB $3C,$0C,$0C,$0C,$0C,$0C,$3C,$00 |
---|
| 1245 | * ^ |
---|
| 1246 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1247 | * _ |
---|
| 1248 | FCB $0,$0,$0,$0,$0,$FE,$0,$0 |
---|
| 1249 | * ` |
---|
| 1250 | FCB $18,$18,$0,$0,$0,$0,$0,$0 |
---|
| 1251 | |
---|
| 1252 | * a-z |
---|
| 1253 | FCB $0,$7E,$C6,$C6,$FE,$7E,$0,$0 |
---|
| 1254 | FCB $C0,$C0,$FC,$C6,$FE,$FC,$0,$0 |
---|
| 1255 | FCB $0,$7E,$C0,$C0,$FE,$7E,$0,$0 |
---|
| 1256 | FCB $6,$6,$7E,$C6,$FE,$7E,$0,$0 |
---|
| 1257 | FCB $0,$7C,$C6,$FE,$E0,$7C,$0,$0 |
---|
| 1258 | FCB $1E,$30,$7E,$30,$30,$30,$0,$0 |
---|
| 1259 | FCB $0,$7E,$C6,$C6,$7E,$6,$6,$7C |
---|
| 1260 | FCB $C0,$C0,$FC,$C6,$C6,$C6,$0,$0 |
---|
| 1261 | FCB $18,$0,$18,$18,$18,$18,$0,$0 |
---|
| 1262 | FCB $18,$0,$18,$18,$18,$18,$18,$70 |
---|
| 1263 | FCB $C0,$C6,$C6,$FC,$C6,$C6,$0,$0 |
---|
| 1264 | FCB $18,$18,$18,$18,$18,$18,$0,$0 |
---|
| 1265 | FCB $0,$FC,$D6,$D6,$D6,$D6,$0,$0 |
---|
| 1266 | FCB $0,$FC,$C6,$C6,$C6,$C6,$0,$0 |
---|
| 1267 | FCB $0,$7C,$C6,$C6,$FE,$7C,$0,$0 |
---|
| 1268 | FCB $0,$FC,$C6,$C6,$FE,$FC,$C0,$C0 |
---|
| 1269 | FCB $0,$7E,$C6,$C6,$FE,$7E,$6,$6 |
---|
| 1270 | FCB $0,$7E,$C0,$C0,$C0,$C0,$0,$0 |
---|
| 1271 | FCB $0,$7E,$E0,$7C,$E,$FC,$0,$0 |
---|
| 1272 | FCB $60,$60,$FE,$60,$60,$3E,$0,$0 |
---|
| 1273 | FCB $0,$C6,$C6,$C6,$FE,$7E,$0,$0 |
---|
| 1274 | FCB $0,$C6,$C6,$C6,$7C,$38,$0,$0 |
---|
| 1275 | FCB $0,$D6,$D6,$D6,$FC,$F8,$0,$0 |
---|
| 1276 | FCB $0,$C6,$C6,$7C,$C6,$C6,$0,$0 |
---|
| 1277 | FCB $0,$C6,$C6,$C6,$7E,$6,$6,$7C |
---|
| 1278 | FCB $0,$FE,$E,$38,$E0,$FE,$0,$0 |
---|
| 1279 | |
---|
| 1280 | * |
---|
| 1281 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1282 | |
---|
| 1283 | * | as a block |
---|
| 1284 | FCB $FE,$FE,$FE,$FE,$FE,$FE,$0,$0 |
---|
| 1285 | |
---|
| 1286 | * |
---|
| 1287 | FCB $0,$0,$0,$0,$0,$0,$0,$0 |
---|
| 1288 | |
---|
| 1289 | FCB $00,$60,$F2,$9E,$0C,$00,$0,$0 |
---|
| 1290 | |
---|
| 1291 | * MC09 internal functions/lib |
---|
| 1292 | |
---|
| 1293 | _00001 PSHS D,X,Y multiply |
---|
| 1294 | |
---|
| 1295 | LDA ,S |
---|
| 1296 | LDB 3,S |
---|
| 1297 | MUL |
---|
| 1298 | STB 4,S |
---|
| 1299 | |
---|
| 1300 | LDD 1,S |
---|
| 1301 | MUL |
---|
| 1302 | STB 5,S |
---|
| 1303 | |
---|
| 1304 | LDA 1,S |
---|
| 1305 | LDB 3,S |
---|
| 1306 | MUL |
---|
| 1307 | ADDA 4,S |
---|
| 1308 | ADDA 5,S |
---|
| 1309 | |
---|
| 1310 | LEAS 6,S |
---|
| 1311 | RTS |
---|
| 1312 | |
---|
| 1313 | _00006 CMPX #0 signed left shift |
---|
| 1314 | BMI _06001 |
---|
| 1315 | |
---|
| 1316 | _06000 BEQ _06009 |
---|
| 1317 | LSLB |
---|
| 1318 | ROLA |
---|
| 1319 | LEAX -1,X |
---|
| 1320 | BRA _06000 |
---|
| 1321 | |
---|
| 1322 | _06001 BEQ _06009 |
---|
| 1323 | ASRA |
---|
| 1324 | RORB |
---|
| 1325 | LEAX 1,X |
---|
| 1326 | BRA _06001 |
---|
| 1327 | |
---|
| 1328 | _06009 RTS |
---|
| 1329 | _00008 CMPX #0 sined right shift |
---|
| 1330 | BMI _08001 |
---|
| 1331 | |
---|
| 1332 | _08000 BEQ _08009 |
---|
| 1333 | ASRA |
---|
| 1334 | RORB |
---|
| 1335 | LEAX -1,X |
---|
| 1336 | BRA _08000 |
---|
| 1337 | |
---|
| 1338 | _08001 BEQ _08009 |
---|
| 1339 | LSLB |
---|
| 1340 | ROLA |
---|
| 1341 | LEAX 1,X |
---|
| 1342 | BRA _08001 |
---|
| 1343 | |
---|
| 1344 | _08009 RTS |
---|
| 1345 | _00009 CMPX #0 unsined right shift |
---|
| 1346 | BMI _09001 |
---|
| 1347 | |
---|
| 1348 | _09000 BEQ _09009 |
---|
| 1349 | LSRA |
---|
| 1350 | RORB |
---|
| 1351 | LEAX -1,X |
---|
| 1352 | BRA _09000 |
---|
| 1353 | |
---|
| 1354 | _09001 BEQ _09009 |
---|
| 1355 | LSLB |
---|
| 1356 | ROLA |
---|
| 1357 | LEAX 1,X |
---|
| 1358 | BRA _09001 |
---|
| 1359 | |
---|
| 1360 | _09009 RTS |
---|
| 1361 | #endasm |
---|
| 1362 | } |
---|
| 1363 | } |
---|