diff --git a/cube/swiss/source/gcm.c b/cube/swiss/source/gcm.c index 14a8c042..2de94677 100644 --- a/cube/swiss/source/gcm.c +++ b/cube/swiss/source/gcm.c @@ -262,7 +262,7 @@ int parse_gcm(file_handle *file, ExecutableFile *filesToPatch) { memcpy(&filesToPatch[numFiles].name,&filename[0],64); numFiles++; } - if(strstr(filename,"switcher.prs")) { + if(!strcasecmp(filename,"switcher.prs")) { filesToPatch[numFiles].offset = file_offset; filesToPatch[numFiles].size = size; filesToPatch[numFiles].type = PATCH_DOL_PRS; @@ -270,7 +270,7 @@ int parse_gcm(file_handle *file, ExecutableFile *filesToPatch) { numFiles++; } if(endsWith(filename,".elf")) { - if(!strstr(filename,"STUBRDVD.ELF")) { + if(strcasecmp(filename,"STUBRDVD.ELF")) { if(dolSize == calc_elf_segments_size(file, file_offset, &size) + DOLHDRLENGTH) { continue; } @@ -281,7 +281,7 @@ int parse_gcm(file_handle *file, ExecutableFile *filesToPatch) { memcpy(&filesToPatch[numFiles].name,&filename[0],64); numFiles++; } - if(strstr(filename,"execD.img")) { + if(!strcasecmp(filename,"execD.img")) { filesToPatch[numFiles].offset = file_offset; filesToPatch[numFiles].size = size; filesToPatch[numFiles].type = PATCH_BS2; @@ -417,7 +417,7 @@ int parse_tgc(file_handle *file, ExecutableFile *filesToPatch, u32 tgc_base, cha memcpy(&filesToPatch[numFiles].name,&filename[0],64); numFiles++; } - if(strstr(filename,"execD.img")) { + if(!strcasecmp(filename,"execD.img")) { filesToPatch[numFiles].offset = file_offset; filesToPatch[numFiles].size = size; filesToPatch[numFiles].type = PATCH_BS2; @@ -486,7 +486,7 @@ int patch_gcm(file_handle *file, ExecutableFile *filesToPatch, int numToPatch) { } print_gecko("Checking %s %iKb\r\n", filesToPatch[i].name, filesToPatch[i].size/1024); - if(strstr(filesToPatch[i].name, "iwanagaD.dol") || strstr(filesToPatch[i].name, "switcherD.dol")) { + if(!strcasecmp(filesToPatch[i].name, "iwanagaD.dol") || !strcasecmp(filesToPatch[i].name, "switcherD.dol")) { continue; // skip unused PSO files } uiDrawObj_t* progBox = DrawPublish(DrawProgressBar(true, 0, txtbuffer)); diff --git a/cube/swiss/source/patcher.c b/cube/swiss/source/patcher.c index 79b406f3..c1a76c3b 100644 --- a/cube/swiss/source/patcher.c +++ b/cube/swiss/source/patcher.c @@ -10262,6 +10262,23 @@ int Patch_GameSpecific(void *data, u32 length, const char *gameID, int dataType) *(u32 *)(data + 0x8000563C - 0x800055E0 + 0x25E0) = 0x60000000; *(u32 *)(data + 0x80005640 - 0x800055E0 + 0x25E0) = 0x38000000; + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + } + } else if (!strncmp(gameID, "GGIJ13", 6) && (dataType == PATCH_DOL || dataType == PATCH_ELF)) { + switch (length) { + case 205696: + // Fix framebuffer initialization. + *(u32 *)(data + 0x8001501C - 0x800134A0 + 0x4A0) = 0x807E0000; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + case 266324: + // Fix framebuffer initialization. + *(u32 *)(data + 0x807023F0 - 0x807003A0 + 0x500) = 0x807E0000; + print_gecko("Patched:[%.6s]\n", gameID); patched++; break; @@ -10276,6 +10293,57 @@ int Patch_GameSpecific(void *data, u32 length, const char *gameID, int dataType) *(u32 *)(data + 0x80014598 - 0x800034A0 + 0x4A0) = 0x3D208000; *(u32 *)(data + 0x8001459C - 0x800034A0 + 0x4A0) = 0x812900EC; + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + } + } else if ((!strncmp(gameID, "GOND69", 6) || !strncmp(gameID, "GONE69", 6) || !strncmp(gameID, "GONF69", 6) || !strncmp(gameID, "GONP69", 6)) && (dataType == PATCH_DOL || dataType == PATCH_ELF)) { + switch (length) { + case 277472: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80014C54 - 0x800134A0 + 0x4A0) = 0x807E0000; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + case 339500: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80701C38 - 0x807003A0 + 0x500) = 0x807E0000; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + } + } else if (!strncmp(gameID, "GONJ13", 6) && (dataType == PATCH_DOL || dataType == PATCH_ELF)) { + switch (length) { + case 276416: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80014C54 - 0x800134A0 + 0x4A0) = 0x807E0000; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + case 338376: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80701C38 - 0x807003A0 + 0x500) = 0x807E0000; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + } + } else if ((!strncmp(gameID, "GOYD69", 6) || !strncmp(gameID, "GOYE69", 6) || !strncmp(gameID, "GOYF69", 6) || !strncmp(gameID, "GOYP69", 6) || !strncmp(gameID, "GOYS69", 6)) && (dataType == PATCH_DOL || dataType == PATCH_ELF)) { + switch (length) { + case 207232: + // Fix framebuffer initialization. + *(u32 *)(data + 0x8001501C - 0x800134A0 + 0x4A0) = 0x807E0000; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + case 268372: + // Fix framebuffer initialization. + *(u32 *)(data + 0x807023F0 - 0x807003A0 + 0x500) = 0x807E0000; + print_gecko("Patched:[%.6s]\n", gameID); patched++; break; @@ -10525,6 +10593,40 @@ int Patch_GameSpecific(void *data, u32 length, const char *gameID, int dataType) *(s16 *)(data + 0x80129362 - 0x800056C0 + 0x2600) = 0x181F; + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + } + } else if ((!strncmp(gameID, "GR8D69", 6) || !strncmp(gameID, "GR8E69", 6) || !strncmp(gameID, "GR8F69", 6) || !strncmp(gameID, "GR8P69", 6)) && (dataType == PATCH_DOL || dataType == PATCH_ELF)) { + switch (length) { + case 206016: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80500EB4 - 0x805003A0 + 0x4A0) = 0x387D2720; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + case 260164: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80500EB4 - 0x805003A0 + 0x500) = 0x387D2720; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + } + } else if (!strncmp(gameID, "GRZJ13", 6) && (dataType == PATCH_DOL || dataType == PATCH_ELF)) { + switch (length) { + case 206240: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80500EB4 - 0x805003A0 + 0x4A0) = 0x387D2800; + + print_gecko("Patched:[%.6s]\n", gameID); + patched++; + break; + case 260852: + // Fix framebuffer initialization. + *(u32 *)(data + 0x80500EB4 - 0x805003A0 + 0x500) = 0x387D2800; + print_gecko("Patched:[%.6s]\n", gameID); patched++; break;