Skip to content

Commit

Permalink
add support for MMCE: (#86)
Browse files Browse the repository at this point in the history
* convert readMASS into a generic device reader

* initial mmce support

* warn of illegal entries on `readGENERIC()`

* Update Makefile
  • Loading branch information
israpps authored Jan 11, 2025
1 parent 4455812 commit 6778a79
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 17 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
eth: ["ETH=0", "ETH=1"]
bdmstuff: ["EXFAT=0", "EXFAT=1", "EXFAT=1 MX4SIO=1"]
ds34: ["DS34=0", "DS34=1"]
mmce: ["MMCE=0", "MMCE=1"]
exclude:
- bdmstuff: "EXFAT=1 MX4SIO=1"
mmce: "MMCE=1"
runs-on: ubuntu-latest
container: ps2dev/ps2dev:v1.0
steps:
Expand All @@ -32,12 +36,12 @@ jobs:
- name: Compile wLaunchELF
run: |
make rebuild ${{ matrix.eth }} ${{ matrix.sior }} ${{ matrix.bdmstuff }} ${{ matrix.ds34 }} ${{ matrix.xfrom }} ${{ github.event.inputs.make_args }}
make rebuild ${{ matrix.eth }} ${{ matrix.mmce }} ${{ matrix.bdmstuff }} ${{ matrix.ds34 }} ${{ matrix.xfrom }} ${{ github.event.inputs.make_args }}
- name: Upload variants artifact ELF
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: WLE
name: "WLE-${{ matrix.eth }}-${{ matrix.mmce }}-${{ matrix.bdmstuff }}-${{ matrix.ds34 }}-${{ matrix.xfrom }}"
path: |
BOOT*.ELF
Expand All @@ -48,13 +52,17 @@ jobs:
needs: [build]
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git fetch --prune --unshallow
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: WLE/
pattern: "WLE-*"
merge-multiple: true

- name: list
run: |
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#.SILENT:

# ---{ BUILD CONFIGURATION }--- #
SIO_DEBUG ?= 0
MMCE ?= 0
DS34 ?= 0
SMB ?= 0
TMANIP ?= 1
Expand All @@ -14,12 +14,13 @@ UDPTTY ?= 0
MX4SIO ?= 0
SIO2MAN ?= 0
PPC_UART ?= 0
SIO_DEBUG ?= 0
DEBUG ?= 0
LCDVD ?= LEGACY#or LATEST
# ----------------------------- #
.SILENT:

BIN_NAME = $(HAS_EXFAT)$(HAS_DS34)$(HAS_ETH)$(HAS_SMB)$(HAS_DVRP)$(HAS_XFROM)$(HAS_MX4SIO)$(HAS_EESIO)$(HAS_UDPTTY)$(HAS_PPCTTY)$(HAS_IOP_RESET)
BIN_NAME = $(HAS_EXFAT)$(HAS_DS34)$(HAS_ETH)$(HAS_MX4SIO)$(HAS_MMCE)$(HAS_SMB)$(HAS_DVRP)$(HAS_XFROM)$(HAS_EESIO)$(HAS_UDPTTY)$(HAS_PPCTTY)$(HAS_IOP_RESET)
ifeq ($(DEBUG), 0)
EE_BIN = UNC-BOOT$(BIN_NAME).ELF
EE_BIN_PKD = BOOT$(BIN_NAME).ELF
Expand Down Expand Up @@ -79,6 +80,13 @@ ifeq ($(DVRP),1)
HAS_DVRP = -DVRP
endif

ifeq ($(MMCE),1)
EE_OBJS += mmceman_irx.o
EE_CFLAGS += -DMMCE
HAS_MMCE = -MMCE
SIO2MAN = 1
endif

ifeq ($(MX4SIO),1)
ifneq ($(EXFAT),1)
$(error MX4SIO Requested on build without BDM)
Expand Down
6 changes: 4 additions & 2 deletions embed.make
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ $(EE_ASM_DIR)mcserv_irx.s: $(MCSERV_SOURCE) | $(EE_ASM_DIR)

$(EE_ASM_DIR)sio2man.s: $(SIO2MAN_SOURCE) | $(EE_ASM_DIR)
$(BIN2S) $< $@ sio2man_irx


$(EE_ASM_DIR)mx4sio_bd.s: iop/__precompiled/mx4sio_bd.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ mx4sio_bd_irx

$(EE_ASM_DIR)mmceman_irx.s: iop/__precompiled/mmceman.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ mmceman_irx
#---{ USB }---#

$(EE_ASM_DIR)usbd_irx.s: $(PS2SDK)/iop/irx/usbd.irx | $(EE_ASM_DIR)
Expand Down Expand Up @@ -169,7 +171,7 @@ $(EE_ASM_DIR)ps2kbd_irx.s: $(PS2SDK)/iop/irx/ps2kbd.irx | $(EE_ASM_DIR)
$(EE_ASM_DIR)sior_irx.s: $(PS2SDK)/iop/irx/sior.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ sior_irx

$(EE_ASM_DIR)ppctty_irx.s:iop/__precompiled/ppctty.irx | $(EE_ASM_DIR)
$(EE_ASM_DIR)ppctty.s:iop/__precompiled/ppctty.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ ppctty_irx

iop/AllowDVDV.irx: iop/AllowDVDV
Expand Down
Binary file added iop/__precompiled/mmceman.irx
Binary file not shown.
28 changes: 20 additions & 8 deletions src/filer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,14 +1332,11 @@ void scan_USB_mass(void)
//------------------------------
//endfunc scan_USB_mass
//--------------------------------------------------------------
int readMASS(const char *path, FILEINFO *info, int max)
int readGENERIC(const char *path, FILEINFO *info, int max)
{
iox_dirent_t record;
int n = 0, dd = -1;

if (!USB_mass_scanned)
scan_USB_mass();

if ((dd = fileXioDopen(path)) < 0)
goto exit; //exit if error opening directory
while (fileXioDread(dd, &record) > 0) {
Expand All @@ -1354,8 +1351,10 @@ int readMASS(const char *path, FILEINFO *info, int max)
info[n].stats.AttrFile = MC_ATTR_norm_file;
info[n].stats.FileSizeByte = record.stat.size;
info[n].stats.Reserve2 = record.stat.hisize;
} else
} else {
DPRINTF("%s:UNKNOWN_FILEMODE:('%s', 0x%x, siz:%d, attr:%d)\n", record.name, record.stat.mode, record.stat.size, record.stat.attr);
continue; //Skip entry which is neither a file nor a folder
}
strncpy((char *)info[n].stats.EntryName, info[n].name, 32);
memcpy((void *)&info[n].stats._Create, record.stat.ctime, 8);
memcpy((void *)&info[n].stats._Modify, record.stat.mtime, 8);
Expand All @@ -1372,7 +1371,7 @@ int readMASS(const char *path, FILEINFO *info, int max)
return n;
}
//------------------------------
//endfunc readMASS
//endfunc readGENERIC
//--------------------------------------------------------------
#ifdef ETH
char *makeHostPath(char *dp, char *sp)
Expand Down Expand Up @@ -1533,14 +1532,21 @@ int getDir(const char *path, FILEINFO *info)
else if (!strncmp(path, "dvr_hdd", 7))
n = readHDDDVRP(path, info, max);
#endif
else if (!strncmp(path, "mass", 4))
n = readMASS(path, info, max);
else if (!strncmp(path, "mass", 4)) {
if (!USB_mass_scanned)
scan_USB_mass();
n = readGENERIC(path, info, max);
}
else if (!strncmp(path, "cdfs", 4))
n = readCD(path, info, max);
#ifdef ETH
else if (!strncmp(path, "host", 4))
n = readHOST(path, info, max);
#endif
#ifdef MMCE
else if (!strncmp(path, "mmce", 4))
n = readGENERIC(path, info, max);
#endif
#ifdef XFROM
else if (!strncmp(path, "xfrom", 5))
n = readXFROM(path, info, max);
Expand Down Expand Up @@ -3498,6 +3504,12 @@ int setFileList(const char *path, const char *ext, FILEINFO *files, int cnfmode)
files[nfiles++].stats.AttrFile = sceMcFileAttrSubdir;
#ifdef MX4SIO
}
#endif
#ifdef MMCE
strcpy(files[nfiles].name, "mmce0:");
files[nfiles++].stats.AttrFile = sceMcFileAttrSubdir;
strcpy(files[nfiles].name, "mmce1:");
files[nfiles++].stats.AttrFile = sceMcFileAttrSubdir;
#endif
strcpy(files[nfiles].name, "hdd0:");
files[nfiles++].stats.AttrFile = sceMcFileAttrSubdir;
Expand Down
14 changes: 14 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ IMPORT_BIN2C(dvrdrv_irx);
IMPORT_BIN2C(dvrfile_irx);
#endif

#ifdef MMCE
IMPORT_BIN2C(mmceman_irx);
#endif

// Mandatory IRX
IMPORT_BIN2C(iomanx_irx);
IMPORT_BIN2C(filexio_irx);
Expand Down Expand Up @@ -441,6 +445,11 @@ static void Show_build_info(void)
#else
" MX4SIO=0"
#endif
#ifdef MMCE
" MMCE=1"
#else
" MMCE=0"
#endif
, COLOR_TEXT);
#if defined(UDPTTY) || defined(SIO_DEBUG) || defined(POWERPC_UART) || defined(NO_IOP_RESET)

Expand Down Expand Up @@ -1173,6 +1182,11 @@ static void loadBasicModules(void)
id = SifLoadModule("rom0:PADMAN", 0, NULL);
DPRINTF(" [rom0:PADMAN]: id=%d\n", id);
#endif

#ifdef MMCE
id = SifExecModuleBuffer(mmceman_irx, size_mmceman_irx, 0, NULL, &ret); //Home
DPRINTF(" [MMCE]: id=%d ret=%d\n", id, ret);
#endif
}
//------------------------------
//endfunc loadBasicModules
Expand Down

0 comments on commit 6778a79

Please sign in to comment.