diff --git a/src/BizHawk.Client.EmuHawk/ArgParser.cs b/src/BizHawk.Client.EmuHawk/ArgParser.cs index 640469c5f2..1e739c6fbe 100644 --- a/src/BizHawk.Client.EmuHawk/ArgParser.cs +++ b/src/BizHawk.Client.EmuHawk/ArgParser.cs @@ -220,7 +220,7 @@ namespace BizHawk.Client.EmuHawk public ArgParserException(string message) : base(message) {} } - public /*readonly*/ struct ParsedCLIFlags + public readonly struct ParsedCLIFlags { public readonly string? cmdLoadSlot; @@ -236,7 +236,7 @@ namespace BizHawk.Client.EmuHawk public readonly HashSet? _currAviWriterFrameList; - public /*readonly*/ int _autoDumpLength; + public readonly int _autoDumpLength; public readonly bool printVersion; diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index bdf9b84454..e8b6780724 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -472,6 +472,7 @@ namespace BizHawk.Client.EmuHawk Config.VideoWriterAudioSync = _argParser.audiosync.Value; } + _autoDumpLength = _argParser._autoDumpLength; if (_argParser.cmdMovie != null) { _suppressSyncSettingsWarning = true; // We don't want to be nagged if we are attempting to automate @@ -487,9 +488,9 @@ namespace BizHawk.Client.EmuHawk MovieSession.ReadOnly = true; // if user is dumping and didn't supply dump length, make it as long as the loaded movie - if (_argParser._autoDumpLength == 0) + if (_autoDumpLength == 0) { - _argParser._autoDumpLength = movie.InputLogLength; + _autoDumpLength = movie.InputLogLength; } // Copy pasta from drag & drop @@ -1524,7 +1525,9 @@ namespace BizHawk.Client.EmuHawk private int _lastOpenRomFilter; - private ParsedCLIFlags _argParser; + private readonly ParsedCLIFlags _argParser; + + private int _autoDumpLength; // Resources private Bitmap _statusBarDiskLightOnImage; @@ -3405,10 +3408,10 @@ namespace BizHawk.Client.EmuHawk } } - if (_argParser._autoDumpLength > 0) + if (_autoDumpLength > 0) //TODO this is probably not necessary because of the call to StopAv --yoshi { - _argParser._autoDumpLength--; - if (_argParser._autoDumpLength == 0) // finish + _autoDumpLength--; + if (_autoDumpLength == 0) // finish { StopAv(); if (_argParser._autoCloseOnDump)