From b0eb4ee7912d83ac57f5eb9f5d19b5a75498b4fc Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 9 Nov 2014 17:14:16 +0000 Subject: [PATCH] When loading a movie that specified quicknes or neshawk (or bsnes vs snes9x), don't permanently override the user's core preference --- BizHawk.Client.Common/movie/MovieSession.cs | 9 +++++++++ BizHawk.Client.EmuHawk/MainForm.Movie.cs | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/BizHawk.Client.Common/movie/MovieSession.cs b/BizHawk.Client.Common/movie/MovieSession.cs index f2c07a5b61..5dc63b4a5c 100644 --- a/BizHawk.Client.Common/movie/MovieSession.cs +++ b/BizHawk.Client.Common/movie/MovieSession.cs @@ -436,6 +436,11 @@ namespace BizHawk.Client.Common } } + // The behavior here is to only temporarily override these settings when playing a movie and then restore the user's preferred settings + // A more elegant approach would be appreciated + public bool? PreviousNES_InQuickNES = null; + public bool? PreviousSNES_InSnes9x = null; + public void QueueNewMovie(IMovie movie, bool record) { if (!record) // The semantics of record is that we are starting a new movie, and even wiping a pre-existing movie with the same path, but non-record means we are loading an existing movie into playback mode @@ -469,10 +474,12 @@ namespace BizHawk.Client.Common // If either is specified use that, else use whatever is currently set if (movie.Core == quicknesName) { + PreviousNES_InQuickNES = Global.Config.NES_InQuickNES; Global.Config.NES_InQuickNES = true; } else if (movie.Core == neshawkName) { + PreviousNES_InQuickNES = Global.Config.NES_InQuickNES; Global.Config.NES_InQuickNES = false; } } @@ -483,10 +490,12 @@ namespace BizHawk.Client.Common if (movie.Core == snes9xName) { + PreviousSNES_InSnes9x = Global.Config.SNES_InSnes9x; Global.Config.SNES_InSnes9x = true; } else { + PreviousSNES_InSnes9x = Global.Config.SNES_InSnes9x; Global.Config.SNES_InSnes9x = false; } } diff --git a/BizHawk.Client.EmuHawk/MainForm.Movie.cs b/BizHawk.Client.EmuHawk/MainForm.Movie.cs index ca8509bd69..e9c89a1f2d 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Movie.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Movie.cs @@ -32,6 +32,18 @@ namespace BizHawk.Client.EmuHawk LoadRom(GlobalWin.MainForm.CurrentlyOpenRom); + if (Global.MovieSession.PreviousNES_InQuickNES.HasValue) + { + Global.Config.NES_InQuickNES = Global.MovieSession.PreviousNES_InQuickNES.HasValue; + Global.MovieSession.PreviousNES_InQuickNES = null; + } + + if (Global.MovieSession.PreviousSNES_InSnes9x.HasValue) + { + Global.Config.SNES_InSnes9x = Global.MovieSession.PreviousSNES_InSnes9x.HasValue; + Global.MovieSession.PreviousSNES_InSnes9x = null; + } + Global.Config.RecentMovies.Add(movie.Filename); if (movie.StartsFromSavestate)