diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 40d40b773d..e5a7643086 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -407,11 +407,11 @@ namespace BizHawk.MultiClient target.SMS_ShowBG = Global.Config.SMSDispBG; target.SMS_ShowOBJ = Global.Config.SMSDispOBJ; - target.PSX_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); // PathManager.MakeAbsolutePath(Global.Config.PathPSXFirmwares, "PSX"); + target.PSX_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); // PathManager.MakeAbsolutePath(Global.Config.PathPSXFirmwares, "PSX"); - target.C64_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); // PathManager.MakeAbsolutePath(Global.Config.PathC64Firmwares, "C64"); + target.C64_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); // PathManager.MakeAbsolutePath(Global.Config.PathC64Firmwares, "C64"); - target.SNES_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); // PathManager.MakeAbsolutePath(Global.Config.PathSNESFirmwares, "SNES"); + target.SNES_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); // PathManager.MakeAbsolutePath(Global.Config.PathSNESFirmwares, "SNES"); target.SNES_ShowBG1_0 = Global.Config.SNES_ShowBG1_0; target.SNES_ShowBG1_1 = Global.Config.SNES_ShowBG1_1; target.SNES_ShowBG2_0 = Global.Config.SNES_ShowBG2_0; @@ -4119,12 +4119,12 @@ namespace BizHawk.MultiClient if (!(Global.Emulator is NullEmulator)) { sfd.FileName = PathManager.FilesystemSafeName(Global.Game); - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.AVIPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.AVIPath); } else { sfd.FileName = "NULL"; - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.AVIPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.AVIPath); } sfd.Filter = String.Format("{0} (*.{0})|*.{0}|All Files|*.*", aw.DesiredExtension()); @@ -4356,7 +4356,7 @@ namespace BizHawk.MultiClient void ProcessMovieImport(string fn) { var file = new FileInfo(fn); - string d = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, ""); + string d = PathManager.MakeAbsolutePath(Global.Config.MoviesPath); string errorMsg = ""; string warningMsg = ""; Movie m = MovieImport.ImportFile(fn, out errorMsg, out warningMsg); diff --git a/BizHawk.MultiClient/PlayMovie.cs b/BizHawk.MultiClient/PlayMovie.cs index 93b1bc42d4..c665252c71 100644 --- a/BizHawk.MultiClient/PlayMovie.cs +++ b/BizHawk.MultiClient/PlayMovie.cs @@ -79,7 +79,7 @@ namespace BizHawk.MultiClient private void BrowseMovies_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath); string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; ofd.Filter = filter; @@ -284,7 +284,7 @@ namespace BizHawk.MultiClient { ClearList(); - string d = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, ""); + string d = PathManager.MakeAbsolutePath(Global.Config.MoviesPath); if (!Directory.Exists(d)) Directory.CreateDirectory(d); string extension = "*." + Global.Config.MovieExtension; diff --git a/BizHawk.MultiClient/RecordMovie.cs b/BizHawk.MultiClient/RecordMovie.cs index e0059ab6c0..39c7a3d631 100644 --- a/BizHawk.MultiClient/RecordMovie.cs +++ b/BizHawk.MultiClient/RecordMovie.cs @@ -38,7 +38,7 @@ namespace BizHawk.MultiClient { if (path[0] != '\\') path = path.Insert(0, "\\"); - path = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, "") + path; + path = PathManager.MakeAbsolutePath(Global.Config.MoviesPath) + path; if (path[path.Length - 4] != '.') //If no file extension, add movie extension path += "." + Global.Config.MovieExtension; @@ -165,7 +165,7 @@ namespace BizHawk.MultiClient { string filename = ""; SaveFileDialog sfd = new SaveFileDialog(); - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath); sfd.DefaultExt = "." + Global.Config.MovieExtension; sfd.FileName = RecordBox.Text; sfd.OverwritePrompt = false; diff --git a/BizHawk.MultiClient/config/PathConfig.cs b/BizHawk.MultiClient/config/PathConfig.cs index 64b355e41e..798698d3a7 100644 --- a/BizHawk.MultiClient/config/PathConfig.cs +++ b/BizHawk.MultiClient/config/PathConfig.cs @@ -470,7 +470,7 @@ namespace BizHawk.MultiClient { FolderBrowserDialog f = new FolderBrowserDialog(); f.Description = "Set the directory for " + Name; - f.SelectedPath = PathManager.MakeAbsolutePath(box.Text, ""); + f.SelectedPath = PathManager.MakeAbsolutePath(box.Text); DialogResult result = f.ShowDialog(); if (result == DialogResult.OK) box.Text = f.SelectedPath; @@ -1080,7 +1080,7 @@ namespace BizHawk.MultiClient private void button2_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); ofd.Filter = "Binary Files (*.rom,*.bin,*.pce)|*.rom;*.bin;*.pce|All Files|*.*"; ofd.RestoreDirectory = false; DialogResult result = ofd.ShowDialog(); @@ -1094,7 +1094,7 @@ namespace BizHawk.MultiClient private void NESBrowseFDSBIOS_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); ofd.Filter = "Binary Files (*.rom,*.bin)|*.rom;*.bin|All Files|*.*"; ofd.RestoreDirectory = false; DialogResult result = ofd.ShowDialog(); @@ -1108,7 +1108,7 @@ namespace BizHawk.MultiClient private void button3_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); ofd.Filter = "Binary Files (*.rom,*.bin)|*.rom;*.bin|All Files|*.*"; ofd.RestoreDirectory = false; DialogResult result = ofd.ShowDialog(); @@ -1122,7 +1122,7 @@ namespace BizHawk.MultiClient private void button4_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); ofd.Filter = "Binary Files (*.rom,*.bin)|*.rom;*.bin|All Files|*.*"; ofd.RestoreDirectory = false; DialogResult result = ofd.ShowDialog(); @@ -1141,7 +1141,7 @@ namespace BizHawk.MultiClient private void Atari7800BrowseNTSCBIOS_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); ofd.Filter = "Binary Files (*.rom,*.bin)|*.rom;*.bin|All Files|*.*"; ofd.RestoreDirectory = false; DialogResult result = ofd.ShowDialog(); @@ -1155,7 +1155,7 @@ namespace BizHawk.MultiClient private void Atari7800BrowsePALBIOS_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); ofd.Filter = "Binary Files (*.rom,*.bin)|*.rom;*.bin|All Files|*.*"; ofd.RestoreDirectory = false; DialogResult result = ofd.ShowDialog(); @@ -1169,7 +1169,7 @@ namespace BizHawk.MultiClient private void Atari7800BrowseHSCBIOS_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath); ofd.Filter = "Binary Files (*.rom,*.bin)|*.rom;*.bin|All Files|*.*"; ofd.RestoreDirectory = false; DialogResult result = ofd.ShowDialog(); diff --git a/BizHawk.MultiClient/config/PathManager.cs b/BizHawk.MultiClient/config/PathManager.cs index ec582585c8..b640e86786 100644 --- a/BizHawk.MultiClient/config/PathManager.cs +++ b/BizHawk.MultiClient/config/PathManager.cs @@ -19,7 +19,7 @@ namespace BizHawk.MultiClient /// /// Makes a path relative to the %exe% dir /// - public static string MakeProgramRelativePath(string path) { return MakeAbsolutePath("%exe%/" + path, ""); } + public static string MakeProgramRelativePath(string path) { return MakeAbsolutePath("%exe%/" + path); } /// /// The location of the default INI file @@ -110,10 +110,10 @@ namespace BizHawk.MultiClient public static string StandardFirmwareName(string name) { - return Path.Combine(MakeAbsolutePath(Global.Config.FirmwaresPath, ""), name); + return Path.Combine(MakeAbsolutePath(Global.Config.FirmwaresPath), name); } - public static string MakeAbsolutePath(string path, string system) + public static string MakeAbsolutePath(string path, string system = null) { //This function translates relative path and special identifiers in absolute paths @@ -139,7 +139,7 @@ namespace BizHawk.MultiClient if (path[0] == '.') { - if (system.Length > 0) + if (!String.IsNullOrWhiteSpace(system)) { path = path.Remove(0, 1); @@ -219,7 +219,7 @@ namespace BizHawk.MultiClient public static string GetLuaPath() { - return MakeAbsolutePath(Global.Config.LuaPath, ""); + return MakeAbsolutePath(Global.Config.LuaPath); } public static string GetRomsPath(string sysID) @@ -282,7 +282,7 @@ namespace BizHawk.MultiClient path = PathManager.MakeAbsolutePath(Global.Config.PathCOLROMs, "Coleco"); break; default: - path = PathManager.MakeAbsolutePath(Global.Config.BaseROMPath, ""); + path = PathManager.MakeAbsolutePath(Global.Config.BaseROMPath); break; } diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 770daf5712..c94629de5d 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -1886,7 +1886,7 @@ namespace BizHawk.MultiClient var ofd = new OpenFileDialog(); if (currentFile.Length > 0) ofd.FileName = Path.GetFileNameWithoutExtension(currentFile); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath); ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; ofd.RestoreDirectory = true; if (currentFile.Length > 0) diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index 38deeeefa8..a354e77f0d 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -592,7 +592,7 @@ namespace BizHawk.MultiClient var ofd = new OpenFileDialog(); if (currentFile.Length > 0) ofd.FileName = Path.GetFileNameWithoutExtension(currentFile); - ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, ""); + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath); ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; ofd.RestoreDirectory = true; diff --git a/BizHawk.MultiClient/tools/TAStudio.cs b/BizHawk.MultiClient/tools/TAStudio.cs index b7a1c4921e..d65c4c5e29 100644 --- a/BizHawk.MultiClient/tools/TAStudio.cs +++ b/BizHawk.MultiClient/tools/TAStudio.cs @@ -453,7 +453,7 @@ namespace BizHawk.MultiClient private static string SaveRecordingAs() { SaveFileDialog sfd = new SaveFileDialog(); - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath); sfd.DefaultExt = "." + Global.Config.MovieExtension; sfd.FileName = Global.MovieSession.Movie.Filename; string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; diff --git a/BizHawk.MultiClient/tools/TraceLogger.cs b/BizHawk.MultiClient/tools/TraceLogger.cs index 2f482b2014..04becba9ff 100644 --- a/BizHawk.MultiClient/tools/TraceLogger.cs +++ b/BizHawk.MultiClient/tools/TraceLogger.cs @@ -242,7 +242,7 @@ namespace BizHawk.MultiClient FileBox.Visible = true; BrowseBox.Visible = true; string name = PathManager.FilesystemSafeName(Global.Game); - string filename = Path.Combine(PathManager.MakeAbsolutePath(Global.Config.LogPath, ""), name) + ".txt"; + string filename = Path.Combine(PathManager.MakeAbsolutePath(Global.Config.LogPath), name) + ".txt"; LogFile = new FileInfo(filename); if (!LogFile.Directory.Exists) { @@ -313,7 +313,7 @@ namespace BizHawk.MultiClient { string name = PathManager.FilesystemSafeName(Global.Game); sfd.FileName = name + ".txt"; - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.LogPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.LogPath); } else if (!String.IsNullOrWhiteSpace(LogFile.FullName)) { @@ -323,7 +323,7 @@ namespace BizHawk.MultiClient else { sfd.FileName = Path.GetFileNameWithoutExtension(LogFile.FullName); - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.LogPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.LogPath); } sfd.Filter = "Text Files (*.txt)|*.txt|Log Files (*.log)|*.log|All Files|*.*"; diff --git a/BizHawk.MultiClient/tools/WatchCommon.cs b/BizHawk.MultiClient/tools/WatchCommon.cs index 8d28a15d7d..c050e16896 100644 --- a/BizHawk.MultiClient/tools/WatchCommon.cs +++ b/BizHawk.MultiClient/tools/WatchCommon.cs @@ -196,12 +196,12 @@ namespace BizHawk.MultiClient else if (!(Global.Emulator is NullEmulator)) { sfd.FileName = PathManager.FilesystemSafeName(Global.Game); - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath); } else { sfd.FileName = "NULL"; - sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, ""); + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath); } sfd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; sfd.RestoreDirectory = true;