Collect sysID constants in a single class

This commit is contained in:
YoshiRulz 2021-11-10 13:00:03 +10:00
parent 1d6a4460d0
commit 4a4d8fe751
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
142 changed files with 901 additions and 795 deletions

View File

@ -1,6 +1,8 @@
using System; using System;
using System.Globalization; using System.Globalization;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
{ {
/// <summary> /// <summary>
@ -25,46 +27,46 @@ namespace BizHawk.Client.Common
{ {
return (string) value switch return (string) value switch
{ {
"AppleII" => CoreSystem.AppleII, VSystemID.Raw.AppleII => CoreSystem.AppleII,
"A26" => CoreSystem.Atari2600, VSystemID.Raw.A26 => CoreSystem.Atari2600,
"A78" => CoreSystem.Atari7800, VSystemID.Raw.A78 => CoreSystem.Atari7800,
"Coleco" => CoreSystem.ColecoVision, VSystemID.Raw.Coleco => CoreSystem.ColecoVision,
"C64" => CoreSystem.Commodore64, VSystemID.Raw.C64 => CoreSystem.Commodore64,
"DGB" => CoreSystem.DualGameBoy, VSystemID.Raw.DGB => CoreSystem.DualGameBoy,
"GB" => CoreSystem.GameBoy, VSystemID.Raw.GB => CoreSystem.GameBoy,
"GBA" => CoreSystem.GameBoyAdvance, VSystemID.Raw.GBA => CoreSystem.GameBoyAdvance,
"GEN" => CoreSystem.Genesis, VSystemID.Raw.GEN => CoreSystem.Genesis,
"INTV" => CoreSystem.Intellivision, VSystemID.Raw.INTV => CoreSystem.Intellivision,
"Libretro" => CoreSystem.Libretro, VSystemID.Raw.Libretro => CoreSystem.Libretro,
"Lynx" => CoreSystem.Lynx, VSystemID.Raw.Lynx => CoreSystem.Lynx,
"SMS" => CoreSystem.MasterSystem, VSystemID.Raw.SMS => CoreSystem.MasterSystem,
"NDS" => CoreSystem.NintendoDS, VSystemID.Raw.NDS => CoreSystem.NintendoDS,
"NES" => CoreSystem.NES, VSystemID.Raw.NES => CoreSystem.NES,
"N64" => CoreSystem.Nintendo64, VSystemID.Raw.N64 => CoreSystem.Nintendo64,
"NULL" => CoreSystem.Null, VSystemID.Raw.NULL => CoreSystem.Null,
"PCE" => CoreSystem.PCEngine, VSystemID.Raw.PCE => CoreSystem.PCEngine,
"PCECD" => CoreSystem.PCEngine, VSystemID.Raw.PCECD => CoreSystem.PCEngine,
"SGX" => CoreSystem.PCEngine, VSystemID.Raw.SGX => CoreSystem.PCEngine,
"PSX" => CoreSystem.Playstation, VSystemID.Raw.PSX => CoreSystem.Playstation,
"SAT" => CoreSystem.Saturn, VSystemID.Raw.SAT => CoreSystem.Saturn,
"SNES" => CoreSystem.SNES, VSystemID.Raw.SNES => CoreSystem.SNES,
"TI83" => CoreSystem.TI83, VSystemID.Raw.TI83 => CoreSystem.TI83,
"VEC" => CoreSystem.Vectrex, VSystemID.Raw.VEC => CoreSystem.Vectrex,
"WSWAN" => CoreSystem.WonderSwan, VSystemID.Raw.WSWAN => CoreSystem.WonderSwan,
"ZXSpectrum" => CoreSystem.ZXSpectrum, VSystemID.Raw.ZXSpectrum => CoreSystem.ZXSpectrum,
"AmstradCPC" => CoreSystem.AmstradCPC, VSystemID.Raw.AmstradCPC => CoreSystem.AmstradCPC,
"GGL" => CoreSystem.GGL, VSystemID.Raw.GGL => CoreSystem.GGL,
"ChannelF" => CoreSystem.ChannelF, VSystemID.Raw.ChannelF => CoreSystem.ChannelF,
"GB3x" => CoreSystem.GB3x, VSystemID.Raw.GB3x => CoreSystem.GB3x,
"GB4x" => CoreSystem.GB4x, VSystemID.Raw.GB4x => CoreSystem.GB4x,
"MAME" => CoreSystem.MAME, VSystemID.Raw.MAME => CoreSystem.MAME,
"O2" => CoreSystem.Odyssey2, VSystemID.Raw.O2 => CoreSystem.Odyssey2,
"MSX" => CoreSystem.MSX, VSystemID.Raw.MSX => CoreSystem.MSX,
"VB" => CoreSystem.VirtualBoy, VSystemID.Raw.VB => CoreSystem.VirtualBoy,
"NGP" => CoreSystem.NeoGeoPocket, VSystemID.Raw.NGP => CoreSystem.NeoGeoPocket,
"SGB" => CoreSystem.SuperGameBoy, VSystemID.Raw.SGB => CoreSystem.SuperGameBoy,
"UZE" => CoreSystem.UzeBox, VSystemID.Raw.UZE => CoreSystem.UzeBox,
"PCFX" => CoreSystem.PcFx, VSystemID.Raw.PCFX => CoreSystem.PcFx,
_ => throw new IndexOutOfRangeException($"{value} is missing in convert list") _ => throw new IndexOutOfRangeException($"{value} is missing in convert list")
}; };
} }
@ -95,31 +97,31 @@ namespace BizHawk.Client.Common
{ {
return (CoreSystem) value switch return (CoreSystem) value switch
{ {
CoreSystem.AppleII => "AppleII", CoreSystem.AppleII => VSystemID.Raw.AppleII,
CoreSystem.Atari2600 => "A26", CoreSystem.Atari2600 => VSystemID.Raw.A26,
CoreSystem.Atari7800 => "A78", CoreSystem.Atari7800 => VSystemID.Raw.A78,
CoreSystem.ColecoVision => "Coleco", CoreSystem.ColecoVision => VSystemID.Raw.Coleco,
CoreSystem.Commodore64 => "C64", CoreSystem.Commodore64 => VSystemID.Raw.C64,
CoreSystem.DualGameBoy => "DGB", CoreSystem.DualGameBoy => VSystemID.Raw.DGB,
CoreSystem.GameBoy => "GB", CoreSystem.GameBoy => VSystemID.Raw.GB,
CoreSystem.GameBoyAdvance => "GBA", CoreSystem.GameBoyAdvance => VSystemID.Raw.GBA,
CoreSystem.Genesis => "GEN", CoreSystem.Genesis => VSystemID.Raw.GEN,
CoreSystem.Intellivision => "INTV", CoreSystem.Intellivision => VSystemID.Raw.INTV,
CoreSystem.Libretro => "Libretro", CoreSystem.Libretro => VSystemID.Raw.Libretro,
CoreSystem.Lynx => "Lynx", CoreSystem.Lynx => VSystemID.Raw.Lynx,
CoreSystem.MasterSystem => "SMS", CoreSystem.MasterSystem => VSystemID.Raw.SMS,
CoreSystem.NES => "NES", CoreSystem.NES => VSystemID.Raw.NES,
CoreSystem.Nintendo64 => "N64", CoreSystem.Nintendo64 => VSystemID.Raw.N64,
CoreSystem.Null => "NULL", CoreSystem.Null => VSystemID.Raw.NULL,
CoreSystem.PCEngine => "PCE", CoreSystem.PCEngine => VSystemID.Raw.PCE,
CoreSystem.Playstation => "PSX", CoreSystem.Playstation => VSystemID.Raw.PSX,
CoreSystem.Saturn => "SAT", CoreSystem.Saturn => VSystemID.Raw.SAT,
CoreSystem.SNES => "SNES", CoreSystem.SNES => VSystemID.Raw.SNES,
CoreSystem.TI83 => "TI83", CoreSystem.TI83 => VSystemID.Raw.TI83,
CoreSystem.WonderSwan => "WSWAN", CoreSystem.WonderSwan => VSystemID.Raw.WSWAN,
CoreSystem.ZXSpectrum => "ZXSpectrum", CoreSystem.ZXSpectrum => VSystemID.Raw.ZXSpectrum,
CoreSystem.AmstradCPC => "AmstradCPC", CoreSystem.AmstradCPC => VSystemID.Raw.AmstradCPC,
CoreSystem.Odyssey2 => "O2", CoreSystem.Odyssey2 => VSystemID.Raw.O2,
_ => throw new IndexOutOfRangeException($"{value} is missing in convert list") _ => throw new IndexOutOfRangeException($"{value} is missing in convert list")
}; };
} }

View File

@ -245,24 +245,24 @@ namespace BizHawk.Client.Common
switch (discType) switch (discType)
{ {
case DiscType.SegaSaturn: case DiscType.SegaSaturn:
game.System = "SAT"; game.System = VSystemID.Raw.SAT;
break; break;
case DiscType.SonyPSP: case DiscType.SonyPSP:
game.System = "PSP"; game.System = "PSP";
break; break;
case DiscType.SonyPS2: case DiscType.SonyPS2:
game.System = "PS2"; game.System = VSystemID.Raw.PS2;
break; break;
case DiscType.MegaCD: case DiscType.MegaCD:
game.System = "GEN"; game.System = VSystemID.Raw.GEN;
break; break;
case DiscType.PCFX: case DiscType.PCFX:
game.System = "PCFX"; game.System = VSystemID.Raw.PCFX;
break; break;
case DiscType.TurboGECD: case DiscType.TurboGECD:
case DiscType.TurboCD: case DiscType.TurboCD:
game.System = "PCE"; game.System = VSystemID.Raw.PCE;
break; break;
case DiscType.Amiga: case DiscType.Amiga:
@ -280,12 +280,12 @@ namespace BizHawk.Client.Common
case DiscType.AudioDisc: case DiscType.AudioDisc:
case DiscType.UnknownCDFS: case DiscType.UnknownCDFS:
case DiscType.UnknownFormat: case DiscType.UnknownFormat:
game.System = _config.TryGetChosenSystemForFileExt(ext, out var sysID) ? sysID : "NULL"; game.System = _config.TryGetChosenSystemForFileExt(ext, out var sysID) ? sysID : VSystemID.Raw.NULL;
break; break;
default: //"for an unknown disc, default to psx instead of pce-cd, since that is far more likely to be what they are attempting to open" [5e07ab3ec3b8b8de9eae71b489b55d23a3909f55, year 2015] default: //"for an unknown disc, default to psx instead of pce-cd, since that is far more likely to be what they are attempting to open" [5e07ab3ec3b8b8de9eae71b489b55d23a3909f55, year 2015]
case DiscType.SonyPSX: case DiscType.SonyPSX:
game.System = "PSX"; game.System = VSystemID.Raw.PSX;
break; break;
} }
} }
@ -415,11 +415,11 @@ namespace BizHawk.Client.Common
// hacky for now // hacky for now
if (file.Extension == ".exe") if (file.Extension == ".exe")
{ {
rom.GameInfo.System = "PSX"; rom.GameInfo.System = VSystemID.Raw.PSX;
} }
else if (file.Extension == ".nsf") else if (file.Extension == ".nsf")
{ {
rom.GameInfo.System = "NES"; rom.GameInfo.System = VSystemID.Raw.NES;
} }
Util.DebugWriteLine(rom.GameInfo.System); Util.DebugWriteLine(rom.GameInfo.System);
@ -453,14 +453,14 @@ namespace BizHawk.Client.Common
switch (game.System) switch (game.System)
{ {
case "GB": case VSystemID.Raw.GB:
case "GBC": case VSystemID.Raw.GBC:
if (_config.GbAsSgb) if (_config.GbAsSgb)
{ {
game.System = "SGB"; game.System = VSystemID.Raw.SGB;
} }
break; break;
case "MAME": case VSystemID.Raw.MAME:
nextEmulator = new MAME( nextEmulator = new MAME(
file.Directory, file.Directory,
file.CanonicalName, file.CanonicalName,
@ -562,7 +562,7 @@ namespace BizHawk.Client.Common
// need to get rid of this hack at some point // need to get rid of this hack at some point
rom = new RomGame(file); rom = new RomGame(file);
game = rom.GameInfo; game = rom.GameInfo;
game.System = "SNES"; game.System = VSystemID.Raw.SNES;
nextEmulator = new LibsnesCore( nextEmulator = new LibsnesCore(
game, game,
null, null,
@ -576,7 +576,7 @@ namespace BizHawk.Client.Common
} }
catch catch
{ {
DoLoadErrorCallback(ex.ToString(), "DGB", LoadErrorType.Xml); DoLoadErrorCallback(ex.ToString(), VSystemID.Raw.DGB, LoadErrorType.Xml);
return false; return false;
} }
} }
@ -611,7 +611,7 @@ namespace BizHawk.Client.Common
{ {
// must be done before LoadNoGame (which triggers retro_init and the paths to be consumed by the core) // must be done before LoadNoGame (which triggers retro_init and the paths to be consumed by the core)
// game name == name of core // game name == name of core
Game = game = new GameInfo { Name = Path.GetFileNameWithoutExtension(launchLibretroCore), System = "Libretro" }; Game = game = new GameInfo { Name = Path.GetFileNameWithoutExtension(launchLibretroCore), System = VSystemID.Raw.Libretro };
var retro = new LibretroCore(nextComm, game, launchLibretroCore); var retro = new LibretroCore(nextComm, game, launchLibretroCore);
nextEmulator = retro; nextEmulator = retro;
@ -620,7 +620,7 @@ namespace BizHawk.Client.Common
// if we are allowed to run NoGame and we don't have a game, boot up the core that way // if we are allowed to run NoGame and we don't have a game, boot up the core that way
if (!retro.LoadNoGame()) if (!retro.LoadNoGame())
{ {
DoLoadErrorCallback("LibretroNoGame failed to load. This is weird", "Libretro"); DoLoadErrorCallback("LibretroNoGame failed to load. This is weird", VSystemID.Raw.Libretro);
retro.Dispose(); retro.Dispose();
return false; return false;
} }
@ -655,7 +655,7 @@ namespace BizHawk.Client.Common
if (!ret) if (!ret)
{ {
DoLoadErrorCallback("Libretro failed to load the given file. This is probably due to a core/content mismatch. Moreover, the process is now likely to be hosed. We suggest you restart the program.", "Libretro"); DoLoadErrorCallback("Libretro failed to load the given file. This is probably due to a core/content mismatch. Moreover, the process is now likely to be hosed. We suggest you restart the program.", VSystemID.Raw.Libretro);
retro.Dispose(); retro.Dispose();
return false; return false;
} }

View File

@ -17,15 +17,15 @@ namespace BizHawk.Client.Common.cheats
{ {
return _systemId switch return _systemId switch
{ {
"GB" or "SGB" => GameBoy(code), // FIXME: HLE SGB cores report a "SGB" ID, while LLE SNES cores report a "SNES" ID, is this intentional? VSystemID.Raw.GB or VSystemID.Raw.SGB => GameBoy(code), // FIXME: HLE SGB cores report a "SGB" ID, while LLE SNES cores report a "SNES" ID, is this intentional?
"GBA" => Gba(code), VSystemID.Raw.GBA => Gba(code),
"GEN" => Gen(code), VSystemID.Raw.GEN => Gen(code),
"N64" => N64(code), VSystemID.Raw.N64 => N64(code),
"NES" => Nes(code), VSystemID.Raw.NES => Nes(code),
"PSX" => Psx(code), VSystemID.Raw.PSX => Psx(code),
"SAT" => Saturn(code), VSystemID.Raw.SAT => Saturn(code),
"SMS" => Sms(code), VSystemID.Raw.SMS => Sms(code),
"SNES" => Snes(code), VSystemID.Raw.SNES => Snes(code),
_ => new InvalidCheatCode("Cheat codes not currently supported on this system") _ => new InvalidCheatCode("Cheat codes not currently supported on this system")
}; };
} }
@ -40,10 +40,10 @@ namespace BizHawk.Client.Common.cheats
private string CheatDomainName() => _systemId switch private string CheatDomainName() => _systemId switch
{ {
"N64" => "RDRAM", VSystemID.Raw.N64 => "RDRAM",
"PSX" => "MainRAM", VSystemID.Raw.PSX => "MainRAM",
#if false #if false
"SAT" => "Work Ram High", // Work RAM High may be incorrect? VSystemID.Raw.SAT => "Work Ram High", // Work RAM High may be incorrect?
#endif #endif
_ => null _ => null

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Common.PathExtensions; using BizHawk.Common.PathExtensions;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -19,17 +20,17 @@ namespace BizHawk.Client.Common
/// </remarks> /// </remarks>
public static readonly IReadOnlyList<(string[] AppliesTo, string[] CoreNames)> CorePickerUIData = new List<(string[], string[])> public static readonly IReadOnlyList<(string[] AppliesTo, string[] CoreNames)> CorePickerUIData = new List<(string[], string[])>
{ {
(new[] { "NES" }, (new[] { VSystemID.Raw.NES },
new[] { CoreNames.QuickNes, CoreNames.NesHawk, CoreNames.SubNesHawk }), new[] { CoreNames.QuickNes, CoreNames.NesHawk, CoreNames.SubNesHawk }),
(new[] { "SNES" }, (new[] { VSystemID.Raw.SNES },
new[] { CoreNames.Faust, CoreNames.Snes9X, CoreNames.Bsnes, CoreNames.Bsnes115 }), new[] { CoreNames.Faust, CoreNames.Snes9X, CoreNames.Bsnes, CoreNames.Bsnes115 }),
(new[] { "SGB" }, (new[] { VSystemID.Raw.SGB },
new[] { CoreNames.Gambatte, CoreNames.Bsnes, CoreNames.Bsnes115}), new[] { CoreNames.Gambatte, CoreNames.Bsnes, CoreNames.Bsnes115}),
(new[] { "GB", "GBC" }, (new[] { VSystemID.Raw.GB, VSystemID.Raw.GBC },
new[] { CoreNames.Gambatte, CoreNames.GbHawk, CoreNames.SubGbHawk }), new[] { CoreNames.Gambatte, CoreNames.GbHawk, CoreNames.SubGbHawk }),
(new[] { "DGB" }, (new[] { VSystemID.Raw.DGB },
new[] { CoreNames.DualGambatte, CoreNames.GBHawkLink }), new[] { CoreNames.DualGambatte, CoreNames.GBHawkLink }),
(new[] { "PCE", "PCECD", "SGX" }, (new[] { VSystemID.Raw.PCE, VSystemID.Raw.PCECD, VSystemID.Raw.SGX },
new[] { CoreNames.TurboNyma, CoreNames.HyperNyma, CoreNames.PceHawk }) new[] { CoreNames.TurboNyma, CoreNames.HyperNyma, CoreNames.PceHawk })
}; };
@ -317,15 +318,15 @@ namespace BizHawk.Client.Common
public Dictionary<string, string> PreferredCores = new Dictionary<string, string> public Dictionary<string, string> PreferredCores = new Dictionary<string, string>
{ {
["NES"] = CoreNames.QuickNes, [VSystemID.Raw.NES] = CoreNames.QuickNes,
["SNES"] = CoreNames.Snes9X, [VSystemID.Raw.SNES] = CoreNames.Snes9X,
["GB"] = CoreNames.Gambatte, [VSystemID.Raw.GB] = CoreNames.Gambatte,
["GBC"] = CoreNames.Gambatte, [VSystemID.Raw.GBC] = CoreNames.Gambatte,
["DGB"] = CoreNames.DualGambatte, [VSystemID.Raw.DGB] = CoreNames.DualGambatte,
["SGB"] = CoreNames.Gambatte, [VSystemID.Raw.SGB] = CoreNames.Gambatte,
["PCE"] = CoreNames.TurboNyma, [VSystemID.Raw.PCE] = CoreNames.TurboNyma,
["PCECD"] = CoreNames.TurboNyma, [VSystemID.Raw.PCECD] = CoreNames.TurboNyma,
["SGX"] = CoreNames.TurboNyma [VSystemID.Raw.SGX] = CoreNames.TurboNyma,
}; };
public bool DontTryOtherCores { get; set; } public bool DontTryOtherCores { get; set; }

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using BizHawk.Common.PathExtensions; using BizHawk.Common.PathExtensions;
using BizHawk.Emulation.Common;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
@ -10,45 +12,51 @@ namespace BizHawk.Client.Common
[JsonObject] [JsonObject]
public class PathEntryCollection : IEnumerable<PathEntry> public class PathEntryCollection : IEnumerable<PathEntry>
{ {
private static readonly string COMBINED_SYSIDS_GB = string.Join("_", VSystemID.Raw.GB, VSystemID.Raw.GBC, VSystemID.Raw.SGB);
private static readonly string COMBINED_SYSIDS_PCE = string.Join("_", VSystemID.Raw.PCE, VSystemID.Raw.PCECD, VSystemID.Raw.SGX);
public static readonly string GLOBAL = string.Join("_", "Global", VSystemID.Raw.NULL);
private static readonly Dictionary<string, string> _displayNameLookup = new() private static readonly Dictionary<string, string> _displayNameLookup = new()
{ {
["Global_NULL"] = "Global", [GLOBAL] = "Global",
["INTV"] = "Intellivision", [VSystemID.Raw.INTV] = "Intellivision",
["NES"] = "NES", [VSystemID.Raw.NES] = "NES",
["SNES"] = "SNES", [VSystemID.Raw.SNES] = "SNES",
["GBA"] = "GBA", [VSystemID.Raw.GBA] = "GBA",
["SMS"] = "SMS", [VSystemID.Raw.SMS] = "SMS",
["GG"] = "GG", [VSystemID.Raw.GG] = "GG",
["SG"] = "SG", [VSystemID.Raw.SG] = "SG",
["GEN"] = "Genesis", [VSystemID.Raw.GEN] = "Genesis",
["PCE_PCECD_SGX"] = "PC Engine", [COMBINED_SYSIDS_PCE] = "PC Engine",
["GB_GBC_SGB"] = "Gameboy", [COMBINED_SYSIDS_GB] = "Gameboy",
["DGB"] = "Dual Gameboy", [VSystemID.Raw.DGB] = "Dual Gameboy",
["TI83"] = "TI83", [VSystemID.Raw.TI83] = "TI83",
["A26"] = "Atari 2600", [VSystemID.Raw.A26] = "Atari 2600",
["A78"] = "Atari 7800", [VSystemID.Raw.A78] = "Atari 7800",
["C64"] = "Commodore 64", [VSystemID.Raw.C64] = "Commodore 64",
["ZXSpectrum"] = "Sinclair ZX Spectrum", [VSystemID.Raw.ZXSpectrum] = "Sinclair ZX Spectrum",
["AmstradCPC"] = "Amstrad CPC", [VSystemID.Raw.AmstradCPC] = "Amstrad CPC",
["PSX"] = "Playstation", [VSystemID.Raw.PSX] = "Playstation",
["Coleco"] = "Coleco", [VSystemID.Raw.Coleco] = "Coleco",
["N64"] = "N64", [VSystemID.Raw.N64] = "N64",
["SAT"] = "Saturn", [VSystemID.Raw.SAT] = "Saturn",
["WSWAN"] = "WonderSwan", [VSystemID.Raw.WSWAN] = "WonderSwan",
["Lynx"] = "Lynx", [VSystemID.Raw.Lynx] = "Lynx",
["AppleII"] = "Apple II", [VSystemID.Raw.AppleII] = "Apple II",
["Libretro"] = "Libretro", [VSystemID.Raw.Libretro] = "Libretro",
["VB"] = "VB", [VSystemID.Raw.VB] = "VB",
["NGP"] = "NGP", [VSystemID.Raw.NGP] = "NGP",
["PCFX"] = "PCFX", [VSystemID.Raw.PCFX] = "PCFX",
["ChannelF"] = "Fairchild Channel F", [VSystemID.Raw.ChannelF] = "Fairchild Channel F",
["GB3x"] = "GB3x", [VSystemID.Raw.GB3x] = "GB3x",
["GB4x"] = "GB4x", [VSystemID.Raw.GB4x] = "GB4x",
["VEC"] = "VEC", [VSystemID.Raw.VEC] = "VEC",
["O2"] = "O2", [VSystemID.Raw.O2] = "O2",
["MSX"] = "MSX", [VSystemID.Raw.MSX] = "MSX",
["UZE"] = "UZE", [VSystemID.Raw.UZE] = "UZE",
["NDS"] = "NDS", [VSystemID.Raw.NDS] = "NDS",
}; };
public static string GetDisplayNameFor(string sysID) public static string GetDisplayNameFor(string sysID)
@ -132,283 +140,283 @@ namespace BizHawk.Client.Common
} }
[JsonIgnore] [JsonIgnore]
public string FirmwaresPathFragment => this["Global", "Firmware"].Path; public string FirmwaresPathFragment => this[GLOBAL, "Firmware"].Path;
[JsonIgnore] [JsonIgnore]
internal string TempFilesFragment => this["Global", "Temp Files"].Path; internal string TempFilesFragment => this[GLOBAL, "Temp Files"].Path;
public static List<PathEntry> DefaultValues => new List<PathEntry> public static List<PathEntry> DefaultValues => new List<PathEntry>
{ {
new("Global_NULL", 1, "Base", "."), new(GLOBAL, 1, "Base", "."),
new("Global_NULL", 2, "ROM", "."), new(GLOBAL, 2, "ROM", "."),
new("Global_NULL", 3, "Firmware", Path.Combine(".", "Firmware")), new(GLOBAL, 3, "Firmware", Path.Combine(".", "Firmware")),
new("Global_NULL", 4, "Movies", Path.Combine(".", "Movies")), new(GLOBAL, 4, "Movies", Path.Combine(".", "Movies")),
new("Global_NULL", 5, "Movie backups", Path.Combine(".", "Movies", "backup")), new(GLOBAL, 5, "Movie backups", Path.Combine(".", "Movies", "backup")),
new("Global_NULL", 6, "A/V Dumps", "."), new(GLOBAL, 6, "A/V Dumps", "."),
new("Global_NULL", 7, "Tools", Path.Combine(".", "Tools")), new(GLOBAL, 7, "Tools", Path.Combine(".", "Tools")),
new("Global_NULL", 8, "Lua", Path.Combine(".", "Lua")), new(GLOBAL, 8, "Lua", Path.Combine(".", "Lua")),
new("Global_NULL", 9, "Watch (.wch)", Path.Combine(".", ".")), new(GLOBAL, 9, "Watch (.wch)", Path.Combine(".", ".")),
new("Global_NULL", 10, "Debug Logs", Path.Combine(".", "")), new(GLOBAL, 10, "Debug Logs", Path.Combine(".", "")),
new("Global_NULL", 11, "Macros", Path.Combine(".", "Movies", "Macros")), new(GLOBAL, 11, "Macros", Path.Combine(".", "Movies", "Macros")),
new("Global_NULL", 12, "TAStudio states", Path.Combine(".", "Movies", "TAStudio states")), new(GLOBAL, 12, "TAStudio states", Path.Combine(".", "Movies", "TAStudio states")),
new("Global_NULL", 13, "Multi-Disk Bundles", Path.Combine(".", "")), new(GLOBAL, 13, "Multi-Disk Bundles", Path.Combine(".", "")),
new("Global_NULL", 14, "External Tools", Path.Combine(".", "ExternalTools")), new(GLOBAL, 14, "External Tools", Path.Combine(".", "ExternalTools")),
new("Global_NULL", 15, "Temp Files", ""), new(GLOBAL, 15, "Temp Files", ""),
new("INTV", 0, "Base", Path.Combine(".", "Intellivision")), new(VSystemID.Raw.INTV, 0, "Base", Path.Combine(".", "Intellivision")),
new("INTV", 1, "ROM", "."), new(VSystemID.Raw.INTV, 1, "ROM", "."),
new("INTV", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.INTV, 2, "Savestates", Path.Combine(".", "State")),
new("INTV", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.INTV, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("INTV", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.INTV, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("INTV", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.INTV, 5, "Cheats", Path.Combine(".", "Cheats")),
new("INTV", 6, "Palettes", Path.Combine(".", "Palettes")), new(VSystemID.Raw.INTV, 6, "Palettes", Path.Combine(".", "Palettes")),
new("NES", 0, "Base", Path.Combine(".", "NES")), new(VSystemID.Raw.NES, 0, "Base", Path.Combine(".", "NES")),
new("NES", 1, "ROM", "."), new(VSystemID.Raw.NES, 1, "ROM", "."),
new("NES", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.NES, 2, "Savestates", Path.Combine(".", "State")),
new("NES", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.NES, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("NES", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.NES, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("NES", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.NES, 5, "Cheats", Path.Combine(".", "Cheats")),
new("NES", 6, "Palettes", Path.Combine(".", "Palettes")), new(VSystemID.Raw.NES, 6, "Palettes", Path.Combine(".", "Palettes")),
new("SNES", 0, "Base", Path.Combine(".", "SNES")), new(VSystemID.Raw.SNES, 0, "Base", Path.Combine(".", "SNES")),
new("SNES", 1, "ROM", "."), new(VSystemID.Raw.SNES, 1, "ROM", "."),
new("SNES", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.SNES, 2, "Savestates", Path.Combine(".", "State")),
new("SNES", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.SNES, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("SNES", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.SNES, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("SNES", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.SNES, 5, "Cheats", Path.Combine(".", "Cheats")),
new("GBA", 0, "Base", Path.Combine(".", "GBA")), new(VSystemID.Raw.GBA, 0, "Base", Path.Combine(".", "GBA")),
new("GBA", 1, "ROM", "."), new(VSystemID.Raw.GBA, 1, "ROM", "."),
new("GBA", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.GBA, 2, "Savestates", Path.Combine(".", "State")),
new("GBA", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.GBA, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("GBA", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.GBA, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("GBA", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.GBA, 5, "Cheats", Path.Combine(".", "Cheats")),
new("SMS", 0, "Base", Path.Combine(".", "SMS")), new(VSystemID.Raw.SMS, 0, "Base", Path.Combine(".", "SMS")),
new("SMS", 1, "ROM", "."), new(VSystemID.Raw.SMS, 1, "ROM", "."),
new("SMS", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.SMS, 2, "Savestates", Path.Combine(".", "State")),
new("SMS", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.SMS, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("SMS", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.SMS, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("SMS", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.SMS, 5, "Cheats", Path.Combine(".", "Cheats")),
new("GG", 0, "Base", Path.Combine(".", "Game Gear")), new(VSystemID.Raw.GG, 0, "Base", Path.Combine(".", "Game Gear")),
new("GG", 1, "ROM", "."), new(VSystemID.Raw.GG, 1, "ROM", "."),
new("GG", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.GG, 2, "Savestates", Path.Combine(".", "State")),
new("GG", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.GG, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("GG", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.GG, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("GG", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.GG, 5, "Cheats", Path.Combine(".", "Cheats")),
new("SG", 0, "Base", Path.Combine(".", "SG-1000")), new(VSystemID.Raw.SG, 0, "Base", Path.Combine(".", "SG-1000")),
new("SG", 1, "ROM", "."), new(VSystemID.Raw.SG, 1, "ROM", "."),
new("SG", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.SG, 2, "Savestates", Path.Combine(".", "State")),
new("SG", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.SG, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("SG", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.SG, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("SG", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.SG, 5, "Cheats", Path.Combine(".", "Cheats")),
new("GEN", 0, "Base", Path.Combine(".", "Genesis")), new(VSystemID.Raw.GEN, 0, "Base", Path.Combine(".", "Genesis")),
new("GEN", 1, "ROM", "."), new(VSystemID.Raw.GEN, 1, "ROM", "."),
new("GEN", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.GEN, 2, "Savestates", Path.Combine(".", "State")),
new("GEN", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.GEN, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("GEN", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.GEN, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("GEN", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.GEN, 5, "Cheats", Path.Combine(".", "Cheats")),
new("PCE_PCECD_SGX", 0, "Base", Path.Combine(".", "PC Engine")), new(COMBINED_SYSIDS_PCE, 0, "Base", Path.Combine(".", "PC Engine")),
new("PCE_PCECD_SGX", 1, "ROM", "."), new(COMBINED_SYSIDS_PCE, 1, "ROM", "."),
new("PCE_PCECD_SGX", 2, "Savestates", Path.Combine(".", "State")), new(COMBINED_SYSIDS_PCE, 2, "Savestates", Path.Combine(".", "State")),
new("PCE_PCECD_SGX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(COMBINED_SYSIDS_PCE, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("PCE_PCECD_SGX", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(COMBINED_SYSIDS_PCE, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("PCE_PCECD_SGX", 5, "Cheats", Path.Combine(".", "Cheats")), new(COMBINED_SYSIDS_PCE, 5, "Cheats", Path.Combine(".", "Cheats")),
new("GB_GBC_SGB", 0, "Base", Path.Combine(".", "Gameboy")), new(COMBINED_SYSIDS_GB, 0, "Base", Path.Combine(".", "Gameboy")),
new("GB_GBC_SGB", 1, "ROM", "."), new(COMBINED_SYSIDS_GB, 1, "ROM", "."),
new("GB_GBC_SGB", 2, "Savestates", Path.Combine(".", "State")), new(COMBINED_SYSIDS_GB, 2, "Savestates", Path.Combine(".", "State")),
new("GB_GBC_SGB", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(COMBINED_SYSIDS_GB, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("GB_GBC_SGB", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(COMBINED_SYSIDS_GB, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("GB_GBC_SGB", 5, "Cheats", Path.Combine(".", "Cheats")), new(COMBINED_SYSIDS_GB, 5, "Cheats", Path.Combine(".", "Cheats")),
new("GB_GBC_SGB", 6, "Palettes", Path.Combine(".", "Palettes")), new(COMBINED_SYSIDS_GB, 6, "Palettes", Path.Combine(".", "Palettes")),
new("DGB", 0, "Base", Path.Combine(".", "Dual Gameboy")), new(VSystemID.Raw.DGB, 0, "Base", Path.Combine(".", "Dual Gameboy")),
new("DGB", 1, "ROM", "."), new(VSystemID.Raw.DGB, 1, "ROM", "."),
new("DGB", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.DGB, 2, "Savestates", Path.Combine(".", "State")),
new("DGB", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.DGB, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("DGB", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.DGB, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("DGB", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.DGB, 5, "Cheats", Path.Combine(".", "Cheats")),
new("DGB", 6, "Palettes", Path.Combine(".", "Palettes")), new(VSystemID.Raw.DGB, 6, "Palettes", Path.Combine(".", "Palettes")),
new("TI83", 0, "Base", Path.Combine(".", "TI83")), new(VSystemID.Raw.TI83, 0, "Base", Path.Combine(".", "TI83")),
new("TI83", 1, "ROM", "."), new(VSystemID.Raw.TI83, 1, "ROM", "."),
new("TI83", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.TI83, 2, "Savestates", Path.Combine(".", "State")),
new("TI83", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.TI83, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("TI83", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.TI83, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("TI83", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.TI83, 5, "Cheats", Path.Combine(".", "Cheats")),
new("A26", 0, "Base", Path.Combine(".", "Atari 2600")), new(VSystemID.Raw.A26, 0, "Base", Path.Combine(".", "Atari 2600")),
new("A26", 1, "ROM", "."), new(VSystemID.Raw.A26, 1, "ROM", "."),
new("A26", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.A26, 2, "Savestates", Path.Combine(".", "State")),
new("A26", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.A26, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("A26", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.A26, 5, "Cheats", Path.Combine(".", "Cheats")),
new("A78", 0, "Base", Path.Combine(".", "Atari 7800")), new(VSystemID.Raw.A78, 0, "Base", Path.Combine(".", "Atari 7800")),
new("A78", 1, "ROM", "."), new(VSystemID.Raw.A78, 1, "ROM", "."),
new("A78", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.A78, 2, "Savestates", Path.Combine(".", "State")),
new("A78", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.A78, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("A78", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.A78, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("A78", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.A78, 5, "Cheats", Path.Combine(".", "Cheats")),
new("C64", 0, "Base", Path.Combine(".", "C64")), new(VSystemID.Raw.C64, 0, "Base", Path.Combine(".", "C64")),
new("C64", 1, "ROM", "."), new(VSystemID.Raw.C64, 1, "ROM", "."),
new("C64", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.C64, 2, "Savestates", Path.Combine(".", "State")),
new("C64", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.C64, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("C64", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.C64, 5, "Cheats", Path.Combine(".", "Cheats")),
new("ZXSpectrum", 0, "Base", Path.Combine(".", "ZXSpectrum")), new(VSystemID.Raw.ZXSpectrum, 0, "Base", Path.Combine(".", "ZXSpectrum")),
new("ZXSpectrum", 1, "ROM", "."), new(VSystemID.Raw.ZXSpectrum, 1, "ROM", "."),
new("ZXSpectrum", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.ZXSpectrum, 2, "Savestates", Path.Combine(".", "State")),
new("ZXSpectrum", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.ZXSpectrum, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("ZXSpectrum", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.ZXSpectrum, 5, "Cheats", Path.Combine(".", "Cheats")),
new("AmstradCPC", 0, "Base", Path.Combine(".", "AmstradCPC")), new(VSystemID.Raw.AmstradCPC, 0, "Base", Path.Combine(".", "AmstradCPC")),
new("AmstradCPC", 1, "ROM", "."), new(VSystemID.Raw.AmstradCPC, 1, "ROM", "."),
new("AmstradCPC", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.AmstradCPC, 2, "Savestates", Path.Combine(".", "State")),
new("AmstradCPC", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.AmstradCPC, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("AmstradCPC", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.AmstradCPC, 5, "Cheats", Path.Combine(".", "Cheats")),
new("PSX", 0, "Base", Path.Combine(".", "PSX")), new(VSystemID.Raw.PSX, 0, "Base", Path.Combine(".", "PSX")),
new("PSX", 1, "ROM", "."), new(VSystemID.Raw.PSX, 1, "ROM", "."),
new("PSX", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.PSX, 2, "Savestates", Path.Combine(".", "State")),
new("PSX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.PSX, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("PSX", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.PSX, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("PSX", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.PSX, 5, "Cheats", Path.Combine(".", "Cheats")),
new("Coleco", 0, "Base", Path.Combine(".", "Coleco")), new(VSystemID.Raw.Coleco, 0, "Base", Path.Combine(".", "Coleco")),
new("Coleco", 1, "ROM", "."), new(VSystemID.Raw.Coleco, 1, "ROM", "."),
new("Coleco", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.Coleco, 2, "Savestates", Path.Combine(".", "State")),
new("Coleco", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.Coleco, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("Coleco", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.Coleco, 5, "Cheats", Path.Combine(".", "Cheats")),
new("N64", 0, "Base", Path.Combine(".", "N64")), new(VSystemID.Raw.N64, 0, "Base", Path.Combine(".", "N64")),
new("N64", 1, "ROM", "."), new(VSystemID.Raw.N64, 1, "ROM", "."),
new("N64", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.N64, 2, "Savestates", Path.Combine(".", "State")),
new("N64", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.N64, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("N64", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.N64, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("N64", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.N64, 5, "Cheats", Path.Combine(".", "Cheats")),
new("SAT", 0, "Base", Path.Combine(".", "Saturn")), new(VSystemID.Raw.SAT, 0, "Base", Path.Combine(".", "Saturn")),
new("SAT", 1, "ROM", "."), new(VSystemID.Raw.SAT, 1, "ROM", "."),
new("SAT", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.SAT, 2, "Savestates", Path.Combine(".", "State")),
new("SAT", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.SAT, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("SAT", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.SAT, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("SAT", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.SAT, 5, "Cheats", Path.Combine(".", "Cheats")),
new("WSWAN", 0, "Base", Path.Combine(".", "WonderSwan")), new(VSystemID.Raw.WSWAN, 0, "Base", Path.Combine(".", "WonderSwan")),
new("WSWAN", 1, "ROM", "."), new(VSystemID.Raw.WSWAN, 1, "ROM", "."),
new("WSWAN", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.WSWAN, 2, "Savestates", Path.Combine(".", "State")),
new("WSWAN", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.WSWAN, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("WSWAN", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.WSWAN, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("WSWAN", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.WSWAN, 5, "Cheats", Path.Combine(".", "Cheats")),
new("Lynx", 0, "Base", Path.Combine(".", "Lynx")), new(VSystemID.Raw.Lynx, 0, "Base", Path.Combine(".", "Lynx")),
new("Lynx", 1, "ROM", "."), new(VSystemID.Raw.Lynx, 1, "ROM", "."),
new("Lynx", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.Lynx, 2, "Savestates", Path.Combine(".", "State")),
new("Lynx", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.Lynx, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("Lynx", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.Lynx, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("Lynx", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.Lynx, 5, "Cheats", Path.Combine(".", "Cheats")),
new("AppleII", 0, "Base", Path.Combine(".", "Apple II")), new(VSystemID.Raw.AppleII, 0, "Base", Path.Combine(".", "Apple II")),
new("AppleII", 1, "ROM", "."), new(VSystemID.Raw.AppleII, 1, "ROM", "."),
new("AppleII", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.AppleII, 2, "Savestates", Path.Combine(".", "State")),
new("AppleII", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.AppleII, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("AppleII", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.AppleII, 5, "Cheats", Path.Combine(".", "Cheats")),
new("Libretro", 0, "Base", Path.Combine(".", "Libretro")), new(VSystemID.Raw.Libretro, 0, "Base", Path.Combine(".", "Libretro")),
new("Libretro", 1, "Cores", Path.Combine(".", "Cores")), new(VSystemID.Raw.Libretro, 1, "Cores", Path.Combine(".", "Cores")),
new("Libretro", 2, "System", Path.Combine(".", "System")), new(VSystemID.Raw.Libretro, 2, "System", Path.Combine(".", "System")),
new("Libretro", 3, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.Libretro, 3, "Savestates", Path.Combine(".", "State")),
new("Libretro", 4, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.Libretro, 4, "Save RAM", Path.Combine(".", "SaveRAM")),
new("Libretro", 5, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.Libretro, 5, "Screenshots", Path.Combine(".", "Screenshots")),
new("Libretro", 6, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.Libretro, 6, "Cheats", Path.Combine(".", "Cheats")),
//It doesn't make much sense to have a ROM dir for libretro, but a lot of stuff is built around the assumption of a ROM dir existing //It doesn't make much sense to have a ROM dir for libretro, but a lot of stuff is built around the assumption of a ROM dir existing
//also, note, sometimes when path gets used, it's for opening a rom, which will be... loaded by... the default system for that rom, i.e. NOT libretro. //also, note, sometimes when path gets used, it's for opening a rom, which will be... loaded by... the default system for that rom, i.e. NOT libretro.
//Really, "Open Rom" for instance doesn't make sense when you have a libretro core open. //Really, "Open Rom" for instance doesn't make sense when you have a libretro core open.
//Well, this is better than nothing. //Well, this is better than nothing.
new("Libretro", 7, "ROM", "%recent%"), new(VSystemID.Raw.Libretro, 7, "ROM", "%recent%"),
new("VB", 0, "Base", Path.Combine(".", "VB")), new(VSystemID.Raw.VB, 0, "Base", Path.Combine(".", "VB")),
new("VB", 1, "ROM", "."), new(VSystemID.Raw.VB, 1, "ROM", "."),
new("VB", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.VB, 2, "Savestates", Path.Combine(".", "State")),
new("VB", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.VB, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("VB", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.VB, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("VB", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.VB, 5, "Cheats", Path.Combine(".", "Cheats")),
new("NGP", 0, "Base", Path.Combine(".", "NGP")), new(VSystemID.Raw.NGP, 0, "Base", Path.Combine(".", "NGP")),
new("NGP", 1, "ROM", "."), new(VSystemID.Raw.NGP, 1, "ROM", "."),
new("NGP", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.NGP, 2, "Savestates", Path.Combine(".", "State")),
new("NGP", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.NGP, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("NGP", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.NGP, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("NGP", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.NGP, 5, "Cheats", Path.Combine(".", "Cheats")),
new("PCFX", 0, "Base", Path.Combine(".", "PCFX")), new(VSystemID.Raw.PCFX, 0, "Base", Path.Combine(".", "PCFX")),
new("PCFX", 1, "ROM", "."), new(VSystemID.Raw.PCFX, 1, "ROM", "."),
new("PCFX", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.PCFX, 2, "Savestates", Path.Combine(".", "State")),
new("PCFX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.PCFX, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("PCFX", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.PCFX, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("PCFX", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.PCFX, 5, "Cheats", Path.Combine(".", "Cheats")),
new("ChannelF", 0, "Base", Path.Combine(".", "ZXSpectrum")), new(VSystemID.Raw.ChannelF, 0, "Base", Path.Combine(".", "ZXSpectrum")),
new("ChannelF", 1, "ROM", "."), new(VSystemID.Raw.ChannelF, 1, "ROM", "."),
new("ChannelF", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.ChannelF, 2, "Savestates", Path.Combine(".", "State")),
new("ChannelF", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.ChannelF, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("ChannelF", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.ChannelF, 5, "Cheats", Path.Combine(".", "Cheats")),
new("GB3x", 0, "Base", Path.Combine(".", "GB3x")), new(VSystemID.Raw.GB3x, 0, "Base", Path.Combine(".", "GB3x")),
new("GB3x", 1, "ROM", "."), new(VSystemID.Raw.GB3x, 1, "ROM", "."),
new("GB3x", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.GB3x, 2, "Savestates", Path.Combine(".", "State")),
new("GB3x", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.GB3x, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("GB3x", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.GB3x, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("GB3x", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.GB3x, 5, "Cheats", Path.Combine(".", "Cheats")),
new("GB4x", 0, "Base", Path.Combine(".", "GB4x")), new(VSystemID.Raw.GB4x, 0, "Base", Path.Combine(".", "GB4x")),
new("GB4x", 1, "ROM", "."), new(VSystemID.Raw.GB4x, 1, "ROM", "."),
new("GB4x", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.GB4x, 2, "Savestates", Path.Combine(".", "State")),
new("GB4x", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.GB4x, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("GB4x", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.GB4x, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("GB4x", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.GB4x, 5, "Cheats", Path.Combine(".", "Cheats")),
new("VEC", 0, "Base", Path.Combine(".", "VEC")), new(VSystemID.Raw.VEC, 0, "Base", Path.Combine(".", "VEC")),
new("VEC", 1, "ROM", "."), new(VSystemID.Raw.VEC, 1, "ROM", "."),
new("VEC", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.VEC, 2, "Savestates", Path.Combine(".", "State")),
new("VEC", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.VEC, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("VEC", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.VEC, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("VEC", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.VEC, 5, "Cheats", Path.Combine(".", "Cheats")),
new("O2", 0, "Base", Path.Combine(".", "O2")), new(VSystemID.Raw.O2, 0, "Base", Path.Combine(".", "O2")),
new("O2", 1, "ROM", "."), new(VSystemID.Raw.O2, 1, "ROM", "."),
new("O2", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.O2, 2, "Savestates", Path.Combine(".", "State")),
new("O2", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.O2, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("O2", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.O2, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("O2", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.O2, 5, "Cheats", Path.Combine(".", "Cheats")),
new("MSX", 0, "Base", Path.Combine(".", "MSX")), new(VSystemID.Raw.MSX, 0, "Base", Path.Combine(".", "MSX")),
new("MSX", 1, "ROM", "."), new(VSystemID.Raw.MSX, 1, "ROM", "."),
new("MSX", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.MSX, 2, "Savestates", Path.Combine(".", "State")),
new("MSX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.MSX, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("MSX", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.MSX, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("MSX", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.MSX, 5, "Cheats", Path.Combine(".", "Cheats")),
new("UZE", 0, "Base", Path.Combine(".", "VEC")), new(VSystemID.Raw.UZE, 0, "Base", Path.Combine(".", "VEC")),
new("UZE", 1, "ROM", "."), new(VSystemID.Raw.UZE, 1, "ROM", "."),
new("UZE", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.UZE, 2, "Savestates", Path.Combine(".", "State")),
new("UZE", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.UZE, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("UZE", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.UZE, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("UZE", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.UZE, 5, "Cheats", Path.Combine(".", "Cheats")),
new("NDS", 0, "Base", Path.Combine(".", "NDS")), new(VSystemID.Raw.NDS, 0, "Base", Path.Combine(".", "NDS")),
new("NDS", 1, "ROM", "."), new(VSystemID.Raw.NDS, 1, "ROM", "."),
new("NDS", 2, "Savestates", Path.Combine(".", "State")), new(VSystemID.Raw.NDS, 2, "Savestates", Path.Combine(".", "State")),
new("NDS", 3, "Save RAM", Path.Combine(".", "SaveRAM")), new(VSystemID.Raw.NDS, 3, "Save RAM", Path.Combine(".", "SaveRAM")),
new("NDS", 4, "Screenshots", Path.Combine(".", "Screenshots")), new(VSystemID.Raw.NDS, 4, "Screenshots", Path.Combine(".", "Screenshots")),
new("NDS", 5, "Cheats", Path.Combine(".", "Cheats")), new(VSystemID.Raw.NDS, 5, "Cheats", Path.Combine(".", "Cheats")),
}; };
} }
} }

View File

@ -21,7 +21,7 @@ namespace BizHawk.Client.Common
public static string GlobalBaseAbsolutePath(this PathEntryCollection collection) public static string GlobalBaseAbsolutePath(this PathEntryCollection collection)
{ {
var globalBase = collection["Global", "Base"].Path; var globalBase = collection[PathEntryCollection.GLOBAL, "Base"].Path;
// if %exe% prefixed then substitute exe path and repeat // if %exe% prefixed then substitute exe path and repeat
if (globalBase.StartsWith("%exe%", StringComparison.InvariantCultureIgnoreCase)) if (globalBase.StartsWith("%exe%", StringComparison.InvariantCultureIgnoreCase))
@ -50,7 +50,7 @@ namespace BizHawk.Client.Common
{ {
return (collection[systemId, pathType] return (collection[systemId, pathType]
?? collection[systemId, "Base"]) ?? collection[systemId, "Base"])
?? collection["Global", "Base"]; ?? collection[PathEntryCollection.GLOBAL, "Base"];
} }
public static string AbsolutePathForType(this PathEntryCollection collection, string systemId, string type) public static string AbsolutePathForType(this PathEntryCollection collection, string systemId, string type)
@ -138,25 +138,25 @@ namespace BizHawk.Client.Common
public static string MovieAbsolutePath(this PathEntryCollection collection) public static string MovieAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection["Global", "Movies"].Path; var path = collection[PathEntryCollection.GLOBAL, "Movies"].Path;
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
public static string MovieBackupsAbsolutePath(this PathEntryCollection collection) public static string MovieBackupsAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection["Global", "Movie backups"].Path; var path = collection[PathEntryCollection.GLOBAL, "Movie backups"].Path;
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
public static string AvAbsolutePath(this PathEntryCollection collection) public static string AvAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection["Global", "A/V Dumps"].Path; var path = collection[PathEntryCollection.GLOBAL, "A/V Dumps"].Path;
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
public static string LuaAbsolutePath(this PathEntryCollection collection) public static string LuaAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection["Global", "Lua"].Path; var path = collection[PathEntryCollection.GLOBAL, "Lua"].Path;
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
@ -167,31 +167,31 @@ namespace BizHawk.Client.Common
public static string LogAbsolutePath(this PathEntryCollection collection) public static string LogAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection.ResolveToolsPath(collection["Global", "Debug Logs"].Path); var path = collection.ResolveToolsPath(collection[PathEntryCollection.GLOBAL, "Debug Logs"].Path);
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
public static string WatchAbsolutePath(this PathEntryCollection collection) public static string WatchAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection.ResolveToolsPath(collection["Global", "Watch (.wch)"].Path); var path = collection.ResolveToolsPath(collection[PathEntryCollection.GLOBAL, "Watch (.wch)"].Path);
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
public static string ToolsAbsolutePath(this PathEntryCollection collection) public static string ToolsAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection["Global", "Tools"].Path; var path = collection[PathEntryCollection.GLOBAL, "Tools"].Path;
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
public static string TastudioStatesAbsolutePath(this PathEntryCollection collection) public static string TastudioStatesAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection["Global", "TAStudio states"].Path; var path = collection[PathEntryCollection.GLOBAL, "TAStudio states"].Path;
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
public static string MultiDiskAbsolutePath(this PathEntryCollection collection) public static string MultiDiskAbsolutePath(this PathEntryCollection collection)
{ {
var path = collection.ResolveToolsPath(collection["Global", "Multi-Disk Bundles"].Path); var path = collection.ResolveToolsPath(collection[PathEntryCollection.GLOBAL, "Multi-Disk Bundles"].Path);
return collection.AbsolutePathFor(path, null); return collection.AbsolutePathFor(path, null);
} }
@ -199,7 +199,7 @@ namespace BizHawk.Client.Common
{ {
if (string.IsNullOrWhiteSpace(systemId)) if (string.IsNullOrWhiteSpace(systemId))
{ {
return collection.AbsolutePathFor(collection["Global_NULL", "ROM"].Path, "Global_NULL"); return collection.AbsolutePathFor(collection[PathEntryCollection.GLOBAL, "ROM"].Path, PathEntryCollection.GLOBAL);
} }
if (collection.UseRecentForRoms) if (collection.UseRecentForRoms)
@ -211,7 +211,7 @@ namespace BizHawk.Client.Common
if (!path.Path.PathIsSet()) if (!path.Path.PathIsSet())
{ {
path = collection["Global", "ROM"]; path = collection[PathEntryCollection.GLOBAL, "ROM"];
if (path.Path.PathIsSet()) if (path.Path.PathIsSet())
{ {
@ -333,7 +333,7 @@ namespace BizHawk.Client.Common
return subPath; return subPath;
} }
var toolsPath = collection["Global", "Tools"].Path; var toolsPath = collection[PathEntryCollection.GLOBAL, "Tools"].Path;
// Hack for backwards compatibility, prior to 1.11.5, .wch files were in .\Tools, we don't want that to turn into .Tools\Tools // Hack for backwards compatibility, prior to 1.11.5, .wch files were in .\Tools, we don't want that to turn into .Tools\Tools
if (subPath == "Tools") if (subPath == "Tools")

View File

@ -30,7 +30,7 @@ namespace BizHawk.Client.Common
var @base = File.ReadAllBytes(baseFilename); var @base = File.ReadAllBytes(baseFilename);
var (patched, actualHash) = PerformPatchInMemory(@base, in patchOption); var (patched, actualHash) = PerformPatchInMemory(@base, in patchOption);
Trace.Assert(actualHash == patchOption.TargetHash); Trace.Assert(actualHash == patchOption.TargetHash);
var patchedParentDir = Path.Combine(pathEntries["Global", "Temp Files"].Path, "AutopatchedFirmware"); var patchedParentDir = Path.Combine(pathEntries[PathEntryCollection.GLOBAL, "Temp Files"].Path, "AutopatchedFirmware");
Directory.CreateDirectory(patchedParentDir); Directory.CreateDirectory(patchedParentDir);
var ff = FirmwareDatabase.FirmwareFilesByHash[patchOption.TargetHash]; var ff = FirmwareDatabase.FirmwareFilesByHash[patchOption.TargetHash];
var patchedFilePath = Path.Combine(patchedParentDir, ff.RecommendedName); var patchedFilePath = Path.Combine(patchedParentDir, ff.RecommendedName);

View File

@ -1,5 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using BizHawk.Emulation.Common;
// ReSharper disable StyleCop.SA1509 // ReSharper disable StyleCop.SA1509
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
{ {
@ -174,7 +176,7 @@ namespace BizHawk.Client.Common
private static readonly Dictionary<string, Dictionary<string, char>> SystemOverrides = new Dictionary<string, Dictionary<string, char>> private static readonly Dictionary<string, Dictionary<string, char>> SystemOverrides = new Dictionary<string, Dictionary<string, char>>
{ {
["NES"] = new Dictionary<string, char> [VSystemID.Raw.NES] = new()
{ {
["FDS Eject"] = 'E', ["FDS Eject"] = 'E',
["FDS Insert 0"] = '0', ["FDS Insert 0"] = '0',
@ -200,7 +202,7 @@ namespace BizHawk.Client.Common
["Click"] = 'C', ["Click"] = 'C',
["Touch"] = 'T', ["Touch"] = 'T',
}, },
["SNES"] = new Dictionary<string, char> [VSystemID.Raw.SNES] = new()
{ {
["Cursor"] = 'c', ["Cursor"] = 'c',
["Turbo"] = 't', ["Turbo"] = 't',
@ -239,7 +241,7 @@ namespace BizHawk.Client.Common
["B30"] = 'u', ["B30"] = 'u',
["B31"] = 'v' ["B31"] = 'v'
}, },
["TI83"] = new Dictionary<string, char> [VSystemID.Raw.TI83] = new()
{ {
["UP"] = 'U', ["UP"] = 'U',
["DOWN"] = 'D', ["DOWN"] = 'D',
@ -282,7 +284,7 @@ namespace BizHawk.Client.Common
["COMMA"] = ',', ["COMMA"] = ',',
["SIN"] = 'S' ["SIN"] = 'S'
}, },
["C64"] = new Dictionary<string, char> [VSystemID.Raw.C64] = new()
{ {
["L"] = 'L', ["L"] = 'L',
["R"] = 'R', ["R"] = 'R',
@ -313,7 +315,7 @@ namespace BizHawk.Client.Common
["Cursor Left/Right"] = 'l', ["Cursor Left/Right"] = 'l',
["Space"] = '_' ["Space"] = '_'
}, },
["ZXSpectrum"] = new Dictionary<string, char> [VSystemID.Raw.ZXSpectrum] = new()
{ {
["Caps Shift"] = '^', ["Caps Shift"] = '^',
["Caps Lock"] = 'L', ["Caps Lock"] = 'L',
@ -348,7 +350,7 @@ namespace BizHawk.Client.Common
["Left Cursor"] = 'l', ["Left Cursor"] = 'l',
["Right Cursor"] = 'r' ["Right Cursor"] = 'r'
}, },
["N64"] = new Dictionary<string, char> [VSystemID.Raw.N64] = new()
{ {
["C Up"] = 'u', ["C Up"] = 'u',
["C Down"] = 'd', ["C Down"] = 'd',
@ -365,33 +367,33 @@ namespace BizHawk.Client.Common
["DPad L"] = 'L', ["DPad L"] = 'L',
["DPad R"] = 'R', ["DPad R"] = 'R',
}, },
["DGB"] = new Dictionary<string, char> [VSystemID.Raw.DGB] = new()
{ {
["Toggle Cable"] = 'L' ["Toggle Cable"] = 'L'
}, },
["GB3x"] = new Dictionary<string, char> [VSystemID.Raw.GB3x] = new()
{ {
["Toggle Cable LC"] = 'L', ["Toggle Cable LC"] = 'L',
["Toggle Cable CR"] = 'C', ["Toggle Cable CR"] = 'C',
["Toggle Cable RL"] = 'R' ["Toggle Cable RL"] = 'R'
}, },
["GB4x"] = new Dictionary<string, char> [VSystemID.Raw.GB4x] = new()
{ {
["Toggle Cable UD"] = 'U', ["Toggle Cable UD"] = 'U',
["Toggle Cable LR"] = 'L', ["Toggle Cable LR"] = 'L',
["Toggle Cable X"] = 'X', ["Toggle Cable X"] = 'X',
["Toggle Cable 4x"] = '4' ["Toggle Cable 4x"] = '4'
}, },
["Lynx"] = new Dictionary<string, char> [VSystemID.Raw.Lynx] = new()
{ {
["Option 1"] = '1', ["Option 1"] = '1',
["Option 2"] = '2' ["Option 2"] = '2'
}, },
["NGP"] = new Dictionary<string, char> [VSystemID.Raw.NGP] = new()
{ {
["Option"] = 'O' ["Option"] = 'O'
}, },
["AppleII"] = new Dictionary<string, char> [VSystemID.Raw.AppleII] = new()
{ {
["Tab"] = 't' , ["Tab"] = 't' ,
["Return"] = 'e' , ["Return"] = 'e' ,
@ -406,7 +408,7 @@ namespace BizHawk.Client.Common
["L"] = 'L' , ["L"] = 'L' ,
["R"] = 'R' ["R"] = 'R'
}, },
["INTV"] = new Dictionary<string, char> [VSystemID.Raw.INTV] = new()
{ {
["Clear"] = 'C' , ["Clear"] = 'C' ,
["Enter"] = 'E' , ["Enter"] = 'E' ,
@ -424,14 +426,14 @@ namespace BizHawk.Client.Common
["NW"] = '\\' , ["NW"] = '\\' ,
["NNW"] = 'n' ["NNW"] = 'n'
}, },
["Coleco"] = new Dictionary<string, char> [VSystemID.Raw.Coleco] = new()
{ {
["Yellow"] = 'Y', ["Yellow"] = 'Y',
["Red"] = 'R', ["Red"] = 'R',
["Blue"] = 'B', ["Blue"] = 'B',
["Purple"] = 'P' ["Purple"] = 'P'
}, },
["VB"] = new Dictionary<string, char> [VSystemID.Raw.VB] = new()
{ {
["L_Up"] = 'U', ["L_Up"] = 'U',
["L_Down"] = 'D', ["L_Down"] = 'D',
@ -442,7 +444,7 @@ namespace BizHawk.Client.Common
["R_Left"] = 'l', ["R_Left"] = 'l',
["R_Right"] = 'r', ["R_Right"] = 'r',
}, },
["PCFX"] = new Dictionary<string, char> [VSystemID.Raw.PCFX] = new()
{ {
["I"] = '1', ["I"] = '1',
["II"] = '2', ["II"] = '2',
@ -455,7 +457,7 @@ namespace BizHawk.Client.Common
["Mode 2: Set A"] = 'A', ["Mode 2: Set A"] = 'A',
["Mode 2: Set B"] = 'B' ["Mode 2: Set B"] = 'B'
}, },
["PCE"] = new Dictionary<string, char> [VSystemID.Raw.PCE] = new()
{ {
["I"] = '1', ["I"] = '1',
["II"] = '2', ["II"] = '2',
@ -466,7 +468,7 @@ namespace BizHawk.Client.Common
["Mode: Set 2-button"] = 'm', ["Mode: Set 2-button"] = 'm',
["Mode: Set 6-button"] = 'M' ["Mode: Set 6-button"] = 'M'
}, },
["PCECD"] = new Dictionary<string, char> [VSystemID.Raw.PCECD] = new()
{ {
["I"] = '1', ["I"] = '1',
["II"] = '2', ["II"] = '2',
@ -477,13 +479,13 @@ namespace BizHawk.Client.Common
["Mode: Set 2-button"] = 'm', ["Mode: Set 2-button"] = 'm',
["Mode: Set 6-button"] = 'M' ["Mode: Set 6-button"] = 'M'
}, },
["NDS"] = new Dictionary<string, char> [VSystemID.Raw.NDS] = new()
{ {
["LidOpen"] = 'o', ["LidOpen"] = 'o',
["LidClose"] = 'c', ["LidClose"] = 'c',
["Touch"] = 'T' ["Touch"] = 'T'
}, },
["O2"] = new Dictionary<string, char> [VSystemID.Raw.O2] = new()
{ {
["PERIOD"] = '.', ["PERIOD"] = '.',
["SPC"] = 's', ["SPC"] = 's',
@ -492,7 +494,7 @@ namespace BizHawk.Client.Common
["CLR"] = 'c', ["CLR"] = 'c',
["ENT"] = 'e' ["ENT"] = 'e'
}, },
["MAME"] = new Dictionary<string, char> [VSystemID.Raw.MAME] = new()
{ {
["1 Player Start"] = '1', ["1 Player Start"] = '1',
["2 Players Start"] = '2', ["2 Players Start"] = '2',
@ -577,7 +579,7 @@ namespace BizHawk.Client.Common
["VR3 (Yellow)"] = 'Y', ["VR3 (Yellow)"] = 'Y',
["VR4 (Green)"] = 'G', ["VR4 (Green)"] = 'G',
}, },
["SAT"] = new Dictionary<string, char> [VSystemID.Raw.SAT] = new()
{ {
["Smpc Reset"] = 's', ["Smpc Reset"] = 's',
["D-Pad Up"] = 'U', ["D-Pad Up"] = 'U',
@ -613,7 +615,7 @@ namespace BizHawk.Client.Common
private static readonly Dictionary<string, Dictionary<string, string>> AxisSystemOverrides = new Dictionary<string, Dictionary<string, string>> private static readonly Dictionary<string, Dictionary<string, string>> AxisSystemOverrides = new Dictionary<string, Dictionary<string, string>>
{ {
["A78"] = new Dictionary<string, string> [VSystemID.Raw.A78] = new()
{ {
["VPos"] = "X", ["VPos"] = "X",
["HPos"] = "Y" ["HPos"] = "Y"

View File

@ -13,7 +13,7 @@ namespace BizHawk.Client.Common
{ {
protected override void RunImport() protected override void RunImport()
{ {
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "NDS"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NDS;
var syncSettings = new NDS.NDSSyncSettings(); var syncSettings = new NDS.NDSSyncSettings();

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using BizHawk.Common.BufferExtensions; using BizHawk.Common.BufferExtensions;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores;
using BizHawk.Emulation.Cores.Nintendo.NES; using BizHawk.Emulation.Cores.Nintendo.NES;
@ -27,7 +28,7 @@ namespace BizHawk.Client.Common.movie.import
return; return;
} }
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "NES"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NES;
var syncSettings = new NES.NESSyncSettings(); var syncSettings = new NES.NESSyncSettings();

View File

@ -2,6 +2,7 @@
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Common.BufferExtensions; using BizHawk.Common.BufferExtensions;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores;
using BizHawk.Emulation.Cores.Nintendo.NES; using BizHawk.Emulation.Cores.Nintendo.NES;
@ -16,7 +17,7 @@ namespace BizHawk.Client.Common
{ {
Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.NesHawk; Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.NesHawk;
const string emulator = "FCEUX"; const string emulator = "FCEUX";
var platform = "NES"; // TODO: FDS? var platform = VSystemID.Raw.NES; // TODO: FDS?
var syncSettings = new NES.NESSyncSettings(); var syncSettings = new NES.NESSyncSettings();

View File

@ -1,4 +1,6 @@
using System.IO; using System.IO;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Nintendo.NES; using BizHawk.Emulation.Cores.Nintendo.NES;
namespace BizHawk.Client.Common.movie.import namespace BizHawk.Client.Common.movie.import
@ -32,7 +34,7 @@ namespace BizHawk.Client.Common.movie.import
return; return;
} }
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "NES"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NES;
var syncSettings = new NES.NESSyncSettings(); var syncSettings = new NES.NESSyncSettings();
// other bits: unknown, set to 0 // other bits: unknown, set to 0

View File

@ -1,4 +1,6 @@
using System.IO; using System.IO;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx; using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
namespace BizHawk.Client.Common.movie.import namespace BizHawk.Client.Common.movie.import
@ -21,7 +23,7 @@ namespace BizHawk.Client.Common.movie.import
return; return;
} }
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "GEN"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.GEN;
// 00F ASCII-encoded GMV file format version. The most recent is 'A'. (?) // 00F ASCII-encoded GMV file format version. The most recent is 'A'. (?)
string version = new string(r.ReadChars(1)); string version = new string(r.ReadChars(1));

View File

@ -43,7 +43,7 @@ namespace BizHawk.Client.Common.movie.import
}; };
_deck = new LibsnesControllerDeck(ss); _deck = new LibsnesControllerDeck(ss);
string platform = "SNES"; string platform = VSystemID.Raw.SNES;
foreach (var item in zip.Entries) foreach (var item in zip.Entries)
{ {
@ -106,15 +106,15 @@ namespace BizHawk.Client.Common.movie.import
switch (gametype) switch (gametype)
{ {
case "gdmg": case "gdmg":
platform = "GB"; platform = VSystemID.Raw.GB;
break; break;
case "ggbc": case "ggbc":
case "ggbca": case "ggbca":
platform = "GBC"; platform = VSystemID.Raw.GBC;
break; break;
case "sgb_ntsc": case "sgb_ntsc":
case "sgb_pal": case "sgb_pal":
platform = "SNES"; platform = VSystemID.Raw.SNES;
Config.GbAsSgb = true; Config.GbAsSgb = true;
break; break;
} }
@ -145,7 +145,7 @@ namespace BizHawk.Client.Common.movie.import
// lsnes' frame boundary occurs at V = 241, after which the input is read; // lsnes' frame boundary occurs at V = 241, after which the input is read;
// BizHawk's frame boundary is just before automatic polling; // BizHawk's frame boundary is just before automatic polling;
// This isn't a great place to add this logic but this code is a mess // This isn't a great place to add this logic but this code is a mess
if (lineNum == 1 && platform == "SNES") if (lineNum == 1 && platform == VSystemID.Raw.SNES)
{ {
// Note that this logic assumes the first non-empty log entry is a valid input log entry // Note that this logic assumes the first non-empty log entry is a valid input log entry
// and that it is NOT a subframe input entry. It seems safe to assume subframe input would not be on the first line // and that it is NOT a subframe input entry. It seems safe to assume subframe input would not be on the first line
@ -259,7 +259,7 @@ namespace BizHawk.Client.Common.movie.import
Result.Movie.HeaderEntries[HeaderKeys.Platform] = platform; Result.Movie.HeaderEntries[HeaderKeys.Platform] = platform;
Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss); Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss);
MaybeSetCorePreference(sysID: "SNES", CoreNames.Bsnes, fileExt: ".lsmv"); MaybeSetCorePreference(VSystemID.Raw.SNES, CoreNames.Bsnes, fileExt: ".lsmv");
} }
private IController EmptyLmsvFrame() private IController EmptyLmsvFrame()
@ -289,7 +289,7 @@ namespace BizHawk.Client.Common.movie.import
"B", "Y", "Select", "Start", "Up", "Down", "Left", "Right", "A", "X", "L", "R" "B", "Y", "Select", "Start", "Up", "Down", "Left", "Right", "A", "X", "L", "R"
}; };
if (platform == "GB" || platform == "GBC") if (platform == VSystemID.Raw.GB || platform == VSystemID.Raw.GBC)
{ {
buttons = new[] { "A", "B", "Select", "Start", "Right", "Left", "Up", "Down" }; buttons = new[] { "A", "B", "Select", "Start", "Right", "Left", "Up", "Down" };
} }

View File

@ -1,4 +1,5 @@
using BizHawk.Emulation.Cores.PCEngine; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.PCEngine;
namespace BizHawk.Client.Common.movie.import namespace BizHawk.Client.Common.movie.import
{ {
@ -27,7 +28,7 @@ namespace BizHawk.Client.Common.movie.import
ss.Port4, ss.Port4,
ss.Port5); ss.Port5);
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "PCE"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PCE;
using var sr = SourceFile.OpenText(); using var sr = SourceFile.OpenText();
string line; string line;
@ -84,7 +85,7 @@ namespace BizHawk.Client.Common.movie.import
} }
else if (line.ToLower().StartsWith("pcecd")) else if (line.ToLower().StartsWith("pcecd"))
{ {
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "PCECD"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PCECD;
} }
else if (line.ToLower().StartsWith("emuversion")) else if (line.ToLower().StartsWith("emuversion"))
{ {

View File

@ -1,5 +1,6 @@
using System.IO; using System.IO;
using BizHawk.Common.BufferExtensions; using BizHawk.Common.BufferExtensions;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Sega.MasterSystem; using BizHawk.Emulation.Cores.Sega.MasterSystem;
namespace BizHawk.Client.Common.movie.import namespace BizHawk.Client.Common.movie.import
@ -80,7 +81,7 @@ namespace BizHawk.Client.Common.movie.import
isGameGear = false; isGameGear = false;
} }
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "SMS"; // System Id is still SMS even if game gear Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.SMS; // System Id is still SMS even if game gear
// bits 4-31: unused // bits 4-31: unused
r.ReadBytes(3); r.ReadBytes(3);

View File

@ -1,4 +1,6 @@
using System.IO; using System.IO;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Sony.PSX; using BizHawk.Emulation.Cores.Sony.PSX;
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
@ -8,7 +10,7 @@ namespace BizHawk.Client.Common
{ {
protected override void RunImport() protected override void RunImport()
{ {
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "PSX"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PSX;
using var fs = SourceFile.OpenRead(); using var fs = SourceFile.OpenRead();
using var br = new BinaryReader(fs); using var br = new BinaryReader(fs);

View File

@ -1,5 +1,7 @@
using System.IO; using System.IO;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.Common.Movie.Import namespace BizHawk.Client.Common.Movie.Import
{ {
// PXM files are directly compatible with binary-format PJM files, with the only // PXM files are directly compatible with binary-format PJM files, with the only
@ -15,7 +17,7 @@ namespace BizHawk.Client.Common.Movie.Import
protected override void RunImport() protected override void RunImport()
{ {
var movie = Result.Movie; var movie = Result.Movie;
movie.HeaderEntries[HeaderKeys.Platform] = "PSX"; movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PSX;
using var fs = SourceFile.OpenRead(); using var fs = SourceFile.OpenRead();
using var br = new BinaryReader(fs); using var br = new BinaryReader(fs);

View File

@ -1,6 +1,8 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores;
using BizHawk.Emulation.Cores.Nintendo.SNES; using BizHawk.Emulation.Cores.Nintendo.SNES;
@ -28,7 +30,7 @@ namespace BizHawk.Client.Common.movie.import
return; return;
} }
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "SNES"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.SNES;
// 004 4-byte little-endian unsigned int: version number // 004 4-byte little-endian unsigned int: version number
uint versionNumber = r.ReadUInt32(); uint versionNumber = r.ReadUInt32();
@ -311,7 +313,7 @@ namespace BizHawk.Client.Common.movie.import
Result.Movie.AppendFrame(controllers); Result.Movie.AppendFrame(controllers);
Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss); Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss);
MaybeSetCorePreference(sysID: "SNES", CoreNames.Bsnes, fileExt: ".smv"); MaybeSetCorePreference(VSystemID.Raw.SNES, CoreNames.Bsnes, fileExt: ".smv");
} }
} }
} }

View File

@ -110,17 +110,17 @@ namespace BizHawk.Client.Common.movie.import
bool isSGB = ((flags >> 2) & 0x1) != 0; bool isSGB = ((flags >> 2) & 0x1) != 0;
// (If all 3 of these bits are "0", it is for regular GB.) // (If all 3 of these bits are "0", it is for regular GB.)
string platform = "GB"; string platform = VSystemID.Raw.GB;
if (isGBA) if (isGBA)
{ {
platform = "GBA"; platform = VSystemID.Raw.GBA;
Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.Mgba; Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.Mgba;
} }
if (isGBC) if (isGBC)
{ {
is_GBC = true; is_GBC = true;
platform = "GB"; platform = VSystemID.Raw.GB;
Result.Movie.HeaderEntries.Add("IsCGBMode", "1"); Result.Movie.HeaderEntries.Add("IsCGBMode", "1");
} }
@ -176,7 +176,7 @@ namespace BizHawk.Client.Common.movie.import
GBA GBA
*/ */
uint gameCodeUnitCode = r.ReadUInt32(); uint gameCodeUnitCode = r.ReadUInt32();
if (platform == "GBA") if (platform == VSystemID.Raw.GBA)
{ {
Result.Movie.HeaderEntries["CRC16"] = checksumCRC16.ToString(); Result.Movie.HeaderEntries["CRC16"] = checksumCRC16.ToString();
Result.Movie.HeaderEntries["GameCode"] = gameCodeUnitCode.ToString(); Result.Movie.HeaderEntries["GameCode"] = gameCodeUnitCode.ToString();
@ -278,7 +278,7 @@ namespace BizHawk.Client.Common.movie.import
} }
else else
{ {
if (Config.PreferredCores["GB"] == CoreNames.GbHawk || Config.PreferredCores["GB"] == CoreNames.SubGbHawk) if (Config.PreferredCores[VSystemID.Raw.GB] == CoreNames.GbHawk || Config.PreferredCores[VSystemID.Raw.GB] == CoreNames.SubGbHawk)
{ {
var tempSync = new GBHawk.GBSyncSettings(); var tempSync = new GBHawk.GBSyncSettings();
if (is_GBC) { tempSync.ConsoleMode = GBHawk.GBSyncSettings.ConsoleModeType.GBC; } if (is_GBC) { tempSync.ConsoleMode = GBHawk.GBSyncSettings.ConsoleModeType.GBC; }

View File

@ -12,7 +12,7 @@ namespace BizHawk.Client.Common.movie.import
{ {
protected override void RunImport() protected override void RunImport()
{ {
Result.Movie.HeaderEntries[HeaderKeys.Platform] = "SAT"; Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.SAT;
var ss = new Emulation.Cores.Waterbox.NymaCore.NymaSyncSettings var ss = new Emulation.Cores.Waterbox.NymaCore.NymaSyncSettings
{ {
PortDevices = PortDevices =

View File

@ -42,7 +42,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions
{ {
NullEmulator => string.Empty, NullEmulator => string.Empty,
#if false #if false
IGameboyCommon gb when gb.IsCGBMode() => EmulatorExtensions.SystemIDToDisplayName("GBC"), IGameboyCommon gb when gb.IsCGBMode() => EmulatorExtensions.SystemIDToDisplayName(VSystemID.Raw.GBC),
#endif #endif
_ => EmulatorExtensions.SystemIDToDisplayName(emulator.SystemId) _ => EmulatorExtensions.SystemIDToDisplayName(emulator.SystemId)
}; };

View File

@ -1559,7 +1559,7 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
ofd.InitialDirectory = Config.PathEntries.AbsolutePathForType("Libretro", "Cores"); ofd.InitialDirectory = Config.PathEntries.AbsolutePathForType(VSystemID.Raw.Libretro, "Cores");
if (!Directory.Exists(ofd.InitialDirectory)) if (!Directory.Exists(ofd.InitialDirectory))
{ {
Directory.CreateDirectory(ofd.InitialDirectory); Directory.CreateDirectory(ofd.InitialDirectory);
@ -1961,60 +1961,60 @@ namespace BizHawk.Client.EmuHawk
switch (Emulator.SystemId) switch (Emulator.SystemId)
{ {
case "NULL": case VSystemID.Raw.NULL:
break; break;
case "A78": case VSystemID.Raw.A78:
A7800SubMenu.Visible = true; A7800SubMenu.Visible = true;
break; break;
case "AmstradCPC": case VSystemID.Raw.AmstradCPC:
amstradCPCToolStripMenuItem.Visible = true; amstradCPCToolStripMenuItem.Visible = true;
break; break;
case "AppleII": case VSystemID.Raw.AppleII:
AppleSubMenu.Visible = true; AppleSubMenu.Visible = true;
break; break;
case "C64": case VSystemID.Raw.C64:
C64SubMenu.Visible = true; C64SubMenu.Visible = true;
break; break;
case "Coleco": case VSystemID.Raw.Coleco:
ColecoSubMenu.Visible = true; ColecoSubMenu.Visible = true;
break; break;
case "INTV": case VSystemID.Raw.INTV:
IntvSubMenu.Visible = true; IntvSubMenu.Visible = true;
break; break;
case "N64": case VSystemID.Raw.N64:
N64SubMenu.Visible = true; N64SubMenu.Visible = true;
break; break;
case "NES": case VSystemID.Raw.NES:
NESSubMenu.Visible = true; NESSubMenu.Visible = true;
break; break;
case "PSX": case VSystemID.Raw.PSX:
PSXSubMenu.Visible = true; PSXSubMenu.Visible = true;
break; break;
case "TI83": case VSystemID.Raw.TI83:
TI83SubMenu.Visible = true; TI83SubMenu.Visible = true;
break; break;
case "ZXSpectrum": case VSystemID.Raw.ZXSpectrum:
zXSpectrumToolStripMenuItem.Visible = true; zXSpectrumToolStripMenuItem.Visible = true;
break; break;
case "DGB" when Emulator is GambatteLink: case VSystemID.Raw.DGB when Emulator is GambatteLink:
DGBSubMenu.Visible = true; DGBSubMenu.Visible = true;
break; break;
case "GB": case VSystemID.Raw.GB:
case "GBC": case VSystemID.Raw.GBC:
case "SGB" when Emulator is Gameboy: case VSystemID.Raw.SGB when Emulator is Gameboy:
GBSubMenu.Visible = true; GBSubMenu.Visible = true;
break; break;
case "SNES" when Emulator is LibsnesCore { IsSGB: true }: // doesn't use "SGB" sysID case VSystemID.Raw.SNES when Emulator is LibsnesCore { IsSGB: true }: // doesn't use "SGB" sysID
SNESSubMenu.Text = "&SGB"; SNESSubMenu.Text = "&SGB";
SNESSubMenu.Visible = true; SNESSubMenu.Visible = true;
SnesGfxDebuggerMenuItem.Visible = true; SnesGfxDebuggerMenuItem.Visible = true;
break; break;
case "SNES" when Emulator is LibsnesCore { IsSGB: false }: case VSystemID.Raw.SNES when Emulator is LibsnesCore { IsSGB: false }:
SNESSubMenu.Text = "&SNES"; SNESSubMenu.Text = "&SNES";
SNESSubMenu.Visible = true; SNESSubMenu.Visible = true;
SnesGfxDebuggerMenuItem.Visible = true; SnesGfxDebuggerMenuItem.Visible = true;
break; break;
case "SNES" when Emulator is BsnesCore bsnesCore: case VSystemID.Raw.SNES when Emulator is BsnesCore bsnesCore:
SNESSubMenu.Text = bsnesCore.IsSGB ? "&SGB" : "&SNES"; SNESSubMenu.Text = bsnesCore.IsSGB ? "&SGB" : "&SNES";
SnesGfxDebuggerMenuItem.Visible = false; SnesGfxDebuggerMenuItem.Visible = false;
SNESSubMenu.Visible = true; SNESSubMenu.Visible = true;
@ -2869,13 +2869,13 @@ namespace BizHawk.Client.EmuHawk
CoreNameStatusBarButton.ToolTipText = attributes is PortedCoreAttribute ? "(ported) " : ""; CoreNameStatusBarButton.ToolTipText = attributes is PortedCoreAttribute ? "(ported) " : "";
if (Emulator.SystemId == "ZXSpectrum") if (Emulator.SystemId == VSystemID.Raw.ZXSpectrum)
{ {
var core = (Emulation.Cores.Computers.SinclairSpectrum.ZXSpectrum)Emulator; var core = (Emulation.Cores.Computers.SinclairSpectrum.ZXSpectrum)Emulator;
CoreNameStatusBarButton.ToolTipText = core.GetMachineType(); CoreNameStatusBarButton.ToolTipText = core.GetMachineType();
} }
if (Emulator.SystemId == "AmstradCPC") if (Emulator.SystemId == VSystemID.Raw.AmstradCPC)
{ {
var core = (Emulation.Cores.Computers.AmstradCPC.AmstradCPC)Emulator; var core = (Emulation.Cores.Computers.AmstradCPC.AmstradCPC)Emulator;
CoreNameStatusBarButton.ToolTipText = core.GetMachineType(); CoreNameStatusBarButton.ToolTipText = core.GetMachineType();
@ -4341,9 +4341,9 @@ namespace BizHawk.Client.EmuHawk
return Emulator switch return Emulator switch
{ {
Snes9x => PromptToSwitchCore(CoreNames.Snes9X, CoreNames.Bsnes, () => Config.PreferredCores["SNES"] = CoreNames.Bsnes), Snes9x => PromptToSwitchCore(CoreNames.Snes9X, CoreNames.Bsnes, () => Config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Bsnes),
QuickNES => PromptToSwitchCore(CoreNames.QuickNes, CoreNames.NesHawk, () => Config.PreferredCores["NES"] = CoreNames.NesHawk), QuickNES => PromptToSwitchCore(CoreNames.QuickNes, CoreNames.NesHawk, () => Config.PreferredCores[VSystemID.Raw.NES] = CoreNames.NesHawk),
HyperNyma => PromptToSwitchCore(CoreNames.HyperNyma, CoreNames.TurboNyma, () => Config.PreferredCores["PCE"] = CoreNames.TurboNyma), HyperNyma => PromptToSwitchCore(CoreNames.HyperNyma, CoreNames.TurboNyma, () => Config.PreferredCores[VSystemID.Raw.PCE] = CoreNames.TurboNyma),
_ => true _ => true
}; };
} }

View File

@ -304,7 +304,7 @@ namespace BizHawk.Client.EmuHawk
{ {
using var ofd = new OpenFileDialog using var ofd = new OpenFileDialog
{ {
InitialDirectory = _config.PathEntries.ScreenshotAbsolutePathFor("GB"), InitialDirectory = _config.PathEntries.ScreenshotAbsolutePathFor(VSystemID.Raw.GB),
Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(),
RestoreDirectory = true RestoreDirectory = true
}; };
@ -340,7 +340,7 @@ namespace BizHawk.Client.EmuHawk
{ {
using var sfd = new SaveFileDialog using var sfd = new SaveFileDialog
{ {
InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor("GB"), InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor(VSystemID.Raw.GB),
FileName = $"{_game.Name}.pal", FileName = $"{_game.Name}.pal",
Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(),
RestoreDirectory = true RestoreDirectory = true

View File

@ -4,6 +4,7 @@ using System.Windows.Forms;
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Nintendo.NES; using BizHawk.Emulation.Cores.Nintendo.NES;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
@ -55,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
{ {
using var ofd = new OpenFileDialog using var ofd = new OpenFileDialog
{ {
InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor("NES"), InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor(VSystemID.Raw.NES),
Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(),
RestoreDirectory = true RestoreDirectory = true
}; };

View File

@ -5,6 +5,7 @@ using System.Windows.Forms;
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
@ -82,7 +83,7 @@ namespace BizHawk.Client.EmuHawk
{ {
using var ofd = new OpenFileDialog using var ofd = new OpenFileDialog
{ {
InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor("NES"), InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor(VSystemID.Raw.NES),
Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(),
RestoreDirectory = true RestoreDirectory = true
}; };

View File

@ -6,6 +6,7 @@ using System.Windows.Forms;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
@ -26,7 +27,7 @@ namespace BizHawk.Client.EmuHawk
return; return;
} }
string[] coresToHide = { "GB4x", "O2", "ChannelF", "AmstradCPC" }; string[] coresToHide = { VSystemID.Raw.GB4x, VSystemID.Raw.O2, VSystemID.Raw.ChannelF, VSystemID.Raw.AmstradCPC };
foreach (var core in coresToHide) foreach (var core in coresToHide)
{ {
@ -153,14 +154,13 @@ namespace BizHawk.Client.EmuHawk
.OrderBy(tuple => tuple.DisplayName) .OrderBy(tuple => tuple.DisplayName)
.ToList(); .ToList();
// add the Global tab first... // add the Global tab first...
const string idGlobal = "Global_NULL"; tpGlobal.Name = PathEntryCollection.GLOBAL; // required for SaveSettings
tpGlobal.Name = idGlobal; // required for SaveSettings systems.RemoveAll(tuple => tuple.SysGroup == PathEntryCollection.GLOBAL);
systems.RemoveAll(tuple => tuple.SysGroup == idGlobal);
var hack = tpGlobal.Size.Width - UIHelper.ScaleX(220); // whyyyyyyyyyy var hack = tpGlobal.Size.Width - UIHelper.ScaleX(220); // whyyyyyyyyyy
textBoxWidth += hack; textBoxWidth += hack;
widgetOffset += hack; widgetOffset += hack;
Size hack1 = new(17, 0); // also whyyyyyyyyyy Size hack1 = new(17, 0); // also whyyyyyyyyyy
PopulateTabPage(tpGlobal, idGlobal); PopulateTabPage(tpGlobal, PathEntryCollection.GLOBAL);
tpGlobal.Controls[tpGlobal.Controls.Count - 1].Size -= hack1; // TextBox tpGlobal.Controls[tpGlobal.Controls.Count - 1].Size -= hack1; // TextBox
tpGlobal.Controls[tpGlobal.Controls.Count - 2].Location -= hack1; // Button tpGlobal.Controls[tpGlobal.Controls.Count - 2].Location -= hack1; // Button
textBoxWidth -= hack; textBoxWidth -= hack;
@ -168,9 +168,9 @@ namespace BizHawk.Client.EmuHawk
// ...then continue with the others // ...then continue with the others
foreach (var (sys, dispName) in systems) AddTabPageForSystem(sys, dispName); foreach (var (sys, dispName) in systems) AddTabPageForSystem(sys, dispName);
if (IsTabPendingFocus(idGlobal)) if (IsTabPendingFocus(PathEntryCollection.GLOBAL))
{ {
comboSystem.SelectedIndex = systems.FindIndex(tuple => tuple.SysGroup == "NES"); // event handler selects correct tab in inner TabControl comboSystem.SelectedIndex = systems.FindIndex(tuple => tuple.SysGroup == VSystemID.Raw.NES); // event handler selects correct tab in inner TabControl
// selected tab in tcMain is already 0 (Global) // selected tab in tcMain is already 0 (Global)
} }
@ -180,7 +180,7 @@ namespace BizHawk.Client.EmuHawk
private void BrowseFolder(TextBox box, string name, string system) private void BrowseFolder(TextBox box, string name, string system)
{ {
// Ugly hack, we don't want to pass in the system in for system base and global paths // Ugly hack, we don't want to pass in the system in for system base and global paths
if (name == "Base" || system == "Global" || system == "Global_NULL") if (name == "Base" || system == "Global" || system == PathEntryCollection.GLOBAL)
{ {
BrowseFolder(box, name, system: null); BrowseFolder(box, name, system: null);
return; return;
@ -261,7 +261,7 @@ namespace BizHawk.Client.EmuHawk
} }
private void DefaultsBtn_Click(object sender, EventArgs e) private void DefaultsBtn_Click(object sender, EventArgs e)
=> DoTabs(PathEntryCollection.DefaultValues, "Global_NULL"); => DoTabs(PathEntryCollection.DefaultValues, PathEntryCollection.GLOBAL);
private void Ok_Click(object sender, EventArgs e) private void Ok_Click(object sender, EventArgs e)
{ {

View File

@ -113,7 +113,7 @@ namespace BizHawk.Client.EmuHawk
PutSyncSettings<N64>(n64Settings); PutSyncSettings<N64>(n64Settings);
// SNES // SNES
_config.PreferredCores["SNES"] = CoreNames.Snes9X; _config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Snes9X;
// Genesis // Genesis
var genesisSettings = GetSyncSettings<GPGX, GPGX.GPGXSyncSettings>(); var genesisSettings = GetSyncSettings<GPGX, GPGX.GPGXSyncSettings>();
@ -138,11 +138,11 @@ namespace BizHawk.Client.EmuHawk
PutSyncSettings<Atari2600>(a2600Settings); PutSyncSettings<Atari2600>(a2600Settings);
// NES // NES
_config.PreferredCores["NES"] = CoreNames.QuickNes; _config.PreferredCores[VSystemID.Raw.NES] = CoreNames.QuickNes;
// GB // GB
_config.PreferredCores["GB"] = CoreNames.Gambatte; _config.PreferredCores[VSystemID.Raw.GB] = CoreNames.Gambatte;
_config.PreferredCores["GBC"] = CoreNames.Gambatte; _config.PreferredCores[VSystemID.Raw.GBC] = CoreNames.Gambatte;
var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>(); var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>();
s.EnableBIOS = false; s.EnableBIOS = false;
PutSyncSettings<Gameboy>(s); PutSyncSettings<Gameboy>(s);
@ -153,7 +153,7 @@ namespace BizHawk.Client.EmuHawk
_config.Savestates.CompressionLevelNormal = 5; _config.Savestates.CompressionLevelNormal = 5;
// SNES // SNES
_config.PreferredCores["SNES"] = CoreNames.Bsnes; _config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Bsnes;
// SMS // SMS
var smsSettings = GetSyncSettings<SMS, SMS.SmsSyncSettings>(); var smsSettings = GetSyncSettings<SMS, SMS.SmsSyncSettings>();
@ -168,11 +168,11 @@ namespace BizHawk.Client.EmuHawk
PutSyncSettings<Atari2600>(a2600Settings); PutSyncSettings<Atari2600>(a2600Settings);
// NES // NES
_config.PreferredCores["NES"] = CoreNames.NesHawk; _config.PreferredCores[VSystemID.Raw.NES] = CoreNames.NesHawk;
// GB // GB
_config.PreferredCores["GB"] = CoreNames.Gambatte; _config.PreferredCores[VSystemID.Raw.GB] = CoreNames.Gambatte;
_config.PreferredCores["GBC"] = CoreNames.Gambatte; _config.PreferredCores[VSystemID.Raw.GBC] = CoreNames.Gambatte;
var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>(); var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>();
s.EnableBIOS = true; s.EnableBIOS = true;
PutSyncSettings<Gameboy>(s); PutSyncSettings<Gameboy>(s);
@ -197,7 +197,7 @@ namespace BizHawk.Client.EmuHawk
PutSyncSettings<N64>(n64Settings); PutSyncSettings<N64>(n64Settings);
// SNES // SNES
_config.PreferredCores["SNES"] = CoreNames.Bsnes; _config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Bsnes;
// Genesis // Genesis
var genesisSettings = GetSyncSettings<GPGX, GPGX.GPGXSyncSettings>(); var genesisSettings = GetSyncSettings<GPGX, GPGX.GPGXSyncSettings>();
@ -217,11 +217,11 @@ namespace BizHawk.Client.EmuHawk
PutSyncSettings<Atari2600>(a2600Settings); PutSyncSettings<Atari2600>(a2600Settings);
// NES // NES
_config.PreferredCores["NES"] = CoreNames.NesHawk; _config.PreferredCores[VSystemID.Raw.NES] = CoreNames.NesHawk;
// GB // GB
_config.PreferredCores["GB"] = CoreNames.Gambatte; _config.PreferredCores[VSystemID.Raw.GB] = CoreNames.Gambatte;
_config.PreferredCores["GBC"] = CoreNames.Gambatte; _config.PreferredCores[VSystemID.Raw.GBC] = CoreNames.Gambatte;
var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>(); var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>();
s.EnableBIOS = true; s.EnableBIOS = true;
PutSyncSettings<Gameboy>(s); PutSyncSettings<Gameboy>(s);

View File

@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
DirectoryMonitor.Created -= DirectoryMonitor_Created; DirectoryMonitor.Created -= DirectoryMonitor_Created;
DirectoryMonitor.Dispose(); DirectoryMonitor.Dispose();
} }
var path = _paths["Global", "External Tools"].Path; var path = _paths[PathEntryCollection.GLOBAL, "External Tools"].Path;
if (Directory.Exists(path)) if (Directory.Exists(path))
{ {
DirectoryMonitor = new FileSystemWatcher(path, "*.dll") DirectoryMonitor = new FileSystemWatcher(path, "*.dll")
@ -86,7 +86,7 @@ namespace BizHawk.Client.EmuHawk
var toolAttribute = allAttrs.OfType<ExternalToolAttribute>().First(); var toolAttribute = allAttrs.OfType<ExternalToolAttribute>().First();
if (toolAttribute.LoadAssemblyFiles != null) if (toolAttribute.LoadAssemblyFiles != null)
{ {
foreach (var depFilename in toolAttribute.LoadAssemblyFiles) Assembly.LoadFrom($"{_paths["Global", "External Tools"].Path}/{depFilename}"); foreach (var depFilename in toolAttribute.LoadAssemblyFiles) Assembly.LoadFrom($"{_paths[PathEntryCollection.GLOBAL, "External Tools"].Path}/{depFilename}");
} }
var embeddedIconAttr = allAttrs.OfType<ExternalToolEmbeddedIconAttribute>().FirstOrDefault(); var embeddedIconAttr = allAttrs.OfType<ExternalToolEmbeddedIconAttribute>().FirstOrDefault();
if (embeddedIconAttr != null) if (embeddedIconAttr != null)

View File

@ -14,7 +14,7 @@ namespace BizHawk.Client.EmuHawk
{ {
[Tool( [Tool(
released: true, released: true,
supportedSystems: new[] { "GB", "GBA", "GEN", "N64", "NES", "PSX", "SAT", "SGB", "SMS", "SNES" }, supportedSystems: new[] { VSystemID.Raw.GB, VSystemID.Raw.GBA, VSystemID.Raw.GEN, VSystemID.Raw.N64, VSystemID.Raw.NES, VSystemID.Raw.PSX, VSystemID.Raw.SAT, VSystemID.Raw.SGB, VSystemID.Raw.SMS, VSystemID.Raw.SNES },
unsupportedCores: new[] { CoreNames.Snes9X })] unsupportedCores: new[] { CoreNames.Snes9X })]
public partial class GameShark : ToolFormBase, IToolFormAutoConfig public partial class GameShark : ToolFormBase, IToolFormAutoConfig
{ {

View File

@ -258,7 +258,7 @@ namespace BizHawk.Client.EmuHawk
public static string SuggestedFolder(Config config, IGameInfo game = null) public static string SuggestedFolder(Config config, IGameInfo game = null)
{ {
return config.PathEntries.AbsolutePathFor(Path.Combine( return config.PathEntries.AbsolutePathFor(Path.Combine(
config.PathEntries["Global", "Macros"].Path, config.PathEntries[PathEntryCollection.GLOBAL, "Macros"].Path,
game?.FilesystemSafeName()), null); game?.FilesystemSafeName()), null);
} }

View File

@ -60,7 +60,7 @@ namespace BizHawk.Client.EmuHawk
} }
else if (Emulator is SMS sms && sms.IsGameGear) else if (Emulator is SMS sms && sms.IsGameGear)
{ {
SystemDropDown.SelectedItem = "GGL"; SystemDropDown.SelectedItem = VSystemID.Raw.GGL;
} }
FileSelectors.First().Path = MainForm.CurrentlyOpenRom; FileSelectors.First().Path = MainForm.CurrentlyOpenRom;
@ -279,7 +279,7 @@ namespace BizHawk.Client.EmuHawk
} }
} while (FileSelectorPanel.Controls.Count != 0); } while (FileSelectorPanel.Controls.Count != 0);
if (SystemDropDown.SelectedItem.ToString() == "GB") if (SystemDropDown.SelectedItem.ToString() == VSystemID.Raw.GB)
{ {
AddButton.Enabled = false; AddButton.Enabled = false;
btnRemove.Enabled = false; btnRemove.Enabled = false;

View File

@ -4,6 +4,7 @@ using System.Windows.Forms;
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
@ -91,7 +92,7 @@ namespace BizHawk.Client.EmuHawk
if (hf.IsArchive) if (hf.IsArchive)
{ {
// archive - run the archive chooser // archive - run the archive chooser
if (SystemString == "PSX" || SystemString == "PCFX" || SystemString == "SAT") if (SystemString == VSystemID.Raw.PSX || SystemString == VSystemID.Raw.PCFX || SystemString == VSystemID.Raw.SAT)
{ {
DialogController.ShowMessageBox("Using archives with PSX, PCFX or SATURN is not currently recommended/supported."); DialogController.ShowMessageBox("Using archives with PSX, PCFX or SATURN is not currently recommended/supported.");
return; return;

View File

@ -188,7 +188,7 @@ namespace BizHawk.Client.EmuHawk
{ {
NameTableView NameTableView
.ToBitMap() .ToBitMap()
.SaveAsFile(Game, "Nametables", "NES", Config.PathEntries, this); .SaveAsFile(Game, "Nametables", VSystemID.Raw.NES, Config.PathEntries, this);
} }
private void ScreenshotToClipboardMenuItem_Click(object sender, EventArgs e) private void ScreenshotToClipboardMenuItem_Click(object sender, EventArgs e)

View File

@ -314,7 +314,7 @@ namespace BizHawk.Client.EmuHawk
private void Screenshot(Bitmap b, string suffix) private void Screenshot(Bitmap b, string suffix)
{ {
b.SaveAsFile(Game, suffix, "NES", Config.PathEntries, this); b.SaveAsFile(Game, suffix, VSystemID.Raw.NES, Config.PathEntries, this);
} }
private void SavePaletteScreenshotMenuItem_Click(object sender, EventArgs e) private void SavePaletteScreenshotMenuItem_Click(object sender, EventArgs e)

View File

@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Common
public int Frame => 0; public int Frame => 0;
public string SystemId => "NULL"; public string SystemId => VSystemID.Raw.NULL;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Common
/// <summary> /// <summary>
/// Default fallthrough to AppleII /// Default fallthrough to AppleII
/// </summary> /// </summary>
public string IdentifiedSystem { get; set; } = "AppleII"; public string IdentifiedSystem { get; set; } = VSystemID.Raw.AppleII;
// dsk header // dsk header
public byte NumberOfTracks { get; set; } public byte NumberOfTracks { get; set; }
@ -68,7 +68,7 @@ namespace BizHawk.Emulation.Common
if (trk.Sectors[0].SectorData[0] == 0 && trk.Sectors[0].SectorData[1] == 0 if (trk.Sectors[0].SectorData[0] == 0 && trk.Sectors[0].SectorData[1] == 0
&& trk.Sectors[0].SectorData[2] == 40) && trk.Sectors[0].SectorData[2] == 40)
{ {
_possibleIdent = "ZXSpectrum"; _possibleIdent = VSystemID.Raw.ZXSpectrum;
} }
} }
@ -83,7 +83,7 @@ namespace BizHawk.Emulation.Common
string str = Encoding.ASCII.GetString(s.SectorData, 0, s.SectorData.Length).ToUpper(); string str = Encoding.ASCII.GetString(s.SectorData, 0, s.SectorData.Length).ToUpper();
if (str.Contains("PLUS3DOS")) if (str.Contains("PLUS3DOS"))
{ {
IdentifiedSystem = "ZXSpectrum"; IdentifiedSystem = VSystemID.Raw.ZXSpectrum;
return; return;
} }
} }
@ -95,13 +95,13 @@ namespace BizHawk.Emulation.Common
switch (trk.Sectors[0].GetChecksum256()) switch (trk.Sectors[0].GetChecksum256())
{ {
case 3: case 3:
IdentifiedSystem = "ZXSpectrum"; IdentifiedSystem = VSystemID.Raw.ZXSpectrum;
return; return;
case 1: case 1:
case 255: case 255:
// different Amstrad PCW boot records // different Amstrad PCW boot records
// just return CPC for now // just return CPC for now
IdentifiedSystem = "AmstradCPC"; IdentifiedSystem = VSystemID.Raw.AmstradCPC;
return; return;
} }
@ -109,7 +109,7 @@ namespace BizHawk.Emulation.Common
{ {
case 65: case 65:
case 193: case 193:
IdentifiedSystem = "AmstradCPC"; IdentifiedSystem = VSystemID.Raw.AmstradCPC;
return; return;
} }
} }
@ -124,19 +124,19 @@ namespace BizHawk.Emulation.Common
switch (trk.Sectors[0].GetChecksum256()) switch (trk.Sectors[0].GetChecksum256())
{ {
case 3: case 3:
IdentifiedSystem = "ZXSpectrum"; IdentifiedSystem = VSystemID.Raw.ZXSpectrum;
return; return;
case 1: case 1:
case 255: case 255:
// different Amstrad PCW checksums // different Amstrad PCW checksums
// just return CPC for now // just return CPC for now
IdentifiedSystem = "AmstradCPC"; IdentifiedSystem = VSystemID.Raw.AmstradCPC;
return; return;
} }
break; break;
case 65: case 65:
case 193: case 193:
IdentifiedSystem = "AmstradCPC"; IdentifiedSystem = VSystemID.Raw.AmstradCPC;
return; return;
} }
} }
@ -148,14 +148,14 @@ namespace BizHawk.Emulation.Common
if (trk.Sectors.Length == 8) if (trk.Sectors.Length == 8)
{ {
// CPC IBM // CPC IBM
IdentifiedSystem = "AmstradCPC"; IdentifiedSystem = VSystemID.Raw.AmstradCPC;
return; return;
} }
break; break;
case 65: case 65:
case 193: case 193:
// possible CPC custom // possible CPC custom
_possibleIdent = "AmstradCPC"; _possibleIdent = VSystemID.Raw.AmstradCPC;
break; break;
} }
@ -174,16 +174,16 @@ namespace BizHawk.Emulation.Common
switch (Tracks[1].Sectors[0].SectorID) switch (Tracks[1].Sectors[0].SectorID)
{ {
case 7: case 7:
IdentifiedSystem = "ZXSpectrum"; IdentifiedSystem = VSystemID.Raw.ZXSpectrum;
return; return;
default: default:
_possibleIdent = "ZXSpectrum"; _possibleIdent = VSystemID.Raw.ZXSpectrum;
break; break;
} }
} }
else else
{ {
_possibleIdent = "ZXSpectrum"; _possibleIdent = VSystemID.Raw.ZXSpectrum;
} }
break; break;
case 1: case 1:
@ -193,13 +193,13 @@ namespace BizHawk.Emulation.Common
{ {
case 7: case 7:
case 1: case 1:
IdentifiedSystem = "ZXSpectrum"; IdentifiedSystem = VSystemID.Raw.ZXSpectrum;
return; return;
} }
} }
else else
{ {
_possibleIdent = "ZXSpectrum"; _possibleIdent = VSystemID.Raw.ZXSpectrum;
} }
break; break;
} }
@ -209,16 +209,16 @@ namespace BizHawk.Emulation.Common
trk.Sectors[0].SectorData[9] == 23 && trk.Sectors[0].SectorData[9] == 23 &&
trk.Sectors[0].SectorData[2] == 40) trk.Sectors[0].SectorData[2] == 40)
{ {
IdentifiedSystem = "ZXSpectrum"; IdentifiedSystem = VSystemID.Raw.ZXSpectrum;
return; return;
} }
} }
} }
// last chance. use the possible value // last chance. use the possible value
if (IdentifiedSystem == "AppleII" && _possibleIdent != "") if (IdentifiedSystem == VSystemID.Raw.AppleII && _possibleIdent != "")
{ {
IdentifiedSystem = "ZXSpectrum"; IdentifiedSystem = VSystemID.Raw.ZXSpectrum;
} }
} }

View File

@ -226,68 +226,68 @@ namespace BizHawk.Emulation.Common
case ".NES": case ".NES":
case ".UNF": case ".UNF":
case ".FDS": case ".FDS":
game.System = "NES"; game.System = VSystemID.Raw.NES;
break; break;
case ".SFC": case ".SFC":
case ".SMC": case ".SMC":
game.System = "SNES"; game.System = VSystemID.Raw.SNES;
break; break;
case ".GB": case ".GB":
game.System = "GB"; game.System = VSystemID.Raw.GB;
break; break;
case ".GBC": case ".GBC":
game.System = "GBC"; game.System = VSystemID.Raw.GBC;
break; break;
case ".GBA": case ".GBA":
game.System = "GBA"; game.System = VSystemID.Raw.GBA;
break; break;
case ".NDS": case ".NDS":
game.System = "NDS"; game.System = VSystemID.Raw.NDS;
break; break;
case ".SMS": case ".SMS":
game.System = "SMS"; game.System = VSystemID.Raw.SMS;
break; break;
case ".GG": case ".GG":
game.System = "GG"; game.System = VSystemID.Raw.GG;
break; break;
case ".SG": case ".SG":
game.System = "SG"; game.System = VSystemID.Raw.SG;
break; break;
case ".GEN": case ".GEN":
case ".MD": case ".MD":
case ".SMD": case ".SMD":
game.System = "GEN"; game.System = VSystemID.Raw.GEN;
break; break;
case ".PSF": case ".PSF":
case ".MINIPSF": case ".MINIPSF":
game.System = "PSX"; game.System = VSystemID.Raw.PSX;
break; break;
case ".PCE": case ".PCE":
game.System = "PCE"; game.System = VSystemID.Raw.PCE;
break; break;
case ".SGX": case ".SGX":
game.System = "SGX"; game.System = VSystemID.Raw.SGX;
break; break;
case ".A26": case ".A26":
game.System = "A26"; game.System = VSystemID.Raw.A26;
break; break;
case ".A78": case ".A78":
game.System = "A78"; game.System = VSystemID.Raw.A78;
break; break;
case ".COL": case ".COL":
game.System = "Coleco"; game.System = VSystemID.Raw.Coleco;
break; break;
case ".INT": case ".INT":
game.System = "INTV"; game.System = VSystemID.Raw.INTV;
break; break;
case ".PRG": case ".PRG":
@ -295,48 +295,48 @@ namespace BizHawk.Emulation.Common
case ".T64": case ".T64":
case ".G64": case ".G64":
case ".CRT": case ".CRT":
game.System = "C64"; game.System = VSystemID.Raw.C64;
break; break;
case ".TZX": case ".TZX":
case ".PZX": case ".PZX":
case ".CSW": case ".CSW":
case ".WAV": case ".WAV":
game.System = "ZXSpectrum"; game.System = VSystemID.Raw.ZXSpectrum;
break; break;
case ".CDT": case ".CDT":
game.System = "AmstradCPC"; game.System = VSystemID.Raw.AmstradCPC;
break; break;
case ".TAP": case ".TAP":
byte[] head = romData.Take(8).ToArray(); byte[] head = romData.Take(8).ToArray();
game.System = Encoding.Default.GetString(head).Contains("C64-TAPE") game.System = Encoding.Default.GetString(head).Contains("C64-TAPE")
? "C64" ? VSystemID.Raw.C64
: "ZXSpectrum"; : VSystemID.Raw.ZXSpectrum;
break; break;
case ".Z64": case ".Z64":
case ".V64": case ".V64":
case ".N64": case ".N64":
game.System = "N64"; game.System = VSystemID.Raw.N64;
break; break;
case ".DEBUG": case ".DEBUG":
game.System = "DEBUG"; game.System = VSystemID.Raw.DEBUG;
break; break;
case ".WS": case ".WS":
case ".WSC": case ".WSC":
game.System = "WSWAN"; game.System = VSystemID.Raw.WSWAN;
break; break;
case ".LNX": case ".LNX":
game.System = "Lynx"; game.System = VSystemID.Raw.Lynx;
break; break;
case ".83P": case ".83P":
game.System = "83P"; game.System = VSystemID.Raw.TI83P;
break; break;
case ".DSK": case ".DSK":
@ -346,40 +346,40 @@ namespace BizHawk.Emulation.Common
case ".PO": case ".PO":
case ".DO": case ".DO":
game.System = "AppleII"; game.System = VSystemID.Raw.AppleII;
break; break;
case ".VB": case ".VB":
game.System = "VB"; game.System = VSystemID.Raw.VB;
break; break;
case ".NGP": case ".NGP":
case ".NGC": case ".NGC":
game.System = "NGP"; game.System = VSystemID.Raw.NGP;
break; break;
case ".O2": case ".O2":
game.System = "O2"; game.System = VSystemID.Raw.O2;
break; break;
case ".UZE": case ".UZE":
game.System = "UZE"; game.System = VSystemID.Raw.UZE;
break; break;
case ".32X": case ".32X":
game.System = "32X"; game.System = VSystemID.Raw.Sega32X;
game.AddOption("32X", "true"); game.AddOption("32X", "true");
break; break;
case ".VEC": case ".VEC":
game.System = "VEC"; game.System = VSystemID.Raw.VEC;
game.AddOption("VEC", "true"); game.AddOption("VEC", "true");
break; break;
// refactor to use mame db (output of "mame -listxml" command) // refactor to use mame db (output of "mame -listxml" command)
// there's no good definition for Arcade anymore, so we might limit to coin-based machines? // there's no good definition for Arcade anymore, so we might limit to coin-based machines?
case ".ZIP": case ".ZIP":
game.System = "MAME"; game.System = VSystemID.Raw.MAME;
break; break;
} }

View File

@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Common
public static GameInfo NullInstance => new GameInfo public static GameInfo NullInstance => new GameInfo
{ {
Name = "Null", Name = "Null",
System = "NULL", System = VSystemID.Raw.NULL,
Hash = "", Hash = "",
Region = "", Region = "",
Status = RomStatus.GoodDump, Status = RomStatus.GoodDump,
@ -175,7 +175,7 @@ namespace BizHawk.Emulation.Common
{ {
public static bool IsNullInstance(this IGameInfo game) public static bool IsNullInstance(this IGameInfo game)
{ {
return game == null || game.System == "NULL"; return game == null || game.System == VSystemID.Raw.NULL;
} }
public static bool IsRomStatusBad(this IGameInfo game) public static bool IsRomStatusBad(this IGameInfo game)

View File

@ -17,46 +17,46 @@ namespace BizHawk.Emulation.Common
{ {
public static readonly IReadOnlyDictionary<string, string> SystemIDDisplayNames = new Dictionary<string, string> public static readonly IReadOnlyDictionary<string, string> SystemIDDisplayNames = new Dictionary<string, string>
{ {
["A26"] = "Atari 2600", [VSystemID.Raw.A26] = "Atari 2600",
["A78"] = "Atari 7800", [VSystemID.Raw.A78] = "Atari 7800",
["AmstradCPC"] = "Amstrad CPC", [VSystemID.Raw.AmstradCPC] = "Amstrad CPC",
["AppleII"] = "Apple II", [VSystemID.Raw.AppleII] = "Apple II",
["C64"] = "Commodore 64", [VSystemID.Raw.C64] = "Commodore 64",
["ChannelF"] = "Channel F", [VSystemID.Raw.ChannelF] = "Channel F",
["Coleco"] = "ColecoVision", [VSystemID.Raw.Coleco] = "ColecoVision",
["DGB"] = "Game Boy Link", [VSystemID.Raw.DGB] = "Game Boy Link",
["GB"] = "GB", [VSystemID.Raw.GB] = "GB",
["SGB"] = "SGB", [VSystemID.Raw.SGB] = "SGB",
["GB3x"] = "Game Boy Link 3x", [VSystemID.Raw.GB3x] = "Game Boy Link 3x",
["GB4x"] = "Game Boy Link 4x", [VSystemID.Raw.GB4x] = "Game Boy Link 4x",
["GBA"] = "Gameboy Advance", [VSystemID.Raw.GBA] = "Gameboy Advance",
["GBC"] = "Gameboy Color", [VSystemID.Raw.GBC] = "Gameboy Color",
["GEN"] = "Genesis", [VSystemID.Raw.GEN] = "Genesis",
["GG"] = "Game Gear", [VSystemID.Raw.GG] = "Game Gear",
["INTV"] = "Intellivision", [VSystemID.Raw.INTV] = "Intellivision",
["Libretro"] = "Libretro", [VSystemID.Raw.Libretro] = "Libretro",
["Lynx"] = "Lynx", [VSystemID.Raw.Lynx] = "Lynx",
["MAME"] = "MAME", [VSystemID.Raw.MAME] = "MAME",
["N64"] = "Nintendo 64", [VSystemID.Raw.N64] = "Nintendo 64",
["NDS"] = "NDS", [VSystemID.Raw.NDS] = "NDS",
["NES"] = "NES", [VSystemID.Raw.NES] = "NES",
["NGP"] = "Neo-Geo Pocket", [VSystemID.Raw.NGP] = "Neo-Geo Pocket",
["O2"] = "Odyssey2", [VSystemID.Raw.O2] = "Odyssey2",
["PCE"] = "TurboGrafx-16", [VSystemID.Raw.PCE] = "TurboGrafx-16",
["PCECD"] = "TurboGrafx - 16(CD)", [VSystemID.Raw.PCECD] = "TurboGrafx - 16(CD)",
["PCFX"] = "PCFX", [VSystemID.Raw.PCFX] = "PCFX",
["PSX"] = "PlayStation", [VSystemID.Raw.PSX] = "PlayStation",
["SAT"] = "Saturn", [VSystemID.Raw.SAT] = "Saturn",
["SG"] = "SG-1000", [VSystemID.Raw.SG] = "SG-1000",
["SGX"] = "SuperGrafx", [VSystemID.Raw.SGX] = "SuperGrafx",
["SMS"] = "Sega Master System", [VSystemID.Raw.SMS] = "Sega Master System",
["SNES"] = "SNES", [VSystemID.Raw.SNES] = "SNES",
["TI83"] = "TI - 83", [VSystemID.Raw.TI83] = "TI - 83",
["UZE"] = "Uzebox", [VSystemID.Raw.UZE] = "Uzebox",
["VB"] = "Virtual Boy", [VSystemID.Raw.VB] = "Virtual Boy",
["VEC"] = "Vectrex", [VSystemID.Raw.VEC] = "Vectrex",
["WSWAN"] = "WonderSwan", [VSystemID.Raw.WSWAN] = "WonderSwan",
["ZXSpectrum"] = "ZX Spectrum", [VSystemID.Raw.ZXSpectrum] = "ZX Spectrum",
}; };
public static CoreAttribute Attributes(this IEmulator core) public static CoreAttribute Attributes(this IEmulator core)

View File

@ -10,33 +10,33 @@ namespace BizHawk.Emulation.Common
{ {
private readonly List<SystemInfo> _systems = new List<SystemInfo> private readonly List<SystemInfo> _systems = new List<SystemInfo>
{ {
new SystemInfo("A26", "Atari 2600"), new(VSystemID.Raw.A26, "Atari 2600"),
new SystemInfo("A78", "Atari 7800"), new(VSystemID.Raw.A78, "Atari 7800"),
new SystemInfo("Lynx", "Atari Lynx"), new(VSystemID.Raw.Lynx, "Atari Lynx"),
new SystemInfo("NES", "NES"), new(VSystemID.Raw.NES, "NES"),
new SystemInfo("SNES", "Super NES"), new(VSystemID.Raw.SNES, "Super NES"),
new SystemInfo("N64", "Nintendo 64"), new(VSystemID.Raw.N64, "Nintendo 64"),
new SystemInfo("GB", "Gameboy"), new(VSystemID.Raw.GB, "Gameboy"),
new SystemInfo("GBA", "Gameboy Advance"), new(VSystemID.Raw.GBA, "Gameboy Advance"),
new SystemInfo("PSX", "Playstation"), new(VSystemID.Raw.PSX, "Playstation"),
new SystemInfo("SMS", "Sega Master System"), new(VSystemID.Raw.SMS, "Sega Master System"),
new SystemInfo("GEN", "Sega Genesis/Mega Drive"), new(VSystemID.Raw.GEN, "Sega Genesis/Mega Drive"),
new SystemInfo("32X", "Sega Genesis 32X/Mega Drive 32X"), new(VSystemID.Raw.Sega32X, "Sega Genesis 32X/Mega Drive 32X"),
new SystemInfo("SAT", "Sega Saturn"), new(VSystemID.Raw.SAT, "Sega Saturn"),
new SystemInfo("PCE", "PC Engine/TurboGrafx 16"), new(VSystemID.Raw.PCE, "PC Engine/TurboGrafx 16"),
new SystemInfo("Coleco", "ColecoVision"), new(VSystemID.Raw.Coleco, "ColecoVision"),
new SystemInfo("TI83", "TI-83 Calculator"), new(VSystemID.Raw.TI83, "TI-83 Calculator"),
new SystemInfo("WSWAN", "WonderSwan"), new(VSystemID.Raw.WSWAN, "WonderSwan"),
new SystemInfo("C64", "Commodore 64"), new(VSystemID.Raw.C64, "Commodore 64"),
new SystemInfo("AppleII", "Apple II"), new(VSystemID.Raw.AppleII, "Apple II"),
new SystemInfo("INTV", "IntelliVision"), new(VSystemID.Raw.INTV, "IntelliVision"),
new SystemInfo("ZXSpectrum", "Sinclair ZX Spectrum"), new(VSystemID.Raw.ZXSpectrum, "Sinclair ZX Spectrum"),
new SystemInfo("AmstradCPC", "Amstrad CPC"), new(VSystemID.Raw.AmstradCPC, "Amstrad CPC"),
new SystemInfo("ChannelF", "Fairchild Channel F"), new(VSystemID.Raw.ChannelF, "Fairchild Channel F"),
new SystemInfo("O2", "Odyssey2"), new(VSystemID.Raw.O2, "Odyssey2"),
new SystemInfo("VEC", "Vectrex"), new(VSystemID.Raw.VEC, "Vectrex"),
new SystemInfo("MSX", "MSX"), new(VSystemID.Raw.MSX, "MSX"),
new SystemInfo("NDS", "Nintendo DS") new(VSystemID.Raw.NDS, "Nintendo DS")
}; };
public SystemInfo this[string systemId] public SystemInfo this[string systemId]

View File

@ -0,0 +1,77 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace BizHawk.Emulation.Common
{
/// <summary>
/// You probably want <see cref="Raw"/>.
/// It's laid out this way to match a local branch of mine where this is a struct. --yoshi
/// </summary>
public static class VSystemID
{
public static class Raw
{
public const string A26 = "A26";
public const string A78 = "A78";
public const string AmstradCPC = "AmstradCPC";
public const string AppleII = "AppleII";
public const string C64 = "C64";
public const string ChannelF = "ChannelF";
public const string Coleco = "Coleco";
public const string DEBUG = "DEBUG";
public const string DGB = "DGB";
public const string GB = "GB";
public const string GB3x = "GB3x";
public const string GB4x = "GB4x";
public const string GBA = "GBA";
public const string GBC = "GBC";
public const string GEN = "GEN";
public const string GG = "GG";
public const string GGL = "GGL";
public const string INTV = "INTV";
public const string Libretro = "Libretro";
public const string Lynx = "Lynx";
public const string MAME = "MAME";
public const string MSX = "MSX";
public const string N64 = "N64";
public const string NDS = "NDS";
public const string NES = "NES";
public const string NGP = "NGP";
public const string NULL = "NULL";
public const string O2 = "O2";
public const string PCE = "PCE";
public const string PCECD = "PCECD";
public const string PCFX = "PCFX";
public const string PS2 = "PS2";
public const string PSX = "PSX";
public const string SAT = "SAT";
public const string Sega32X = "32X";
public const string SG = "SG";
public const string SGB = "SGB";
public const string SGX = "SGX";
public const string SGXCD = "SGXCD";
public const string SMS = "SMS";
public const string SNES = "SNES";
public const string TI83 = "TI83";
public const string TI83P = "TI83P"; //TODO only used for CoreConstructor, SystemId is TI83
public const string UZE = "UZE";
public const string VB = "VB";
public const string VEC = "VEC";
public const string WSWAN = "WSWAN";
public const string ZXSpectrum = "ZXSpectrum";
}
private static List<string>? _allSysIDs = null;
private static List<string> AllSysIDs
=> _allSysIDs ??= typeof(Raw).GetFields(BindingFlags.Public | BindingFlags.Static)
.Select(x => (string) x.GetRawConstantValue())
.OrderBy(s => s)
.ToList();
/// <returns><paramref name="sysID"/> iff it's in <see cref="Raw">the valid list</see>, else <see langword="null"/></returns>
public static string? Validate(string sysID)
=> AllSysIDs.BinarySearch(sysID) < 0 ? null : sysID;
}
}

View File

@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
{ {
public partial class MAME : IEmulator public partial class MAME : IEmulator
{ {
public string SystemId => "MAME"; public string SystemId => VSystemID.Raw.MAME;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;
public int Frame { get; private set; } public int Frame { get; private set; }
public IEmulatorServiceProvider ServiceProvider { get; } public IEmulatorServiceProvider ServiceProvider { get; }

View File

@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Calculators
private set => _frame = value; private set => _frame = value;
} }
public string SystemId => "TI83"; public string SystemId => VSystemID.Raw.TI83;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Calculators
[ServiceNotApplicable(new[] { typeof(IBoardInfo), typeof(IDriveLight), typeof(IRegionable), typeof(ISaveRam), typeof(ISoundProvider) })] [ServiceNotApplicable(new[] { typeof(IBoardInfo), typeof(IDriveLight), typeof(IRegionable), typeof(ISaveRam), typeof(ISoundProvider) })]
public partial class TI83 : IEmulator, IVideoProvider, IDebuggable, IInputPollable, ISettable<TI83.TI83Settings, object> public partial class TI83 : IEmulator, IVideoProvider, IDebuggable, IInputPollable, ISettable<TI83.TI83Settings, object>
{ {
[CoreConstructor("83P")] [CoreConstructor(VSystemID.Raw.TI83P)]
public TI83(CoreLoadParameters<TI83Settings, object> lp) public TI83(CoreLoadParameters<TI83Settings, object> lp)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
public int Frame => _machine?.FrameCount ?? 0; public int Frame => _machine?.FrameCount ?? 0;
public string SystemId => "AmstradCPC"; public string SystemId => VSystemID.Raw.AmstradCPC;
public bool DeterministicEmulation { get; } public bool DeterministicEmulation { get; }

View File

@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
[Core(CoreNames.CPCHawk, "Asnivor", isReleased: false)] [Core(CoreNames.CPCHawk, "Asnivor", isReleased: false)]
public partial class AmstradCPC : IRegionable, IDriveLight public partial class AmstradCPC : IRegionable, IDriveLight
{ {
[CoreConstructor("AmstradCPC")] [CoreConstructor(VSystemID.Raw.AmstradCPC)]
public AmstradCPC(CoreLoadParameters<AmstradCPCSettings, AmstradCPCSyncSettings> lp) public AmstradCPC(CoreLoadParameters<AmstradCPCSettings, AmstradCPCSyncSettings> lp)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
private int _frame; private int _frame;
public int Frame { get => _frame; set => _frame = value; } public int Frame { get => _frame; set => _frame = value; }
public string SystemId => "AppleII"; public string SystemId => VSystemID.Raw.AppleII;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
AppleIIController.BoolButtons.AddRange(ExtraButtons); AppleIIController.BoolButtons.AddRange(ExtraButtons);
} }
[CoreConstructor("AppleII")] [CoreConstructor(VSystemID.Raw.AppleII)]
public AppleII(CoreLoadParameters<Settings, object> lp) public AppleII(CoreLoadParameters<Settings, object> lp)
{ {
_romSet = lp.Roms.Select(r => r.RomData).ToList(); _romSet = lp.Roms.Select(r => r.RomData).ToList();

View File

@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "C64"; public string SystemId => VSystemID.Raw.C64;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
[Core(CoreNames.C64Hawk, "SaxxonPike")] [Core(CoreNames.C64Hawk, "SaxxonPike")]
public sealed partial class C64 : IEmulator, IRegionable, IBoardInfo, IRomInfo public sealed partial class C64 : IEmulator, IRegionable, IBoardInfo, IRomInfo
{ {
[CoreConstructor("C64")] [CoreConstructor(VSystemID.Raw.C64)]
public C64(CoreLoadParameters<C64Settings, C64SyncSettings> lp) public C64(CoreLoadParameters<C64Settings, C64SyncSettings> lp)
{ {
PutSyncSettings((C64SyncSettings)lp.SyncSettings ?? new C64SyncSettings()); PutSyncSettings((C64SyncSettings)lp.SyncSettings ?? new C64SyncSettings());

View File

@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "MSX"; public string SystemId => VSystemID.Raw.MSX;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX
[ServiceNotApplicable(new[] { typeof(IDriveLight) })] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class MSX : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IRegionable, ISettable<MSX.MSXSettings, MSX.MSXSyncSettings> public partial class MSX : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IRegionable, ISettable<MSX.MSXSettings, MSX.MSXSyncSettings>
{ {
[CoreConstructor("MSX")] [CoreConstructor(VSystemID.Raw.MSX)]
public MSX(CoreComm comm, GameInfo game, byte[] rom, MSX.MSXSettings settings, MSX.MSXSyncSettings syncSettings) public MSX(CoreComm comm, GameInfo game, byte[] rom, MSX.MSXSettings settings, MSX.MSXSyncSettings syncSettings)
{ {
ServiceProvider = new BasicServiceProvider(this); ServiceProvider = new BasicServiceProvider(this);

View File

@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public int Frame => _machine?.FrameCount ?? 0; public int Frame => _machine?.FrameCount ?? 0;
public string SystemId => "ZXSpectrum"; public string SystemId => VSystemID.Raw.ZXSpectrum;
public bool DeterministicEmulation { get; } public bool DeterministicEmulation { get; }

View File

@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
[Core(CoreNames.ZXHawk, "Asnivor, Alyosha")] [Core(CoreNames.ZXHawk, "Asnivor, Alyosha")]
public partial class ZXSpectrum : IRegionable, IDriveLight public partial class ZXSpectrum : IRegionable, IDriveLight
{ {
[CoreConstructor("ZXSpectrum")] [CoreConstructor(VSystemID.Raw.ZXSpectrum)]
public ZXSpectrum( public ZXSpectrum(
CoreLoadParameters<ZXSpectrumSettings, ZXSpectrumSyncSettings> lp) CoreLoadParameters<ZXSpectrumSettings, ZXSpectrumSyncSettings> lp)
{ {

View File

@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "A26"; public string SystemId => VSystemID.Raw.A26;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
public const string Tapper = /*sha1:*/"E986E1818E747BEB9B33CE4DFF1CDC6B55BDB620"; public const string Tapper = /*sha1:*/"E986E1818E747BEB9B33CE4DFF1CDC6B55BDB620";
} }
[CoreConstructor("A26")] [CoreConstructor(VSystemID.Raw.A26)]
public Atari2600(GameInfo game, byte[] rom, Atari2600.A2600Settings settings, Atari2600.A2600SyncSettings syncSettings) public Atari2600(GameInfo game, byte[] rom, Atari2600.A2600Settings settings, Atari2600.A2600SyncSettings syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);
@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
return new CompactGameInfo return new CompactGameInfo
{ {
Name = _game.Name, Name = _game.Name,
System = "A26", System = VSystemID.Raw.A26,
MetaData = "m=" + _mapper.GetType().ToString().Split('.').Last(), MetaData = "m=" + _mapper.GetType().ToString().Split('.').Last(),
Hash = Rom.HashSHA1(), Hash = Rom.HashSHA1(),
Region = _game.Region, Region = _game.Region,

View File

@ -315,7 +315,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "A78"; public string SystemId => VSystemID.Raw.A78;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
public void WriteMemory(ushort address, byte value) => _a7800.WriteMemory(address, value); public void WriteMemory(ushort address, byte value) => _a7800.WriteMemory(address, value);
} }
[CoreConstructor("A78")] [CoreConstructor(VSystemID.Raw.A78)]
public A7800Hawk(CoreComm comm, byte[] rom, A7800Hawk.A7800Settings settings, A7800Hawk.A7800SyncSettings syncSettings) public A7800Hawk(CoreComm comm, byte[] rom, A7800Hawk.A7800Settings settings, A7800Hawk.A7800SyncSettings syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx
[ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable), typeof(ISettable<,>) })] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable), typeof(ISettable<,>) })]
public partial class Lynx : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable public partial class Lynx : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable
{ {
[CoreConstructor("Lynx")] [CoreConstructor(VSystemID.Raw.Lynx)]
public Lynx(byte[] file, GameInfo game, CoreComm comm) public Lynx(byte[] file, GameInfo game, CoreComm comm)
{ {
ServiceProvider = new BasicServiceProvider(this); ServiceProvider = new BasicServiceProvider(this);
@ -141,7 +141,7 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx
public int Frame { get; private set; } public int Frame { get; private set; }
public string SystemId => "Lynx"; public string SystemId => VSystemID.Raw.Lynx;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Belogic
private LibUzem _uze; private LibUzem _uze;
private readonly bool _mouseEnabled; private readonly bool _mouseEnabled;
[CoreConstructor("UZE")] [CoreConstructor(VSystemID.Raw.UZE)]
public Uzem(CoreComm comm, byte[] rom) public Uzem(CoreComm comm, byte[] rom)
: base(comm, new Configuration : base(comm, new Configuration
{ {
@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Belogic
MaxWidth = 720, MaxWidth = 720,
MaxHeight = 224, MaxHeight = 224,
MaxSamples = 4096, MaxSamples = 4096,
SystemId = "UZE", SystemId = VSystemID.Raw.UZE,
DefaultFpsNumerator = 28618182, DefaultFpsNumerator = 28618182,
DefaultFpsDenominator = 476840 DefaultFpsDenominator = 476840
}) })

View File

@ -179,7 +179,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "Coleco"; public string SystemId => VSystemID.Raw.Coleco;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
[ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(ISaveRam) })] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(ISaveRam) })]
public sealed partial class ColecoVision : IEmulator, IDebuggable, IInputPollable, ISettable<ColecoVision.ColecoSettings, ColecoVision.ColecoSyncSettings> public sealed partial class ColecoVision : IEmulator, IDebuggable, IInputPollable, ISettable<ColecoVision.ColecoSettings, ColecoVision.ColecoSyncSettings>
{ {
[CoreConstructor("Coleco")] [CoreConstructor(VSystemID.Raw.Coleco)]
public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, public ColecoVision(CoreComm comm, GameInfo game, byte[] rom,
ColecoSettings settings, ColecoSettings settings,
ColecoSyncSettings syncSettings) ColecoSyncSettings syncSettings)

View File

@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
public ControllerDefinition ControllerDefinition { get; set; } public ControllerDefinition ControllerDefinition { get; set; }
public string SystemId => "ChannelF"; public string SystemId => VSystemID.Raw.ChannelF;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
[ServiceNotApplicable(new[] { typeof(IDriveLight) })] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class ChannelF public partial class ChannelF
{ {
[CoreConstructor("ChannelF")] [CoreConstructor(VSystemID.Raw.ChannelF)]
public ChannelF(CoreComm comm, GameInfo game, byte[] rom) public ChannelF(CoreComm comm, GameInfo game, byte[] rom)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -97,7 +97,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "VEC"; public string SystemId => VSystemID.Raw.VEC;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
public Audio audio; public Audio audio;
public SerialPort serialport; public SerialPort serialport;
[CoreConstructor("VEC")] [CoreConstructor(VSystemID.Raw.VEC)]
public VectrexHawk(CoreComm comm, byte[] rom, VectrexHawk.VectrexSyncSettings syncSettings) public VectrexHawk(CoreComm comm, byte[] rom, VectrexHawk.VectrexSyncSettings syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "INTV"; public string SystemId => VSystemID.Raw.INTV;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;

View File

@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
public sealed partial class Intellivision : IEmulator, IInputPollable, IDisassemblable, public sealed partial class Intellivision : IEmulator, IInputPollable, IDisassemblable,
IBoardInfo, IDebuggable, ISettable<Intellivision.IntvSettings, Intellivision.IntvSyncSettings> IBoardInfo, IDebuggable, ISettable<Intellivision.IntvSettings, Intellivision.IntvSyncSettings>
{ {
[CoreConstructor("INTV")] [CoreConstructor(VSystemID.Raw.INTV)]
public Intellivision(CoreComm comm, byte[] rom, Intellivision.IntvSettings settings, Intellivision.IntvSyncSettings syncSettings) public Intellivision(CoreComm comm, byte[] rom, Intellivision.IntvSettings settings, Intellivision.IntvSyncSettings syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -192,7 +192,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "O2"; public string SystemId => VSystemID.Raw.O2;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
public bool is_XROM; public bool is_XROM;
[CoreConstructor("O2")] [CoreConstructor(VSystemID.Raw.O2)]
public O2Hawk(CoreComm comm, GameInfo game, byte[] rom, O2Settings settings, O2SyncSettings syncSettings) public O2Hawk(CoreComm comm, GameInfo game, byte[] rom, O2Settings settings, O2SyncSettings syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -15,11 +15,11 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE
private readonly LibHyperNyma _hyperNyma; private readonly LibHyperNyma _hyperNyma;
private readonly bool _hasCds; private readonly bool _hasCds;
[CoreConstructor("PCE", Priority = CorePriority.Low)] [CoreConstructor(VSystemID.Raw.PCE, Priority = CorePriority.Low)]
[CoreConstructor("SGX", Priority = CorePriority.Low)] [CoreConstructor(VSystemID.Raw.SGX, Priority = CorePriority.Low)]
[CoreConstructor("PCECD", Priority = CorePriority.Low)] [CoreConstructor(VSystemID.Raw.PCECD, Priority = CorePriority.Low)]
public HyperNyma(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp) public HyperNyma(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp)
: base(lp.Comm, "PCE", "PC Engine Controller", lp.Settings, lp.SyncSettings) : base(lp.Comm, VSystemID.Raw.PCE, "PC Engine Controller", lp.Settings, lp.SyncSettings)
{ {
var firmwares = new Dictionary<string, FirmwareID>(); var firmwares = new Dictionary<string, FirmwareID>();
if (lp.Discs.Count > 0) if (lp.Discs.Count > 0)
@ -32,8 +32,8 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE
} }
public override string SystemId => IsSgx public override string SystemId => IsSgx
? _hasCds ? "SGXCD" : "SGX" ? _hasCds ? VSystemID.Raw.SGXCD : VSystemID.Raw.SGX
: _hasCds ? "PCECD" : "PCE"; : _hasCds ? VSystemID.Raw.PCECD : VSystemID.Raw.PCE;
protected override IDictionary<string, SettingOverride> SettingOverrides { get; } = new Dictionary<string, SettingOverride> protected override IDictionary<string, SettingOverride> SettingOverrides { get; } = new Dictionary<string, SettingOverride>
{ {

View File

@ -17,11 +17,11 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE
private readonly LibTurboNyma _turboNyma; private readonly LibTurboNyma _turboNyma;
private readonly bool _hasCds; private readonly bool _hasCds;
[CoreConstructor("PCE")] [CoreConstructor(VSystemID.Raw.PCE)]
[CoreConstructor("SGX")] [CoreConstructor(VSystemID.Raw.SGX)]
[CoreConstructor("PCECD")] [CoreConstructor(VSystemID.Raw.PCECD)]
public TurboNyma(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp) public TurboNyma(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp)
: base(lp.Comm, "PCE", "PC Engine Controller", lp.Settings, lp.SyncSettings) : base(lp.Comm, VSystemID.Raw.PCE, "PC Engine Controller", lp.Settings, lp.SyncSettings)
{ {
var firmwares = new Dictionary<string, FirmwareID>(); var firmwares = new Dictionary<string, FirmwareID>();
if (lp.Discs.Count > 0) if (lp.Discs.Count > 0)
@ -43,8 +43,8 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE
} }
public override string SystemId => IsSgx public override string SystemId => IsSgx
? _hasCds ? "SGXCD" : "SGX" ? _hasCds ? VSystemID.Raw.SGXCD : VSystemID.Raw.SGX
: _hasCds ? "PCECD" : "PCE"; : _hasCds ? VSystemID.Raw.PCECD : VSystemID.Raw.PCE;
protected override IDictionary<string, SettingOverride> SettingOverrides { get; } = new Dictionary<string, SettingOverride> protected override IDictionary<string, SettingOverride> SettingOverrides { get; } = new Dictionary<string, SettingOverride>
{ {

View File

@ -8,9 +8,9 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCFX
[PortedCore(CoreNames.TST, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")] [PortedCore(CoreNames.TST, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")]
public class Tst : NymaCore public class Tst : NymaCore
{ {
[CoreConstructor("PCFX")] [CoreConstructor(VSystemID.Raw.PCFX)]
public Tst(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp) public Tst(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp)
: base(lp.Comm, "PCFX", "PC-FX Controller", lp.Settings, lp.SyncSettings) : base(lp.Comm, VSystemID.Raw.PCFX, "PC-FX Controller", lp.Settings, lp.SyncSettings)
{ {
if (lp.Roms.Count > 0) if (lp.Roms.Count > 0)
throw new InvalidOperationException("To load a PC-FX game, please load the CUE file and not the BIN file."); throw new InvalidOperationException("To load a PC-FX game, please load the CUE file and not the BIN file.");

View File

@ -17,8 +17,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
{ {
private BsnesApi.SNES_REGION _region; private BsnesApi.SNES_REGION _region;
[CoreConstructor("SGB")] [CoreConstructor(VSystemID.Raw.SGB)]
[CoreConstructor("SNES")] [CoreConstructor(VSystemID.Raw.SNES)]
public BsnesCore(GameInfo game, byte[] rom, CoreComm comm, public BsnesCore(GameInfo game, byte[] rom, CoreComm comm,
SnesSettings settings, SnesSyncSettings syncSettings) SnesSettings settings, SnesSyncSettings syncSettings)
:this(game, rom, null, null, comm, settings, syncSettings) :this(game, rom, null, null, comm, settings, syncSettings)
@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
_settings = settings ?? new SnesSettings(); _settings = settings ?? new SnesSettings();
_syncSettings = syncSettings ?? new SnesSyncSettings(); _syncSettings = syncSettings ?? new SnesSyncSettings();
if (game.System == "SGB") if (game.System == VSystemID.Raw.SGB)
{ {
if ((romData[0x143] & 0xc0) == 0xc0) if ((romData[0x143] & 0xc0) == 0xc0)
{ {
@ -76,10 +76,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
InitAudio(); InitAudio();
ser.Register<ISoundProvider>(_resampler); ser.Register<ISoundProvider>(_resampler);
if (game.System == "SGB") if (game.System == VSystemID.Raw.SGB)
{ {
IsSGB = true; IsSGB = true;
SystemId = "SNES"; SystemId = VSystemID.Raw.SNES;
ser.Register<IBoardInfo>(new SGBBoardInfo()); ser.Register<IBoardInfo>(new SGBBoardInfo());
_currLoadParams = new LoadParams _currLoadParams = new LoadParams
@ -112,7 +112,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
} }
} }
SystemId = "SNES"; SystemId = VSystemID.Raw.SNES;
_currLoadParams = new LoadParams _currLoadParams = new LoadParams
{ {
type = LoadParamType.Normal, type = LoadParamType.Normal,

View File

@ -7,10 +7,10 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Faust
[PortedCore(CoreNames.Faust, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")] [PortedCore(CoreNames.Faust, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")]
public class Faust : NymaCore, IRegionable public class Faust : NymaCore, IRegionable
{ {
[CoreConstructor("SNES")] [CoreConstructor(VSystemID.Raw.SNES)]
public Faust(GameInfo game, byte[] rom, CoreComm comm, string extension, public Faust(GameInfo game, byte[] rom, CoreComm comm, string extension,
NymaSettings settings, NymaSyncSettings syncSettings, bool deterministic) NymaSettings settings, NymaSyncSettings syncSettings, bool deterministic)
: base(comm, "SNES", "SNES Controller", settings, syncSettings) : base(comm, VSystemID.Raw.SNES, "SNES Controller", settings, syncSettings)
{ {
if (deterministic) if (deterministic)
// force ST renderer // force ST renderer

View File

@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
LibmGBA = BizInvoker.GetInvoker<LibmGBA>(resolver, CallingConventionAdapters.Native); LibmGBA = BizInvoker.GetInvoker<LibmGBA>(resolver, CallingConventionAdapters.Native);
} }
[CoreConstructor("GBA")] [CoreConstructor(VSystemID.Raw.GBA)]
public MGBAHawk(byte[] file, CoreComm comm, SyncSettings syncSettings, Settings settings, bool deterministic, GameInfo game) public MGBAHawk(byte[] file, CoreComm comm, SyncSettings syncSettings, Settings settings, bool deterministic, GameInfo game)
{ {
_syncSettings = syncSettings ?? new SyncSettings(); _syncSettings = syncSettings ?? new SyncSettings();
@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
public int Frame { get; private set; } public int Frame { get; private set; }
public string SystemId => "GBA"; public string SystemId => VSystemID.Raw.GBA;
public bool DeterministicEmulation { get; } public bool DeterministicEmulation { get; }

View File

@ -411,7 +411,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "GB"; public string SystemId => VSystemID.Raw.GB;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -126,8 +126,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
private static readonly byte[] GBA_override = { 0xFF, 0x00, 0xCD, 0x03, 0x35, 0xAA, 0x31, 0x90, 0x94, 0x00, 0x00, 0x00, 0x00 }; private static readonly byte[] GBA_override = { 0xFF, 0x00, 0xCD, 0x03, 0x35, 0xAA, 0x31, 0x90, 0x94, 0x00, 0x00, 0x00, 0x00 };
[CoreConstructor("GB")] [CoreConstructor(VSystemID.Raw.GB)]
[CoreConstructor("GBC")] [CoreConstructor(VSystemID.Raw.GBC)]
public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBSettings settings, GBSyncSettings syncSettings) public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBSettings settings, GBSyncSettings syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -225,7 +225,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "DGB"; public string SystemId => VSystemID.Raw.DGB;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
public bool do_frame_fill; public bool do_frame_fill;
[CoreConstructor("DGB")] [CoreConstructor(VSystemID.Raw.DGB)]
public GBHawkLink(CoreLoadParameters<GBHawkLink.GBLinkSettings, GBHawkLink.GBLinkSyncSettings> lp) public GBHawkLink(CoreLoadParameters<GBHawkLink.GBLinkSettings, GBHawkLink.GBLinkSyncSettings> lp)
{ {
if (lp.Roms.Count != 2) if (lp.Roms.Count != 2)

View File

@ -420,7 +420,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "GB3x"; public string SystemId => VSystemID.Raw.GB3x;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
public bool do_frame_fill; public bool do_frame_fill;
[CoreConstructor("GB3x")] [CoreConstructor(VSystemID.Raw.GB3x)]
public GBHawkLink3x(CoreLoadParameters<GBLink3xSettings, GBLink3xSyncSettings> lp) public GBHawkLink3x(CoreLoadParameters<GBLink3xSettings, GBLink3xSyncSettings> lp)
{ {
if (lp.Roms.Count != 3) if (lp.Roms.Count != 3)

View File

@ -999,7 +999,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "GB4x"; public string SystemId => VSystemID.Raw.GB4x;
public bool DeterministicEmulation { get; set; } public bool DeterministicEmulation { get; set; }

View File

@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x
public bool do_frame_fill; public bool do_frame_fill;
[CoreConstructor("GB4x")] [CoreConstructor(VSystemID.Raw.GB4x)]
public GBHawkLink4x(CoreLoadParameters<GBLink4xSettings, GBLink4xSyncSettings> lp) public GBHawkLink4x(CoreLoadParameters<GBLink4xSettings, GBLink4xSyncSettings> lp)
{ {
if (lp.Roms.Count != 4) if (lp.Roms.Count != 4)

View File

@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public int Frame { get; private set; } public int Frame { get; private set; }
public string SystemId => IsSgb ? "SGB" : "GB"; public string SystemId => IsSgb ? VSystemID.Raw.SGB : VSystemID.Raw.GB;
public string BoardName { get; } public string BoardName { get; }

View File

@ -18,9 +18,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
IBoardInfo, IRomInfo, IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>, IBoardInfo, IRomInfo, IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>,
IGameboyCommon, ICycleTiming, ILinkable IGameboyCommon, ICycleTiming, ILinkable
{ {
[CoreConstructor("GB")] [CoreConstructor(VSystemID.Raw.GB)]
[CoreConstructor("GBC")] [CoreConstructor(VSystemID.Raw.GBC)]
[CoreConstructor("SGB")] [CoreConstructor(VSystemID.Raw.SGB)]
public Gameboy(CoreComm comm, GameInfo game, byte[] file, Gameboy.GambatteSettings settings, Gameboy.GambatteSyncSettings syncSettings, bool deterministic) public Gameboy(CoreComm comm, GameInfo game, byte[] file, Gameboy.GambatteSettings settings, Gameboy.GambatteSyncSettings syncSettings, bool deterministic)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);
@ -62,12 +62,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
flags |= LibGambatte.LoadFlags.CGB_MODE | LibGambatte.LoadFlags.GBA_FLAG; flags |= LibGambatte.LoadFlags.CGB_MODE | LibGambatte.LoadFlags.GBA_FLAG;
break; break;
default: default:
if (game.System == "GBC") if (game.System == VSystemID.Raw.GBC)
flags |= LibGambatte.LoadFlags.CGB_MODE; flags |= LibGambatte.LoadFlags.CGB_MODE;
break; break;
} }
if (game.System == "SGB") if (game.System == VSystemID.Raw.SGB)
{ {
flags &= ~(LibGambatte.LoadFlags.CGB_MODE | LibGambatte.LoadFlags.GBA_FLAG); flags &= ~(LibGambatte.LoadFlags.CGB_MODE | LibGambatte.LoadFlags.GBA_FLAG);
flags |= LibGambatte.LoadFlags.SGB_MODE; flags |= LibGambatte.LoadFlags.SGB_MODE;

View File

@ -161,7 +161,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public int Frame { get; private set; } public int Frame { get; private set; }
public string SystemId => "DGB"; public string SystemId => VSystemID.Raw.DGB;
public bool DeterministicEmulation => L.DeterministicEmulation && R.DeterministicEmulation; public bool DeterministicEmulation => L.DeterministicEmulation && R.DeterministicEmulation;

View File

@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public partial class GambatteLink : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, ISaveRam, IStatable, ILinkable, public partial class GambatteLink : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, ISaveRam, IStatable, ILinkable,
IBoardInfo, IRomInfo, IDebuggable, ISettable<GambatteLink.GambatteLinkSettings, GambatteLink.GambatteLinkSyncSettings>, ICodeDataLogger IBoardInfo, IRomInfo, IDebuggable, ISettable<GambatteLink.GambatteLinkSettings, GambatteLink.GambatteLinkSyncSettings>, ICodeDataLogger
{ {
[CoreConstructor("DGB")] [CoreConstructor(VSystemID.Raw.DGB)]
public GambatteLink(CoreLoadParameters<GambatteLinkSettings, GambatteLinkSyncSettings> lp) public GambatteLink(CoreLoadParameters<GambatteLinkSettings, GambatteLinkSyncSettings> lp)
{ {
if (lp.Roms.Count != 2) if (lp.Roms.Count != 2)

View File

@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
/// <param name="file">Rom that should be loaded</param> /// <param name="file">Rom that should be loaded</param>
/// <param name="rom">rom data with consistent endianness/order</param> /// <param name="rom">rom data with consistent endianness/order</param>
/// <param name="syncSettings">N64SyncSettings object</param> /// <param name="syncSettings">N64SyncSettings object</param>
[CoreConstructor("N64")] [CoreConstructor(VSystemID.Raw.N64)]
public N64(GameInfo game, byte[] file, byte[] rom, N64Settings settings, N64SyncSettings syncSettings) public N64(GameInfo game, byte[] file, byte[] rom, N64Settings settings, N64SyncSettings syncSettings)
{ {
ServiceProvider = new BasicServiceProvider(this); ServiceProvider = new BasicServiceProvider(this);
@ -242,7 +242,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
return true; return true;
} }
public string SystemId => "N64"; public string SystemId => VSystemID.Raw.N64;
public DisplayType Region => _display_type; public DisplayType Region => _display_type;

View File

@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
private readonly NDSDisassembler _disassembler; private readonly NDSDisassembler _disassembler;
private SpeexResampler _resampler; private SpeexResampler _resampler;
[CoreConstructor("NDS")] [CoreConstructor(VSystemID.Raw.NDS)]
public NDS(CoreLoadParameters<NDSSettings, NDSSyncSettings> lp) public NDS(CoreLoadParameters<NDSSettings, NDSSyncSettings> lp)
: base(lp.Comm, new Configuration : base(lp.Comm, new Configuration
{ {
@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
MaxSamples = 1024, MaxSamples = 1024,
DefaultFpsNumerator = 33513982, DefaultFpsNumerator = 33513982,
DefaultFpsDenominator = 560190, DefaultFpsDenominator = 560190,
SystemId = "NDS" SystemId = VSystemID.Raw.NDS,
}) })
{ {
var roms = lp.Roms.Select(r => r.RomData).ToList(); var roms = lp.Roms.Select(r => r.RomData).ToList();

View File

@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public partial class NES : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, IVideoLogicalOffsets, public partial class NES : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, IVideoLogicalOffsets,
IBoardInfo, IRomInfo, ISettable<NES.NESSettings, NES.NESSyncSettings>, ICodeDataLogger IBoardInfo, IRomInfo, ISettable<NES.NESSettings, NES.NESSyncSettings>, ICodeDataLogger
{ {
[CoreConstructor("NES")] [CoreConstructor(VSystemID.Raw.NES)]
public NES(CoreComm comm, GameInfo game, byte[] rom, NESSettings settings, NESSyncSettings syncSettings) public NES(CoreComm comm, GameInfo game, byte[] rom, NESSettings settings, NESSyncSettings syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);
@ -277,7 +277,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;
public string SystemId => "NES"; public string SystemId => VSystemID.Raw.NES;
public string GameName => game_name; public string GameName => game_name;

View File

@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
QN.qn_setup_mappers(); QN.qn_setup_mappers();
} }
[CoreConstructor("NES", Priority = CorePriority.Low)] [CoreConstructor(VSystemID.Raw.NES, Priority = CorePriority.Low)]
public QuickNES(byte[] file, QuickNESSettings settings, QuickNESSyncSettings syncSettings) public QuickNES(byte[] file, QuickNESSettings settings, QuickNESSyncSettings syncSettings)
{ {
FP = OSTailoredCode.IsUnixHost FP = OSTailoredCode.IsUnixHost
@ -218,7 +218,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
private IntPtr Context; private IntPtr Context;
public int Frame { get; private set; } public int Frame { get; private set; }
public string SystemId => "NES"; public string SystemId => VSystemID.Raw.NES;
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;
public string BoardName { get; } public string BoardName { get; }

View File

@ -22,8 +22,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
public unsafe partial class LibsnesCore : IEmulator, IVideoProvider, ISaveRam, IStatable, IInputPollable, IRegionable, ICodeDataLogger, public unsafe partial class LibsnesCore : IEmulator, IVideoProvider, ISaveRam, IStatable, IInputPollable, IRegionable, ICodeDataLogger,
IDebuggable, ISettable<LibsnesCore.SnesSettings, LibsnesCore.SnesSyncSettings> IDebuggable, ISettable<LibsnesCore.SnesSettings, LibsnesCore.SnesSyncSettings>
{ {
[CoreConstructor("SGB")] [CoreConstructor(VSystemID.Raw.SGB)]
[CoreConstructor("SNES")] [CoreConstructor(VSystemID.Raw.SNES)]
public LibsnesCore(GameInfo game, byte[] rom, CoreComm comm, public LibsnesCore(GameInfo game, byte[] rom, CoreComm comm,
LibsnesCore.SnesSettings settings, LibsnesCore.SnesSyncSettings syncSettings) LibsnesCore.SnesSettings settings, LibsnesCore.SnesSyncSettings syncSettings)
:this(game, rom, null, null, comm, settings, syncSettings) :this(game, rom, null, null, comm, settings, syncSettings)
@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
CoreComm = comm; CoreComm = comm;
byte[] sgbRomData = null; byte[] sgbRomData = null;
if (game.System == "SGB") if (game.System == VSystemID.Raw.SGB)
{ {
if ((romData[0x143] & 0xc0) == 0xc0) if ((romData[0x143] & 0xc0) == 0xc0)
{ {
@ -110,10 +110,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
romData = newData; romData = newData;
} }
if (game.System == "SGB") if (game.System == VSystemID.Raw.SGB)
{ {
IsSGB = true; IsSGB = true;
SystemId = "SNES"; SystemId = VSystemID.Raw.SNES;
ser.Register<IBoardInfo>(new SGBBoardInfo()); ser.Register<IBoardInfo>(new SGBBoardInfo());
_currLoadParams = new LoadParams _currLoadParams = new LoadParams
@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
} }
} }
SystemId = "SNES"; SystemId = VSystemID.Raw.SNES;
_currLoadParams = new LoadParams _currLoadParams = new LoadParams
{ {
type = LoadParamType.Normal, type = LoadParamType.Normal,

View File

@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES9X
{ {
private readonly LibSnes9x _core; private readonly LibSnes9x _core;
[CoreConstructor("SNES")] [CoreConstructor(VSystemID.Raw.SNES)]
public Snes9x(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings) public Snes9x(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings)
:base(comm, new Configuration :base(comm, new Configuration
{ {
@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES9X
MaxWidth = 512, MaxWidth = 512,
MaxHeight = 480, MaxHeight = 480,
MaxSamples = 8192, MaxSamples = 8192,
SystemId = "SNES" SystemId = VSystemID.Raw.SNES,
}) })
{ {
settings ??= new Settings(); settings ??= new Settings();

View File

@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "GB"; public string SystemId => VSystemID.Raw.GB;
public bool DeterministicEmulation => _GBCore.DeterministicEmulation; public bool DeterministicEmulation => _GBCore.DeterministicEmulation;

View File

@ -10,8 +10,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk
public partial class SubGBHawk : IEmulator, IStatable, IInputPollable, public partial class SubGBHawk : IEmulator, IStatable, IInputPollable,
ISettable<GBHawk.GBHawk.GBSettings, GBHawk.GBHawk.GBSyncSettings>, IDebuggable ISettable<GBHawk.GBHawk.GBSettings, GBHawk.GBHawk.GBSyncSettings>, IDebuggable
{ {
[CoreConstructor("GB", Priority = CorePriority.SuperLow)] [CoreConstructor(VSystemID.Raw.GB, Priority = CorePriority.SuperLow)]
[CoreConstructor("GBC", Priority = CorePriority.SuperLow)] [CoreConstructor(VSystemID.Raw.GBC, Priority = CorePriority.SuperLow)]
public SubGBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBHawk.GBHawk.GBSettings settings, GBHawk.GBHawk.GBSyncSettings syncSettings) public SubGBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBHawk.GBHawk.GBSettings settings, GBHawk.GBHawk.GBSyncSettings syncSettings)
{ {

View File

@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "NES"; public string SystemId => VSystemID.Raw.NES;
public bool DeterministicEmulation => _nesCore.DeterministicEmulation; public bool DeterministicEmulation => _nesCore.DeterministicEmulation;

View File

@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk
public partial class SubNESHawk : IEmulator, IStatable, IInputPollable, public partial class SubNESHawk : IEmulator, IStatable, IInputPollable,
ISettable<NES.NES.NESSettings, NES.NES.NESSyncSettings> ISettable<NES.NES.NESSettings, NES.NES.NESSyncSettings>
{ {
[CoreConstructor("NES", Priority = CorePriority.SuperLow)] [CoreConstructor(VSystemID.Raw.NES, Priority = CorePriority.SuperLow)]
public SubNESHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ NES.NES.NESSettings settings, NES.NES.NESSyncSettings syncSettings) public SubNESHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ NES.NES.NESSettings settings, NES.NES.NESSyncSettings syncSettings)
{ {
var subNesSettings = (NES.NES.NESSettings)settings ?? new NES.NES.NESSettings(); var subNesSettings = (NES.NES.NESSettings)settings ?? new NES.NES.NESSettings();

View File

@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.VB
{ {
private readonly LibVirtualBoyee _boyee; private readonly LibVirtualBoyee _boyee;
[CoreConstructor("VB")] [CoreConstructor(VSystemID.Raw.VB)]
public VirtualBoyee(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings) public VirtualBoyee(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings)
: base(comm, new Configuration : base(comm, new Configuration
{ {
@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.VB
MaxWidth = 1024, MaxWidth = 1024,
MaxHeight = 1024, MaxHeight = 1024,
MaxSamples = 8192, MaxSamples = 8192,
SystemId = "VB" SystemId = VSystemID.Raw.VB,
}) })
{ {
_settings = settings ?? new Settings(); _settings = settings ?? new Settings();

Some files were not shown because too many files have changed in this diff Show More