Skip to content

Commit 4f36cc1

Browse files
authored
Add MMCE Support
initial MMCE implementation
1 parent 1c11d80 commit 4f36cc1

File tree

7 files changed

+64
-4
lines changed

7 files changed

+64
-4
lines changed

.github/workflows/CI.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ jobs:
6464
run: |
6565
make release COMMIT_HASH=${GITHUB_SHA::7} BINDIR=PS2_HDD/ HDD=1 ${{ env.DEBUG }} PRINTF=${{ github.event.inputs.name }}
6666
67+
- name: Compile PS2 MMCE build
68+
run: |
69+
make release COMMIT_HASH=${GITHUB_SHA::7} BINDIR=PS2_MMCE/ MMCE=1 ${{ env.DEBUG }} PRINTF=${{ github.event.inputs.name }}
70+
71+
- name: Compile PSX MMCE build
72+
run: |
73+
make release COMMIT_HASH=${GITHUB_SHA::7} BINDIR=PSX_MMCE/ PSX=1 MMCE=1 ${{ env.DEBUG }} PRINTF=${{ github.event.inputs.name }}
74+
6775
- name: list
6876
run: |
6977
git ls-files -i --exclude-standard -c
@@ -76,6 +84,8 @@ jobs:
7684
mv PSX/ release/PSX/
7785
mv PS2_HDD/ release/PS2_HDD/
7886
mv PS2_MX4SIO/ release/PS2_MX4SIO/
87+
mv PS2_MMCE/ release/PS2_MMCE/
88+
mv PSX_MMCE/ release/PSX_MMCE/
7989
8090
- name: pack release
8191
run: |

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ HAS_EMBED_IRX = 1 # whether to embed or not non vital IRX (wich will be loaded f
1515
DEBUG ?= 0
1616
PSX ?= 0 # PSX DESR support
1717
HDD ?= 0 #wether to add internal HDD support
18+
MMCE ?= 0
1819
MX4SIO ?= 0
1920
PROHBIT_DVD_0100 ?= 0 # prohibit the DVD Players v1.00 and v1.01 from being booted.
2021
XCDVD_READKEY ?= 0 # Enable the newer sceCdReadKey checks, which are only supported by a newer CDVDMAN module.
@@ -86,6 +87,19 @@ ifeq ($(MX4SIO), 1)
8687
endif
8788
endif
8889

90+
ifeq ($(MMCE), 1)
91+
HOMEBREW_IRX = 1
92+
FILEXIO_NEED = 1
93+
EE_OBJS += mmceman_irx.o
94+
EE_CFLAGS += -DMMCE
95+
ifeq ($(USE_ROM_SIO2MAN), 1)
96+
$(error MMCE needs Homebrew SIO2MAN to work)
97+
endif
98+
ifeq ($(MX4SIO), 1)
99+
$(error MX4SIO cant coexist with MMCE)
100+
endif
101+
endif
102+
89103
ifeq ($(HOMEBREW_IRX), 1)
90104
$(info --- enforcing usage of homebrew IRX modules)
91105
USE_ROM_PADMAN = 0
@@ -268,9 +282,9 @@ endif
268282
$(EE_BIN_ENCRYPTED): $(EE_BIN_PACKED)
269283
@echo " -- Encrypting ($(KELFTYPE))"
270284
ifeq ($(KELFTYPE), MC)
271-
thirdparty/kelftool_dnasload.exe encrypt dnasload $< $@
285+
thirdparty/kelftool encrypt dnasload $< $@
272286
else ifeq ($(KELFTYPE), HDD)
273-
thirdparty/kelftool_dnasload.exe encrypt fhdb $< $@
287+
thirdparty/kelftool encrypt fhdb $< $@
274288
else
275289
$(error UNKNOWN KELF TYPE: '$(KELFTYPE)')
276290
endif

embed.make

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $(EE_ASM_DIR)ioprp.c: embed/ioprp.img | $(EE_ASM_DIR)
99

1010
$(EE_ASM_DIR)padman_irx.c: freepad.irx | $(EE_ASM_DIR)
1111
$(BIN2S) $< $@ padman_irx
12-
12+
1313
$(EE_ASM_DIR)iomanx_irx.c: iomanX.irx | $(EE_ASM_DIR)
1414
$(BIN2S) $< $@ iomanX_irx
1515

@@ -26,6 +26,9 @@ $(EE_ASM_DIR)%_irx.c: %.irx
2626
$(DIR_GUARD)
2727
$(BIN2S) $< $@ $(IRXTAG)
2828

