summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorsl1nk3.s <sl1nk3.s@gmail.com>2009-10-21 00:01:07 +0000
committersl1nk3.s <sl1nk3.s@gmail.com>2009-10-21 00:01:07 +0000
commit4c3e405c4769ebee45f74bdbbdb265ec08772250 (patch)
tree02aa10ec2c372ef2fc6cbfd12a65a871d02ddd2f /Source/Core
parentc60092671085154d020e053599208f25325e75d6 (diff)
Revert the the Fifo changes from r3984 (Pokemon XD still somewhat works) this should fix hangs/desyncs in a couple of games (burnout, metroid, spyro, soulcalibur, nightfire...) see issue 1524
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4442 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/State.cpp2
-rw-r--r--Source/Core/VideoCommon/Src/Fifo.cpp64
2 files changed, 40 insertions, 26 deletions
diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp
index 2190a90a1f..d920a2d801 100644
--- a/Source/Core/Core/Src/State.cpp
+++ b/Source/Core/Core/Src/State.cpp
@@ -81,7 +81,7 @@ void DoState(PointerWrap &p)
p.Do(cookie);
if (cookie != 0xBAADBABE + STATE_VERSION)
{
- PanicAlert("Savestate version mismatch !\nSorry, you can't load states from others revisions.");
+ PanicAlert("Savestate version mismatch !\nSorry, you can't load states from other revisions.");
return;
}
// Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM
diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp
index b258eb97f2..6285e37afe 100644
--- a/Source/Core/VideoCommon/Src/Fifo.cpp
+++ b/Source/Core/VideoCommon/Src/Fifo.cpp
@@ -145,49 +145,63 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
{
Common::AtomicStore(_fifo.CPReadIdle, 0);
- do
+ while (_fifo.bFF_GPReadEnable && _fifo.CPReadWriteDistance)
{
if (!fifoStateRun)
break;
- // Get the Read Pointer
- // Create pointer to video data and send it to the VideoPlugin
+ // Create pointer to video data and send it to the VideoPlugin
u32 readPtr = _fifo.CPReadPointer;
-
- // Set distance
- // if we are on BP mode we must send 32B chunks to Video plugin for BP checking
- distToSend = _fifo.bFF_BPEnable ? 32 : _fifo.CPReadWriteDistance;
- // send 1024B chunk max length to have better control over PeekMessages' period
- //distToSend = distToSend > 1024 ? 1024 : distToSend;
-
- // Get Data based on pointer
u8 *uData = video_initialize.pGetMemoryPointer(readPtr);
- // Check Pointer and move pointer
- if ((distToSend + readPtr) >= _fifo.CPEnd)
+ // if we are on BP mode we must send 32B chunks to Video plugin for BP checking
+ // TODO (mb2): test & check if MP1/MP2 realy need this now.
+ if (_fifo.bFF_BPEnable)
{
- distToSend =_fifo.CPEnd - readPtr;
- readPtr = _fifo.CPBase;
+ if (readPtr == _fifo.CPBreakpoint)
+ {
+ Common::AtomicStore(_fifo.bFF_Breakpoint, 1);
+ CommandProcessor::UpdateInterruptsFromVideoPlugin();
+ break;
+ }
+ distToSend = 32;
+ readPtr += 32;
+ if ( readPtr >= _fifo.CPEnd)
+ readPtr = _fifo.CPBase;
}
else
- readPtr += distToSend;
+ {
+ distToSend = _fifo.CPReadWriteDistance;
+ // send 1024B chunk max length to have better control over PeekMessages' period
+ distToSend = distToSend > 1024 ? 1024 : distToSend;
+ if ((distToSend + readPtr) >= _fifo.CPEnd) // TODO: better?
+ {
+ distToSend =_fifo.CPEnd - readPtr;
+ readPtr = _fifo.CPBase;
+ }
+ else
+ readPtr += distToSend;
+ }
// Execute new instructions found in uData
Fifo_SendFifoData(uData, distToSend);
- //Check BP Mode - Pokemon XD wants this to be called after the pointer move
+ // The following condition is what keeps Pokemon XD "sorta booting" weird isn't it ?
if (_fifo.bFF_BPEnable && (readPtr == _fifo.CPBreakpoint))
- {
- Common::AtomicStore(_fifo.bFF_Breakpoint, 1);
- CommandProcessor::UpdateInterruptsFromVideoPlugin();
- }
+ {
+ Common::AtomicStore(_fifo.bFF_Breakpoint, 1);
+ CommandProcessor::UpdateInterruptsFromVideoPlugin();
+ }
+
+ Common::AtomicStore(_fifo.CPReadPointer, readPtr);
+ Common::AtomicAdd(_fifo.CPReadWriteDistance, -distToSend);
- // Update CPReadPointer and RWDistance
- Common::AtomicStore(_fifo.CPReadPointer, readPtr);
- Common::AtomicAdd(_fifo.CPReadWriteDistance, -distToSend);
+ video_initialize.pPeekMessages();
+ VideoFifo_CheckEFBAccess();
- } while (_fifo.bFF_GPReadEnable && _fifo.CPReadWriteDistance && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint));
+ VideoFifo_CheckSwapRequest();
+ }
Common::AtomicStore(_fifo.CPReadIdle, 1);
CommandProcessor::SetFifoIdleFromVideoPlugin();