Some turbo speed refactorings - added a new hotkey for turbo mapped to shift+tab, rennamed the original turbo as unthrottle (since it is simply a toggle for this feature) and removed its mapping. On the new turbo, lots of various things will eventually be in place, but right now it bypasses tool updating. Still todo: have it max out frame skip and whatnot, also what is the difference between unthrottle and the limit framerate option? I think these should be merged.

This commit is contained in:
adelikat 2012-08-28 01:29:07 +00:00
parent c4afd9f393
commit ebf029b76d
4 changed files with 652 additions and 608 deletions

View File

@ -421,7 +421,8 @@ namespace BizHawk.MultiClient
public string RewindBinding = "Shift+R, J1 B5";
public string EmulatorPauseBinding = "Pause";
public string FrameAdvanceBinding = "F";
public string TurboBinding = "Shift+Tab";
public string TurboBinding = "";
public string MaxTurboBinding = "Shift+Tab";
public string ScreenshotBinding = "F12";
public string ToggleFullscreenBinding = "Alt+Return";
public string QuickSave = "I";

View File

@ -61,6 +61,7 @@ namespace BizHawk.MultiClient
Throttle throttle;
bool unthrottled = false;
bool maxturbo = false;
//For handling automatic pausing when entering the menu
private bool wasPaused = false;
@ -398,7 +399,7 @@ namespace BizHawk.MultiClient
void SyncThrottle()
{
bool fastforward = Global.ClientControls["Fast Forward"] || FastForward;
bool fastforward = Global.ClientControls["Fast Forward"] || FastForward || Global.ClientControls["MaxTurbo"];
Global.ForceNoVsync = unthrottled || fastforward;
// realtime throttle is never going to be so exact that using a double here is wrong
@ -535,7 +536,7 @@ namespace BizHawk.MultiClient
{
Name = "Emulator Frontend Controls",
BoolButtons = { "Fast Forward", "Rewind", "Hard Reset", "Mode Flip", "Quick Save State", "Quick Load State", "Save Named State", "Load Named State",
"Emulator Pause", "Frame Advance", "Unthrottle", "Screenshot", "Toggle Fullscreen", "SelectSlot0", "SelectSlot1", "SelectSlot2", "SelectSlot3", "SelectSlot4",
"Emulator Pause", "Frame Advance", "Unthrottle", "MaxTurbo", "Screenshot", "Toggle Fullscreen", "SelectSlot0", "SelectSlot1", "SelectSlot2", "SelectSlot3", "SelectSlot4",
"SelectSlot5", "SelectSlot6", "SelectSlot7", "SelectSlot8", "SelectSlot9", "SaveSlot0", "SaveSlot1", "SaveSlot2", "SaveSlot3", "SaveSlot4",
"SaveSlot5","SaveSlot6","SaveSlot7","SaveSlot8","SaveSlot9","LoadSlot0","LoadSlot1","LoadSlot2","LoadSlot3","LoadSlot4","LoadSlot5","LoadSlot6",
"LoadSlot7","LoadSlot8","LoadSlot9", "ToolBox", "Previous Slot", "Next Slot", "Ram Watch", "Ram Search", "Ram Poke", "Hex Editor",
@ -558,6 +559,7 @@ namespace BizHawk.MultiClient
controls.BindMulti("Decrease Speed", Global.Config.DecreaseSpeedBinding);
controls.BindMulti("Toggle Background Input", Global.Config.ToggleBackgroundInput);
controls.BindMulti("Unthrottle", Global.Config.TurboBinding);
controls.BindMulti("MaxTurbo", Global.Config.MaxTurboBinding);
controls.BindMulti("Screenshot", Global.Config.ScreenshotBinding);
controls.BindMulti("Toggle Fullscreen", Global.Config.ToggleFullscreenBinding);
controls.BindMulti("Quick Save State", Global.Config.QuickSave);
@ -1882,18 +1884,23 @@ namespace BizHawk.MultiClient
bool genSound = false;
if (runFrame)
{
runloop_fps++;
bool ff = Global.ClientControls["Fast Forward"] || Global.ClientControls["MaxTurbo"];
bool fff = Global.ClientControls["MaxTurbo"];
bool updateFpsString = (runloop_last_ff != ff);
runloop_last_ff = ff;
//client input-related duties
Global.OSD.ClearGUIText();
UpdateToolsBefore();
if (!fff)
{
UpdateToolsBefore();
#if WINDOWS
LuaConsole1.ResumeScripts(true);
#endif
runloop_fps++;
bool ff = Global.ClientControls["Fast Forward"];
bool updateFpsString = (runloop_last_ff != ff);
runloop_last_ff = ff;
}
if ((DateTime.Now - runloop_second).TotalSeconds > 1)
{
@ -1906,7 +1913,14 @@ namespace BizHawk.MultiClient
if (updateFpsString)
{
string fps_string = runloop_last_fps + " fps";
if (ff) fps_string += " >>";
if (fff)
{
fps_string += " >>>>";
}
else if (ff)
{
fps_string += " >>";
}
Global.OSD.FPS = fps_string;
}
@ -1952,7 +1966,10 @@ namespace BizHawk.MultiClient
}
PressFrameAdvance = false;
UpdateToolsAfter();
if (!fff)
{
UpdateToolsAfter();
}
}
if (Global.ClientControls["Rewind"] || PressRewind)

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,7 @@ namespace BizHawk.MultiClient.tools
IDW_HARDRESET.SetBindings(Global.Config.HardResetBinding);
IDW_REWIND.SetBindings(Global.Config.RewindBinding);
IDW_UNTHROTTLE.SetBindings(Global.Config.TurboBinding);
IDW_MAXTURBO.SetBindings(Global.Config.MaxTurboBinding);
IDW_FASTFORWARD.SetBindings(Global.Config.FastForwardBinding);
IDW_SCREENSHOT.SetBindings(Global.Config.ScreenshotBinding);
IDW_FULLSCREEN.SetBindings(Global.Config.ToggleFullscreenBinding);
@ -124,6 +125,7 @@ namespace BizHawk.MultiClient.tools
Global.Config.HardResetBinding = IDW_HARDRESET.Text;
Global.Config.RewindBinding = IDW_REWIND.Text;
Global.Config.TurboBinding = IDW_UNTHROTTLE.Text;
Global.Config.MaxTurboBinding = IDW_MAXTURBO.Text;
Global.Config.EmulatorPauseBinding = IDW_PAUSE.Text;
Global.Config.ToggleFullscreenBinding = IDW_FULLSCREEN.Text;
Global.Config.ScreenshotBinding = IDW_SCREENSHOT.Text;