diff --git a/Core/Shared/Movies/MesenMovie.cpp b/Core/Shared/Movies/MesenMovie.cpp index 10e07549..7b9644c9 100644 --- a/Core/Shared/Movies/MesenMovie.cpp +++ b/Core/Shared/Movies/MesenMovie.cpp @@ -132,6 +132,13 @@ bool MesenMovie::Play(VirtualFile &file) auto emuLock = _emu->AcquireLock(); ParseSettings(settingsData); + + string version = LoadString(_settings, MovieKeys::MesenVersion); + if(version.size() < 2 || version.substr(0, 2) == "0." || version.substr(0, 2) == "1.") { + //Prevent loading movies from Mesen/Mesen-S version 0.x.x or 1.x.x + MessageManager::DisplayMessage("Movies", "MovieIncompatibleVersion"); + return false; + } if(LoadInt(_settings, MovieKeys::MovieFormatVersion, 0) < 2) { MessageManager::DisplayMessage("Movies", "MovieIncompatibleVersion"); diff --git a/Core/Shared/SaveStateManager.cpp b/Core/Shared/SaveStateManager.cpp index 718c6d3f..3a1d72b4 100644 --- a/Core/Shared/SaveStateManager.cpp +++ b/Core/Shared/SaveStateManager.cpp @@ -318,7 +318,8 @@ int32_t SaveStateManager::GetSaveStatePreview(string saveStatePath, uint8_t* png stream.read(header, 3); if(memcmp(header, "MSS", 3) == 0) { uint32_t emuVersion = ReadValue(stream); - if(emuVersion > _emu->GetSettings()->GetVersion()) { + if(emuVersion > _emu->GetSettings()->GetVersion() || emuVersion <= 0x10000) { + //Prevent loading files created with a newer version of Mesen or with Mesen 0.9.x or lower. return -1; } diff --git a/Core/Shared/SaveStateManager.h b/Core/Shared/SaveStateManager.h index 6bc60b7b..ad83bd95 100644 --- a/Core/Shared/SaveStateManager.h +++ b/Core/Shared/SaveStateManager.h @@ -12,7 +12,7 @@ private: atomic _lastIndex; Emulator* _emu; - string GetStateFilepath(int stateIndex); + string GetStateFilepath(int stateIndex); void SaveVideoData(ostream& stream); bool GetVideoData(vector& out, RenderedFrame& frame, istream& stream); diff --git a/InteropDLL/InteropDLL.vcxproj b/InteropDLL/InteropDLL.vcxproj index 793acbb0..82baf4db 100644 --- a/InteropDLL/InteropDLL.vcxproj +++ b/InteropDLL/InteropDLL.vcxproj @@ -70,7 +70,7 @@ true - MesenSCore + MesenCore $(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ false @@ -78,7 +78,7 @@ false - MesenSCore + MesenCore $(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ false @@ -86,7 +86,7 @@ false - MesenSCore + MesenCore $(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ false @@ -94,7 +94,7 @@ false - MesenSCore + MesenCore $(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\ obj\$(Platform)\PGO Profile\ false diff --git a/Mesen-S.sln b/Mesen.sln similarity index 100% rename from Mesen-S.sln rename to Mesen.sln diff --git a/NewUI/Assets/MesenSIcon.png b/NewUI/Assets/MesenSIcon.png deleted file mode 100644 index 8b41e08e..00000000 Binary files a/NewUI/Assets/MesenSIcon.png and /dev/null differ diff --git a/NewUI/Assets/MesenSIconSmall.png b/NewUI/Assets/MesenSIconSmall.png deleted file mode 100644 index 0c12b19b..00000000 Binary files a/NewUI/Assets/MesenSIconSmall.png and /dev/null differ diff --git a/NewUI/Config/ConfigManager.cs b/NewUI/Config/ConfigManager.cs index 01ed4ba0..019dbafa 100644 --- a/NewUI/Config/ConfigManager.cs +++ b/NewUI/Config/ConfigManager.cs @@ -25,7 +25,7 @@ namespace Mesen.Config { get { - return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Mesen-SCore"); + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Mesen2"); } } diff --git a/NewUI/Interop/ConfigApi.cs b/NewUI/Interop/ConfigApi.cs index 401a8efb..ce88a203 100644 --- a/NewUI/Interop/ConfigApi.cs +++ b/NewUI/Interop/ConfigApi.cs @@ -14,7 +14,7 @@ namespace Mesen.Interop { public class ConfigApi { - private const string DllPath = "MesenSCore.dll"; + private const string DllPath = EmuApi.DllName; [DllImport(DllPath)] public static extern void SetVideoConfig(InteropVideoConfig config); [DllImport(DllPath)] public static extern void SetAudioConfig(InteropAudioConfig config); diff --git a/NewUI/Interop/DebugApi.cs b/NewUI/Interop/DebugApi.cs index bb53651b..3d691b28 100644 --- a/NewUI/Interop/DebugApi.cs +++ b/NewUI/Interop/DebugApi.cs @@ -15,7 +15,7 @@ namespace Mesen.Interop { public class DebugApi { - private const string DllPath = "MesenSCore.dll"; + private const string DllPath = EmuApi.DllName; [DllImport(DllPath)] public static extern void InitializeDebugger(); [DllImport(DllPath)] public static extern void ReleaseDebugger(); diff --git a/NewUI/Interop/EmuApi.cs b/NewUI/Interop/EmuApi.cs index 8bbc3100..273752d5 100644 --- a/NewUI/Interop/EmuApi.cs +++ b/NewUI/Interop/EmuApi.cs @@ -15,7 +15,9 @@ namespace Mesen.Interop { public class EmuApi { - private const string DllPath = "MesenSCore.dll"; + public const string DllName = "MesenCore.dll"; + private const string DllPath = EmuApi.DllName; + [DllImport(DllPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool TestDll(); [DllImport(DllPath)] public static extern void InitDll(); diff --git a/NewUI/Interop/HistoryApi.cs b/NewUI/Interop/HistoryApi.cs index adc1742e..7230ead1 100644 --- a/NewUI/Interop/HistoryApi.cs +++ b/NewUI/Interop/HistoryApi.cs @@ -10,7 +10,7 @@ namespace Mesen.Interop { public class HistoryApi { - private const string DllPath = "MesenSCore.dll"; + private const string DllPath = EmuApi.DllName; [DllImport(DllPath)] public static extern void HistoryViewerInitialize(IntPtr windowHandle, IntPtr viewerHandle); [DllImport(DllPath)] public static extern void HistoryViewerRelease(); diff --git a/NewUI/Interop/InputApi.cs b/NewUI/Interop/InputApi.cs index b1af9ea3..4f09c1e3 100644 --- a/NewUI/Interop/InputApi.cs +++ b/NewUI/Interop/InputApi.cs @@ -8,7 +8,7 @@ namespace Mesen.Interop { public class InputApi { - private const string DllPath = "MesenSCore.dll"; + private const string DllPath = EmuApi.DllName; [DllImport(DllPath)] public static extern void SetKeyState(UInt16 scanCode, [MarshalAs(UnmanagedType.I1)]bool pressed); [DllImport(DllPath)] public static extern void ResetKeyState(); diff --git a/NewUI/Interop/NetplayApi.cs b/NewUI/Interop/NetplayApi.cs index 2b82588f..bf4a0959 100644 --- a/NewUI/Interop/NetplayApi.cs +++ b/NewUI/Interop/NetplayApi.cs @@ -7,7 +7,7 @@ namespace Mesen.Interop { public class NetplayApi { - private const string DllPath = "MesenSCore.dll"; + private const string DllPath = EmuApi.DllName; [DllImport(DllPath)] public static extern void StartServer(UInt16 port, [MarshalAs(UnmanagedType.LPUTF8Str)]string password); [DllImport(DllPath)] public static extern void StopServer(); diff --git a/NewUI/Interop/RecordApi.cs b/NewUI/Interop/RecordApi.cs index aa3d8d94..d22e8920 100644 --- a/NewUI/Interop/RecordApi.cs +++ b/NewUI/Interop/RecordApi.cs @@ -10,7 +10,7 @@ namespace Mesen.Interop { class RecordApi { - private const string DllPath = "MesenSCore.dll"; + private const string DllPath = EmuApi.DllName; [DllImport(DllPath)] public static extern void AviRecord([MarshalAs(UnmanagedType.LPUTF8Str)]string filename, VideoCodec codec, UInt32 compressionLevel); [DllImport(DllPath)] public static extern void AviStop(); diff --git a/NewUI/Interop/TestApi.cs b/NewUI/Interop/TestApi.cs index 460d4e10..95d36d5a 100644 --- a/NewUI/Interop/TestApi.cs +++ b/NewUI/Interop/TestApi.cs @@ -9,7 +9,7 @@ namespace Mesen.Interop { class TestApi { - private const string DllPath = "MesenSCore.dll"; + private const string DllPath = EmuApi.DllName; [DllImport(DllPath)] public static extern Int32 RunRecordedTest([MarshalAs(UnmanagedType.LPUTF8Str)]string filename, [MarshalAs(UnmanagedType.I1)]bool inBackground); [DllImport(DllPath)] public static extern void RomTestRecord([MarshalAs(UnmanagedType.LPUTF8Str)]string filename, [MarshalAs(UnmanagedType.I1)]bool reset); diff --git a/NewUI/Localization/resources.en.xml b/NewUI/Localization/resources.en.xml index 7729d4ec..3bdbd68f 100644 --- a/NewUI/Localization/resources.en.xml +++ b/NewUI/Localization/resources.en.xml @@ -1426,19 +1426,6 @@ - All Files (*.*)|*.* - Zip files (*.zip)|*.zip - Movie files (*.msm)|*.msm|All Files (*.*)|*.* - Wave files (*.wav)|*.wav|All Files (*.*)|*.* - Avi files (*.avi)|*.avi|All Files (*.*)|*.* - GIF files (*.gif)|*.gif|All Files (*.*)|*.* - Palette Files (*.pal)|*.pal|All Files (*.*)|*.* - All supported formats (*.sfc, *.gb, *.gbc, *.bs, *.spc, *.zip, *.7z)|*.SFC;*.SMC;*.SWC;*.FIG;*.ZIP;*.7Z;*.SPC;*.BS;*.GB;*.GBC|SNES Roms (*.sfc)|*.SFC;*.SMC;*.SWC;*.FIG;*.BS|Gameboy Roms (*.gb, *.gbc)|*.GB;*.GBC|SPC Sound Files (*.spc)|*.SPC|ZIP Archives (*.zip)|*.ZIP|7-Zip Archives (*.7z)|*.7z|All (*.*)|*.* - Test files (*.mtp)|*.mtp|All (*.*)|*.* - All supported formats (*.cht, *.xml)|*.cht;*.xml - Mesen Savestates (*.mss)|*.mss|All files (*.*)|*.* - Family Basic Tape files (*.fbt)|*.fbt|All Files (*.*)|*.* - Last Session Auto-save Slot #{0} @@ -1476,7 +1463,7 @@ /fullscreen - Start Mesen in fullscreen mode /DoNotSaveSettings - Prevent settings from being saved to the disk (useful to prevent command line options from becoming the default settings) - /RecordMovie="filename.msm" - Start recording a movie after the specified game is loaded. + /RecordMovie="filename.mmo" - Start recording a movie after the specified game is loaded. /LoadLastSession - Resumes the game in the state it was left in when it was last played. Resume @@ -1525,8 +1512,8 @@ Patch and reset the current game? Please select a ROM for this patch file. Unable to download file. Check your internet connection and try again. Details: {0} - Mesen could not launch because it was unable to load MesenSCore.dll due to missing dependencies. - Mesen was unable to start due to missing files. Error: MesenSCore.dll is missing. + Mesen could not launch because it was unable to load MesenCore.dll due to missing dependencies. + Mesen was unable to start due to missing files. Error: MesenCore.dll is missing. An unexpected error has occurred. Error details: {0} Download failed - the file appears to be corrupted. Please visit the Mesen website to download the latest version manually. Upgrade completed successfully. diff --git a/NewUI/NewUI.csproj b/NewUI/NewUI.csproj index 2c52d910..2c4606d3 100644 --- a/NewUI/NewUI.csproj +++ b/NewUI/NewUI.csproj @@ -522,13 +522,13 @@ - + ..\bin\x64\Release\ - + diff --git a/NewUI/Utilities/FileDialogHelper.cs b/NewUI/Utilities/FileDialogHelper.cs index ecef1806..661015bc 100644 --- a/NewUI/Utilities/FileDialogHelper.cs +++ b/NewUI/Utilities/FileDialogHelper.cs @@ -15,7 +15,7 @@ namespace Mesen.Utilities { public const string RomExt = "[[ROMFILES]]"; public const string FirmwareExt = "[[FIRMWAREFILES]]"; - public const string MesenMovieExt = "msm"; + public const string MesenMovieExt = "mmo"; public const string TblExt = "tbl"; public const string PaletteExt = "pal"; public const string TraceExt = "txt"; @@ -46,13 +46,13 @@ namespace Mesen.Utilities List filter = new List(); foreach(string ext in extensions) { if(ext == FileDialogHelper.RomExt) { - filter.Add(new FilePickerFileType("All ROM Files") { Patterns = new List() { "*.sfc", "*.fig", "*.smc", "*.spc", "*.nes", "*.fds", "*.unif", "*.unf", "*.studybox", "*.nsf", "*.nsfe", "*.gb", "*.gbc", "*.gbs", "*.pce", "*.sgx", "*.cue", "*.hes", "*.zip", "*.7z" } }); - filter.Add(new FilePickerFileType("SNES ROM Files") { Patterns = new List() { "*.sfc", "*.fig", "*.smc", "*.spc" } }); - filter.Add(new FilePickerFileType("NES ROM Files") { Patterns = new List() { "*.nes", "*.fds", "*.unif", "*.unf", "*.studybox", "*.nsf", "*.nsfe" } }); - filter.Add(new FilePickerFileType("GB ROM Files") { Patterns = new List() { "*.gb", "*.gbc", "*.gbs" } }); - filter.Add(new FilePickerFileType("PC Engine ROM Files") { Patterns = new List() { "*.pce", "*.sgx", "*.cue", ".hes" } }); + filter.Add(new FilePickerFileType("All ROM files") { Patterns = new List() { "*.sfc", "*.fig", "*.smc", "*.spc", "*.nes", "*.fds", "*.unif", "*.unf", "*.studybox", "*.nsf", "*.nsfe", "*.gb", "*.gbc", "*.gbs", "*.pce", "*.sgx", "*.cue", "*.hes", "*.zip", "*.7z" } }); + filter.Add(new FilePickerFileType("SNES ROM files") { Patterns = new List() { "*.sfc", "*.fig", "*.smc", "*.spc" } }); + filter.Add(new FilePickerFileType("NES ROM files") { Patterns = new List() { "*.nes", "*.fds", "*.unif", "*.unf", "*.studybox", "*.nsf", "*.nsfe" } }); + filter.Add(new FilePickerFileType("GB ROM files") { Patterns = new List() { "*.gb", "*.gbc", "*.gbs" } }); + filter.Add(new FilePickerFileType("PC Engine ROM files") { Patterns = new List() { "*.pce", "*.sgx", "*.cue", ".hes" } }); } else if(ext == FileDialogHelper.FirmwareExt) { - filter.Add(new FilePickerFileType("All firmware Files") { Patterns = new List() { "*.sfc", "*.pce", "*.nes", "*.bin", "*.rom" } }); + filter.Add(new FilePickerFileType("All firmware files") { Patterns = new List() { "*.sfc", "*.pce", "*.nes", "*.bin", "*.rom" } }); } else { filter.Add(new FilePickerFileType(ext.ToUpper() + " files") { Patterns = new List() { "*." + ext } }); } diff --git a/makefile b/makefile index 73361c74..e1cc92cb 100644 --- a/makefile +++ b/makefile @@ -46,7 +46,7 @@ ifneq ($(STATICLINK),false) endif OBJFOLDER=obj.$(MESENPLATFORM) -SHAREDLIB=libMesenSCore.dll +SHAREDLIB=libMesenCore.dll RELEASEFOLDER=bin/$(MESENPLATFORM)/Release CORESRC := $(shell find Core -name '*.cpp')