fix new BSNES with subbsnes

fixes 22e35c45fc
This commit is contained in:
CasualPokePlayer 2023-04-01 01:26:38 -07:00
parent 22e35c45fc
commit a31ecb7c0f
3 changed files with 4 additions and 3 deletions

View File

@ -34,6 +34,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
IsLagFrame = true; IsLagFrame = true;
// run the core for one frame // run the core for one frame
Api.core.snes_run(false); Api.core.snes_run(false);
AdvanceRtc();
FrameAdvancePost(); FrameAdvancePost();
return true; return true;
@ -55,7 +56,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
int numSamples = UpdateAudioBuffer(); int numSamples = UpdateAudioBuffer();
_soundProvider.PutSamples(_audioBuffer, numSamples / 2); _soundProvider.PutSamples(_audioBuffer, numSamples / 2);
Frame++; Frame++;
AdvanceRtc();
if (IsLagFrame) if (IsLagFrame)
{ {

View File

@ -348,10 +348,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
private long _clockTime; private long _clockTime;
private int _clockRemainder; private int _clockRemainder;
protected void InitializeRtc(DateTime start) private void InitializeRtc(DateTime start)
=> _clockTime = (long)(start - _epoch).TotalSeconds; => _clockTime = (long)(start - _epoch).TotalSeconds;
private void AdvanceRtc() internal void AdvanceRtc()
{ {
_clockRemainder += VsyncDenominator; _clockRemainder += VsyncDenominator;
if (_clockRemainder >= VsyncNumerator) if (_clockRemainder >= VsyncNumerator)

View File

@ -81,6 +81,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
} }
if (!framePassed) _bsnesCore.IsLagFrame = false; if (!framePassed) _bsnesCore.IsLagFrame = false;
if (framePassed) _bsnesCore.AdvanceRtc();
_bsnesCore.FrameAdvancePost(); _bsnesCore.FrameAdvancePost();
return true; return true;