4 void decode_fat(ushort *fat, bool backup)
\r
9 if(backup) img = (uchar *)ADR_DISKIMG + 0x00001400;
\r
10 else img = (uchar *)ADR_DISKIMG + 0x00000200;
\r
12 for(i = 0; i < 2880; i += 2){
\r
13 fat[i + 0] = (img[j + 0] | img[j + 1] << 8) & 0xfff;
\r
14 fat[i + 1] = (img[j + 1] >> 4 | img[j + 2] << 4) & 0xfff;
\r
20 void load_file(uint finfo_no, uchar *buf)
\r
27 if(finfo_no > 224) return;
\r
29 img = (uchar *)ADR_DISKIMG + 0x00003e00;
\r
30 size = system.io.file.list[finfo_no].size;
\r
31 clustno = system.io.file.list[finfo_no].clustno;
\r
36 for(i = 0; i < size; i++){
\r
37 buf[i] = img[clustno * 512 + i];
\r
41 for(i = 0; i < 512; i++){
\r
42 buf[i] = img[clustno * 512 + i];
\r
46 clustno = system.io.file.fat[clustno];
\r
51 uint search_file(char *name)
\r
56 for(j = 0; j < 11; j++){
\r
60 for(i = 0; j < 11 && name[i] != 0x00; i++){
\r
61 if(name[i] == '.' && j <= 8){
\r
65 if('a' <= s[j] && s[j] <= 'z'){
\r
71 for(i = 0; i < 224; ){
\r
72 if(system.io.file.list[i].name[0] == 0x00) break;
\r
73 if((system.io.file.list[i].type & 0x18) == 0){
\r
74 for(j = 0; j < 11; j++){
\r
75 if(system.io.file.list[i].name[j] != s[j]) goto next_file;
\r
82 if(i < 224 && system.io.file.list[i].name[0] != 0x00){
\r