mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-05 02:15:07 +01:00
improved automatic frame-skipping (fixes Virtua Racing on Gamecube)
This commit is contained in:
parent
e2366f81a9
commit
70ef2fc20b
@ -1288,6 +1288,7 @@ void gx_video_Stop(void)
|
||||
VIDEO_Configure(vmode);
|
||||
|
||||
/* starts menu rendering */
|
||||
gxClearScreen((GXColor)BLACK);
|
||||
gxDrawScreenshot(0xff);
|
||||
gxSetScreen();
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user