summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/OpcodeDecoding.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-09-03 21:49:15 +0200
committerdegasus <wickmarkus@web.de>2014-09-04 18:07:39 +0200
commit8b84ddce9a3e9c889996e2022279f78ef7a4ab5c (patch)
treec808ca530ddd20d53c2cecf9e0c6f111dd8043ea /Source/Core/VideoCommon/OpcodeDecoding.cpp
parente1248599ebdd9d179a109fff9184cabde8088f4c (diff)
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 fe644db21e..884a8c978a 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp
@@ -91,7 +91,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
@@ -146,7 +146,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)
@@ -221,10 +221,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;
@@ -261,21 +258,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
@@ -311,13 +301,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;