From ecdcffc7cf8ddb24da12f7359c8e4096c16b1f17 Mon Sep 17 00:00:00 2001 From: ayuanx Date: Wed, 13 Jan 2010 09:03:55 +0000 Subject: [PATCH] Fixes Issue 1997 This also makes the CP FIFO hack obsolete. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4821 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/VideoInterface.cpp | 8 ++++++-- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 5 ----- Source/Core/VideoCommon/Src/Fifo.cpp | 4 +--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Source/Core/Core/Src/HW/VideoInterface.cpp b/Source/Core/Core/Src/HW/VideoInterface.cpp index 0827db5ff0..6c339dec3f 100644 --- a/Source/Core/Core/Src/HW/VideoInterface.cpp +++ b/Source/Core/Core/Src/HW/VideoInterface.cpp @@ -717,7 +717,9 @@ void UpdateParameters() case 0: // NTSC case 2: // PAL-M TargetRefreshRate = NTSC_FIELD_RATE; - TicksPerFrame = SystemTimers::GetTicksPerSecond() / NTSC_FIELD_RATE; + // AyuanX: Some games are pretty sensitive to this value + // So we have to make it run a little faster to prevent potential time out + TicksPerFrame = SystemTimers::GetTicksPerSecond() / (NTSC_FIELD_RATE + 1); s_lineCount = m_DisplayControlRegister.NIN ? NTSC_LINE_COUNT : (NTSC_LINE_COUNT+1)/2; //s_upperFieldBegin = NTSC_UPPER_BEGIN; //s_lowerFieldBegin = NTSC_LOWER_BEGIN; @@ -725,7 +727,9 @@ void UpdateParameters() case 1: // PAL TargetRefreshRate = PAL_FIELD_RATE; - TicksPerFrame = SystemTimers::GetTicksPerSecond() / PAL_FIELD_RATE; + // AyuanX: Some games are pretty sensitive to this value + // So we have to make it run a little faster to prevent potential time out + TicksPerFrame = SystemTimers::GetTicksPerSecond() / (PAL_FIELD_RATE + 1); s_lineCount = m_DisplayControlRegister.NIN ? PAL_LINE_COUNT : (PAL_LINE_COUNT+1)/2; //s_upperFieldBegin = PAL_UPPER_BEGIN; //s_lowerFieldBegin = PAL_LOWER_BEGIN; diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index 2e39d34cfd..dff94e2184 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -408,11 +408,6 @@ void Write16(const u16 _Value, const u32 _Address) { // Clear old BP and initiate new BP Common::AtomicStore(fifo.bFF_Breakpoint, 0); - // AyuanX: The following is a hack for dual core - // There is definitely some initialization problem with Dolphin (not found exact location yet) - // Which prevents Metroid Prime 2 from first time booting (If you boot some other GC game first then MP2 can boot) - // But somehow this instant BP hack can make MP2 boot even at first time - if (g_VideoInitialize.bOnThread) UpdateInterrupts(true); } INFO_LOG(COMMANDPROCESSOR,"\t write to CTRL_REGISTER : %04x", _Value); diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index c01a9d94b3..172d6095fa 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -169,9 +169,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) ) { Common::AtomicStore(_fifo.bFF_Breakpoint, 1); - // Replaced by instant BP hack - // TODO: figure out why the correct trigger method doesn't work for MP2 - //CommandProcessor::UpdateInterruptsFromVideoPlugin(true); + CommandProcessor::UpdateInterruptsFromVideoPlugin(true); break; } distToSend = 32;