-added sneek video patch, as soon as you set "Patch video modes" to "normal" or higher, wiiflow will also apply the sneek patch (should fix quite a good amount of wii game black screens when using video patching)

This commit is contained in:
fix94.1 2013-05-04 12:06:28 +00:00
parent 8f66b05995
commit ce732fd058
3 changed files with 19 additions and 0 deletions

View File

@ -119,6 +119,8 @@ void maindolpatches(void *dst, int len, u8 vidMode, GXRModeObj *vmode, bool vipa
if(hooktype != 0 && hookpatched == false) if(hooktype != 0 && hookpatched == false)
hookpatched = dogamehooks(dst, len, false); hookpatched = dogamehooks(dst, len, false);
patchVideoModes(dst, len, vidMode, vmode, patchVidModes); patchVideoModes(dst, len, vidMode, vmode, patchVidModes);
if(patchVidModes > 0)
PatchVideoSneek(dst, len);
if(vipatch) if(vipatch)
vidolpatcher(dst, len); vidolpatcher(dst, len);
if(configbytes[0] != 0xCD) if(configbytes[0] != 0xCD)

View File

@ -245,6 +245,22 @@ void vidolpatcher(void *addr, u32 len)
} }
} }
void PatchVideoSneek(void *addr, u32 len)
{
u8 *addr_start = addr;
u8 *addr_end = addr+len;
while(addr_start < addr_end)
{
if(*(vu32*)(addr_start) == 0x3C608000)
{
if(((*(vu32*)(addr_start+4) & 0xFC1FFFFF ) == 0x800300CC) && ((*(vu32*)(addr_start+8) >> 24) == 0x54))
*(vu32*)(addr_start+4) = 0x5400F0BE | ((*(vu32*)(addr_start+4) & 0x3E00000) >> 5);
}
addr_start += 4;
}
}
//giantpune's magic super patch to return to channels //giantpune's magic super patch to return to channels
static u32 ad[ 4 ] = { 0, 0, 0, 0 };//these variables are global on the off chance the different parts needed static u32 ad[ 4 ] = { 0, 0, 0, 0 };//these variables are global on the off chance the different parts needed

View File

@ -33,6 +33,7 @@ extern u8 configbytes[2];
bool dogamehooks(void *addr, u32 len, bool channel); bool dogamehooks(void *addr, u32 len, bool channel);
void langpatcher(void *addr, u32 len); void langpatcher(void *addr, u32 len);
void vidolpatcher(void *addr, u32 len); void vidolpatcher(void *addr, u32 len);
void PatchVideoSneek(void *addr, u32 len);
void PatchCountryStrings(void *Address, int Size); void PatchCountryStrings(void *Address, int Size);
void PatchAspectRatio(void *addr, u32 len, u8 aspect); void PatchAspectRatio(void *addr, u32 len, u8 aspect);
bool PatchReturnTo(void *Address, int Size, u32 id); bool PatchReturnTo(void *Address, int Size, u32 id);