Add a hotkey for disabling the framelimit.
Atm this is hardcoded to '\t'.
This commit is contained in:
parent
a40ea4e26a
commit
8483811b39
|
@ -7,7 +7,7 @@
|
||||||
#include "Common/Atomic.h"
|
#include "Common/Atomic.h"
|
||||||
#include "Common/CPUDetect.h"
|
#include "Common/CPUDetect.h"
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
#include "Core/Host.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/HW/AudioInterface.h"
|
#include "Core/HW/AudioInterface.h"
|
||||||
#include "Core/HW/VideoInterface.h"
|
#include "Core/HW/VideoInterface.h"
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ void CMixer::PushSamples(const short *samples, unsigned int num_samples)
|
||||||
if (*PowerPC::GetStatePtr() != PowerPC::CPU_RUNNING || soundStream->IsMuted())
|
if (*PowerPC::GetStatePtr() != PowerPC::CPU_RUNNING || soundStream->IsMuted())
|
||||||
break;
|
break;
|
||||||
// Shortcut key for Throttle Skipping
|
// Shortcut key for Throttle Skipping
|
||||||
if (Host_GetKeyState('\t'))
|
if (Core::IsFramelimiterTempDisabled)
|
||||||
break;
|
break;
|
||||||
SLEEP(1);
|
SLEEP(1);
|
||||||
soundStream->Update();
|
soundStream->Update();
|
||||||
|
|
|
@ -71,6 +71,7 @@ static const struct
|
||||||
{ "ToggleAspectRatio", 0, 0 /* wxMOD_NONE */ },
|
{ "ToggleAspectRatio", 0, 0 /* wxMOD_NONE */ },
|
||||||
{ "ToggleEFBCopies", 0, 0 /* wxMOD_NONE */ },
|
{ "ToggleEFBCopies", 0, 0 /* wxMOD_NONE */ },
|
||||||
{ "ToggleFog", 0, 0 /* wxMOD_NONE */ },
|
{ "ToggleFog", 0, 0 /* wxMOD_NONE */ },
|
||||||
|
{ "ToggleThrottle", 9 /* '\t' */, 0 /* wxMOD_NONE */ },
|
||||||
{ "IncreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
|
{ "IncreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
|
||||||
{ "DecreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
|
{ "DecreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
|
||||||
{ "LoadStateSlot1", 340 /* WXK_F1 */, 0 /* wxMOD_NONE */ },
|
{ "LoadStateSlot1", 340 /* WXK_F1 */, 0 /* wxMOD_NONE */ },
|
||||||
|
|
|
@ -90,7 +90,7 @@ static bool g_requestRefreshInfo = false;
|
||||||
static int g_pauseAndLockDepth = 0;
|
static int g_pauseAndLockDepth = 0;
|
||||||
|
|
||||||
SCoreStartupParameter g_CoreStartupParameter;
|
SCoreStartupParameter g_CoreStartupParameter;
|
||||||
bool isTabPressed = false;
|
bool IsFramelimiterTempDisabled = false;
|
||||||
|
|
||||||
std::string GetStateFileName() { return g_stateFileName; }
|
std::string GetStateFileName() { return g_stateFileName; }
|
||||||
void SetStateFileName(std::string val) { g_stateFileName = val; }
|
void SetStateFileName(std::string val) { g_stateFileName = val; }
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace Core
|
||||||
// TODO: kill, use SConfig instead
|
// TODO: kill, use SConfig instead
|
||||||
extern SCoreStartupParameter g_CoreStartupParameter;
|
extern SCoreStartupParameter g_CoreStartupParameter;
|
||||||
|
|
||||||
extern bool isTabPressed;
|
extern bool IsFramelimiterTempDisabled;
|
||||||
|
|
||||||
void Callback_VideoCopiedToXFB(bool video_update);
|
void Callback_VideoCopiedToXFB(bool video_update);
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ enum Hotkey
|
||||||
HK_TOGGLE_AR,
|
HK_TOGGLE_AR,
|
||||||
HK_TOGGLE_EFBCOPIES,
|
HK_TOGGLE_EFBCOPIES,
|
||||||
HK_TOGGLE_FOG,
|
HK_TOGGLE_FOG,
|
||||||
|
HK_TOGGLE_THROTTLE,
|
||||||
|
|
||||||
HK_INCREASE_FRAME_LIMIT,
|
HK_INCREASE_FRAME_LIMIT,
|
||||||
HK_DECREASE_FRAME_LIMIT,
|
HK_DECREASE_FRAME_LIMIT,
|
||||||
|
|
|
@ -62,9 +62,9 @@ IPC_HLE_PERIOD: For the Wiimote this is the call schedule:
|
||||||
#include "Common/Timer.h"
|
#include "Common/Timer.h"
|
||||||
|
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
|
#include "Core/Core.h"
|
||||||
#include "Core/CoreTiming.h"
|
#include "Core/CoreTiming.h"
|
||||||
#include "Core/DSPEmulator.h"
|
#include "Core/DSPEmulator.h"
|
||||||
#include "Core/Host.h"
|
|
||||||
#include "Core/PatchEngine.h"
|
#include "Core/PatchEngine.h"
|
||||||
#include "Core/HW/AudioInterface.h"
|
#include "Core/HW/AudioInterface.h"
|
||||||
#include "Core/HW/DSP.h"
|
#include "Core/HW/DSP.h"
|
||||||
|
@ -237,7 +237,8 @@ void ThrottleCallback(u64 last_time, int cyclesLate)
|
||||||
u32 time = Common::Timer::GetTimeMs();
|
u32 time = Common::Timer::GetTimeMs();
|
||||||
|
|
||||||
int diff = (u32)last_time - time;
|
int diff = (u32)last_time - time;
|
||||||
bool frame_limiter = SConfig::GetInstance().m_Framelimit && SConfig::GetInstance().m_Framelimit != 2 && !Host_GetKeyState('\t');
|
const SConfig& config = SConfig::GetInstance();
|
||||||
|
bool frame_limiter = config.m_Framelimit && config.m_Framelimit != 2 && !Core::IsFramelimiterTempDisabled;
|
||||||
u32 next_event = GetTicksPerSecond()/1000;
|
u32 next_event = GetTicksPerSecond()/1000;
|
||||||
if (SConfig::GetInstance().m_Framelimit > 2)
|
if (SConfig::GetInstance().m_Framelimit > 2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -940,6 +940,10 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||||
OSDChoice = 4;
|
OSDChoice = 4;
|
||||||
g_Config.bDisableFog = !g_Config.bDisableFog;
|
g_Config.bDisableFog = !g_Config.bDisableFog;
|
||||||
}
|
}
|
||||||
|
else if (IsHotkey(event, HK_TOGGLE_THROTTLE))
|
||||||
|
{
|
||||||
|
Core::IsFramelimiterTempDisabled = true;
|
||||||
|
}
|
||||||
else if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
|
else if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
|
||||||
{
|
{
|
||||||
if (++SConfig::GetInstance().m_Framelimit > 0x19)
|
if (++SConfig::GetInstance().m_Framelimit > 0x19)
|
||||||
|
@ -1040,7 +1044,18 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||||
|
|
||||||
void CFrame::OnKeyUp(wxKeyEvent& event)
|
void CFrame::OnKeyUp(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
event.Skip();
|
if(Core::GetState() != Core::CORE_UNINITIALIZED &&
|
||||||
|
(RendererHasFocus() || TASInputHasFocus()))
|
||||||
|
{
|
||||||
|
if (IsHotkey(event, HK_TOGGLE_THROTTLE))
|
||||||
|
{
|
||||||
|
Core::IsFramelimiterTempDisabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrame::OnMouse(wxMouseEvent& event)
|
void CFrame::OnMouse(wxMouseEvent& event)
|
||||||
|
|
|
@ -233,6 +233,7 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
|
||||||
_("Toggle Aspect Ratio"),
|
_("Toggle Aspect Ratio"),
|
||||||
_("Toggle EFB Copies"),
|
_("Toggle EFB Copies"),
|
||||||
_("Toggle Fog"),
|
_("Toggle Fog"),
|
||||||
|
_("Toggle Frame limit"),
|
||||||
_("Increase Frame limit"),
|
_("Increase Frame limit"),
|
||||||
_("Decrease Frame limit"),
|
_("Decrease Frame limit"),
|
||||||
|
|
||||||
|
|
|
@ -276,5 +276,5 @@ void VideoConfig::Save(const std::string& ini_file)
|
||||||
|
|
||||||
bool VideoConfig::IsVSync()
|
bool VideoConfig::IsVSync()
|
||||||
{
|
{
|
||||||
return Core::isTabPressed ? false : bVSync;
|
return Core::IsFramelimiterTempDisabled ? false : bVSync;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue