Fix Pikmin PAL not booting thanks to LordMark for figuring it out ! :D

Added "AccurateFCMP" ini setting which fixes Nights, Paper Mario games...

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4042 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
sl1nk3.s 2009-08-24 04:04:10 +00:00
parent 9fcb1db34f
commit 944844bfba
12 changed files with 38 additions and 18 deletions

View File

@ -44,6 +44,7 @@ void SCoreStartupParameter::LoadDefaults()
bDSPThread = true;
bLockThreads = true;
bEnableFPRF = false;
bAccurateFCMP = false;
bWii = false;
SelectedLanguage = 0;
iTLBHack = 0;

View File

@ -57,6 +57,9 @@ struct SCoreStartupParameter
bool bJITBranchOff;
bool bJITProfiledReJIT;
bool bEnableFPRF;
bool bAccurateFCMP;
bool bUseDualCore;
bool bDSPThread;
bool bSkipIdle;
@ -65,7 +68,6 @@ struct SCoreStartupParameter
bool bUseFastMem;
bool bLockThreads;
bool bOptimizeQuantizers;
bool bEnableFPRF;
bool bEnableCheats;
bool bEnableIsoCache;

View File

@ -210,7 +210,7 @@ void Jit64::Init()
jo.enableFastMem = false;
#endif
jo.assumeFPLoadFromMem = true;
jo.fpAccurateFcmp = false;
jo.fpAccurateFcmp = Core::GetStartupParameter().bEnableFPRF || Core::GetStartupParameter().bAccurateFCMP;
jo.optimizeGatherPipe = true;
jo.fastInterrupts = false;
jo.accurateSinglePrecision = true;

View File

@ -205,9 +205,10 @@ void Jit64::fmrx(UGeckoInstruction inst)
fpr.LoadToX64(d, true); // we don't want to destroy the high bit
MOVSD(fpr.RX(d), fpr.R(b));
}
void Jit64::fcmpx(UGeckoInstruction inst)
{
// TODO : this causes crashes in Nights, and broken graphics in Paper Mario, Super Paper Mario
INSTRUCTION_START;
if(Core::g_CoreStartupParameter.bJITOff || jo.fpAccurateFcmp
|| Core::g_CoreStartupParameter.bJITFloatingPointOff) {

View File

@ -132,6 +132,7 @@ bool BootCore(const std::string& _rFilename)
ini->Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
ini->Get("Core", "OptimizeQuantizers", &StartUp.bOptimizeQuantizers, StartUp.bOptimizeQuantizers);
ini->Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
ini->Get("Core", "AccurateFCMP", &StartUp.bAccurateFCMP, StartUp.bAccurateFCMP);
ini->Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack);
// ------------------------------------------------

View File

@ -122,7 +122,8 @@ void PixelShaderManager::SetConstants()
if (s_bZBiasChanged || s_bDepthRangeChanged)
{
//ERROR_LOG("pixel=%x,%x, bias=%x\n", bpmem.zcontrol.pixel_format, bpmem.ztex2.type, lastZBias);
//ERROR_LOG("pixel=%x,%x, bias=%x\n", bpmem.zcontrol.pixel_format, bpmem.ztex2.type, lastZBias);
// TODO : Should this use 16777216.0f or 16777215.0f ?
SetPSConstant4f(C_ZBIAS+1, lastDepthRange[0] / 16777216.0f, lastDepthRange[1] / 16777216.0f, 0, (float)( (((int)lastZBias<<8)>>8))/16777216.0f);
s_bZBiasChanged = s_bDepthRangeChanged = false;
}

View File

@ -91,6 +91,8 @@
#define XFMEM_SETMATRIXINDA 0x1018
#define XFMEM_SETMATRIXINDB 0x1019
#define XFMEM_SETVIEWPORT 0x101a
#define XFMEM_SETZSCALE 0x101c
#define XFMEM_SETZOFFSET 0x101f
#define XFMEM_SETPROJECTION 0x1020
#define XFMEM_SETNUMTEXGENS 0x103f
#define XFMEM_SETTEXMTXINFO 0x1040

View File

@ -169,6 +169,24 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
}
break;
// GXSetZScaleOffset ?
// Actually everything i tried didn't seem to change anything x)
case XFMEM_SETZSCALE:
// paper mario writes 16777216.0f, 1677721.75
// Killer 7 writes 16777216.0f here
WARN_LOG(VIDEO, "Set ZScale : %x=%x\n", address, data);
break;
case XFMEM_SETZOFFSET:
// paper mario writes 16777216.0f, 5033165.0f
// Killer 7 alterns this between 16777216.0f and 16710107.0f
WARN_LOG(VIDEO, "Set ZOffset : %x=%x\n", address, data);
break;
// --------------
// Unknown Regs
// --------------
// Maybe these are for Normals?
case 0x1048: //xfregs.texcoords[0].nrmmtxinfo.hex = data; break; ??
case 0x1049:
@ -181,21 +199,12 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
DEBUG_LOG(VIDEO, "Possible Normal Mtx XF reg?: %x=%x\n", address, data);
break;
// --------------
// Unknown Regs
// --------------
case 0x1013:
case 0x1014:
case 0x1015:
case 0x1016:
case 0x1017:
case 0x101c:
// paper mario writes 16777216.0f, 1677721.75
// Killer 7 writes 0x4b800000 here on 3D rendering only
case 0x101f:
// paper mario writes 16777216.0f, 5033165.0f
// Killer 7 alterns this between 0x4b800000 and 0x4b7ef9db on 3D rendering
default:
WARN_LOG(VIDEO, "Unknown XF Reg: %x=%x\n", address, data);
break;

