fix TAStudio state gap
This commit is contained in:
parent
503469e4e0
commit
a868cd5f5c
|
@ -113,7 +113,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public void UpdateStateFrequency()
|
||||
{
|
||||
_stateFrequency = ((int)_expectedStateSizeInMb / Settings.MemStateGapDivider / 1024)
|
||||
_stateFrequency = ((int)(_expectedStateSizeInMb * 1024 / Settings.MemStateGapDividerKB))
|
||||
.Clamp(MinFrequency, MaxFrequency);
|
||||
|
||||
_decay.UpdateSettings(MaxStates, _stateFrequency, 4);
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
|
|||
DiskSaveCapacityMb = 512;
|
||||
CapacityMb = 512;
|
||||
DiskCapacityMb = 1; // not working yet
|
||||
MemStateGapDivider = 64;
|
||||
MemStateGapDividerKB = 64;
|
||||
FileStateGap = 4;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ namespace BizHawk.Client.Common
|
|||
DiskSaveCapacityMb = settings.DiskSaveCapacityMb;
|
||||
CapacityMb = settings.CapacityMb;
|
||||
DiskCapacityMb = settings.DiskCapacityMb;
|
||||
MemStateGapDivider = settings.MemStateGapDivider;
|
||||
MemStateGapDividerKB = settings.MemStateGapDividerKB;
|
||||
FileStateGap = settings.FileStateGap;
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,8 @@ namespace BizHawk.Client.Common
|
|||
/// Gets or sets the divider that determines memory state gap
|
||||
/// </summary>
|
||||
[DisplayName("Divider for memory state interval")]
|
||||
[Description("The actual state gap in frames is calculated as ExpectedStateSize / div / 1024")]
|
||||
public int MemStateGapDivider { get; set; }
|
||||
[Description("The actual state gap in frames is calculated as ExpectedStateSizeMB * 1024 / div")]
|
||||
public int MemStateGapDividerKB { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the amount of states to skip during project saving
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
MemCapacityNumeric.Value = NumberExtensions.Clamp(_settings.CapacityMb, MemCapacityNumeric.Minimum, MemCapacityNumeric.Maximum);
|
||||
DiskCapacityNumeric.Value = NumberExtensions.Clamp(_settings.DiskCapacityMb, MemCapacityNumeric.Minimum, MemCapacityNumeric.Maximum);
|
||||
FileCapacityNumeric.Value = NumberExtensions.Clamp(_settings.DiskSaveCapacityMb, MemCapacityNumeric.Minimum, MemCapacityNumeric.Maximum);
|
||||
MemStateGapDividerNumeric.Value = NumberExtensions.Clamp(_settings.MemStateGapDivider, MemStateGapDividerNumeric.Minimum, MemStateGapDividerNumeric.Maximum);
|
||||
MemStateGapDividerNumeric.Value = NumberExtensions.Clamp(_settings.MemStateGapDividerKB, MemStateGapDividerNumeric.Minimum, MemStateGapDividerNumeric.Maximum);
|
||||
|
||||
FileStateGapNumeric.Value = _settings.FileStateGap;
|
||||
SavestateSizeLabel.Text = $"{Math.Round(_stateSizeMb, 2)} MB";
|
||||
|
@ -51,7 +51,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_settings.CapacityMb = (int)MemCapacityNumeric.Value;
|
||||
_settings.DiskCapacityMb = (int)DiskCapacityNumeric.Value;
|
||||
_settings.DiskSaveCapacityMb = (int)FileCapacityNumeric.Value;
|
||||
_settings.MemStateGapDivider = (int)MemStateGapDividerNumeric.Value;
|
||||
_settings.MemStateGapDividerKB = (int)MemStateGapDividerNumeric.Value;
|
||||
_settings.FileStateGap = (int)FileStateGapNumeric.Value;
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
|
@ -84,7 +84,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void MemStateGapDivider_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
int val = (int)(Statable.CloneSavestate().Length / MemStateGapDividerNumeric.Value / 1024);
|
||||
int val = (int)(_stateSizeMb * 1024 / MemStateGapDividerNumeric.Value);
|
||||
|
||||
if (val <= 1)
|
||||
MemStateGapDividerNumeric.Maximum = MemStateGapDividerNumeric.Value;
|
||||
|
|
Loading…
Reference in New Issue