diff options
| author | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-08-08 01:39:56 +0000 |
|---|---|---|
| committer | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-08-08 01:39:56 +0000 |
| commit | 51ddedf512a3795193fb809281beb5d5453bc73a (patch) | |
| tree | d6f2c2dfb5e9afe3b29f84aff2f788890d358294 /Source/Core/VideoCommon | |
| parent | 9cbfadb885b585ecbd1e93c885edeb27bbf830e7 (diff) | |
Frameskipping! Complete with GUI! Even my most naive approach resulted in great speeds, even with graphic-intensive games such as Pikmin.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3949 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/Src/Fifo.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/Fifo.h | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/OpcodeDecoding.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexLoaderManager.cpp | 1 |
4 files changed, 12 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 649dabc5e2..9be1bd2288 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -24,6 +24,7 @@ #include "Fifo.h" +volatile bool g_bSkipCurrentFrame = false; extern u8* g_pVideoData; @@ -77,6 +78,10 @@ u8* FAKE_GetFifoEndPtr() return &videoBuffer[size]; } +void Fifo_SetRendering(bool bEnabled) { + g_bSkipCurrentFrame = !bEnabled; +} + // Executed from another thread, no the graphics thread! // Basically, all it does is set a flag so that the loop will eventually exit, then // waits for the event to be set, which happens when the loop does exit. diff --git a/Source/Core/VideoCommon/Src/Fifo.h b/Source/Core/VideoCommon/Src/Fifo.h index b682dcbb5f..fa0e0539ed 100644 --- a/Source/Core/VideoCommon/Src/Fifo.h +++ b/Source/Core/VideoCommon/Src/Fifo.h @@ -25,6 +25,8 @@ #define FIFO_SIZE (1024*1024) +extern volatile bool g_bSkipCurrentFrame; + void Fifo_Init(); void Fifo_Shutdown(); @@ -37,6 +39,8 @@ void Fifo_ExitLoopNonBlocking(); void Fifo_DoState(PointerWrap &f); +void Fifo_SetRendering(bool bEnabled); + // Implemented by the Video Plugin void VideoFifo_CheckSwapRequest(); void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight); diff --git a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp index 95def571a6..138cc93fd7 100644 --- a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp @@ -197,6 +197,7 @@ bool FifoCommandRunnable() static void Decode() { int Cmd = DataReadU8(); + switch(Cmd) { case GX_NOP: @@ -268,6 +269,7 @@ static void Decode() { // load vertices (use computed vertex size from FifoCommandRunnable above) u16 numVertices = DataReadU16(); + VertexLoaderManager::RunVertices( Cmd & GX_VAT_MASK, // Vertex loader index (0 - 7) (Cmd & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, diff --git a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp index d7380c42e4..a7db50e420 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -115,6 +115,7 @@ void RunVertices(int vtx_attr_group, int primitive, int count) { if (!count) return; + RefreshLoader(vtx_attr_group); g_VertexLoaders[vtx_attr_group]->RunVertices(vtx_attr_group, primitive, count); } |