View File

@ -199,8 +199,7 @@ private:
switch (m_CRC)
{
case 0x42f64ac4: // Luigi
case 0x267fd05a: // Pikmin PAL
case 0x4be6a5cb: // AC, Pikmin
case 0x4be6a5cb: // AC, Pikmin NTSC
case 0x088e38a5: // IPL - JAP
case 0xd73338cf: // IPL
return true;
@ -217,7 +216,8 @@ private:
{
switch (m_CRC)
{
case 0x56d36052:
case 0x56d36052: // Super Mario Sunshine
case 0x267fd05a: // Pikmin PAL
return true;
default:
return false;

View File

@ -57,7 +57,6 @@ IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
case 0x088e38a5: // IPL - JAP
case 0xd73338cf: // IPL
case 0x42f64ac4: // Luigi
case 0x267fd05a: // Pikmin PAL
case 0x4be6a5cb: // AC, Pikmin
INFO_LOG(DSPHLE, "CRC %08x: JAC (early Zelda) ucode chosen", _CRC);
return new CUCode_Zelda(_rMailHandler, _CRC);
@ -66,6 +65,7 @@ IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
case 0x86840740: // Zelda WW - US
case 0x56d36052: // Mario Sunshine
case 0x2fcdf1ec: // Mario Kart, zelda 4 swords
case 0x267fd05a: // Pikmin PAL
INFO_LOG(DSPHLE, "CRC %08x: Zelda ucode chosen", _CRC);
return new CUCode_Zelda(_rMailHandler, _CRC);
@ -83,7 +83,7 @@ IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
case 0xfa450138: // wii sports - PAL
case 0xadbc06bd: // Elebits
case 0x4cc52064: // Bleach: Versus Crusade
case 0xd9c4bf34: // WiiMenu ... pray
case 0xd9c4bf34: // WiiMenu
INFO_LOG(DSPHLE, "CRC %08x: Wii - AXWii chosen", _CRC);
return new CUCode_AXWii(_rMailHandler, _CRC);

View File

@ -110,6 +110,8 @@ void Config::GameIniLoad()
if (iniFile->Exists("Video", "EFBToTextureEnable"))
iniFile->Get("Video", "EFBToTextureEnable", &bCopyEFBToRAM, 0);
bCopyEFBToRAM = !bCopyEFBToRAM;
if (iniFile->Exists("Video", "SafeTextureCache"))
iniFile->Get("Video", "SafeTextureCache", &bSafeTextureCache, false);

View File

@ -1451,6 +1451,7 @@ void UpdateViewport()
glViewport(GLx, GLy, GLWidth, GLHeight);
// GLDepthRange - this could be a source of trouble - see the viewport hacks.
// TODO : Should this use 16777216.0f or 16777215.0f ?
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / 16777215.0f;
double GLFar = xfregs.rawViewport[5] / 16777215.0f;
glDepthRange(GLNear, GLFar);