summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
diff options
context:
space:
mode:
authordonkopunchstania <donkopunchstania@gmail.com>2011-03-27 02:55:08 +0000
committerdonkopunchstania <donkopunchstania@gmail.com>2011-03-27 02:55:08 +0000
commit07c4da6084e6d87cf25f87868da10c068721c19f (patch)
tree5fbbd3476f80cfdb891e8c1f2cbeac86ec85c8b5 /Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
parentf8037e3ccf7723c2c02f7cfae74128561e304727 (diff)
Add graphics FIFO recorder and player for debugging the graphics system.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7414 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/OpcodeDecoding.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/OpcodeDecoding.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
index 6d939882e7..18d6726ae3 100644
--- a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
@@ -33,6 +33,7 @@
#include "Core.h"
#include "Host.h"
#include "HW/Memmap.h"
+#include "FifoPlayer/FifoRecorder.h"
#include "VertexLoaderManager.h"
@@ -50,6 +51,8 @@
#include "VideoConfig.h"
u8* g_pVideoData = 0;
+bool g_bRecordFifoData = false;
+
#if _M_SSE >= 0x301
DataReadU32xNfunc DataReadU32xFuncs_SSSE3[16] = {
DataReadU32xN_SSSE3<1>,
@@ -254,6 +257,8 @@ bool FifoCommandRunnable()
static void Decode()
{
+ u8 *opcodeStart = g_pVideoData;
+
int cmd_byte = DataReadU8();
switch (cmd_byte)
{
@@ -338,10 +343,16 @@ static void Decode()
}
break;
}
+
+ // Display lists get added directly into the FIFO stream
+ if (g_bRecordFifoData && cmd_byte != GX_CMD_CALL_DL)
+ FifoRecorder::GetInstance().WriteGPCommand(opcodeStart, g_pVideoData - opcodeStart);
}
static void DecodeSemiNop()
{
+ u8 *opcodeStart = g_pVideoData;
+
int cmd_byte = DataReadU8();
switch (cmd_byte)
{
@@ -416,6 +427,9 @@ static void DecodeSemiNop()
}
break;
}
+
+ if (g_bRecordFifoData && cmd_byte != GX_CMD_CALL_DL)
+ FifoRecorder::GetInstance().WriteGPCommand(opcodeStart, g_pVideoData - opcodeStart);
}
void OpcodeDecoder_Init()