void gamepatches(u8 videoSelected, u8 videoPatchDol, u8 aspectForce, u8 languageChoice, u8 patchcountrystring, u8 vipatch, u8 sneekVideoPatch, u8 hooktype, u64 returnTo, u8 privateServer) { int i; /* If a wip file is loaded for this game this does nothing - Dimok */ PoPPatch(); NSMBPatch(); for(i = 0; i < dolCount; ++i) { u8 *dst = dolList[i].dst; int len = dolList[i].len; VideoModePatcher(dst, len, videoSelected, videoPatchDol); dogamehooks(hooktype, dst, len); if (vipatch) vidolpatcher(dst, len); if(sneekVideoPatch) sneek_video_patch(dst, len); /*LANGUAGE PATCH - FISHEARS*/ langpatcher(dst, len, languageChoice); /*Thanks to WiiPower*/ if (patchcountrystring == 1) PatchCountryStrings(dst, len); do_wip_code(dst, len); Anti_002_fix(dst, len); if(returnTo) PatchReturnTo(dst, len, (u32) returnTo); if(aspectForce < 2) PatchAspectRatio(dst, len, aspectForce); if(privateServer) PrivateServerPatcher(dst, len, privateServer); DCFlushRange(dst, len); ICInvalidateRange(dst, len); } /* ERROR 002 fix (thanks to WiiPower for sharing this)*/ *(u32 *)0x80003140 = *(u32 *)0x80003188; DCFlushRange((void*) 0x80000000, 0x3f00); free_wip(); ClearDOLList(); }
/* call OCARINAPATCHER after apploader is run */ void ocarinapatcher(void *addr, u32 len) { void* dst = addr; memset((void*)0x80001800,0,kenobiwii_size); memcpy((void*)0x80001800,kenobiwii,kenobiwii_size); DCFlushRange((void*)0x80001800,kenobiwii_size); memcpy((void*)0x80001800, (char*)0x80000000, 6); dogamehooks(dst,len); vidolpatcher(dst,len); DCFlushRange(dst, len); }
void maindolpatches(void *dst, int len, u8 vidMode, GXRModeObj *vmode, bool vipatch, bool countryString, u8 patchVidModes, int aspectRatio) { patchVideoModes(dst, len, vidMode, vmode, patchVidModes); if(vipatch) vidolpatcher(dst, len); if(configbytes[0] != 0xCD) langpatcher(dst, len); if(countryString) PatchCountryStrings(dst, len); if(aspectRatio != -1) PatchAspectRatio(dst, len, aspectRatio); if(hooktype != 0) hookpatched = dogamehooks(dst, len, false); nossl(dst, len); }
void gamepatches(void * dst, int len, u8 videoSelected, u8 patchcountrystring, u8 vipatch, u8 cheat) { VideoModePatcher(dst, len, videoSelected); if(cheat) dogamehooks(dst,len); if (vipatch) vidolpatcher(dst,len); /*LANGUAGE PATCH - FISHEARS*/ langpatcher(dst,len); /*Thanks to WiiPower*/ if (patchcountrystring == 1) PatchCountryStrings(dst, len); NSMBPatch(dst, len); do_wip_code((u8 *) dst, len); if (fix002 == 2) Anti_002_fix(dst, len); }
void maindolpatches(void *dst, int len) { GXRModeObj** table = NULL; DCFlushRange(dst, len); if (CFG.video == CFG_VIDEO_PATCH) // patch auto { switch(CONF_GetVideo()) { case CONF_VIDEO_PAL: if(CONF_GetEuRGB60() > 0) { table = NTSC2PAL60; } else { table = NTSC2PAL; } break; case CONF_VIDEO_MPAL: table = NTSC2PAL; break; default: table = PAL2NTSC; break; } Search_and_patch_Video_Modes(dst, len, table); } // force PAL50 (Narolez) if (CFG.video == CFG_VIDEO_PAL50) { Search_and_patch_Video_Modes(dst, len, NTSC2PAL); } if (CFG.video == CFG_VIDEO_PAL60) { Search_and_patch_Video_Modes(dst, len, NTSC2PAL60); } if (CFG.video == CFG_VIDEO_NTSC) { Search_and_patch_Video_Modes(dst, len, PAL2NTSC); } if (CFG.ocarina) { dogamehooks(dst,len); } if (CFG.vidtv) { vidolpatcher(dst,len); } /*LANGUAGE PATCH - FISHEARS*/ if (CFG.language != CFG_LANG_CONSOLE) { langpatcher(dst,len); } // Country Patch by WiiPower if(CFG.country_patch) { PatchCountryStrings(dst, len); } // 002b fix from NeoGammaR4 by WiiPower: if (CFG.anti_002_fix) { Anti_002_fix(dst, len); } DCFlushRange(dst, len); } // maindolpatches