mirror of
https://github.com/dborth/fceugx.git
synced 2024-10-31 22:45:05 +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
42e0f52d98
commit
e5956294d2
@ -92,8 +92,16 @@ static void ExitCleanup()
|
||||
|
||||
void ExitApp()
|
||||
{
|
||||
SavePrefs(SILENT);
|
||||
|
||||
if (romLoaded && !ConfigRequested && GCSettings.AutoSave == 1)
|
||||
SaveRAMAuto(GCSettings.SaveMethod, SILENT);
|
||||
|
||||
ExitCleanup();
|
||||
|
||||
if(ShutdownRequested)
|
||||
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
|
||||
|
||||
#ifdef HW_RVL
|
||||
if(GCSettings.ExitAction == 0) // Auto
|
||||
{
|
||||
@ -140,18 +148,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
|
||||
@ -348,6 +350,11 @@ int main(int argc, char *argv[])
|
||||
ResetVideo_Menu();
|
||||
break;
|
||||
}
|
||||
#ifdef HW_RVL
|
||||
if(ShutdownRequested)
|
||||
ExitApp();
|
||||
#endif
|
||||
|
||||
} // emulation loop
|
||||
} // main loop
|
||||
}
|
||||
|
@ -533,6 +533,7 @@ int BrowserChangeFolder(int method)
|
||||
return -1;
|
||||
|
||||
CleanupPath(browser.dir);
|
||||
strcpy(GCSettings.LoadFolder, browser.dir);
|
||||
|
||||
switch (method)
|
||||
{
|
||||
|
@ -287,13 +287,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);
|
||||
@ -462,6 +456,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
|
||||
@ -490,6 +487,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
|
||||
|
||||
@ -1939,7 +1939,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);
|
||||
@ -1959,9 +1958,6 @@ static int MenuGameSettings()
|
||||
}
|
||||
}
|
||||
|
||||
if(menu == MENU_GAME)
|
||||
SavePrefs(NOTSILENT);
|
||||
|
||||
HaltGui();
|
||||
|
||||
mainWindow->Remove(&w);
|
||||
@ -3175,9 +3171,6 @@ static int MenuSettings()
|
||||
}
|
||||
}
|
||||
|
||||
if(menu == MENU_GAMESELECTION)
|
||||
SavePrefs(NOTSILENT);
|
||||
|
||||
HaltGui();
|
||||
mainWindow->Remove(&w);
|
||||
return menu;
|
||||
|
Loading…
Reference in New Issue
Block a user