d_guwange, small change to fix desynch while recording inputs and netplay

This commit is contained in:
dinkc64 2016-08-07 02:18:44 +00:00
parent 9a0ddbc646
commit 75f0044d45

View File

@ -28,6 +28,7 @@ static INT32 nCurrentCPU;
static INT32 nCyclesDone[2];
static INT32 nCyclesTotal[2];
static INT32 nCyclesSegment;
static INT32 nCyclesExtra;
static struct BurnInputInfo guwangeInputList[] = {
{"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"},
@ -286,6 +287,7 @@ static INT32 DrvDoReset()
nUnknownIRQ = 1;
nIRQPending = 0;
nCyclesExtra = 0;
HiscoreReset();
@ -391,7 +393,8 @@ static INT32 DrvFrame()
nCyclesSegment = nNext - nCyclesDone[nCurrentCPU];
if (!CheckSleep(nCurrentCPU)) { // See if this CPU is busywaiting
nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment);
nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment+nCyclesExtra);
nCyclesExtra = 0;
} else {
nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment);
}
@ -409,6 +412,7 @@ static INT32 DrvFrame()
}
}
}
nCyclesExtra = SekTotalCycles() - nCyclesTotal[0];
SekClose();