diff --git a/src/BizHawk.Client.Common/movie/MovieSession.cs b/src/BizHawk.Client.Common/movie/MovieSession.cs index 1801bc657e..04208db279 100644 --- a/src/BizHawk.Client.Common/movie/MovieSession.cs +++ b/src/BizHawk.Client.Common/movie/MovieSession.cs @@ -55,6 +55,9 @@ namespace BizHawk.Client.Common public string QueuedCoreName => _queuedMovie?.Core; + public string/*?*/ QueuedSysID + => _queuedMovie?.SystemID; + public IDictionary UserBag { get; set; } = new Dictionary(); public IController MovieIn { get; set; } diff --git a/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs b/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs index 88f268b2d2..96aa7697e7 100644 --- a/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs +++ b/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs @@ -23,6 +23,9 @@ namespace BizHawk.Client.Common /// The Core header of the queued movie iff one is queued, else string QueuedCoreName { get; } + /// The header of the queued movie iff one is queued, else + string/*?*/ QueuedSysID { get; } + IDictionary UserBag { get; set; } IMovieController MovieController { get; } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 9f477f30d3..2307d65474 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -3821,11 +3821,35 @@ namespace BizHawk.Client.EmuHawk //path = ioa_openrom.Path; } + var forcedCoreName = MovieSession.QueuedCoreName ?? string.Empty; + if (!CoreInventory.Instance.SystemsFlat.Any(core => core.Name == forcedCoreName)) + { + const string FMT_STR_NO_SUCH_CORE = "This movie is for the \"{0}\" core," + + " but that's not a valid {1} core. (Was the movie made in this version of EmuHawk?)" + + "\nContinue with your preferred core instead?"; +#if false //TODO let the user pick? + var availCores = CoreInventory.Instance.AllCores.GetValueOrDefault(MovieSession.QueuedSysID, [ ]); +#endif + if (!this.ModalMessageBox2( + caption: "No such core", + icon: EMsgBoxIcon.Error, + text: string.Format( + FMT_STR_NO_SUCH_CORE, + forcedCoreName, + EmulatorExtensions.SystemIDToDisplayName(MovieSession.QueuedSysID)))) + { + return false; + } + forcedCoreName = null; + } + DisplayManager.ActivateOpenGLContext(); // required in case the core wants to create a shared OpenGL context - bool result = string.IsNullOrEmpty(MovieSession.QueuedCoreName) - ? loader.LoadRom(path, nextComm, ioaRetro?.CorePath) - : loader.LoadRom(path, nextComm, ioaRetro?.CorePath, forcedCoreName: MovieSession.QueuedCoreName); + var result = loader.LoadRom( + path: path, + nextComm, + launchLibretroCore: ioaRetro?.CorePath, + forcedCoreName: forcedCoreName); // we need to replace the path in the OpenAdvanced with the canonical one the user chose. // It can't be done until loader.LoadRom happens (for CanonicalFullPath)