diff --git a/BizHawk.Client.Common/config/PathEntry.cs b/BizHawk.Client.Common/config/PathEntry.cs index 4dcb34aacc..93154646b8 100644 --- a/BizHawk.Client.Common/config/PathEntry.cs +++ b/BizHawk.Client.Common/config/PathEntry.cs @@ -64,7 +64,35 @@ namespace BizHawk.Client.Common { get { - return Paths.FirstOrDefault(x => x.HasSystem(system) && x.Type == type); + return Paths.FirstOrDefault(x => x.HasSystem(system) && x.Type == type) ?? TryGetDebugPath(system, type); + } + } + + private PathEntry TryGetDebugPath(string system, string type) + { + if (Paths.Any(p => p.HasSystem(system))) + { + // we have the system, but not the type. don't attempt to add an unknown type + return null; + } + else + { + // we don't have anything for the system in question. add a set of stock paths + + string systempath = PathManager.RemoveInvalidFileSystemChars(system) + "_INTERIM"; + string systemdisp = system + " (INTERIM)"; + + Paths.AddRange(new[] + { + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Base", Path= Path.Combine(".", systempath), Ordinal = 0 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + }); + + return this[system, type]; } }