mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2025-01-28 02:45:27 +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);
|
VIDEO_Configure(vmode);
|
||||||
|
|
||||||
/* starts menu rendering */
|
/* starts menu rendering */
|
||||||
|
gxClearScreen((GXColor)BLACK);
|
||||||
gxDrawScreenshot(0xff);
|
gxDrawScreenshot(0xff);
|
||||||
gxSetScreen();
|
gxSetScreen();
|
||||||
}
|
}
|
||||||
|
@ -334,6 +334,7 @@ int main (int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* main emulation loop */
|
/* main emulation loop */
|
||||||
|
int skip = 0;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
/* Main Menu request */
|
/* Main Menu request */
|
||||||
@ -350,23 +351,20 @@ int main (int argc, char *argv[])
|
|||||||
/* start video & audio */
|
/* start video & audio */
|
||||||
gx_audio_Start();
|
gx_audio_Start();
|
||||||
gx_video_Start();
|
gx_video_Start();
|
||||||
frameticker = 1;
|
skip = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frameticker > 1)
|
frameticker = 0;
|
||||||
|
if (skip)
|
||||||
{
|
{
|
||||||
/* skip frame */
|
/* skip frame */
|
||||||
system_frame(1);
|
system_frame(1);
|
||||||
--frameticker;
|
skip = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (frameticker < 1)
|
|
||||||
usleep(10);
|
|
||||||
|
|
||||||
/* render frame */
|
/* render frame */
|
||||||
system_frame(0);
|
system_frame(0);
|
||||||
--frameticker;
|
|
||||||
|
|
||||||
/* update video */
|
/* update video */
|
||||||
gx_video_Update();
|
gx_video_Update();
|
||||||
@ -374,6 +372,14 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
/* update audio */
|
/* update audio */
|
||||||
gx_audio_Update();
|
gx_audio_Update();
|
||||||
|
|
||||||
|
/* wait for next frame */
|
||||||
|
while (frameticker < 1)
|
||||||
|
usleep(1);
|
||||||
|
|
||||||
|
/* automatic frame skipping */
|
||||||
|
if (frameticker > 1)
|
||||||
|
skip = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user