29+
embed/iop/mmceman.irx:
30+
$(info - - Downloading MMCEMAN Driver)
31+
wget -q https://github.com/israpps/wLaunchELF_ISR/raw/refs/heads/master/iop/__precompiled/mmceman.irx -O $@
2932

3033
# ---{ EMBEDDED RESOURCES }--- #
3134
$(EE_ASM_DIR)icon_sys_A.c: embed/icons/icon_A.sys | $(EE_ASM_DIR)

embed/iop/.gitkeep

Whitespace-only changes.

include/common.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ enum
1414
#ifdef XFROM
1515
SOURCE_XFROM,
1616
#endif
17+
#ifdef MMCE
18+
SOURCE_MMCE1,
19+
SOURCE_MMCE0,
20+
#endif
1721
#ifdef PSX
1822
SOURCE_XCONFIG,
1923
#endif
@@ -35,6 +39,10 @@ char *CONFIG_PATHS[SOURCE_COUNT] = {
3539
#ifdef XFROM
3640
"xfrom:/PS2BBL/CONFIG.INI",
3741
#endif
42+
#ifdef MMCE
43+
"mmce0:/PS2BBL/PS2BBL.INI",
44+
"mmce1:/PS2BBL/PS2BBL.INI",
45+
#endif
3846
#ifdef PSX
3947
"mc?:/SYS-CONF/PSXBBL.INI",
4048
#endif
@@ -55,6 +63,10 @@ static const char *SOURCES[SOURCE_COUNT] = {
5563
#ifdef XFROM
5664
"xfrom",
5765
#endif
66+
#ifdef MMCE
67+
"mmce0",
68+
"mmce1",
69+
#endif
5870
#ifdef PSX
5971
"XCONF",
6072
#endif

include/irx_import.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ IMPORT_BIN2C(padman_irx);
1515
IMPORT_BIN2C(psx_ioprp);
1616
#endif
1717

18+
#ifdef MMCE
19+
IMPORT_BIN2C(mmceman_irx);
20+
#endif
21+
1822
#ifdef FILEXIO
1923
IMPORT_BIN2C(iomanX_irx);
2024
IMPORT_BIN2C(fileXio_irx);

src/main.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ int main(int argc, char *argv[])
8080
j = SifExecModuleBuffer(padman_irx, size_padman_irx, 0, NULL, &x);
8181
DPRINTF(" [PADMAN]: ID=%d, ret=%d\n", j, x);
8282
#endif
83+
8384
j = LoadUSBIRX();
8485
if (j != 0) {
8586
scr_setfontcolor(0x0000ff);
@@ -98,6 +99,11 @@ int main(int argc, char *argv[])
9899
}
99100
#endif
100101

102+
#ifdef MMCE
103+
j = SifExecModuleBuffer(mmceman_irx, size_mmceman_irx, 0, NULL, &x);
104+
DPRINTF(" [MMCEMAN]: ID=%d, ret=%d\n", j, x);
105+
#endif
106+
101107
#ifdef MX4SIO
102108
j = SifExecModuleBuffer(mx4sio_bd_irx, size_mx4sio_bd_irx, 0, NULL, &x);
103109
DPRINTF(" [MX4SIO_BD]: ID=%d, ret=%d\n", j, x);
@@ -371,7 +377,7 @@ int main(int argc, char *argv[])
371377
CleanUp();
372378
RunLoaderElf(EXECPATHS[j], MPART);
373379
} else {
374-
DPRINTF("%s not found\n", EXECPATHS[j]);
380+
scr_printf("%s %-15s\r", EXECPATHS[j], "not found");
375381
}
376382
}
377383

@@ -445,6 +451,17 @@ char *CheckPath(char *path)
445451
if (exist(path))
446452
return path;
447453
}
454+
#ifdef MMCE
455+
} else if (!strncmp("mmce?", path, 5)) {
456+
path[4] = (config_source == SOURCE_MMCE1) ? '1' : '0';
457+
if (exist(path)) {
458+
return path;
459+
} else {
460+
path[4] = (config_source == SOURCE_MMCE1) ? '0' : '1';
461+
if (exist(path))
462+
return path;
463+
}
464+
#endif
448465
#ifdef HDD
449466
} else if (!strncmp("hdd", path, 3)) {
450467
if (MountParty(path) < 0) {

0 commit comments

Comments
 (0)