Remove duplicate variable `winFlashSize`.
We already had `optFlashSize` for both SDL and WX ports. We assigned this variable to replace all ocurrences of `winFlashSize`. As a side note, this entire scope could/should be replaced by a better auto-detect system for saving types. At the moment, it is only really useful for the SDL port, since we have overrides for the WX port. - Fix #585.
This commit is contained in:
parent
8d62a790e3
commit
7bac34eda4
|
@ -248,7 +248,6 @@ int windowMaximized;
|
|||
int windowPositionX, bkpPosX = 0;
|
||||
int windowPositionY, bkpPosY = 0;
|
||||
uint32_t windowWidth;
|
||||
int winFlashSize;
|
||||
int winGbBorderOn;
|
||||
int winGbPrinterEnabled;
|
||||
int winPauseNextFrame;
|
||||
|
@ -534,7 +533,7 @@ void LoadConfig()
|
|||
maxScale = ReadPref("maxScale", 0);
|
||||
movieRecordDir = ReadPrefString("movieRecordDir");
|
||||
openGL = ReadPrefHex("openGL");
|
||||
optFlashSize = ReadPrefHex("flashSize");
|
||||
optFlashSize = ReadPref("flashSize", 0);
|
||||
pauseWhenInactive = ReadPref("pauseWhenInactive", 1);
|
||||
recentFreeze = ReadPref("recentFreeze", 0);
|
||||
rewindTimer = ReadPref("rewindTimer", 0);
|
||||
|
@ -569,7 +568,6 @@ void LoadConfig()
|
|||
windowPositionX = ReadPref("windowX", -1);
|
||||
windowPositionY = ReadPref("windowY", -1);
|
||||
windowWidth = ReadPref("windowWidth", 0);
|
||||
winFlashSize = ReadPref("flashSize", 0x10000);
|
||||
winGbBorderOn = ReadPref("borderOn", 0);
|
||||
winGbPrinterEnabled = ReadPref("gbPrinter", 0);
|
||||
|
||||
|
@ -1334,6 +1332,8 @@ int ReadOpts(int argc, char ** argv)
|
|||
// --opt-flash-size
|
||||
if (optarg) {
|
||||
optFlashSize = atoi(optarg);
|
||||
if (optFlashSize < 0 || optFlashSize > 1)
|
||||
optFlashSize = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -139,7 +139,6 @@ extern int windowMaximized;
|
|||
extern int windowPositionX, bkpPosX;
|
||||
extern int windowPositionY, bkpPosY;
|
||||
extern uint32_t windowWidth;
|
||||
extern int winFlashSize;
|
||||
extern int winGbBorderOn;
|
||||
extern int winGbPrinterEnabled;
|
||||
extern int winPauseNextFrame;
|
||||
|
|
|
@ -3597,7 +3597,7 @@ bool MainFrame::BindControls()
|
|||
/// System and peripherals
|
||||
ch = GetValidatedChild<wxChoice, wxGenericValidator>(d, "SaveType", wxGenericValidator(&cpuSaveType));
|
||||
BatConfigHandler.type = ch;
|
||||
ch = GetValidatedChild<wxChoice, wxGenericValidator>(d, "FlashSize", wxGenericValidator(&winFlashSize));
|
||||
ch = GetValidatedChild<wxChoice, wxGenericValidator>(d, "FlashSize", wxGenericValidator(&optFlashSize));
|
||||
BatConfigHandler.size = ch;
|
||||
d->Connect(XRCID("SaveType"), wxEVT_COMMAND_CHOICE_SELECTED,
|
||||
wxCommandEventHandler(BatConfig_t::ChangeType),
|
||||
|
|
|
@ -569,7 +569,7 @@ void load_opts()
|
|||
cfg->Read(opt.opt, &opt.curint, *opt.intopt);
|
||||
|
||||
if (opt.curint < opt.min || opt.curint > opt.max) {
|
||||
wxLogWarning(_("Invalid value %d for option %s; valid values are %d - %d"), opt.curint, opt.opt.c_str(), opt.min, opt.max);
|
||||
wxLogWarning(_("Invalid value %d for option %s; valid values are %d - %d"), opt.curint, opt.opt.c_str(), int(opt.min), int(opt.max));
|
||||
} else
|
||||
*opt.intopt = opt.curint;
|
||||
} else if (opt.doubleopt) {
|
||||
|
|
|
@ -241,7 +241,7 @@ void GameArea::LoadGame(const wxString& name)
|
|||
int fsz = cfg->Read(wxT("flashSize"), (long)0);
|
||||
|
||||
if (fsz != 0x10000 && fsz != 0x20000)
|
||||
fsz = 0x10000 << winFlashSize;
|
||||
fsz = 0x10000 << optFlashSize;
|
||||
|
||||
flashSetSize(fsz);
|
||||
ovSaveType = cfg->Read(wxT("saveType"), cpuSaveType);
|
||||
|
@ -258,7 +258,7 @@ void GameArea::LoadGame(const wxString& name)
|
|||
cfg->SetPath(wxT("/"));
|
||||
} else {
|
||||
rtcEnable(rtcEnabled);
|
||||
flashSetSize(0x10000 << winFlashSize);
|
||||
flashSetSize(0x10000 << optFlashSize);
|
||||
|
||||
if (cpuSaveType < 0 || cpuSaveType > 5)
|
||||
cpuSaveType = 0;
|
||||
|
|
Loading…
Reference in New Issue