Skip to content

Commit cae5d91

Browse files
committed
use generic parser for XFROM instead of dedicated
nothing special on XFROM, use generic parser like we did with USB and MMCE
1 parent 5a1fdd6 commit cae5d91

File tree

1 file changed

+7
-60
lines changed

1 file changed

+7
-60
lines changed

src/filer.c

Lines changed: 7 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,60 +1236,7 @@ int readHDDDVRP(const char *path, FILEINFO *info, int max)
12361236
//endfunc readHDDDVRP
12371237
//--------------------------------------------------------------
12381238
#endif
1239-
#ifdef XFROM
1240-
int readXFROM(const char *path, FILEINFO *info, int max)
1241-
{
1242-
iox_dirent_t dirbuf;
1243-
char dir[MAX_PATH];
1244-
int i = 0, fd;
1245-
//volatile int j;
1246-
1247-
loadFlashModules();
1248-
1249-
strcpy(dir, path);
1250-
if ((fd = fileXioDopen(path)) < 0)
1251-
{
1252-
DPRINTF("ERROR: Cannot open path '%s'\n", path);
1253-
return 0;
1254-
}
12551239

1256-
while (fileXioDread(fd, &dirbuf) > 0) {
1257-
if (dirbuf.stat.mode & FIO_S_IFDIR &&
1258-
(!strcmp(dirbuf.name, ".") || !strcmp(dirbuf.name, "..")))
1259-
continue; //Skip pseudopaths "." and ".."
1260-
1261-
strcpy(info[i].name, dirbuf.name);
1262-
clear_mcTable(&info[i].stats);
1263-
if (dirbuf.stat.mode & FIO_S_IFDIR) {
1264-
info[i].stats.AttrFile = MC_ATTR_norm_folder;
1265-
} else if (dirbuf.stat.mode & FIO_S_IFREG) {
1266-
info[i].stats.AttrFile = MC_ATTR_norm_file;
1267-
info[i].stats.FileSizeByte = dirbuf.stat.size;
1268-
info[i].stats.Reserve2 = dirbuf.stat.hisize;
1269-
} else
1270-
{
1271-
DPRINTF("ERROR: Skipping entry wich is neither file or folder '%s'\n", path);
1272-
continue; //Skip entry which is neither a file nor a folder
1273-
}
1274-
strncpy((char *)info[i].stats.EntryName, info[i].name, 32);
1275-
memcpy((void *)&info[i].stats._Create, dirbuf.stat.ctime, 8);
1276-
memcpy((void *)&info[i].stats._Modify, dirbuf.stat.mtime, 8);
1277-
i++;
1278-
if (i == max)
1279-
break;
1280-
}
1281-
1282-
fileXioDclose(fd);
1283-
1284-
size_valid = 1;
1285-
time_valid = 1;
1286-
1287-
return i;
1288-
}
1289-
#endif
1290-
//------------------------------
1291-
//endfunc readXFROM
1292-
//--------------------------------------------------------------
12931240
#ifndef USBMASS_IOCTL_GET_DRIVERNAME
12941241
#define USBMASS_IOCTL_GET_DRIVERNAME 0x0003
12951242
#endif
@@ -1551,8 +1498,11 @@ int getDir(const char *path, FILEINFO *info)
15511498
n = readGENERIC(path, info, max);
15521499
#endif
15531500
#ifdef XFROM
1554-
else if (!strncmp(path, "xfrom", 5))
1555-
n = readXFROM(path, info, max);
1501+
else if (!strncmp(path, "xfrom", 5)) {
1502+
1503+
loadFlashModules();
1504+
n = readGENERIC(path, info, max);
1505+
}
15561506
#endif
15571507
else if (!strncmp(path, "vmc", 3))
15581508
n = readVMC(path, info, max);
@@ -3539,11 +3489,8 @@ int setFileList(const char *path, const char *ext, FILEINFO *files, int cnfmode)
35393489
}
35403490
#endif
35413491
#ifdef XFROM
3542-
if (console_is_PSX)
3543-
{
3544-
strcpy(files[nfiles].name, "xfrom0:");
3545-
files[nfiles++].stats.AttrFile = sceMcFileAttrSubdir;
3546-
}
3492+
strcpy(files[nfiles].name, "xfrom0:");
3493+
files[nfiles++].stats.AttrFile = sceMcFileAttrSubdir;
35473494
#endif
35483495
strcpy(files[nfiles].name, "cdfs:");
35493496
files[nfiles++].stats.AttrFile = sceMcFileAttrSubdir;

0 commit comments

Comments
 (0)