Skip to content

Commit 2d60b9d

Browse files
authored
add functional XFROM support
1 parent bb13043 commit 2d60b9d

File tree

9 files changed

+25
-68
lines changed

9 files changed

+25
-68
lines changed

.github/workflows/compile.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
bdmstuff: ["EXFAT=0", "EXFAT=1", "EXFAT=1 MX4SIO=1"]
1919
ds34: ["DS34=0", "DS34=1"]
2020
mmce: ["MMCE=0", "MMCE=1"]
21+
xfrom: ["XFROM=0", "XFROM=1"]
2122
exclude:
2223
- bdmstuff: "EXFAT=1 MX4SIO=1"
2324
mmce: "MMCE=1"

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ endif
6464
ifeq ($(XFROM),1)
6565
HAS_XFROM = -XFROM
6666
EE_CFLAGS += -DXFROM
67+
EE_OBJS += xfromman_irx.o extflash_irx.o
6768
endif
6869

6970
ifeq ($(DS34),1)

embed.make

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ $(EE_ASM_DIR)mx4sio_bd.s: iop/__precompiled/mx4sio_bd.irx | $(EE_ASM_DIR)
2727

2828
$(EE_ASM_DIR)mmceman_irx.s: iop/__precompiled/mmceman.irx | $(EE_ASM_DIR)
2929
$(BIN2S) $< $@ mmceman_irx
30+
31+
$(EE_ASM_DIR)extflash_irx.s: iop/__precompiled/extflash.irx | $(EE_ASM_DIR)
32+
$(BIN2S) $< $@ extflash_irx
33+
34+
$(EE_ASM_DIR)xfromman_irx.s: iop/__precompiled/xfromman.irx | $(EE_ASM_DIR)
35+
$(BIN2S) $< $@ xfromman_irx
36+
3037
#---{ USB }---#
3138

3239
$(EE_ASM_DIR)usbd_irx.s: $(PS2SDK)/iop/irx/usbd.irx | $(EE_ASM_DIR)
3340
$(BIN2S) $< $@ usbd_irx
34-
3541
ifeq ($(EXFAT),1)
3642
$(EE_ASM_DIR)bdm_irx.s:iop/__precompiled/bdm.irx | $(EE_ASM_DIR)
3743
$(BIN2S) $< $@ bdm_irx
@@ -61,10 +67,10 @@ $(EE_ASM_DIR)ioptrap_irx.s: $(PS2SDK)/iop/irx/ioptrap.irx | $(EE_ASM_DIR)
6167
$(EE_ASM_DIR)poweroff_irx.s: $(PS2SDK)/iop/irx/poweroff.irx | $(EE_ASM_DIR)
6268
$(BIN2S) $< $@ poweroff_irx
6369

64-
$(EE_ASM_DIR)iomanx_irx.s: $(PS2SDK)/iop/irx/iomanX.irx | $(EE_ASM_DIR)
70+
$(EE_ASM_DIR)iomanx_irx.s: iop/__precompiled/iomanX.irx | $(EE_ASM_DIR)
6571
$(BIN2S) $< $@ iomanx_irx
6672

67-
$(EE_ASM_DIR)filexio_irx.s: $(PS2SDK)/iop/irx/fileXio.irx | $(EE_ASM_DIR)
73+
$(EE_ASM_DIR)filexio_irx.s: iop/__precompiled/fileXio.irx | $(EE_ASM_DIR)
6874
$(BIN2S) $< $@ filexio_irx
6975

7076
$(EE_ASM_DIR)ps2dev9_irx.s: $(PS2SDK)/iop/irx/ps2dev9.irx | $(EE_ASM_DIR)

iop/__precompiled/extflash.irx

4.02 KB
Binary file not shown.

iop/__precompiled/fileXio.irx

6.25 KB
Binary file not shown.

iop/__precompiled/iomanX.irx

11.6 KB
Binary file not shown.

iop/__precompiled/xfromman.irx

65.3 KB
Binary file not shown.

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;

src/main.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,15 @@ static void load_ps2atad(void)
904904
//endfunc load_ps2atad
905905
//---------------------------------------------------------------------------
906906
#ifdef XFROM
907+
IMPORT_BIN2C(extflash_irx);
908+
IMPORT_BIN2C(xfromman_irx);
907909
static void load_pflash(void)
908910
{
909-
int ID;
910-
ID = SifLoadModule("rom0:PFLASH", 0, NULL);
911-
DPRINTF(" [rom0:PFLASH]: ID=%d\n", ID);
912-
ID = SifLoadModule("rom0:PXFROMMAN", 0, NULL);
913-
DPRINTF(" [rom0:PXFROMMAN]: ID=%d\n", ID);
911+
int ID, ret;
912+
ID = SifExecModuleBuffer(extflash_irx, size_extflash_irx, NULL, 0, &ret);
913+
DPRINTF(" [PFLASH]: ID=%d, ret=%d\n", ID, ret);
914+
ID = SifExecModuleBuffer(xfromman_irx, size_xfromman_irx, NULL, 0, &ret);
915+
DPRINTF(" [XFROMMAN]: ID=%d, ret=%d\n", ID, ret);
914916
}
915917
//------------------------------
916918
//endfunc load_pflash

0 commit comments

Comments
 (0)