summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/CommandProcessor.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2022-02-12 17:44:07 -0800
committerPokechu22 <Pokechu022@gmail.com>2022-02-12 23:38:20 -0800
commit68cdceb4bef1b6923c3d3039b2535209dd58db8b (patch)
tree9062c7a592ee046921d533b6a10b418d235d27bd /Source/Core/VideoCommon/CommandProcessor.cpp
parent095803d1e965b89bd3010f8b426eec85b17a1f45 (diff)
CommandProcessor: Log PC and LR on unknown opcodes
Diffstat (limited to 'Source/Core/VideoCommon/CommandProcessor.cpp')
-rw-r--r--Source/Core/VideoCommon/CommandProcessor.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp
index 81f6118a94..451cdcce9a 100644
--- a/Source/Core/VideoCommon/CommandProcessor.cpp
+++ b/Source/Core/VideoCommon/CommandProcessor.cpp
@@ -17,6 +17,7 @@
#include "Core/HW/GPFifo.h"
#include "Core/HW/MMIO.h"
#include "Core/HW/ProcessorInterface.h"
+#include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"
#include "VideoCommon/Fifo.h"
@@ -637,12 +638,21 @@ void HandleUnknownOpcode(u8 cmd_byte, const u8* buffer, bool preprocess)
}
// We always generate this log message, though we only generate the panic alerts once.
+ //
+ // PC and LR are generally inaccurate in dual-core and are still misleading in single-core
+ // due to the gather pipe queueing data. Changing GATHER_PIPE_SIZE to 1 and
+ // GATHER_PIPE_EXTRA_SIZE to 16 * 32 in GPFifo.h, and using the cached interpreter CPU emulation
+ // engine, can result in more accurate information (though it is still a bit delayed).
+ // PC and LR are meaningless when using the fifoplayer, and will generally not be helpful if the
+ // unknown opcode is inside of a display list. Also note that the changes in GPFifo.h are not
+ // accurate and may introduce timing issues.
ERROR_LOG_FMT(VIDEO,
"FIFO: Unknown Opcode {:#04x} @ {}, preprocessing = {}, CPBase: {:#010x}, CPEnd: "
"{:#010x}, CPHiWatermark: {:#010x}, CPLoWatermark: {:#010x}, CPReadWriteDistance: "
"{:#010x}, CPWritePointer: {:#010x}, CPReadPointer: {:#010x}, CPBreakpoint: "
"{:#010x}, bFF_GPReadEnable: {}, bFF_BPEnable: {}, bFF_BPInt: {}, bFF_Breakpoint: "
- "{}, bFF_GPLinkEnable: {}, bFF_HiWatermarkInt: {}, bFF_LoWatermarkInt: {}",
+ "{}, bFF_GPLinkEnable: {}, bFF_HiWatermarkInt: {}, bFF_LoWatermarkInt: {}, "
+ "approximate PC: {:08x}, approximate LR: {:08x}",
cmd_byte, fmt::ptr(buffer), preprocess ? "yes" : "no",
fifo.CPBase.load(std::memory_order_relaxed),
fifo.CPEnd.load(std::memory_order_relaxed), fifo.CPHiWatermark, fifo.CPLoWatermark,
@@ -656,7 +666,7 @@ void HandleUnknownOpcode(u8 cmd_byte, const u8* buffer, bool preprocess)
fifo.bFF_Breakpoint.load(std::memory_order_relaxed) ? "true" : "false",
fifo.bFF_GPLinkEnable.load(std::memory_order_relaxed) ? "true" : "false",
fifo.bFF_HiWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false",
- fifo.bFF_LoWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false");
+ fifo.bFF_LoWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false", PC, LR);
}
} // namespace CommandProcessor