From 94628cab18137047ae177b2ba8aeaea05757575d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Israelson?= <57065102+israpps@users.noreply.github.com> Date: Sat, 18 Jan 2025 22:30:38 -0300 Subject: [PATCH] try to fix MMCE ELF Loading untested --- src/elf.c | 9 ++++++++- src/main.c | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/elf.c b/src/elf.c index 59ee669b..b9fcfda8 100644 --- a/src/elf.c +++ b/src/elf.c @@ -60,7 +60,14 @@ int checkELFheader(char *path) char fullpath[MAX_PATH], tmp[MAX_PATH], *p; strcpy(fullpath, path); - if (!strncmp(fullpath, "mc", 2) || !strncmp(fullpath, "vmc", 3) || !strncmp(fullpath, "rom", 3) || !strncmp(fullpath, "cdrom", 5) || !strncmp(fullpath, "cdfs", 4)) { + if (!strncmp(fullpath, "mc", 2) + || !strncmp(fullpath, "vmc", 3) + || !strncmp(fullpath, "rom", 3) + || !strncmp(fullpath, "cdrom", 5) +#ifdef MMCE + || !strncmp(fullpath, "mmce", 4) +#endif + || !strncmp(fullpath, "cdfs", 4)) { ; //fullpath is already correct } else if (!strncmp(fullpath, "hdd0:", 5)) { p = &path[5]; diff --git a/src/main.c b/src/main.c index ddaa1fc6..22f17476 100644 --- a/src/main.c +++ b/src/main.c @@ -2094,11 +2094,17 @@ static void Execute(char *pathin) goto ELFnotFound; strcpy(fullpath, path); goto ELFchecked; +#endif +#ifdef MMCE + } else if (!strncmp(path, "mmce", 4)) { + if ((t = checkELFheader(path)) <= 0) + goto ELFnotFound; + strcpy(fullpath, path); + goto ELFchecked; #endif } else if (!strncmp(path, "mass", 4)) { if ((t = checkELFheader(path)) <= 0) goto ELFnotFound; - //coming here means the ELF is fine party[0] = 0; strcpy(fullpath, path);