From 711c9b52e4b8fd7ea922d253c247c10f652d9848 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 20 Jun 2014 18:36:03 +0000 Subject: [PATCH] Hack for FilesystemSafeName to remove . if it is the last character in the name (Such as Super Mario bros.) since this method is used for path building --- BizHawk.Client.Common/PathManager.cs | 8 ++++++++ BizHawk.Client.EmuHawk/movie/RecordMovie.cs | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/BizHawk.Client.Common/PathManager.cs b/BizHawk.Client.Common/PathManager.cs index a5fd47f87d..cc60a664f3 100644 --- a/BizHawk.Client.Common/PathManager.cs +++ b/BizHawk.Client.Common/PathManager.cs @@ -237,6 +237,14 @@ namespace BizHawk.Client.Common // zero 22-jul-2012 - i dont think this is used the same way it used to. game.Name shouldnt be a path, so this stuff is illogical. // if game.Name is a path, then someone shouldve made it not-a-path already. // return Path.Combine(Path.GetDirectoryName(filesystemSafeName), Path.GetFileNameWithoutExtension(filesystemSafeName)); + + // adelikat: + // This hack is to prevent annoying things like Super Mario Bros..bk2 + if (filesystemSafeName.EndsWith(".")) + { + return filesystemSafeName.Remove(filesystemSafeName.Length - 1, 1); + } + return filesystemSafeName; } diff --git a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs index d953044941..ba4354e17f 100644 --- a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs @@ -82,10 +82,6 @@ namespace BizHawk.Client.EmuHawk movieToRecord.TextSavestate = sw.ToString(); } } - - //var bytestate = Global.Emulator.SaveStateBinary(); - //string stringstate = Convert.ToBase64String(bytestate); - //movieToRecord.SavestateBinaryBase64Blob = stringstate; } // Header