Port over win32 runahead fixes to SDL (#1770)
* Port over win32 runahead fixes to SDL * Fix formatting
This commit is contained in:
parent
c46b16f225
commit
acea063357
|
@ -160,23 +160,40 @@ static int RunFrame(int bDraw, int bPause)
|
||||||
{
|
{
|
||||||
nFramesRendered++;
|
nFramesRendered++;
|
||||||
|
|
||||||
if (!bRunAhead || bAppDoFast) { // Run-Ahead feature -dink aug 02, 2021
|
if (!bRunAhead || (BurnDrvGetFlags() & BDF_RUNAHEAD_DISABLED) || bAppDoFast) { // Run-Ahead feature -dink aug 02, 2021
|
||||||
if (VidFrame()) { // Do one frame w/o RunAhead or if FFWD is pressed.
|
if (VidFrame()) { // Do one frame w/o RunAhead or if FFWD is pressed.
|
||||||
|
// VidFrame() failed, but we must run a driver frame because we have
|
||||||
|
// a clocked input. Possibly from recording or netplay(!)
|
||||||
|
// Note: VidFrame() calls BurnDrvFrame() on success.
|
||||||
|
pBurnDraw = NULL; // Make sure no image is drawn
|
||||||
|
BurnDrvFrame();
|
||||||
|
|
||||||
AudBlankSound();
|
AudBlankSound();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pBurnDraw = NULL; // Do one frame w/RunAhead
|
pBurnDraw = (BurnDrvGetFlags() & BDF_RUNAHEAD_DRAWSYNC) ? pVidImage : NULL;
|
||||||
BurnDrvFrame();
|
BurnDrvFrame();
|
||||||
StateRunAheadSave();
|
StateRunAheadSave();
|
||||||
pBurnSoundOut = NULL;
|
INT16 *pBurnSoundOut_temp = pBurnSoundOut;
|
||||||
VidFrame();
|
pBurnSoundOut = NULL;
|
||||||
StateRunAheadLoad();
|
nCurrentFrame++;
|
||||||
|
bBurnRunAheadFrame = 1;
|
||||||
|
|
||||||
|
if (VidFrame()) {
|
||||||
|
// VidFrame() failed, but we must run a driver frame because we have
|
||||||
|
// an input. Possibly from recording or netplay(!)
|
||||||
|
pBurnDraw = NULL; // Make sure no image is drawn, since video failed this time 'round.
|
||||||
|
BurnDrvFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
bBurnRunAheadFrame = 0;
|
||||||
|
nCurrentFrame--;
|
||||||
|
StateRunAheadLoad();
|
||||||
|
pBurnSoundOut = pBurnSoundOut_temp; // restore pointer, for wav & avi writer
|
||||||
}
|
}
|
||||||
|
|
||||||
VidPaint(0); // paint the screen (no need to validate)
|
VidPaint(0); // paint the screen (no need to validate)
|
||||||
}
|
} else { // frame skipping
|
||||||
else
|
|
||||||
{ // frame skipping
|
|
||||||
pBurnDraw = NULL; // Make sure no image is drawn
|
pBurnDraw = NULL; // Make sure no image is drawn
|
||||||
BurnDrvFrame();
|
BurnDrvFrame();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue