mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-01 08:25:18 +01:00
preferences now only saved on exit, RAM auto-saved on power off from within a game, last browser folder is now remembered
This commit is contained in:
parent
98625560d4
commit
815f2abd2f
@ -547,6 +547,7 @@ int BrowserChangeFolder(int method)
|
||||
return -1;
|
||||
|
||||
CleanupPath(browser.dir);
|
||||
strcpy(GCSettings.LoadFolder, browser.dir);
|
||||
|
||||
switch (method)
|
||||
{
|
||||
|
@ -302,13 +302,7 @@ UpdateGUI (void *arg)
|
||||
Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0, i},1);
|
||||
Menu_Render();
|
||||
}
|
||||
|
||||
if(ExitRequested)
|
||||
ExitApp();
|
||||
#ifdef HW_RVL
|
||||
else if(ShutdownRequested)
|
||||
ShutdownWii();
|
||||
#endif
|
||||
ExitApp();
|
||||
}
|
||||
}
|
||||
usleep(THREAD_SLEEP);
|
||||
@ -477,6 +471,9 @@ CancelAction()
|
||||
void
|
||||
ShowProgress (const char *msg, int done, int total)
|
||||
{
|
||||
if(!mainWindow)
|
||||
return;
|
||||
|
||||
if(total < (256*1024))
|
||||
return;
|
||||
else if(done > total) // this shouldn't happen
|
||||
@ -505,6 +502,9 @@ ShowProgress (const char *msg, int done, int total)
|
||||
void
|
||||
ShowAction (const char *msg)
|
||||
{
|
||||
if(!mainWindow)
|
||||
return;
|
||||
|
||||
if(showProgress != 0)
|
||||
CancelAction(); // wait for previous progress window to finish
|
||||
|
||||
@ -1950,7 +1950,6 @@ static int MenuGameSettings()
|
||||
else if(closeBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
menu = MENU_EXIT;
|
||||
SavePrefs(NOTSILENT);
|
||||
|
||||
exitSound->Play();
|
||||
bgTopImg->SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 15);
|
||||
@ -1970,9 +1969,6 @@ static int MenuGameSettings()
|
||||
}
|
||||
}
|
||||
|
||||
if(menu == MENU_GAME)
|
||||
SavePrefs(NOTSILENT);
|
||||
|
||||
HaltGui();
|
||||
mainWindow->Remove(&w);
|
||||
return menu;
|
||||
@ -3214,9 +3210,6 @@ static int MenuSettings()
|
||||
}
|
||||
}
|
||||
|
||||
if(menu == MENU_GAMESELECTION)
|
||||
SavePrefs(NOTSILENT);
|
||||
|
||||
HaltGui();
|
||||
mainWindow->Remove(&w);
|
||||
return menu;
|
||||
|
@ -94,8 +94,16 @@ void ExitCleanup()
|
||||
|
||||
void ExitApp()
|
||||
{
|
||||
SavePrefs(SILENT);
|
||||
|
||||
if (SNESROMSize > 0 && !ConfigRequested && GCSettings.AutoSave == 1)
|
||||
SaveSRAMAuto(GCSettings.SaveMethod, SILENT);
|
||||
|
||||
ExitCleanup();
|
||||
|
||||
if(ShutdownRequested)
|
||||
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
|
||||
|
||||
#ifdef HW_RVL
|
||||
if(GCSettings.ExitAction == 0) // Auto
|
||||
{
|
||||
@ -142,18 +150,12 @@ void ExitApp()
|
||||
#ifdef HW_RVL
|
||||
void ShutdownCB()
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
ShutdownRequested = 1;
|
||||
}
|
||||
void ResetCB()
|
||||
{
|
||||
ResetRequested = 1;
|
||||
}
|
||||
void ShutdownWii()
|
||||
{
|
||||
ExitCleanup();
|
||||
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HW_DOL
|
||||
@ -276,6 +278,10 @@ emulate ()
|
||||
ResetVideo_Menu();
|
||||
break;
|
||||
}
|
||||
#ifdef HW_RVL
|
||||
if(ShutdownRequested)
|
||||
ExitApp();
|
||||
#endif
|
||||
} // emulation loop
|
||||
} // main loop
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user