mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 01:59:52 -06:00
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
This commit is contained in:
@ -2244,14 +2244,6 @@
|
||||
RelativePath=".\Src\CoreTiming.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\Frame.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\Frame.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\Host.h"
|
||||
>
|
||||
@ -2264,6 +2256,14 @@
|
||||
RelativePath=".\Src\MemTools.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\OnFrame.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\OnFrame.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PatchEngine.cpp"
|
||||
>
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include "LogManager.h"
|
||||
|
||||
#include "State.h"
|
||||
#include "Frame.h"
|
||||
#include "OnFrame.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#define WINAPI
|
||||
@ -604,9 +604,9 @@ void Callback_VideoCopiedToXFB(bool video_update)
|
||||
static u32 videoupd = 0;
|
||||
|
||||
if (video_update)
|
||||
videoupd++;
|
||||
videoupd += Frame::FrameSkippingFactor() + 1;
|
||||
else
|
||||
frames++;
|
||||
frames += Frame::FrameSkippingFactor() + 1;
|
||||
|
||||
// Custom frame limiter
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "EXI_Device.h"
|
||||
#include "EXI_DeviceMic.h"
|
||||
|
||||
#include "../Frame.h"
|
||||
#include "../OnFrame.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// --- standard gamecube controller ---
|
||||
|
@ -15,6 +15,8 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "OnFrame.h"
|
||||
|
||||
#include "Core.h"
|
||||
#include "PluginManager.h"
|
||||
|
||||
@ -25,12 +27,27 @@ bool g_bAutoFire = false;
|
||||
u32 g_autoFirstKey = 0, g_autoSecondKey = 0;
|
||||
bool g_bFirstKey = true;
|
||||
|
||||
int g_framesToSkip = 1, g_frameSkipCounter = 0;
|
||||
|
||||
void FrameUpdate() {
|
||||
if(g_bFrameStep)
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
|
||||
if(g_bAutoFire)
|
||||
g_bFirstKey = !g_bFirstKey;
|
||||
|
||||
if(g_framesToSkip)
|
||||
FrameSkipping();
|
||||
|
||||
}
|
||||
|
||||
void SetFrameSkipping(unsigned int framesToSkip) {
|
||||
g_framesToSkip = (int)framesToSkip;
|
||||
g_frameSkipCounter = 0;
|
||||
}
|
||||
|
||||
int FrameSkippingFactor() {
|
||||
return g_framesToSkip;
|
||||
}
|
||||
|
||||
void SetAutoHold(bool bEnabled, u32 keyToHold) {
|
||||
@ -60,7 +77,6 @@ void SetFrameStepping(bool bEnabled) {
|
||||
g_bFrameStep = bEnabled;
|
||||
}
|
||||
|
||||
|
||||
void ModifyController(SPADStatus *PadStatus) {
|
||||
u32 keyToPress = (g_bFirstKey) ? g_autoFirstKey : g_autoSecondKey;
|
||||
|
||||
@ -90,4 +106,12 @@ void ModifyController(SPADStatus *PadStatus) {
|
||||
|
||||
}
|
||||
|
||||
void FrameSkipping() {
|
||||
g_frameSkipCounter++;
|
||||
if(g_frameSkipCounter > g_framesToSkip)
|
||||
g_frameSkipCounter = 0;
|
||||
|
||||
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(!g_frameSkipCounter);
|
||||
}
|
||||
|
||||
};
|
@ -18,6 +18,9 @@
|
||||
#ifndef __FRAME_H
|
||||
#define __FRAME_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "pluginspecs_pad.h"
|
||||
|
||||
// Per-(video )Frame actions
|
||||
|
||||
namespace Frame {
|
||||
@ -33,6 +36,10 @@ void SetFrameStepping(bool bEnabled);
|
||||
|
||||
void ModifyController(SPADStatus *PadStatus);
|
||||
|
||||
void SetFrameSkipping(unsigned int framesToSkip);
|
||||
int FrameSkippingFactor();
|
||||
void FrameSkipping();
|
||||
|
||||
};
|
||||
|
||||
#endif // __FRAME_H
|
@ -11,7 +11,7 @@ files = ["ActionReplay.cpp",
|
||||
"CoreParameter.cpp",
|
||||
"CoreRerecording.cpp",
|
||||
"CoreTiming.cpp",
|
||||
"Frame.cpp",
|
||||
"OnFrame.cpp",
|
||||
"Host.cpp",
|
||||
"MemTools.cpp",
|
||||
"PatchEngine.cpp",
|
||||
|
Reference in New Issue
Block a user