mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Just a few fixes for the fps counter, also unbreak direct XFB homebrews.
And a couple of fixes for the frameskip : disabled by default, can be set before launching a game, also safer to avoid lockup. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3950 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -604,9 +604,9 @@ void Callback_VideoCopiedToXFB(bool video_update)
|
||||
static u32 videoupd = 0;
|
||||
|
||||
if (video_update)
|
||||
videoupd += Frame::FrameSkippingFactor() + 1;
|
||||
videoupd++;
|
||||
else
|
||||
frames += Frame::FrameSkippingFactor() + 1;
|
||||
frames++;
|
||||
|
||||
// Custom frame limiter
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
#include "Core.h"
|
||||
#include "PluginManager.h"
|
||||
#include "Thread.h"
|
||||
|
||||
Common::CriticalSection cs_frameSkip;
|
||||
|
||||
namespace Frame {
|
||||
|
||||
@ -27,40 +30,48 @@ bool g_bAutoFire = false;
|
||||
u32 g_autoFirstKey = 0, g_autoSecondKey = 0;
|
||||
bool g_bFirstKey = true;
|
||||
|
||||
int g_framesToSkip = 1, g_frameSkipCounter = 0;
|
||||
int g_framesToSkip = 0, g_frameSkipCounter = 0;
|
||||
|
||||
void FrameUpdate() {
|
||||
if(g_bFrameStep)
|
||||
if (g_bFrameStep)
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
|
||||
if(g_bAutoFire)
|
||||
if (g_bAutoFire)
|
||||
g_bFirstKey = !g_bFirstKey;
|
||||
|
||||
if(g_framesToSkip)
|
||||
if (g_framesToSkip)
|
||||
FrameSkipping();
|
||||
else
|
||||
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(true);
|
||||
|
||||
}
|
||||
|
||||
void SetFrameSkipping(unsigned int framesToSkip) {
|
||||
cs_frameSkip.Enter();
|
||||
|
||||
g_framesToSkip = (int)framesToSkip;
|
||||
g_frameSkipCounter = 0;
|
||||
|
||||
cs_frameSkip.Leave();
|
||||
}
|
||||
|
||||
int FrameSkippingFactor() {
|
||||
return g_framesToSkip;
|
||||
}
|
||||
|
||||
void SetAutoHold(bool bEnabled, u32 keyToHold) {
|
||||
void SetAutoHold(bool bEnabled, u32 keyToHold)
|
||||
{
|
||||
g_bAutoFire = bEnabled;
|
||||
if(bEnabled)
|
||||
if (bEnabled)
|
||||
g_autoFirstKey = g_autoSecondKey = keyToHold;
|
||||
else
|
||||
g_autoFirstKey = g_autoSecondKey = 0;
|
||||
}
|
||||
|
||||
void SetAutoFire(bool bEnabled, u32 keyOne, u32 keyTwo) {
|
||||
void SetAutoFire(bool bEnabled, u32 keyOne, u32 keyTwo)
|
||||
{
|
||||
g_bAutoFire = bEnabled;
|
||||
if(bEnabled) {
|
||||
if (bEnabled) {
|
||||
g_autoFirstKey = keyOne;
|
||||
g_autoSecondKey = keyTwo;
|
||||
} else
|
||||
@ -77,10 +88,11 @@ void SetFrameStepping(bool bEnabled) {
|
||||
g_bFrameStep = bEnabled;
|
||||
}
|
||||
|
||||
void ModifyController(SPADStatus *PadStatus) {
|
||||
void ModifyController(SPADStatus *PadStatus)
|
||||
{
|
||||
u32 keyToPress = (g_bFirstKey) ? g_autoFirstKey : g_autoSecondKey;
|
||||
|
||||
if(!keyToPress)
|
||||
if (!keyToPress)
|
||||
return;
|
||||
|
||||
PadStatus->button |= keyToPress;
|
||||
@ -106,12 +118,17 @@ void ModifyController(SPADStatus *PadStatus) {
|
||||
|
||||
}
|
||||
|
||||
void FrameSkipping() {
|
||||
void FrameSkipping()
|
||||
{
|
||||
cs_frameSkip.Enter();
|
||||
|
||||
g_frameSkipCounter++;
|
||||
if(g_frameSkipCounter > g_framesToSkip)
|
||||
if (g_frameSkipCounter > g_framesToSkip)
|
||||
g_frameSkipCounter = 0;
|
||||
|
||||
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(!g_frameSkipCounter);
|
||||
|
||||
cs_frameSkip.Leave();
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -831,7 +831,9 @@ void CFrame::UpdateGUI()
|
||||
GetMenuBar()->FindItem(IDM_SCREENSHOT)->Enable(running || paused);
|
||||
m_pSubMenuLoad->Enable(initialized);
|
||||
m_pSubMenuSave->Enable(initialized);
|
||||
m_pSubMenuFrameSkipping->Enable(initialized);
|
||||
|
||||
// Let's enable it by default.
|
||||
//m_pSubMenuFrameSkipping->Enable(initialized);
|
||||
|
||||
// Misc
|
||||
GetMenuBar()->FindItem(IDM_CHANGEDISC)->Enable(initialized);
|
||||
|
Reference in New Issue
Block a user