mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Add Fix002 gameini parameter (no ui yet). Hack to fix games that display "002 error" without having to manually patch the games. (yeah this is ugly).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2952 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -42,6 +42,30 @@ void CBoot::RunFunction(u32 _iAddr)
|
|||||||
PowerPC::SingleStep();
|
PowerPC::SingleStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// THIS IS UGLY. this should be figured out properly instead of patching the games.
|
||||||
|
bool Remove_002_Protection(u32 addr, int Size)
|
||||||
|
{
|
||||||
|
u32 SearchPattern[3] = { 0x2C000000, 0x40820214, 0x3C608000 };
|
||||||
|
u32 PatchData[3] = { 0x2C000000, 0x48000214, 0x3C608000 };
|
||||||
|
|
||||||
|
while (Size >= 12)
|
||||||
|
{
|
||||||
|
if (Memory::ReadUnchecked_U32(addr + 0) == SearchPattern[0] &&
|
||||||
|
Memory::ReadUnchecked_U32(addr + 4) == SearchPattern[1] &&
|
||||||
|
Memory::ReadUnchecked_U32(addr + 8) == SearchPattern[2])
|
||||||
|
{
|
||||||
|
Memory::WriteUnchecked_U32(PatchData[0], addr);
|
||||||
|
Memory::WriteUnchecked_U32(PatchData[1], addr + 4);
|
||||||
|
Memory::WriteUnchecked_U32(PatchData[2], addr + 8);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
addr += 4;
|
||||||
|
Size -= 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// __________________________________________________________________________________________________
|
// __________________________________________________________________________________________________
|
||||||
//
|
//
|
||||||
// GameCube BIOS HLE:
|
// GameCube BIOS HLE:
|
||||||
@ -265,7 +289,6 @@ bool CBoot::SetupWiiMemory(unsigned int _CountryCode)
|
|||||||
{
|
{
|
||||||
Memory::Write_U32(0x00000000, 0x80000000 + i);
|
Memory::Write_U32(0x00000000, 0x80000000 + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,6 +396,14 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
|
|||||||
|
|
||||||
PowerPC::ppcState.DebugCount = 0;
|
PowerPC::ppcState.DebugCount = 0;
|
||||||
|
|
||||||
|
if (Core::GetStartupParameter().bFix002)
|
||||||
|
{
|
||||||
|
// UGLY UGLY UGLY
|
||||||
|
// TODO: Understand what this does and fix it properly..
|
||||||
|
// This "fixes" games that display "Error 002" instead of running.
|
||||||
|
Remove_002_Protection(0x80004000, 0x5000000);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ void SCoreStartupParameter::LoadDefaults()
|
|||||||
bDSPThread = true;
|
bDSPThread = true;
|
||||||
bLockThreads = true;
|
bLockThreads = true;
|
||||||
bWii = false;
|
bWii = false;
|
||||||
|
bFix002 = false;
|
||||||
SelectedLanguage = 0;
|
SelectedLanguage = 0;
|
||||||
iTLBHack = 0;
|
iTLBHack = 0;
|
||||||
delete gameIni;
|
delete gameIni;
|
||||||
|
@ -71,6 +71,7 @@ struct SCoreStartupParameter
|
|||||||
bool bRunCompareClient;
|
bool bRunCompareClient;
|
||||||
|
|
||||||
int iTLBHack;
|
int iTLBHack;
|
||||||
|
bool bFix002;
|
||||||
|
|
||||||
int SelectedLanguage;
|
int SelectedLanguage;
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#ifndef _EXICHANNEL_H
|
#ifndef _EXICHANNEL_H
|
||||||
#define _EXICHANNEL_H
|
#define _EXICHANNEL_H
|
||||||
|
|
||||||
@ -93,7 +94,6 @@ private:
|
|||||||
IEXIDevice* m_pDevices[NUM_DEVICES];
|
IEXIDevice* m_pDevices[NUM_DEVICES];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// channelId for debugging
|
// channelId for debugging
|
||||||
u32 m_ChannelId;
|
u32 m_ChannelId;
|
||||||
|
|
||||||
|
@ -135,6 +135,7 @@ bool BootCore(const std::string& _rFilename)
|
|||||||
ini->Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
|
ini->Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
|
||||||
ini->Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers);
|
ini->Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers);
|
||||||
ini->Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack);
|
ini->Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack);
|
||||||
|
ini->Get("Core", "Fix002", &StartUp.bFix002, false);
|
||||||
|
|
||||||
// ------------------------------------------------
|
// ------------------------------------------------
|
||||||
// Wii settings
|
// Wii settings
|
||||||
|
Reference in New Issue
Block a user