Use system's canonical framerate for rewind duration estimate
This commit is contained in:
parent
f473db56c3
commit
3c3ab6578e
|
@ -950,7 +950,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void RewindOptionsMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!Emulator.HasSavestates()) return;
|
||||
using RewindConfig form = new(Config, CreateRewinder, () => this.Rewinder, Emulator.AsStatable());
|
||||
using RewindConfig form = new(
|
||||
Config,
|
||||
PlatformFrameRates.GetFrameRate(Emulator.SystemId, Emulator.HasRegions() && Emulator.AsRegionable().Region is DisplayType.PAL), // why isn't there a helper for this
|
||||
Emulator.AsStatable(),
|
||||
CreateRewinder,
|
||||
() => this.Rewinder);
|
||||
if (this.ShowDialogWithTempMute(form).IsOk()) AddOnScreenMessage("Rewind and State settings saved");
|
||||
}
|
||||
|
||||
|
|
|
@ -12,15 +12,23 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private readonly Config _config;
|
||||
|
||||
private readonly double _framerate;
|
||||
|
||||
private readonly Action _recreateRewinder;
|
||||
|
||||
private readonly Func<IRewinder> _getRewinder;
|
||||
|
||||
private readonly IStatable _statableCore;
|
||||
|
||||
public RewindConfig(Config config, Action recreateRewinder, Func<IRewinder> getRewinder, IStatable statableCore)
|
||||
public RewindConfig(
|
||||
Config config,
|
||||
double framerate,
|
||||
IStatable statableCore,
|
||||
Action recreateRewinder,
|
||||
Func<IRewinder> getRewinder)
|
||||
{
|
||||
_config = config;
|
||||
_framerate = framerate;
|
||||
_recreateRewinder = recreateRewinder;
|
||||
_getRewinder = getRewinder;
|
||||
_statableCore = statableCore;
|
||||
|
@ -150,7 +158,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
estFrames = bufferSize / (double) _avgStateSize;
|
||||
}
|
||||
ApproxFramesLabel.Text = $"{estFrames:n0} frames";
|
||||
EstTimeLabel.Text = $"{estFrames / 3600.0:n} minutes";
|
||||
EstTimeLabel.Text = $"{estFrames / _framerate / 60.0:n} minutes";
|
||||
}
|
||||
|
||||
private void BufferSizeUpDown_ValueChanged(object sender, EventArgs e)
|
||||
|
|
Loading…
Reference in New Issue