Changeset 5 in HXC_thomson_filesel
- Timestamp:
- 03/03/19 16:04:03 (6 years ago)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
loader.c
r4 r5 1 2 1 3 #asm 2 4 (main)test.asm … … 78 80 unsigned int f_cfgh; 79 81 unsigned int f_cfgl; 82 unsigned int idx; 80 83 81 84 int page,select,maxpage; … … 176 179 177 180 for (i=0;i<16;i++) { 178 if ((buf[i<<5]&0xFF)==0x00) { 181 idx=i<<5; 182 if ((buf[idx]&0xFF)==0x00) { 179 183 dirEnd=1; 180 184 break; 181 185 } 182 if ((buf[ (i<<5)+11]&0x0F)==0x0F) {183 longIdx=buf[i <<5]&0xF;186 if ((buf[idx+11]&0x0F)==0x0F) { 187 longIdx=buf[idx]&0xF; 184 188 longOff=(longIdx-1)*13; 185 189 for (j=0;j<5;j++) { 186 190 if (longOff+j<17) { 187 k=(i <<5)+(j<<1)+1;191 k=(idx)+(j<<1)+1; 188 192 longname[longOff+j]=buf[k]; 189 193 } … … 191 195 for (j=0;j<6;j++) { 192 196 if (longOff+j+5<17) { 193 k=(i <<5)+(j<<1)+0xE;197 k=(idx)+(j<<1)+0xE; 194 198 longname[longOff+j+5]=buf[k]; 195 199 } … … 197 201 for (j=0;j<2;j++) { 198 202 if (longOff+j+11<17) { 199 k=(i <<5)+(j<<1)+0x1C;203 k=(idx)+(j<<1)+0x1C; 200 204 longname[longOff+j+11]=buf[k]; 201 205 } … … 204 208 } 205 209 206 if ((buf[i <<5]&0xFF)!=0xE5) {210 if ((buf[idx]&0xFF)!=0xE5) { 207 211 for (j=0;j<8;j++) { 208 212 buf2[(nfic<<5)+j]=buf[(i<<5)+j]; … … 211 215 buf2[(nfic<<5)+j+8]=buf[(i<<5)+j+8]; 212 216 } 213 for (j=0;j<1 7;j++) {217 for (j=0;j<14;j++) { 214 218 buf2[(nfic<<5)+11+j]=longname[j]; 215 219 } … … 222 226 buf2[(nfic<<5)+29]=buf[(i<<5)+0x14]; 223 227 buf2[(nfic<<5)+28]=buf[(i<<5)+0x15]; 228 229 230 /* also copy 3 bytes of size */ 231 buf2[(nfic<<5)+27]=buf[(i<<5)+0x1C]; 232 buf2[(nfic<<5)+26]=buf[(i<<5)+0x1D]; 233 buf2[(nfic<<5)+25]=buf[(i<<5)+0x1E]; 234 224 235 nfic++; 225 236 if (nfic>126) { … … 356 367 string(0,6,"CFG SECTOR1",11); 357 368 rd_lba(f_tmph,f_tmpl); 358 string(0,7,&buf[0],11);string(12,7,&buf[21],1 6);369 string(0,7,&buf[0],11);string(12,7,&buf[21],14); 359 370 360 371 for (ii=0;ii<11;ii++) { … … 373 384 buf[19]=0x1E; 374 385 buf[20]=0x00; 375 for (ii=0;ii<1 6;ii++) {386 for (ii=0;ii<14;ii++) { 376 387 buf[21+ii]=buf2[(j<<5)+ii+11]; 377 388 } … … 385 396 dump16b(0,24,ret); 386 397 string(0,8,"WRT SECTOR1",11); 387 string(0,9,&buf[0],11);string(12,9,&buf[21],1 6);398 string(0,9,&buf[0],11);string(12,9,&buf[21],14); 388 399 389 400 /* just write back sector (LBA is still correct) */ … … 391 402 dump16b(0,24,ret); 392 403 string(0,10,"READ BACK SECTOR1",17); 393 string(0,11,&buf[0],11);string(12,11,&buf[21],1 6);404 string(0,11,&buf[0],11);string(12,11,&buf[21],14); 394 405 395 406 … … 408 419 409 420 /* fixed size for HFE thomson */ 410 buf[17+0x80]= 0x00;411 buf[18+0x80]= 0xA4;412 buf[19+0x80]= 0x1E;421 buf[17+0x80]=buf2[(j<<5)+27]; 422 buf[18+0x80]=buf2[(j<<5)+26]; 423 buf[19+0x80]=buf2[(j<<5)+25]; 413 424 buf[20+0x80]=0x00; 414 for (ii=0;ii<1 6;ii++) {425 for (ii=0;ii<14;ii++) { 415 426 buf[21+ii+0x80]=buf2[(j<<5)+ii+11]; 416 427 } … … 479 490 { 480 491 int i,j; 492 int idx; 481 493 int start; 482 494 int line; … … 489 501 line=0; 490 502 for (i=start;i<(start+16);i++) { 503 idx=i<<5; 491 504 if (i>=nfic) { 492 505 string(1,line+4," ",39); … … 495 508 } 496 509 497 string(1,line+4,&buf2[i <<5],8);510 string(1,line+4,&buf2[idx],8); 498 511 charxy(9,line+4,'.'); 499 string(10,line+4,&buf2[(i <<5)+8],3);500 501 string(14,line+4,&buf2[(i <<5)+11],17);512 string(10,line+4,&buf2[(idx)+8],3); 513 514 string(14,line+4,&buf2[(idx)+11],14); 502 515 503 dump16b(32,line+4,mk_16( buf2[(i<<5)+28],buf2[(i<<5)+29]));504 dump16b(36,line+4,mk_16(buf2[(i <<5)+30],buf2[(i<<5)+31]));516 dump16b(32,line+4,mk_16(0,buf2[(idx)+25])); 517 dump16b(36,line+4,mk_16(buf2[(idx)+26],buf2[(idx)+27])); 505 518 line++; 506 519 }
Note: See TracChangeset
for help on using the changeset viewer.