Exemple #1
0
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();
}
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);
}