summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/CommandProcessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/Src/CommandProcessor.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/CommandProcessor.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp
index a8ee3c8df6..05ebd1ede2 100644
--- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp
+++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp
@@ -284,13 +284,19 @@ void Read16(u16& _rReturnValue, const u32 _Address)
return;
case FIFO_READ_POINTER_LO:
- _rReturnValue = ReadLow (fifo.CPReadPointer);
+ if (IsOnThread())
+ _rReturnValue = ReadLow (fifo.SafeCPReadPointer);
+ else
+ _rReturnValue = ReadLow (fifo.CPReadPointer);
// hack: CPU will always believe fifo is empty and on idle
//_rReturnValue = ReadLow (fifo.CPWritePointer);
DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_LO : %04x", _rReturnValue);
return;
case FIFO_READ_POINTER_HI:
- _rReturnValue = ReadHigh(fifo.CPReadPointer);
+ if (IsOnThread())
+ _rReturnValue = ReadHigh (fifo.SafeCPReadPointer);
+ else
+ _rReturnValue = ReadHigh (fifo.CPReadPointer);
// hack: CPU will always believe fifo is empty and on idle
//_rReturnValue = ReadHigh(fifo.CPWritePointer);
DEBUG_LOG(COMMANDPROCESSOR, "read FIFO_READ_POINTER_HI : %04x", _rReturnValue);
@@ -614,8 +620,11 @@ void Write16(const u16 _Value, const u32 _Address)
{
GPFifo::ResetGatherPipe();
ResetVideoBuffer();
- IncrementCheckContextId();
- }
+ }else
+ {
+ ResetVideoBuffer();
+ }
+ IncrementCheckContextId();
DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_LO : %04x", _Value);
break;