diff --git a/BizHawk.MultiClient/config/PathManager.cs b/BizHawk.MultiClient/config/PathManager.cs index d1b14a9565..4226cae122 100644 --- a/BizHawk.MultiClient/config/PathManager.cs +++ b/BizHawk.MultiClient/config/PathManager.cs @@ -38,6 +38,7 @@ namespace BizHawk.MultiClient string tmp = Global.Config.BasePath; tmp = tmp.Remove(0, 1); tmp = tmp.Insert(0, GetExePathAbsolute()); + return tmp; } } } @@ -90,10 +91,17 @@ namespace BizHawk.MultiClient if ((path[0] > 'A' && path[0] < 'Z') || (path[0] > 'a' && path[0] < 'z')) { + //C:\ if (path.Length > 2 && path[1] == ':' && path[2] == '\\') return path; else - return GetExePathAbsolute(); //bad path + { + //file:\ is an acceptable path as well, and what FileBrowserDialog returns + if (path.Length >= 6 && path.Substring(0, 6) == "file:\\") + return path; + else + return GetExePathAbsolute(); //bad path + } } //all pad paths default to EXE diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index ae0597820d..f266f9985f 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -586,7 +586,7 @@ namespace BizHawk.MultiClient var ofd = new OpenFileDialog(); if (currentWatchFile.Length > 0) ofd.FileName = Path.GetFileNameWithoutExtension(currentWatchFile); - ofd.InitialDirectory = Global.Config.WatchPath; + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath); ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; ofd.RestoreDirectory = true; @@ -632,10 +632,20 @@ namespace BizHawk.MultiClient { var sfd = new SaveFileDialog(); if (currentWatchFile.Length > 0) + { sfd.FileName = Path.GetFileNameWithoutExtension(currentWatchFile); + sfd.InitialDirectory = Path.GetDirectoryName(currentWatchFile); + } else if (!(Global.Emulator is NullEmulator)) + { sfd.FileName = Global.Game.Name; - sfd.InitialDirectory = Global.Config.WatchPath; + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath); + } + else + { + sfd.FileName = "NULL"; + sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath); + } sfd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; sfd.RestoreDirectory = true; Global.Sound.StopSound();