fix some hangs

This commit is contained in:
dborth 2010-04-13 05:17:30 +00:00
parent f8823d6215
commit f2286d213b
3 changed files with 17 additions and 8 deletions

View File

@ -869,6 +869,7 @@ SaveFile (char * buffer, char *filepath, size_t datasize, bool silent)
if(!written) if(!written)
{ {
unmountRequired[device] = true; unmountRequired[device] = true;
if(silent) break;
retry = ErrorPromptRetry("Error saving file!"); retry = ErrorPromptRetry("Error saving file!");
} }
} }

View File

@ -1377,11 +1377,13 @@ static int MenuGame()
#endif #endif
w.SetEffect(EFFECT_FADE, 15); w.SetEffect(EFFECT_FADE, 15);
AutoSave();
} }
ResumeGui(); ResumeGui();
if(lastMenu == MENU_NONE)
AutoSave();
while(menu == MENU_NONE) while(menu == MENU_NONE)
{ {
usleep(THREAD_SLEEP); usleep(THREAD_SLEEP);
@ -3937,10 +3939,6 @@ MainMenu (int menu)
ShutoffRumble(); ShutoffRumble();
#endif #endif
// wait for keys to be depressed
while(MenuRequested())
usleep(THREAD_SLEEP);
CancelAction(); CancelAction();
HaltGui(); HaltGui();
@ -3985,4 +3983,11 @@ MainMenu (int menu)
free(gameScreenTex2); free(gameScreenTex2);
gameScreenTex2 = NULL; gameScreenTex2 = NULL;
} }
// wait for keys to be depressed
while(MenuRequested())
{
UpdatePads();
usleep(THREAD_SLEEP);
}
} }

View File

@ -691,6 +691,9 @@ update_video (int width, int height)
vwidth = width; vwidth = width;
vheight = height; vheight = height;
if(IPPU.RenderedFramesCount == prevRenderedFrameCount)
return; // we haven't rendered any frames yet, so we can't draw anything!
// Ensure previous vb has complete // Ensure previous vb has complete
while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE)) while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE))
usleep (50); usleep (50);
@ -700,7 +703,7 @@ update_video (int width, int height)
if (oldvheight != vheight || oldvwidth != vwidth) // if rendered width/height changes, update scaling if (oldvheight != vheight || oldvwidth != vwidth) // if rendered width/height changes, update scaling
CheckVideo = 1; CheckVideo = 1;
if ( CheckVideo && (IPPU.RenderedFramesCount != prevRenderedFrameCount) ) // if we get back from the menu, and have rendered at least 1 frame if (CheckVideo) // if we get back from the menu, and have rendered at least 1 frame
{ {
int xscale, yscale; int xscale, yscale;