From 532a17a6969ca759d1fca79be6193e87afe1e498 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 9 May 2015 12:32:42 +0000 Subject: [PATCH] Combined the GBA and GB frameskip settings to go under Video Options. --- src/wx/cmdevents.cpp | 20 +++++----- src/wx/guiinit.cpp | 26 +++++-------- src/wx/opts.cpp | 5 +-- src/wx/panel.cpp | 4 +- src/wx/sys.cpp | 2 +- src/wx/xrc/DisplayConfig.xrc | 48 ++++++++++++++++++++++++ src/wx/xrc/GameBoyAdvanceConfig.xrc | 50 +------------------------ src/wx/xrc/GameBoyConfig.xrc | 57 +---------------------------- 8 files changed, 73 insertions(+), 139 deletions(-) diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index 8e130fcd..040b9884 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -1183,9 +1183,9 @@ EVT_HANDLER(Pause, "Pause (toggle)") else if(!IsPaused()) panel->Resume(); // undo next-frame's zeroing of frameskip - int fs = panel->game_type() == IMAGE_GB ? gbFrameSkip : frameSkip; - if(fs > 0) - systemFrameSkip = fs; + int fs = frameSkip; + if(fs >= 0) + systemFrameSkip = fs; } // new @@ -1870,9 +1870,6 @@ EVT_HANDLER(GameBoyConfigure, "Game Boy options...") } else panel->DelBorder(); } - // autoskip will self-adjust - if(gbFrameSkip >= 0) - systemFrameSkip = gbFrameSkip; // don't want to have to reset to change colors memcpy(gbPalette, &systemGbPalette[gbPaletteOption * 8], 8 * sizeof(systemGbPalette[0])); } @@ -1920,9 +1917,6 @@ EVT_HANDLER(GameBoyAdvanceConfigure, "Game Boy Advance options...") if(ShowModal(dlg) != wxID_OK) return; if(panel->game_type() == IMAGE_GBA) { - // autoskip will self-adjust - if(frameSkip >= 0) - systemFrameSkip = frameSkip; agbPrintEnable(agbPrint); wxString s = wxString((const char *)&rom[0xac], wxConvLibc, 4); wxFileConfig *cfg = wxGetApp().overrides; @@ -2035,6 +2029,10 @@ EVT_HANDLER_MASK(DisplayConfigure, "Display options...", CMDEN_NREC_ANY) wxDialog *dlg = GetXRCDialog("DisplayConfig"); if(ShowModal(dlg) != wxID_OK) return; + + if (frameSkip >= 0) + systemFrameSkip = frameSkip; + if(fs != fullScreen) { panel->ShowFullScreen(fullScreen); @@ -2288,9 +2286,9 @@ EVT_HANDLER(NoStatusMsg, "Disable on-screen status messages") update_opts(); } -EVT_HANDLER(FrameSkipAuto, "Skip frames. Values are 0-9 or -1 to skip automatically based on time.") +EVT_HANDLER(FrameSkipAuto, "Auto Skip frames.") { - GetMenuOptionInt("FrameSkipAuto", frameSkip, 1); + GetMenuOptionInt("FrameSkipAuto", autoFrameSkip, 1); update_opts(); } diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index 94c655c1..a3b85808 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -2828,14 +2828,6 @@ bool MainFrame::BindControls() // in command handler. Plus making changes might require resizing // game area. Validation only here. SafeXRCCTRL(d, "Borders"); - /// Speed - // AutoSkip/FrameSkip are 2 controls for 1 value. Needs post-process - // to ensure checkbox not ignored - getcbie("FrameSkipAuto", autoFrameSkip, -1); - getsc("FrameSkip", gbFrameSkip); - addbier(sc, true); - getlab("FrameSkipLab"); - addbier(lab, true); /// Boot ROM getfp("BootRom", gopts.gb_bios); getlab("BootRomLab"); @@ -2904,15 +2896,6 @@ bool MainFrame::BindControls() wxCommandEventHandler(BatConfig_t::Detect), NULL, &BatConfigHandler); - /// Speed - // AutoSkip/FrameSkip are 2 controls for 1 value. Needs post-process - // to ensure checkbox not ignored - //getcbie("FrameSkipAuto", autoFrameSkip, -1); - getsc("FrameSkip", frameSkip); - addbier(sc, true); - getlab("FrameSkipLab"); - addbier(lab, true); - /// Boot ROM getfp("BootRom", gopts.gba_bios); getlab("BootRomLab"); @@ -2930,6 +2913,15 @@ bool MainFrame::BindControls() d = LoadXRCropertySheetDialog("DisplayConfig"); { + /// Speed + // AutoSkip/FrameSkip are 2 controls for 1 value. Needs post-process + // to ensure checkbox not ignored + getsc("FrameSkip", frameSkip); + getlab("FrameSkipLab"); + int fs = frameSkip; + if (fs >= 0) + systemFrameSkip = fs; + /// On-Screen Display ch = GetValidatedChild(d, "SpeedIndicator", wxGenericValidator(&showSpeed)); /// Zoom diff --git a/src/wx/opts.cpp b/src/wx/opts.cpp index 13800f6a..ca2e43b1 100644 --- a/src/wx/opts.cpp +++ b/src/wx/opts.cpp @@ -190,6 +190,7 @@ opt_desc opts[] = { // Core INTOPT ("preferences/agbPrint", "AGBPrinter", wxTRANSLATE("Enable AGB debug print"), agbPrint, 0, 1), + INTOPT ("preferences/autoFrameSkip", "FrameSkipAuto", wxTRANSLATE("Auto skip frames."), autoFrameSkip, 0, 1), INTOPT ("preferences/autoPatch", "ApplyPatches", wxTRANSLATE("Apply IPS/UPS/IPF patches if found"), autoPatch, 0, 1), INTOPT ("preferences/autoSaveCheatList", "", wxTRANSLATE("Automatically save and load cheat list"), autoSaveLoadCheatList, 0, 1), INTOPT ("preferences/borderAutomatic", "", wxTRANSLATE("Automatically enable border for Super GameBoy games"), gbBorderAutomatic, 0, 1), @@ -202,13 +203,12 @@ opt_desc opts[] = { INTOPT ("preferences/disableStatus", "NoStatusMsg", wxTRANSLATE("Disable on-screen status messages"), disableStatusMessages, 0, 1), INTOPT ("preferences/emulatorType", "", wxTRANSLATE("Type of system to emulate"), gbEmulatorType, 0, 5), INTOPT ("preferences/flashSize", "", wxTRANSLATE("Flash size 0 = 64KB 1 = 128KB"), optFlashSize, 0, 1), - INTOPT ("preferences/frameSkip", "FrameSkipAuto", wxTRANSLATE("Skip frames. Values are 0-9 or -1 to skip automatically based on time."), frameSkip, -1, 9), + INTOPT ("preferences/frameSkip", "FrameSkip", wxTRANSLATE("Skip frames. Values are 0-9 or -1 to skip automatically based on time."), frameSkip, -1, 9), INTOPT ("preferences/fsColorDepth", "", wxTRANSLATE("Fullscreen mode color depth (0 = any)"), fsColorDepth, 0, 999), INTOPT ("preferences/fsFrequency", "", wxTRANSLATE("Fullscreen mode frequency (0 = any)"), fsFrequency, 0, 999), INTOPT ("preferences/fsHeight", "", wxTRANSLATE("Fullscreen mode height (0 = desktop)"), fsHeight, 0, 99999), INTOPT ("preferences/fsWidth", "", wxTRANSLATE("Fullscreen mode width (0 = desktop)"), fsWidth, 0, 99999), INTOPT ("preferences/fullScreen", "Fullscreen", wxTRANSLATE("Enter fullscreen mode at startup"), fullScreen, 0, 1), - INTOPT ("preferences/gbFrameSkip", "", wxTRANSLATE("Skip frames. Values are 0-9 or -1 to skip automatically based on time."), gbFrameSkip, -1, 9), INTOPT ("preferences/gbPaletteOption", "", wxTRANSLATE("The palette to use"), gbPaletteOption, 0, 2), INTOPT ("preferences/gbPrinter", "Printer", wxTRANSLATE("Enable printer emulation"), winGbPrinterEnabled, 0, 1), INTOPT ("preferences/gdbBreakOnLoad", "DebugGDBBreakOnLoad", wxTRANSLATE("Break into GDB after loading the game."), gdbBreakOnLoad, 0, 1), @@ -258,7 +258,6 @@ const int num_opts = sizeof(opts)/sizeof(opts[0]); opts_t::opts_t() { frameSkip = -1; - gbFrameSkip = -1; #ifdef __WXMSW__ audio_api = AUD_DIRECTSOUND; #endif diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index c5d5e17d..3ea4433e 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -285,9 +285,9 @@ void GameArea::LoadGame(const wxString &name) agbPrintEnable(agbPrint); // set frame skip based on ROM type - systemFrameSkip = loaded == IMAGE_GB ? gbFrameSkip : frameSkip; + systemFrameSkip = frameSkip; if(systemFrameSkip < 0) - systemFrameSkip = 0; + systemFrameSkip = 0; // load battery and/or saved state recompute_dirs(); diff --git a/src/wx/sys.cpp b/src/wx/sys.cpp index 3ac1b319..4b52d53f 100644 --- a/src/wx/sys.cpp +++ b/src/wx/sys.cpp @@ -316,7 +316,7 @@ int systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; void system10Frames(int rate) { GameArea *panel = wxGetApp().frame->GetPanel(); - int fs = panel->game_type() == IMAGE_GB ? gbFrameSkip : frameSkip; + int fs = frameSkip; if(fs < 0) { // I don't know why this algorithm isn't in common somewhere // as is, I copied it from SDL diff --git a/src/wx/xrc/DisplayConfig.xrc b/src/wx/xrc/DisplayConfig.xrc index d4dc1707..4450d871 100644 --- a/src/wx/xrc/DisplayConfig.xrc +++ b/src/wx/xrc/DisplayConfig.xrc @@ -6,6 +6,54 @@ wxVERTICAL + + + + wxVERTICAL + + + + + bold + + + wxALL + 5 + + + + wxVERTICAL + + wxALL|wxEXPAND + 5 + + wxHORIZONTAL + + + + + wxALL|wxALIGN_CENTRE_VERTICAL + 5 + + + + 0 + 9 + + + wxALL|wxEXPAND + 5 + + + + + wxALL|wxEXPAND + 5 + + + + + diff --git a/src/wx/xrc/GameBoyAdvanceConfig.xrc b/src/wx/xrc/GameBoyAdvanceConfig.xrc index d43efd53..11c6bf4e 100644 --- a/src/wx/xrc/GameBoyAdvanceConfig.xrc +++ b/src/wx/xrc/GameBoyAdvanceConfig.xrc @@ -74,55 +74,7 @@ - - - - - - wxVERTICAL - - - - - bold - - - wxALL - 5 - - - - wxVERTICAL - - wxALL|wxEXPAND - 5 - - wxHORIZONTAL - - - - - wxALL|wxALIGN_CENTRE_VERTICAL - 5 - - - - 0 - 9 - - - wxALL|wxEXPAND - 5 - - - - - wxALL|wxEXPAND - 5 - - - - + diff --git a/src/wx/xrc/GameBoyConfig.xrc b/src/wx/xrc/GameBoyConfig.xrc index 81fb5e84..165c34b8 100644 --- a/src/wx/xrc/GameBoyConfig.xrc +++ b/src/wx/xrc/GameBoyConfig.xrc @@ -69,62 +69,7 @@ - - - - - - wxVERTICAL - - - - - bold - - - wxALL - 5 - - - - wxVERTICAL - - - - - wxALL - 5 - - - wxALL|wxEXPAND - 5 - - wxHORIZONTAL - - - - - wxALL|wxALIGN_CENTRE_VERTICAL - 5 - - - - 0 - 9 - - - wxALL|wxEXPAND - 5 - - - - - wxALL|wxEXPAND - 5 - - - - +