summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/OpcodeDecoding.cpp
diff options
context:
space:
mode:
authorDolphin Bot <dolphin-emu-bot@users.noreply.github.com>2014-09-04 18:27:19 +0200
committerDolphin Bot <dolphin-emu-bot@users.noreply.github.com>2014-09-04 18:27:19 +0200
commit830a03c540c8c76023cd66751c735dc50245e473 (patch)
tree1cdd2a15d0984b46d3e6088d9fbc5e7a2eaa5c14 /Source/Core/VideoCommon/OpcodeDecoding.cpp
parentaf7881474edb90a243031314f81a0a7e2ab92fb2 (diff)
parent8b84ddce9a3e9c889996e2022279f78ef7a4ab5c (diff)
Merge pull request #957 from degasus/frame_skipping
VideoCommon: rewrite frame skipping code
Diffstat (limited to 'Source/Core/VideoCommon/OpcodeDecoding.cpp')
-rw-r--r--Source/Core/VideoCommon/OpcodeDecoding.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp
index a5bd8a62ee..2b9e314ec0 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp
@@ -50,7 +50,7 @@ static u32 InterpretDisplayList(u32 address, u32 size)
Statistics::SwapDL();
u8 *end = g_pVideoData + size;
- cycles = OpcodeDecoder_Run(false, end);
+ cycles = OpcodeDecoder_Run(end);
INCSTAT(stats.thisFrame.numDListsCalled);
// un-swap
@@ -105,7 +105,7 @@ static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)
}
}
-static u32 Decode(u8* end, bool skipped_frame)
+static u32 Decode(u8* end)
{
u8 *opcodeStart = g_pVideoData;
if (g_pVideoData == end)
@@ -178,10 +178,7 @@ static u32 Decode(u8* end, bool skipped_frame)
return 0;
u32 address = DataReadU32();
u32 count = DataReadU32();
- if (skipped_frame)
- cycles = 45; // xxx
- else
- cycles = 6 + InterpretDisplayList(address, count);
+ cycles = 6 + InterpretDisplayList(address, count);
}
break;
@@ -218,21 +215,14 @@ static u32 Decode(u8* end, bool skipped_frame)
return 0;
u16 numVertices = DataReadU16();
- if (skipped_frame)
+ if (!VertexLoaderManager::RunVertices(
+ cmd_byte & GX_VAT_MASK, // Vertex loader index (0 - 7)
+ (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT,
+ numVertices,
+ end - g_pVideoData,
+ g_bSkipCurrentFrame))
{
- size_t size = numVertices * VertexLoaderManager::GetVertexSize(cmd_byte & GX_VAT_MASK);
- if ((size_t) (end - g_pVideoData) < size)
- return 0;
- DataSkip((u32)size);
- }
- else
- {
- if (!VertexLoaderManager::RunVertices(
- cmd_byte & GX_VAT_MASK, // Vertex loader index (0 - 7)
- (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT,
- numVertices,
- end - g_pVideoData))
- return 0;
+ return 0;
}
}
else
@@ -260,13 +250,13 @@ void OpcodeDecoder_Shutdown()
{
}
-u32 OpcodeDecoder_Run(bool skipped_frame, u8* end)
+u32 OpcodeDecoder_Run(u8* end)
{
u32 totalCycles = 0;
while (true)
{
u8* old = g_pVideoData;
- u32 cycles = Decode(end, skipped_frame);
+ u32 cycles = Decode(end);
if (cycles == 0)
{
g_pVideoData = old;