Skip to content

Commit 4d73187

Browse files
committed
Disable AutoSaveRAM while a movie is loaded
1 parent 3fe8317 commit 4d73187

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/BizHawk.Client.EmuHawk/MainForm.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ _argParser.SocketAddress is var (socketIP, socketPort)
769769
}
770770
}
771771
}
772+
//TODO should we be calling `OnRomChanged` from this ctor? it handles this and a bunch of other things also done here
773+
_trackingAutoSaveRAM = Config.AutosaveSaveRAM && MovieSession.Movie is null;
772774

773775
if (_argParser.startFullscreen || Config.StartFullscreen)
774776
{
@@ -1760,6 +1762,8 @@ public bool RunLibretroCoreChooser()
17601762
public int AutoFlushSaveRamIn { get; set; }
17611763
private bool AutoFlushSaveRamFailed;
17621764

1765+
private bool _trackingAutoSaveRAM;
1766+
17631767
private void SetStatusBar()
17641768
{
17651769
if (!_inFullscreen)
@@ -3011,7 +3015,7 @@ private void StepRunLoop_Core(bool force = false)
30113015

30123016
RA?.OnFrameAdvance();
30133017

3014-
if (Config.AutosaveSaveRAM)
3018+
if (_trackingAutoSaveRAM)
30153019
{
30163020
AutoFlushSaveRamIn--;
30173021
if (AutoFlushSaveRamIn <= 0)
@@ -3897,6 +3901,7 @@ private void OnRomChanged()
38973901
UpdateCoreStatusBarButton();
38983902
UpdateDumpInfo();
38993903
SetMainformMovieInfo();
3904+
_trackingAutoSaveRAM = Config.AutosaveSaveRAM && MovieSession.Movie is null;
39003905
RA?.Restart();
39013906
}
39023907

0 commit comments

Comments
 (0)