Fixed the global saveType from getting clobbered.

This commit is contained in:
skidau 2015-04-18 14:28:38 +00:00
parent 5a9015b3f0
commit f2b22ad484
4 changed files with 17 additions and 19 deletions

View File

@ -472,7 +472,6 @@ void LoadConfig()
recentFreeze = ReadPref("recentFreeze", false) ? true : false;
autoPatch = ReadPref("autoPatch", 1) == 1 ? true : false;
cpuDisableSfx = ReadPref("disableSfx", 0) ? true : false;
saveType = ReadPref("saveType", 0);
ifbType = ReadPref("ifbType", 0);
winFlashSize = ReadPref("flashSize", 0x10000);
agbPrintEnable(ReadPref("agbPrint", 0) ? true : false);

View File

@ -522,7 +522,6 @@ bool MainWnd::FileRun()
flashSetSize(winFlashSize);
rtcEnable(rtcEnabled);
cpuSaveType = saveType;
if (cpuSaveType == 0)
utilGBAFindSave(theApp.romSize);

View File

@ -710,62 +710,62 @@ void MainWnd::OnUpdateOptionsEmulatorShowSpeed(CCmdUI *pCmdUI)
void MainWnd::OnOptionsEmulatorSavetypeAutomatic()
{
saveType = 0;
cpuSaveType = 0;
}
void MainWnd::OnUpdateOptionsEmulatorSavetypeAutomatic(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(saveType == 0);
pCmdUI->SetCheck(cpuSaveType == 0);
}
void MainWnd::OnOptionsEmulatorSavetypeEeprom()
{
saveType = 1;
cpuSaveType = 1;
}
void MainWnd::OnUpdateOptionsEmulatorSavetypeEeprom(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(saveType == 1);
pCmdUI->SetCheck(cpuSaveType == 1);
}
void MainWnd::OnOptionsEmulatorSavetypeSram()
{
saveType = 2;
cpuSaveType = 2;
}
void MainWnd::OnUpdateOptionsEmulatorSavetypeSram(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(saveType == 2);
pCmdUI->SetCheck(cpuSaveType == 2);
}
void MainWnd::OnOptionsEmulatorSavetypeFlash()
{
saveType = 3;
cpuSaveType = 3;
}
void MainWnd::OnUpdateOptionsEmulatorSavetypeFlash(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(saveType == 3);
pCmdUI->SetCheck(cpuSaveType == 3);
}
void MainWnd::OnOptionsEmulatorSavetypeEepromsensor()
{
saveType = 4;
cpuSaveType = 4;
}
void MainWnd::OnUpdateOptionsEmulatorSavetypeEepromsensor(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(saveType == 4);
pCmdUI->SetCheck(cpuSaveType == 4);
}
void MainWnd::OnOptionsEmulatorSavetypeNone()
{
saveType = 5;
cpuSaveType = 5;
}
void MainWnd::OnUpdateOptionsEmulatorSavetypeNone(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(saveType == 5);
pCmdUI->SetCheck(cpuSaveType == 5);
}
void MainWnd::OnOptionsEmulatorSavetypeFlash512k()

View File

@ -250,7 +250,7 @@ VBA::VBA()
winGbBorderOn = 0;
winFlashSize = 0x20000;
rtcEnabled = false;
saveType = 0;
cpuSaveType = 0;
rewindMemory = NULL;
rewindPos = 0;
rewindTopPos = 0;
@ -1574,9 +1574,9 @@ void VBA::loadSettings()
cpuDisableSfx = regQueryDwordValue("disableSfx", 0) ? true : false;
saveType = regQueryDwordValue("saveType", 0);
if(saveType < 0 || saveType > 5)
saveType = 0;
cpuSaveType = regQueryDwordValue("saveType", 0);
if(cpuSaveType < 0 || cpuSaveType > 5)
cpuSaveType = 0;
ifbType = (IFBFilter)regQueryDwordValue("ifbType", 0);
if(ifbType < 0 || ifbType > 2)
@ -2578,7 +2578,7 @@ void VBA::saveSettings()
regSetDwordValue("disableSfx", cpuDisableSfx);
regSetDwordValue("saveType", saveType);
regSetDwordValue("saveType", cpuSaveType);
regSetDwordValue("ifbType", ifbType);