Skip to content

Commit

Permalink
try to fix MMCE ELF Loading
Browse files Browse the repository at this point in the history
untested
  • Loading branch information
israpps committed Jan 19, 2025
1 parent 63bdd95 commit 94628ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
8 changes: 7 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 94628ca

Please sign in to comment.