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)
{
unmountRequired[device] = true;
if(silent) break;
retry = ErrorPromptRetry("Error saving file!");
}
}

View File

@ -1377,11 +1377,13 @@ static int MenuGame()
#endif
w.SetEffect(EFFECT_FADE, 15);
AutoSave();
}
ResumeGui();
if(lastMenu == MENU_NONE)
AutoSave();
while(menu == MENU_NONE)
{
usleep(THREAD_SLEEP);
@ -3825,7 +3827,7 @@ MainMenu (int menu)
mainWindow->Append(gameScreenImg);
bgImg->SetVisible(false);
}
GuiTrigger trigA;
if(GCSettings.WiimoteOrientation)
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
@ -3937,10 +3939,6 @@ MainMenu (int menu)
ShutoffRumble();
#endif
// wait for keys to be depressed
while(MenuRequested())
usleep(THREAD_SLEEP);
CancelAction();
HaltGui();
@ -3985,4 +3983,11 @@ MainMenu (int menu)
free(gameScreenTex2);
gameScreenTex2 = NULL;
}
// wait for keys to be depressed
while(MenuRequested())
{
UpdatePads();
usleep(THREAD_SLEEP);
}
}

View File

@ -690,6 +690,9 @@ update_video (int width, int height)
{
vwidth = width;
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
while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE))
@ -697,10 +700,10 @@ update_video (int width, int height)
whichfb ^= 1;
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;
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;