From 07c4da6084e6d87cf25f87868da10c068721c19f Mon Sep 17 00:00:00 2001 From: donkopunchstania Date: Sun, 27 Mar 2011 02:55:08 +0000 Subject: 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 --- Source/Core/VideoCommon/Src/OpcodeDecoding.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Source/Core/VideoCommon/Src/OpcodeDecoding.cpp') 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() -- cgit v1.2.3