Skip to content

Commit

Permalink
Merge pull request #2202 from skidau/Popup-FIFO
Browse files Browse the repository at this point in the history
Show no more than one FIFO error per session.
  • Loading branch information
skidau committed Mar 16, 2015
2 parents b5a1a2f + cdff138 commit 7cda374
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Source/Core/VideoCommon/OpcodeDecoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@


bool g_bRecordFifoData = false;
bool g_bFifoErrorSeen = false;

static u32 InterpretDisplayList(u32 address, u32 size)
{
Expand Down Expand Up @@ -77,12 +78,13 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)
{
// TODO(Omega): Maybe dump FIFO to file on this error
PanicAlert(
"GFX FIFO: Unknown Opcode (0x%x @ %p, preprocessing=%s).\n"
"GFX FIFO: Unknown Opcode (0x%02x @ %p, preprocessing=%s).\n"
"This means one of the following:\n"
"* The emulated GPU got desynced, disabling dual core can help\n"
"* Command stream corrupted by some spurious memory bug\n"
"* This really is an unknown opcode (unlikely)\n"
"* Some other sort of bug\n\n"
"Further errors will be sent to the Video Backend log and\n"
"Dolphin will now likely crash or hang. Enjoy." ,
cmd_byte,
buffer,
Expand Down Expand Up @@ -123,6 +125,7 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)

void OpcodeDecoder_Init()
{
g_bFifoErrorSeen = false;
}


Expand Down Expand Up @@ -150,7 +153,12 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list)
totalCycles += 6; // Hm, this means that we scan over nop streams pretty slowly...
break;

case GX_LOAD_CP_REG: //0x08
case GX_UNKNOWN_RESET:
totalCycles += 6; // Datel software uses this command
DEBUG_LOG(VIDEO, "GX Reset?: %08x", cmd_byte);
break;

case GX_LOAD_CP_REG:
{
if (src.size() < 1 + 4)
goto end;
Expand Down Expand Up @@ -237,7 +245,7 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list)
DEBUG_LOG(VIDEO, "Invalidate (vertex cache?)");
break;

case GX_LOAD_BP_REG: //0x61
case GX_LOAD_BP_REG:
// In skipped_frame case: We have to let BP writes through because they set
// tokens and stuff. TODO: Call a much simplified LoadBPReg instead.
{
Expand Down Expand Up @@ -283,7 +291,10 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list)
}
else
{
UnknownOpcode(cmd_byte, opcodeStart, is_preprocess);
if (!g_bFifoErrorSeen)
UnknownOpcode(cmd_byte, opcodeStart, is_preprocess);
ERROR_LOG(VIDEO, "FIFO: Unknown Opcode(0x%02x @ %p, preprocessing = %s)", cmd_byte, opcodeStart, is_preprocess ? "yes" : "no");
g_bFifoErrorSeen = true;
totalCycles += 1;
}
break;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/OpcodeDecoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "VideoCommon/DataReader.h"

#define GX_NOP 0x00
#define GX_UNKNOWN_RESET 0x01

#define GX_LOAD_BP_REG 0x61
#define GX_LOAD_CP_REG 0x08
Expand Down

0 comments on commit 7cda374

Please sign in to comment.