improved automatic frame-skipping (fixes Virtua Racing on Gamecube)

This commit is contained in:
ekeeke31 2010-05-25 07:34:02 +00:00
parent e2366f81a9
commit 70ef2fc20b
2 changed files with 14 additions and 7 deletions

View File

@ -1288,6 +1288,7 @@ void gx_video_Stop(void)
VIDEO_Configure(vmode);
/* starts menu rendering */
gxClearScreen((GXColor)BLACK);
gxDrawScreenshot(0xff);
gxSetScreen();
}

View File

@ -334,6 +334,7 @@ int main (int argc, char *argv[])
#endif
/* main emulation loop */
int skip = 0;
while (1)
{
/* Main Menu request */
@ -350,23 +351,20 @@ int main (int argc, char *argv[])
/* start video & audio */
gx_audio_Start();
gx_video_Start();
frameticker = 1;
skip = 0;
}
if (frameticker > 1)
frameticker = 0;
if (skip)
{
/* skip frame */
system_frame(1);
--frameticker;
skip = 0;
}
else
{
while (frameticker < 1)
usleep(10);
/* render frame */
system_frame(0);
--frameticker;
/* update video */
gx_video_Update();
@ -374,6 +372,14 @@ int main (int argc, char *argv[])
/* update audio */
gx_audio_Update();
/* wait for next frame */
while (frameticker < 1)
usleep(1);
/* automatic frame skipping */
if (frameticker > 1)
skip = 1;
}
return 0;