Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BizHawk.Client.Common/config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ public void SetWindowScaleFor(string sysID, int windowScale)
/// <summary>
/// Whether to make AutoSave files at periodic intervals
/// </summary>
public bool AutosaveSaveRAM { get; set; }
public bool AutosaveSaveRAM { get; set; } = true;

/// <summary>
/// Intervals at which to make AutoSave files
/// </summary>
public int FlushSaveRamFrames { get; set; }
public int FlushSaveRamFrames { get; set; } = 5/*min*/ * 60/*s/min*/ * 60/*fr/s*/;

public bool TurboSeek { get; set; }

Expand Down
7 changes: 6 additions & 1 deletion src/BizHawk.Client.EmuHawk/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ _argParser.SocketAddress is var (socketIP, socketPort)
}
}
}
//TODO should we be calling `OnRomChanged` from this ctor? it handles this and a bunch of other things also done here
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a ROM gets loaded, it should be getting called by the method that loads the ROM, e.g. LoadRom through LoadRomInternal.

_trackingAutoSaveRAM = Config.AutosaveSaveRAM && MovieSession.Movie is null;

if (_argParser.startFullscreen || Config.StartFullscreen)
{
Expand Down Expand Up @@ -1760,6 +1762,8 @@ public bool RunLibretroCoreChooser()
public int AutoFlushSaveRamIn { get; set; }
private bool AutoFlushSaveRamFailed;

private bool _trackingAutoSaveRAM;

private void SetStatusBar()
{
if (!_inFullscreen)
Expand Down Expand Up @@ -3011,7 +3015,7 @@ private void StepRunLoop_Core(bool force = false)

RA?.OnFrameAdvance();

if (Config.AutosaveSaveRAM)
if (_trackingAutoSaveRAM)
{
AutoFlushSaveRamIn--;
if (AutoFlushSaveRamIn <= 0)
Expand Down Expand Up @@ -3897,6 +3901,7 @@ private void OnRomChanged()
UpdateCoreStatusBarButton();
UpdateDumpInfo();
SetMainformMovieInfo();
_trackingAutoSaveRAM = Config.AutosaveSaveRAM && MovieSession.Movie is null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work, because the movie has not been set yet at this point. If you open a ROM and then TAStudio right after starting EmuHawk, _trackingAutoSaveRAM will be true. (assuming the config option is on) (... so why is SetMainformMovieInfo being called here??)

This should probably also be a value that just tracks if a movie was used, since a user may wish to change the auto save setting after opening a ROM.

RA?.Restart();
}

Expand Down