From cdff138c671c260527108e6771427c05f265f6a7 Mon Sep 17 00:00:00 2001 From: skidau Date: Fri, 13 Mar 2015 23:25:15 +1100 Subject: [PATCH] Show no more than one FIFO error per session. --- Source/Core/VideoCommon/OpcodeDecoding.cpp | 19 +++++++++++++++---- Source/Core/VideoCommon/OpcodeDecoding.h | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index b7bcb8c8e3..20a8f2eac9 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -33,6 +33,7 @@ bool g_bRecordFifoData = false; +bool g_bFifoErrorSeen = false; static u32 InterpretDisplayList(u32 address, u32 size) { @@ -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, @@ -123,6 +125,7 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess) void OpcodeDecoder_Init() { + g_bFifoErrorSeen = false; } @@ -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; @@ -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. { @@ -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; diff --git a/Source/Core/VideoCommon/OpcodeDecoding.h b/Source/Core/VideoCommon/OpcodeDecoding.h index 5fd03e26f3..18be50eb35 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.h +++ b/Source/Core/VideoCommon/OpcodeDecoding.h @@ -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