From 4a4d8fe7518475a19d49e27932df78a1068e5bec Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Wed, 10 Nov 2021 13:00:03 +1000 Subject: [PATCH] Collect sysID constants in a single class --- ...izHawkSystemIdToCoreSystemEnumConverter.cs | 132 ++--- src/BizHawk.Client.Common/RomLoader.cs | 36 +- .../cheats/GameSharkDecoder.cs | 24 +- src/BizHawk.Client.Common/config/Config.cs | 31 +- .../config/PathEntryCollection.cs | 546 +++++++++--------- .../config/PathEntryCollectionExtensions.cs | 28 +- .../fwmanager/FirmwareManager.cs | 2 +- .../movie/bk2/Bk2MnemonicLookup.cs | 48 +- .../movie/import/DsmImport.cs | 2 +- .../movie/import/FcmImport.cs | 3 +- .../movie/import/Fm2Import.cs | 3 +- .../movie/import/FmvImport.cs | 4 +- .../movie/import/GmvImport.cs | 4 +- .../movie/import/LsmvImport.cs | 14 +- .../movie/import/Mc2Import.cs | 7 +- .../movie/import/MmvImport.cs | 3 +- .../movie/import/PjmImport.cs | 4 +- .../movie/import/PxmImport.cs | 4 +- .../movie/import/SmvImport.cs | 6 +- .../movie/import/VbmImport.cs | 10 +- .../movie/import/YmvImport.cs | 2 +- .../Extensions/CoreExtensions.cs | 2 +- src/BizHawk.Client.EmuHawk/MainForm.cs | 50 +- .../config/GB/ColorChooserForm.cs | 4 +- .../config/NES/NESGraphicsConfig.cs | 3 +- .../config/NES/QuickNesConfig.cs | 3 +- .../config/PathConfig.cs | 18 +- .../config/ProfileConfig.cs | 24 +- .../tools/ExternalToolManager.cs | 4 +- src/BizHawk.Client.EmuHawk/tools/GameShark.cs | 2 +- .../tools/Macros/MacroInput.cs | 2 +- .../MultiDiskBundler/MultiDiskBundler.cs | 4 +- .../MultiDiskBundler/MultiDiskFileSelector.cs | 3 +- .../tools/NES/NESNameTableViewer.cs | 2 +- .../tools/NES/NESPPU.cs | 2 +- .../Base Implementations/NullEmulator.cs | 2 +- src/BizHawk.Emulation.Common/DSKIdentifier.cs | 38 +- .../Database/Database.cs | 70 +-- .../Database/GameInfo.cs | 4 +- src/BizHawk.Emulation.Common/Extensions.cs | 80 +-- src/BizHawk.Emulation.Common/SystemLookup.cs | 54 +- src/BizHawk.Emulation.Common/VSystemID.cs | 77 +++ .../Arcades/MAME/MAME.IEmulator.cs | 2 +- .../Calculator/TI83.IEmulator.cs | 2 +- .../Calculator/TI83.cs | 2 +- .../AmstradCPC/AmstradCPC.IEmulator.cs | 2 +- .../Computers/AmstradCPC/AmstradCPC.cs | 2 +- .../Computers/AppleII/AppleII.IEmulator.cs | 2 +- .../Computers/AppleII/AppleII.cs | 2 +- .../Computers/Commodore64/C64.IEmulator.cs | 2 +- .../Computers/Commodore64/C64.cs | 2 +- .../Computers/MSX/MSX.IEmulator.cs | 2 +- .../Computers/MSX/MSX.cs | 2 +- .../SinclairSpectrum/ZXSpectrum.IEmulator.cs | 2 +- .../Computers/SinclairSpectrum/ZXSpectrum.cs | 2 +- .../Atari/2600/Atari2600.IEmulator.cs | 2 +- .../Consoles/Atari/2600/Atari2600.cs | 4 +- .../Atari/A7800Hawk/A7800Hawk.IEmulator.cs | 2 +- .../Consoles/Atari/A7800Hawk/A7800Hawk.cs | 2 +- .../Consoles/Atari/lynx/Lynx.cs | 4 +- .../Consoles/Belogic/Uzem.cs | 4 +- .../Consoles/Coleco/ColecoVision.IEmulator.cs | 2 +- .../Consoles/Coleco/ColecoVision.cs | 2 +- .../Fairchild/ChannelF/ChannelF.IEmulator.cs | 2 +- .../Consoles/Fairchild/ChannelF/ChannelF.cs | 2 +- .../GCE/Vectrex/VectrexHawk.IEmulator.cs | 2 +- .../Consoles/GCE/Vectrex/VectrexHawk.cs | 2 +- .../Intellivision/Intellivision.IEmulator.cs | 2 +- .../Consoles/Intellivision/Intellivision.cs | 2 +- .../Magnavox/Odyssey2/O2Hawk.IEmulator.cs | 2 +- .../Consoles/Magnavox/Odyssey2/O2Hawk.cs | 2 +- .../Consoles/NEC/PCE/HyperNyma.cs | 12 +- .../Consoles/NEC/PCE/TurboNyma.cs | 12 +- .../Consoles/NEC/PCFX/Tst.cs | 4 +- .../Consoles/Nintendo/BSNES/BsnesCore.cs | 12 +- .../Consoles/Nintendo/Faust/Faust.cs | 4 +- .../Consoles/Nintendo/GBA/MGBAHawk.cs | 4 +- .../Nintendo/GBHawk/GBHawk.IEmulator.cs | 2 +- .../Consoles/Nintendo/GBHawk/GBHawk.cs | 4 +- .../GBHawkLink/GBHawkLink.IEmulator.cs | 2 +- .../Nintendo/GBHawkLink/GBHawkLink.cs | 2 +- .../GBHawkLink3x/GBHawkLink3x.IEmulator.cs | 2 +- .../Nintendo/GBHawkLink3x/GBHawkLink3x.cs | 2 +- .../GBHawkLink4x/GBHawkLink4x.IEmulator.cs | 2 +- .../Nintendo/GBHawkLink4x/GBHawkLink4x.cs | 2 +- .../Nintendo/Gameboy/Gambatte.IEmulator.cs | 2 +- .../Consoles/Nintendo/Gameboy/Gambatte.cs | 10 +- .../Gameboy/GambatteLink.IEmulator.cs | 2 +- .../Consoles/Nintendo/Gameboy/GambatteLink.cs | 2 +- .../Consoles/Nintendo/N64/N64.cs | 4 +- .../Consoles/Nintendo/NDS/MelonDS.cs | 4 +- .../Consoles/Nintendo/NES/NES.cs | 4 +- .../Consoles/Nintendo/QuickNES/QuickNES.cs | 4 +- .../Consoles/Nintendo/SNES/LibsnesCore.cs | 12 +- .../Consoles/Nintendo/SNES9X/Snes9x.cs | 4 +- .../Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs | 2 +- .../Consoles/Nintendo/SubGBHawk/SubGBHawk.cs | 4 +- .../SubNESHawk/SubNESHawk.IEmulator.cs | 2 +- .../Nintendo/SubNESHawk/SubNESHawk.cs | 2 +- .../Consoles/Nintendo/VB/VirtualBoyee.cs | 4 +- .../Consoles/PC Engine/PCEngine.cs | 16 +- .../Consoles/SNK/NeoGeoPort.cs | 4 +- .../Sega/GGHawkLink/GGHawkLink.IEmulator.cs | 2 +- .../Consoles/Sega/GGHawkLink/GGHawkLink.cs | 2 +- .../Consoles/Sega/PicoDrive/PicoDrive.cs | 6 +- .../Consoles/Sega/SMS/SMS.cs | 16 +- .../Consoles/Sega/Saturn/Saturnus.cs | 4 +- .../Consoles/Sega/gpgx64/GPGX.IEmulator.cs | 2 +- .../Consoles/Sega/gpgx64/GPGX.cs | 2 +- .../Consoles/Sony/PS2/DobieStation.cs | 4 +- .../Consoles/Sony/PSX/Octoshock.cs | 4 +- .../Consoles/WonderSwan/WonderSwan.cs | 4 +- .../Libretro/LibretroCore.cs | 2 +- .../vpads_schemata/A26Schema.cs | 2 +- .../vpads_schemata/A78Schema.cs | 2 +- .../vpads_schemata/AppleIISchema.cs | 2 +- .../vpads_schemata/C64Schema.cs | 2 +- .../vpads_schemata/ColecoSchema.cs | 2 +- .../vpads_schemata/DualGBSchema.cs | 2 +- .../vpads_schemata/GBASchema.cs | 2 +- .../vpads_schemata/GBSchema.cs | 6 +- .../vpads_schemata/GGLSchema.cs | 2 +- .../vpads_schemata/GenSchema.cs | 2 +- .../vpads_schemata/IntvSchema.cs | 2 +- .../vpads_schemata/LynxSchema.cs | 2 +- .../vpads_schemata/N64Schema.cs | 2 +- .../vpads_schemata/NdsSchema.cs | 2 +- .../vpads_schemata/NesSchema.cs | 2 +- .../vpads_schemata/NgpSchema.cs | 2 +- .../vpads_schemata/O2Schema.cs | 2 +- .../vpads_schemata/PSXSchema.cs | 2 +- .../vpads_schemata/PceSchema.cs | 6 +- .../vpads_schemata/PcfxSchema.cs | 2 +- .../vpads_schemata/SGBSchema.cs | 2 +- .../vpads_schemata/SaturnSchema.cs | 2 +- .../vpads_schemata/SmsSchema.cs | 6 +- .../vpads_schemata/SnesSchema.cs | 2 +- .../vpads_schemata/VECSchema.cs | 2 +- .../vpads_schemata/VirtualBoySchema.cs | 2 +- .../vpads_schemata/WonderSwanSchema.cs | 2 +- .../vpads_schemata/ZXSpectrumSchema.cs | 2 +- .../Client.Common/cheats/CheatDecoderTests.cs | 7 +- 142 files changed, 901 insertions(+), 795 deletions(-) create mode 100644 src/BizHawk.Emulation.Common/VSystemID.cs diff --git a/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs b/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs index 28207b3f54..6c18b72896 100644 --- a/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs +++ b/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs @@ -1,6 +1,8 @@ using System; using System.Globalization; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.Common { /// @@ -25,46 +27,46 @@ namespace BizHawk.Client.Common { return (string) value switch { - "AppleII" => CoreSystem.AppleII, - "A26" => CoreSystem.Atari2600, - "A78" => CoreSystem.Atari7800, - "Coleco" => CoreSystem.ColecoVision, - "C64" => CoreSystem.Commodore64, - "DGB" => CoreSystem.DualGameBoy, - "GB" => CoreSystem.GameBoy, - "GBA" => CoreSystem.GameBoyAdvance, - "GEN" => CoreSystem.Genesis, - "INTV" => CoreSystem.Intellivision, - "Libretro" => CoreSystem.Libretro, - "Lynx" => CoreSystem.Lynx, - "SMS" => CoreSystem.MasterSystem, - "NDS" => CoreSystem.NintendoDS, - "NES" => CoreSystem.NES, - "N64" => CoreSystem.Nintendo64, - "NULL" => CoreSystem.Null, - "PCE" => CoreSystem.PCEngine, - "PCECD" => CoreSystem.PCEngine, - "SGX" => CoreSystem.PCEngine, - "PSX" => CoreSystem.Playstation, - "SAT" => CoreSystem.Saturn, - "SNES" => CoreSystem.SNES, - "TI83" => CoreSystem.TI83, - "VEC" => CoreSystem.Vectrex, - "WSWAN" => CoreSystem.WonderSwan, - "ZXSpectrum" => CoreSystem.ZXSpectrum, - "AmstradCPC" => CoreSystem.AmstradCPC, - "GGL" => CoreSystem.GGL, - "ChannelF" => CoreSystem.ChannelF, - "GB3x" => CoreSystem.GB3x, - "GB4x" => CoreSystem.GB4x, - "MAME" => CoreSystem.MAME, - "O2" => CoreSystem.Odyssey2, - "MSX" => CoreSystem.MSX, - "VB" => CoreSystem.VirtualBoy, - "NGP" => CoreSystem.NeoGeoPocket, - "SGB" => CoreSystem.SuperGameBoy, - "UZE" => CoreSystem.UzeBox, - "PCFX" => CoreSystem.PcFx, + VSystemID.Raw.AppleII => CoreSystem.AppleII, + VSystemID.Raw.A26 => CoreSystem.Atari2600, + VSystemID.Raw.A78 => CoreSystem.Atari7800, + VSystemID.Raw.Coleco => CoreSystem.ColecoVision, + VSystemID.Raw.C64 => CoreSystem.Commodore64, + VSystemID.Raw.DGB => CoreSystem.DualGameBoy, + VSystemID.Raw.GB => CoreSystem.GameBoy, + VSystemID.Raw.GBA => CoreSystem.GameBoyAdvance, + VSystemID.Raw.GEN => CoreSystem.Genesis, + VSystemID.Raw.INTV => CoreSystem.Intellivision, + VSystemID.Raw.Libretro => CoreSystem.Libretro, + VSystemID.Raw.Lynx => CoreSystem.Lynx, + VSystemID.Raw.SMS => CoreSystem.MasterSystem, + VSystemID.Raw.NDS => CoreSystem.NintendoDS, + VSystemID.Raw.NES => CoreSystem.NES, + VSystemID.Raw.N64 => CoreSystem.Nintendo64, + VSystemID.Raw.NULL => CoreSystem.Null, + VSystemID.Raw.PCE => CoreSystem.PCEngine, + VSystemID.Raw.PCECD => CoreSystem.PCEngine, + VSystemID.Raw.SGX => CoreSystem.PCEngine, + VSystemID.Raw.PSX => CoreSystem.Playstation, + VSystemID.Raw.SAT => CoreSystem.Saturn, + VSystemID.Raw.SNES => CoreSystem.SNES, + VSystemID.Raw.TI83 => CoreSystem.TI83, + VSystemID.Raw.VEC => CoreSystem.Vectrex, + VSystemID.Raw.WSWAN => CoreSystem.WonderSwan, + VSystemID.Raw.ZXSpectrum => CoreSystem.ZXSpectrum, + VSystemID.Raw.AmstradCPC => CoreSystem.AmstradCPC, + VSystemID.Raw.GGL => CoreSystem.GGL, + VSystemID.Raw.ChannelF => CoreSystem.ChannelF, + VSystemID.Raw.GB3x => CoreSystem.GB3x, + VSystemID.Raw.GB4x => CoreSystem.GB4x, + VSystemID.Raw.MAME => CoreSystem.MAME, + VSystemID.Raw.O2 => CoreSystem.Odyssey2, + VSystemID.Raw.MSX => CoreSystem.MSX, + VSystemID.Raw.VB => CoreSystem.VirtualBoy, + VSystemID.Raw.NGP => CoreSystem.NeoGeoPocket, + VSystemID.Raw.SGB => CoreSystem.SuperGameBoy, + VSystemID.Raw.UZE => CoreSystem.UzeBox, + VSystemID.Raw.PCFX => CoreSystem.PcFx, _ => throw new IndexOutOfRangeException($"{value} is missing in convert list") }; } @@ -95,31 +97,31 @@ namespace BizHawk.Client.Common { return (CoreSystem) value switch { - CoreSystem.AppleII => "AppleII", - CoreSystem.Atari2600 => "A26", - CoreSystem.Atari7800 => "A78", - CoreSystem.ColecoVision => "Coleco", - CoreSystem.Commodore64 => "C64", - CoreSystem.DualGameBoy => "DGB", - CoreSystem.GameBoy => "GB", - CoreSystem.GameBoyAdvance => "GBA", - CoreSystem.Genesis => "GEN", - CoreSystem.Intellivision => "INTV", - CoreSystem.Libretro => "Libretro", - CoreSystem.Lynx => "Lynx", - CoreSystem.MasterSystem => "SMS", - CoreSystem.NES => "NES", - CoreSystem.Nintendo64 => "N64", - CoreSystem.Null => "NULL", - CoreSystem.PCEngine => "PCE", - CoreSystem.Playstation => "PSX", - CoreSystem.Saturn => "SAT", - CoreSystem.SNES => "SNES", - CoreSystem.TI83 => "TI83", - CoreSystem.WonderSwan => "WSWAN", - CoreSystem.ZXSpectrum => "ZXSpectrum", - CoreSystem.AmstradCPC => "AmstradCPC", - CoreSystem.Odyssey2 => "O2", + CoreSystem.AppleII => VSystemID.Raw.AppleII, + CoreSystem.Atari2600 => VSystemID.Raw.A26, + CoreSystem.Atari7800 => VSystemID.Raw.A78, + CoreSystem.ColecoVision => VSystemID.Raw.Coleco, + CoreSystem.Commodore64 => VSystemID.Raw.C64, + CoreSystem.DualGameBoy => VSystemID.Raw.DGB, + CoreSystem.GameBoy => VSystemID.Raw.GB, + CoreSystem.GameBoyAdvance => VSystemID.Raw.GBA, + CoreSystem.Genesis => VSystemID.Raw.GEN, + CoreSystem.Intellivision => VSystemID.Raw.INTV, + CoreSystem.Libretro => VSystemID.Raw.Libretro, + CoreSystem.Lynx => VSystemID.Raw.Lynx, + CoreSystem.MasterSystem => VSystemID.Raw.SMS, + CoreSystem.NES => VSystemID.Raw.NES, + CoreSystem.Nintendo64 => VSystemID.Raw.N64, + CoreSystem.Null => VSystemID.Raw.NULL, + CoreSystem.PCEngine => VSystemID.Raw.PCE, + CoreSystem.Playstation => VSystemID.Raw.PSX, + CoreSystem.Saturn => VSystemID.Raw.SAT, + CoreSystem.SNES => VSystemID.Raw.SNES, + CoreSystem.TI83 => VSystemID.Raw.TI83, + CoreSystem.WonderSwan => VSystemID.Raw.WSWAN, + CoreSystem.ZXSpectrum => VSystemID.Raw.ZXSpectrum, + CoreSystem.AmstradCPC => VSystemID.Raw.AmstradCPC, + CoreSystem.Odyssey2 => VSystemID.Raw.O2, _ => throw new IndexOutOfRangeException($"{value} is missing in convert list") }; } diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 28ab9c4003..954085c0d4 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -245,24 +245,24 @@ namespace BizHawk.Client.Common switch (discType) { case DiscType.SegaSaturn: - game.System = "SAT"; + game.System = VSystemID.Raw.SAT; break; case DiscType.SonyPSP: game.System = "PSP"; break; case DiscType.SonyPS2: - game.System = "PS2"; + game.System = VSystemID.Raw.PS2; break; case DiscType.MegaCD: - game.System = "GEN"; + game.System = VSystemID.Raw.GEN; break; case DiscType.PCFX: - game.System = "PCFX"; + game.System = VSystemID.Raw.PCFX; break; case DiscType.TurboGECD: case DiscType.TurboCD: - game.System = "PCE"; + game.System = VSystemID.Raw.PCE; break; case DiscType.Amiga: @@ -280,12 +280,12 @@ namespace BizHawk.Client.Common case DiscType.AudioDisc: case DiscType.UnknownCDFS: 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; 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: - game.System = "PSX"; + game.System = VSystemID.Raw.PSX; break; } } @@ -415,11 +415,11 @@ namespace BizHawk.Client.Common // hacky for now if (file.Extension == ".exe") { - rom.GameInfo.System = "PSX"; + rom.GameInfo.System = VSystemID.Raw.PSX; } else if (file.Extension == ".nsf") { - rom.GameInfo.System = "NES"; + rom.GameInfo.System = VSystemID.Raw.NES; } Util.DebugWriteLine(rom.GameInfo.System); @@ -453,14 +453,14 @@ namespace BizHawk.Client.Common switch (game.System) { - case "GB": - case "GBC": + case VSystemID.Raw.GB: + case VSystemID.Raw.GBC: if (_config.GbAsSgb) { - game.System = "SGB"; + game.System = VSystemID.Raw.SGB; } break; - case "MAME": + case VSystemID.Raw.MAME: nextEmulator = new MAME( file.Directory, file.CanonicalName, @@ -562,7 +562,7 @@ namespace BizHawk.Client.Common // need to get rid of this hack at some point rom = new RomGame(file); game = rom.GameInfo; - game.System = "SNES"; + game.System = VSystemID.Raw.SNES; nextEmulator = new LibsnesCore( game, null, @@ -576,7 +576,7 @@ namespace BizHawk.Client.Common } catch { - DoLoadErrorCallback(ex.ToString(), "DGB", LoadErrorType.Xml); + DoLoadErrorCallback(ex.ToString(), VSystemID.Raw.DGB, LoadErrorType.Xml); 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) // 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); 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 (!retro.LoadNoGame()) { - DoLoadErrorCallback("LibretroNoGame failed to load. This is weird", "Libretro"); + DoLoadErrorCallback("LibretroNoGame failed to load. This is weird", VSystemID.Raw.Libretro); retro.Dispose(); return false; } @@ -655,7 +655,7 @@ namespace BizHawk.Client.Common 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(); return false; } diff --git a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs index e46fd76592..fb7f310e19 100644 --- a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs +++ b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs @@ -17,15 +17,15 @@ namespace BizHawk.Client.Common.cheats { 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? - "GBA" => Gba(code), - "GEN" => Gen(code), - "N64" => N64(code), - "NES" => Nes(code), - "PSX" => Psx(code), - "SAT" => Saturn(code), - "SMS" => Sms(code), - "SNES" => Snes(code), + 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? + VSystemID.Raw.GBA => Gba(code), + VSystemID.Raw.GEN => Gen(code), + VSystemID.Raw.N64 => N64(code), + VSystemID.Raw.NES => Nes(code), + VSystemID.Raw.PSX => Psx(code), + VSystemID.Raw.SAT => Saturn(code), + VSystemID.Raw.SMS => Sms(code), + VSystemID.Raw.SNES => Snes(code), _ => new InvalidCheatCode("Cheat codes not currently supported on this system") }; } @@ -40,10 +40,10 @@ namespace BizHawk.Client.Common.cheats private string CheatDomainName() => _systemId switch { - "N64" => "RDRAM", - "PSX" => "MainRAM", + VSystemID.Raw.N64 => "RDRAM", + VSystemID.Raw.PSX => "MainRAM", #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 _ => null diff --git a/src/BizHawk.Client.Common/config/Config.cs b/src/BizHawk.Client.Common/config/Config.cs index b476de52c9..50c5753087 100644 --- a/src/BizHawk.Client.Common/config/Config.cs +++ b/src/BizHawk.Client.Common/config/Config.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using BizHawk.Common; using BizHawk.Common.PathExtensions; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores; using Newtonsoft.Json.Linq; @@ -19,17 +20,17 @@ namespace BizHawk.Client.Common /// 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[] { "SNES" }, + (new[] { VSystemID.Raw.SNES }, new[] { CoreNames.Faust, CoreNames.Snes9X, CoreNames.Bsnes, CoreNames.Bsnes115 }), - (new[] { "SGB" }, + (new[] { VSystemID.Raw.SGB }, 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[] { "DGB" }, + (new[] { VSystemID.Raw.DGB }, 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 }) }; @@ -317,15 +318,15 @@ namespace BizHawk.Client.Common public Dictionary PreferredCores = new Dictionary { - ["NES"] = CoreNames.QuickNes, - ["SNES"] = CoreNames.Snes9X, - ["GB"] = CoreNames.Gambatte, - ["GBC"] = CoreNames.Gambatte, - ["DGB"] = CoreNames.DualGambatte, - ["SGB"] = CoreNames.Gambatte, - ["PCE"] = CoreNames.TurboNyma, - ["PCECD"] = CoreNames.TurboNyma, - ["SGX"] = CoreNames.TurboNyma + [VSystemID.Raw.NES] = CoreNames.QuickNes, + [VSystemID.Raw.SNES] = CoreNames.Snes9X, + [VSystemID.Raw.GB] = CoreNames.Gambatte, + [VSystemID.Raw.GBC] = CoreNames.Gambatte, + [VSystemID.Raw.DGB] = CoreNames.DualGambatte, + [VSystemID.Raw.SGB] = CoreNames.Gambatte, + [VSystemID.Raw.PCE] = CoreNames.TurboNyma, + [VSystemID.Raw.PCECD] = CoreNames.TurboNyma, + [VSystemID.Raw.SGX] = CoreNames.TurboNyma, }; public bool DontTryOtherCores { get; set; } diff --git a/src/BizHawk.Client.Common/config/PathEntryCollection.cs b/src/BizHawk.Client.Common/config/PathEntryCollection.cs index baf0dd383e..f05df89021 100644 --- a/src/BizHawk.Client.Common/config/PathEntryCollection.cs +++ b/src/BizHawk.Client.Common/config/PathEntryCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; using BizHawk.Common.PathExtensions; +using BizHawk.Emulation.Common; + using Newtonsoft.Json; namespace BizHawk.Client.Common @@ -10,45 +12,51 @@ namespace BizHawk.Client.Common [JsonObject] public class PathEntryCollection : IEnumerable { + 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 _displayNameLookup = new() { - ["Global_NULL"] = "Global", - ["INTV"] = "Intellivision", - ["NES"] = "NES", - ["SNES"] = "SNES", - ["GBA"] = "GBA", - ["SMS"] = "SMS", - ["GG"] = "GG", - ["SG"] = "SG", - ["GEN"] = "Genesis", - ["PCE_PCECD_SGX"] = "PC Engine", - ["GB_GBC_SGB"] = "Gameboy", - ["DGB"] = "Dual Gameboy", - ["TI83"] = "TI83", - ["A26"] = "Atari 2600", - ["A78"] = "Atari 7800", - ["C64"] = "Commodore 64", - ["ZXSpectrum"] = "Sinclair ZX Spectrum", - ["AmstradCPC"] = "Amstrad CPC", - ["PSX"] = "Playstation", - ["Coleco"] = "Coleco", - ["N64"] = "N64", - ["SAT"] = "Saturn", - ["WSWAN"] = "WonderSwan", - ["Lynx"] = "Lynx", - ["AppleII"] = "Apple II", - ["Libretro"] = "Libretro", - ["VB"] = "VB", - ["NGP"] = "NGP", - ["PCFX"] = "PCFX", - ["ChannelF"] = "Fairchild Channel F", - ["GB3x"] = "GB3x", - ["GB4x"] = "GB4x", - ["VEC"] = "VEC", - ["O2"] = "O2", - ["MSX"] = "MSX", - ["UZE"] = "UZE", - ["NDS"] = "NDS", + [GLOBAL] = "Global", + [VSystemID.Raw.INTV] = "Intellivision", + [VSystemID.Raw.NES] = "NES", + [VSystemID.Raw.SNES] = "SNES", + [VSystemID.Raw.GBA] = "GBA", + [VSystemID.Raw.SMS] = "SMS", + [VSystemID.Raw.GG] = "GG", + [VSystemID.Raw.SG] = "SG", + [VSystemID.Raw.GEN] = "Genesis", + [COMBINED_SYSIDS_PCE] = "PC Engine", + [COMBINED_SYSIDS_GB] = "Gameboy", + [VSystemID.Raw.DGB] = "Dual Gameboy", + [VSystemID.Raw.TI83] = "TI83", + [VSystemID.Raw.A26] = "Atari 2600", + [VSystemID.Raw.A78] = "Atari 7800", + [VSystemID.Raw.C64] = "Commodore 64", + [VSystemID.Raw.ZXSpectrum] = "Sinclair ZX Spectrum", + [VSystemID.Raw.AmstradCPC] = "Amstrad CPC", + [VSystemID.Raw.PSX] = "Playstation", + [VSystemID.Raw.Coleco] = "Coleco", + [VSystemID.Raw.N64] = "N64", + [VSystemID.Raw.SAT] = "Saturn", + [VSystemID.Raw.WSWAN] = "WonderSwan", + [VSystemID.Raw.Lynx] = "Lynx", + [VSystemID.Raw.AppleII] = "Apple II", + [VSystemID.Raw.Libretro] = "Libretro", + [VSystemID.Raw.VB] = "VB", + [VSystemID.Raw.NGP] = "NGP", + [VSystemID.Raw.PCFX] = "PCFX", + [VSystemID.Raw.ChannelF] = "Fairchild Channel F", + [VSystemID.Raw.GB3x] = "GB3x", + [VSystemID.Raw.GB4x] = "GB4x", + [VSystemID.Raw.VEC] = "VEC", + [VSystemID.Raw.O2] = "O2", + [VSystemID.Raw.MSX] = "MSX", + [VSystemID.Raw.UZE] = "UZE", + [VSystemID.Raw.NDS] = "NDS", }; public static string GetDisplayNameFor(string sysID) @@ -132,283 +140,283 @@ namespace BizHawk.Client.Common } [JsonIgnore] - public string FirmwaresPathFragment => this["Global", "Firmware"].Path; + public string FirmwaresPathFragment => this[GLOBAL, "Firmware"].Path; [JsonIgnore] - internal string TempFilesFragment => this["Global", "Temp Files"].Path; + internal string TempFilesFragment => this[GLOBAL, "Temp Files"].Path; public static List DefaultValues => new List { - new("Global_NULL", 1, "Base", "."), - new("Global_NULL", 2, "ROM", "."), - new("Global_NULL", 3, "Firmware", Path.Combine(".", "Firmware")), - new("Global_NULL", 4, "Movies", Path.Combine(".", "Movies")), - new("Global_NULL", 5, "Movie backups", Path.Combine(".", "Movies", "backup")), - new("Global_NULL", 6, "A/V Dumps", "."), - new("Global_NULL", 7, "Tools", Path.Combine(".", "Tools")), - new("Global_NULL", 8, "Lua", Path.Combine(".", "Lua")), - new("Global_NULL", 9, "Watch (.wch)", Path.Combine(".", ".")), - new("Global_NULL", 10, "Debug Logs", Path.Combine(".", "")), - new("Global_NULL", 11, "Macros", Path.Combine(".", "Movies", "Macros")), - new("Global_NULL", 12, "TAStudio states", Path.Combine(".", "Movies", "TAStudio states")), - new("Global_NULL", 13, "Multi-Disk Bundles", Path.Combine(".", "")), - new("Global_NULL", 14, "External Tools", Path.Combine(".", "ExternalTools")), - new("Global_NULL", 15, "Temp Files", ""), + new(GLOBAL, 1, "Base", "."), + new(GLOBAL, 2, "ROM", "."), + new(GLOBAL, 3, "Firmware", Path.Combine(".", "Firmware")), + new(GLOBAL, 4, "Movies", Path.Combine(".", "Movies")), + new(GLOBAL, 5, "Movie backups", Path.Combine(".", "Movies", "backup")), + new(GLOBAL, 6, "A/V Dumps", "."), + new(GLOBAL, 7, "Tools", Path.Combine(".", "Tools")), + new(GLOBAL, 8, "Lua", Path.Combine(".", "Lua")), + new(GLOBAL, 9, "Watch (.wch)", Path.Combine(".", ".")), + new(GLOBAL, 10, "Debug Logs", Path.Combine(".", "")), + new(GLOBAL, 11, "Macros", Path.Combine(".", "Movies", "Macros")), + new(GLOBAL, 12, "TAStudio states", Path.Combine(".", "Movies", "TAStudio states")), + new(GLOBAL, 13, "Multi-Disk Bundles", Path.Combine(".", "")), + new(GLOBAL, 14, "External Tools", Path.Combine(".", "ExternalTools")), + new(GLOBAL, 15, "Temp Files", ""), - new("INTV", 0, "Base", Path.Combine(".", "Intellivision")), - new("INTV", 1, "ROM", "."), - new("INTV", 2, "Savestates", Path.Combine(".", "State")), - new("INTV", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("INTV", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("INTV", 5, "Cheats", Path.Combine(".", "Cheats")), - new("INTV", 6, "Palettes", Path.Combine(".", "Palettes")), + new(VSystemID.Raw.INTV, 0, "Base", Path.Combine(".", "Intellivision")), + new(VSystemID.Raw.INTV, 1, "ROM", "."), + new(VSystemID.Raw.INTV, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.INTV, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.INTV, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.INTV, 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.INTV, 6, "Palettes", Path.Combine(".", "Palettes")), - new("NES", 0, "Base", Path.Combine(".", "NES")), - new("NES", 1, "ROM", "."), - new("NES", 2, "Savestates", Path.Combine(".", "State")), - new("NES", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("NES", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("NES", 5, "Cheats", Path.Combine(".", "Cheats")), - new("NES", 6, "Palettes", Path.Combine(".", "Palettes")), + new(VSystemID.Raw.NES, 0, "Base", Path.Combine(".", "NES")), + new(VSystemID.Raw.NES, 1, "ROM", "."), + new(VSystemID.Raw.NES, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.NES, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.NES, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.NES, 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.NES, 6, "Palettes", Path.Combine(".", "Palettes")), - new("SNES", 0, "Base", Path.Combine(".", "SNES")), - new("SNES", 1, "ROM", "."), - new("SNES", 2, "Savestates", Path.Combine(".", "State")), - new("SNES", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("SNES", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("SNES", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.SNES, 0, "Base", Path.Combine(".", "SNES")), + new(VSystemID.Raw.SNES, 1, "ROM", "."), + new(VSystemID.Raw.SNES, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.SNES, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.SNES, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.SNES, 5, "Cheats", Path.Combine(".", "Cheats")), - new("GBA", 0, "Base", Path.Combine(".", "GBA")), - new("GBA", 1, "ROM", "."), - new("GBA", 2, "Savestates", Path.Combine(".", "State")), - new("GBA", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("GBA", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("GBA", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.GBA, 0, "Base", Path.Combine(".", "GBA")), + new(VSystemID.Raw.GBA, 1, "ROM", "."), + new(VSystemID.Raw.GBA, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.GBA, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.GBA, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.GBA, 5, "Cheats", Path.Combine(".", "Cheats")), - new("SMS", 0, "Base", Path.Combine(".", "SMS")), - new("SMS", 1, "ROM", "."), - new("SMS", 2, "Savestates", Path.Combine(".", "State")), - new("SMS", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("SMS", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("SMS", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.SMS, 0, "Base", Path.Combine(".", "SMS")), + new(VSystemID.Raw.SMS, 1, "ROM", "."), + new(VSystemID.Raw.SMS, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.SMS, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.SMS, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.SMS, 5, "Cheats", Path.Combine(".", "Cheats")), - new("GG", 0, "Base", Path.Combine(".", "Game Gear")), - new("GG", 1, "ROM", "."), - new("GG", 2, "Savestates", Path.Combine(".", "State")), - new("GG", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("GG", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("GG", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.GG, 0, "Base", Path.Combine(".", "Game Gear")), + new(VSystemID.Raw.GG, 1, "ROM", "."), + new(VSystemID.Raw.GG, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.GG, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.GG, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.GG, 5, "Cheats", Path.Combine(".", "Cheats")), - new("SG", 0, "Base", Path.Combine(".", "SG-1000")), - new("SG", 1, "ROM", "."), - new("SG", 2, "Savestates", Path.Combine(".", "State")), - new("SG", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("SG", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("SG", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.SG, 0, "Base", Path.Combine(".", "SG-1000")), + new(VSystemID.Raw.SG, 1, "ROM", "."), + new(VSystemID.Raw.SG, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.SG, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.SG, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.SG, 5, "Cheats", Path.Combine(".", "Cheats")), - new("GEN", 0, "Base", Path.Combine(".", "Genesis")), - new("GEN", 1, "ROM", "."), - new("GEN", 2, "Savestates", Path.Combine(".", "State")), - new("GEN", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("GEN", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("GEN", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.GEN, 0, "Base", Path.Combine(".", "Genesis")), + new(VSystemID.Raw.GEN, 1, "ROM", "."), + new(VSystemID.Raw.GEN, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.GEN, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.GEN, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.GEN, 5, "Cheats", Path.Combine(".", "Cheats")), - new("PCE_PCECD_SGX", 0, "Base", Path.Combine(".", "PC Engine")), - new("PCE_PCECD_SGX", 1, "ROM", "."), - new("PCE_PCECD_SGX", 2, "Savestates", Path.Combine(".", "State")), - new("PCE_PCECD_SGX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("PCE_PCECD_SGX", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("PCE_PCECD_SGX", 5, "Cheats", Path.Combine(".", "Cheats")), + new(COMBINED_SYSIDS_PCE, 0, "Base", Path.Combine(".", "PC Engine")), + new(COMBINED_SYSIDS_PCE, 1, "ROM", "."), + new(COMBINED_SYSIDS_PCE, 2, "Savestates", Path.Combine(".", "State")), + new(COMBINED_SYSIDS_PCE, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(COMBINED_SYSIDS_PCE, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(COMBINED_SYSIDS_PCE, 5, "Cheats", Path.Combine(".", "Cheats")), - new("GB_GBC_SGB", 0, "Base", Path.Combine(".", "Gameboy")), - new("GB_GBC_SGB", 1, "ROM", "."), - new("GB_GBC_SGB", 2, "Savestates", Path.Combine(".", "State")), - new("GB_GBC_SGB", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("GB_GBC_SGB", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("GB_GBC_SGB", 5, "Cheats", Path.Combine(".", "Cheats")), - new("GB_GBC_SGB", 6, "Palettes", Path.Combine(".", "Palettes")), + new(COMBINED_SYSIDS_GB, 0, "Base", Path.Combine(".", "Gameboy")), + new(COMBINED_SYSIDS_GB, 1, "ROM", "."), + new(COMBINED_SYSIDS_GB, 2, "Savestates", Path.Combine(".", "State")), + new(COMBINED_SYSIDS_GB, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(COMBINED_SYSIDS_GB, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(COMBINED_SYSIDS_GB, 5, "Cheats", Path.Combine(".", "Cheats")), + new(COMBINED_SYSIDS_GB, 6, "Palettes", Path.Combine(".", "Palettes")), - new("DGB", 0, "Base", Path.Combine(".", "Dual Gameboy")), - new("DGB", 1, "ROM", "."), - new("DGB", 2, "Savestates", Path.Combine(".", "State")), - new("DGB", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("DGB", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("DGB", 5, "Cheats", Path.Combine(".", "Cheats")), - new("DGB", 6, "Palettes", Path.Combine(".", "Palettes")), + new(VSystemID.Raw.DGB, 0, "Base", Path.Combine(".", "Dual Gameboy")), + new(VSystemID.Raw.DGB, 1, "ROM", "."), + new(VSystemID.Raw.DGB, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.DGB, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.DGB, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.DGB, 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.DGB, 6, "Palettes", Path.Combine(".", "Palettes")), - new("TI83", 0, "Base", Path.Combine(".", "TI83")), - new("TI83", 1, "ROM", "."), - new("TI83", 2, "Savestates", Path.Combine(".", "State")), - new("TI83", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("TI83", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("TI83", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.TI83, 0, "Base", Path.Combine(".", "TI83")), + new(VSystemID.Raw.TI83, 1, "ROM", "."), + new(VSystemID.Raw.TI83, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.TI83, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.TI83, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.TI83, 5, "Cheats", Path.Combine(".", "Cheats")), - new("A26", 0, "Base", Path.Combine(".", "Atari 2600")), - new("A26", 1, "ROM", "."), - new("A26", 2, "Savestates", Path.Combine(".", "State")), - new("A26", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("A26", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.A26, 0, "Base", Path.Combine(".", "Atari 2600")), + new(VSystemID.Raw.A26, 1, "ROM", "."), + new(VSystemID.Raw.A26, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.A26, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.A26, 5, "Cheats", Path.Combine(".", "Cheats")), - new("A78", 0, "Base", Path.Combine(".", "Atari 7800")), - new("A78", 1, "ROM", "."), - new("A78", 2, "Savestates", Path.Combine(".", "State")), - new("A78", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("A78", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("A78", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.A78, 0, "Base", Path.Combine(".", "Atari 7800")), + new(VSystemID.Raw.A78, 1, "ROM", "."), + new(VSystemID.Raw.A78, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.A78, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.A78, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.A78, 5, "Cheats", Path.Combine(".", "Cheats")), - new("C64", 0, "Base", Path.Combine(".", "C64")), - new("C64", 1, "ROM", "."), - new("C64", 2, "Savestates", Path.Combine(".", "State")), - new("C64", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("C64", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.C64, 0, "Base", Path.Combine(".", "C64")), + new(VSystemID.Raw.C64, 1, "ROM", "."), + new(VSystemID.Raw.C64, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.C64, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.C64, 5, "Cheats", Path.Combine(".", "Cheats")), - new("ZXSpectrum", 0, "Base", Path.Combine(".", "ZXSpectrum")), - new("ZXSpectrum", 1, "ROM", "."), - new("ZXSpectrum", 2, "Savestates", Path.Combine(".", "State")), - new("ZXSpectrum", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("ZXSpectrum", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.ZXSpectrum, 0, "Base", Path.Combine(".", "ZXSpectrum")), + new(VSystemID.Raw.ZXSpectrum, 1, "ROM", "."), + new(VSystemID.Raw.ZXSpectrum, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.ZXSpectrum, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.ZXSpectrum, 5, "Cheats", Path.Combine(".", "Cheats")), - new("AmstradCPC", 0, "Base", Path.Combine(".", "AmstradCPC")), - new("AmstradCPC", 1, "ROM", "."), - new("AmstradCPC", 2, "Savestates", Path.Combine(".", "State")), - new("AmstradCPC", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("AmstradCPC", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.AmstradCPC, 0, "Base", Path.Combine(".", "AmstradCPC")), + new(VSystemID.Raw.AmstradCPC, 1, "ROM", "."), + new(VSystemID.Raw.AmstradCPC, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.AmstradCPC, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.AmstradCPC, 5, "Cheats", Path.Combine(".", "Cheats")), - new("PSX", 0, "Base", Path.Combine(".", "PSX")), - new("PSX", 1, "ROM", "."), - new("PSX", 2, "Savestates", Path.Combine(".", "State")), - new("PSX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("PSX", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("PSX", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.PSX, 0, "Base", Path.Combine(".", "PSX")), + new(VSystemID.Raw.PSX, 1, "ROM", "."), + new(VSystemID.Raw.PSX, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.PSX, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.PSX, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.PSX, 5, "Cheats", Path.Combine(".", "Cheats")), - new("Coleco", 0, "Base", Path.Combine(".", "Coleco")), - new("Coleco", 1, "ROM", "."), - new("Coleco", 2, "Savestates", Path.Combine(".", "State")), - new("Coleco", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("Coleco", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.Coleco, 0, "Base", Path.Combine(".", "Coleco")), + new(VSystemID.Raw.Coleco, 1, "ROM", "."), + new(VSystemID.Raw.Coleco, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.Coleco, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.Coleco, 5, "Cheats", Path.Combine(".", "Cheats")), - new("N64", 0, "Base", Path.Combine(".", "N64")), - new("N64", 1, "ROM", "."), - new("N64", 2, "Savestates", Path.Combine(".", "State")), - new("N64", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("N64", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("N64", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.N64, 0, "Base", Path.Combine(".", "N64")), + new(VSystemID.Raw.N64, 1, "ROM", "."), + new(VSystemID.Raw.N64, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.N64, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.N64, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.N64, 5, "Cheats", Path.Combine(".", "Cheats")), - new("SAT", 0, "Base", Path.Combine(".", "Saturn")), - new("SAT", 1, "ROM", "."), - new("SAT", 2, "Savestates", Path.Combine(".", "State")), - new("SAT", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("SAT", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("SAT", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.SAT, 0, "Base", Path.Combine(".", "Saturn")), + new(VSystemID.Raw.SAT, 1, "ROM", "."), + new(VSystemID.Raw.SAT, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.SAT, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.SAT, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.SAT, 5, "Cheats", Path.Combine(".", "Cheats")), - new("WSWAN", 0, "Base", Path.Combine(".", "WonderSwan")), - new("WSWAN", 1, "ROM", "."), - new("WSWAN", 2, "Savestates", Path.Combine(".", "State")), - new("WSWAN", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("WSWAN", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("WSWAN", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.WSWAN, 0, "Base", Path.Combine(".", "WonderSwan")), + new(VSystemID.Raw.WSWAN, 1, "ROM", "."), + new(VSystemID.Raw.WSWAN, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.WSWAN, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.WSWAN, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.WSWAN, 5, "Cheats", Path.Combine(".", "Cheats")), - new("Lynx", 0, "Base", Path.Combine(".", "Lynx")), - new("Lynx", 1, "ROM", "."), - new("Lynx", 2, "Savestates", Path.Combine(".", "State")), - new("Lynx", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("Lynx", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("Lynx", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.Lynx, 0, "Base", Path.Combine(".", "Lynx")), + new(VSystemID.Raw.Lynx, 1, "ROM", "."), + new(VSystemID.Raw.Lynx, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.Lynx, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.Lynx, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.Lynx, 5, "Cheats", Path.Combine(".", "Cheats")), - new("AppleII", 0, "Base", Path.Combine(".", "Apple II")), - new("AppleII", 1, "ROM", "."), - new("AppleII", 2, "Savestates", Path.Combine(".", "State")), - new("AppleII", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("AppleII", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.AppleII, 0, "Base", Path.Combine(".", "Apple II")), + new(VSystemID.Raw.AppleII, 1, "ROM", "."), + new(VSystemID.Raw.AppleII, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.AppleII, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.AppleII, 5, "Cheats", Path.Combine(".", "Cheats")), - new("Libretro", 0, "Base", Path.Combine(".", "Libretro")), - new("Libretro", 1, "Cores", Path.Combine(".", "Cores")), - new("Libretro", 2, "System", Path.Combine(".", "System")), - new("Libretro", 3, "Savestates", Path.Combine(".", "State")), - new("Libretro", 4, "Save RAM", Path.Combine(".", "SaveRAM")), - new("Libretro", 5, "Screenshots", Path.Combine(".", "Screenshots")), - new("Libretro", 6, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.Libretro, 0, "Base", Path.Combine(".", "Libretro")), + new(VSystemID.Raw.Libretro, 1, "Cores", Path.Combine(".", "Cores")), + new(VSystemID.Raw.Libretro, 2, "System", Path.Combine(".", "System")), + new(VSystemID.Raw.Libretro, 3, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.Libretro, 4, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.Libretro, 5, "Screenshots", Path.Combine(".", "Screenshots")), + 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 //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. //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("VB", 1, "ROM", "."), - new("VB", 2, "Savestates", Path.Combine(".", "State")), - new("VB", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("VB", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("VB", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.VB, 0, "Base", Path.Combine(".", "VB")), + new(VSystemID.Raw.VB, 1, "ROM", "."), + new(VSystemID.Raw.VB, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.VB, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.VB, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.VB, 5, "Cheats", Path.Combine(".", "Cheats")), - new("NGP", 0, "Base", Path.Combine(".", "NGP")), - new("NGP", 1, "ROM", "."), - new("NGP", 2, "Savestates", Path.Combine(".", "State")), - new("NGP", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("NGP", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("NGP", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.NGP, 0, "Base", Path.Combine(".", "NGP")), + new(VSystemID.Raw.NGP, 1, "ROM", "."), + new(VSystemID.Raw.NGP, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.NGP, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.NGP, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.NGP, 5, "Cheats", Path.Combine(".", "Cheats")), - new("PCFX", 0, "Base", Path.Combine(".", "PCFX")), - new("PCFX", 1, "ROM", "."), - new("PCFX", 2, "Savestates", Path.Combine(".", "State")), - new("PCFX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("PCFX", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("PCFX", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.PCFX, 0, "Base", Path.Combine(".", "PCFX")), + new(VSystemID.Raw.PCFX, 1, "ROM", "."), + new(VSystemID.Raw.PCFX, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.PCFX, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.PCFX, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.PCFX, 5, "Cheats", Path.Combine(".", "Cheats")), - new("ChannelF", 0, "Base", Path.Combine(".", "ZXSpectrum")), - new("ChannelF", 1, "ROM", "."), - new("ChannelF", 2, "Savestates", Path.Combine(".", "State")), - new("ChannelF", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("ChannelF", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.ChannelF, 0, "Base", Path.Combine(".", "ZXSpectrum")), + new(VSystemID.Raw.ChannelF, 1, "ROM", "."), + new(VSystemID.Raw.ChannelF, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.ChannelF, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.ChannelF, 5, "Cheats", Path.Combine(".", "Cheats")), - new("GB3x", 0, "Base", Path.Combine(".", "GB3x")), - new("GB3x", 1, "ROM", "."), - new("GB3x", 2, "Savestates", Path.Combine(".", "State")), - new("GB3x", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("GB3x", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("GB3x", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.GB3x, 0, "Base", Path.Combine(".", "GB3x")), + new(VSystemID.Raw.GB3x, 1, "ROM", "."), + new(VSystemID.Raw.GB3x, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.GB3x, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.GB3x, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.GB3x, 5, "Cheats", Path.Combine(".", "Cheats")), - new("GB4x", 0, "Base", Path.Combine(".", "GB4x")), - new("GB4x", 1, "ROM", "."), - new("GB4x", 2, "Savestates", Path.Combine(".", "State")), - new("GB4x", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("GB4x", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("GB4x", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.GB4x, 0, "Base", Path.Combine(".", "GB4x")), + new(VSystemID.Raw.GB4x, 1, "ROM", "."), + new(VSystemID.Raw.GB4x, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.GB4x, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.GB4x, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.GB4x, 5, "Cheats", Path.Combine(".", "Cheats")), - new("VEC", 0, "Base", Path.Combine(".", "VEC")), - new("VEC", 1, "ROM", "."), - new("VEC", 2, "Savestates", Path.Combine(".", "State")), - new("VEC", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("VEC", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("VEC", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.VEC, 0, "Base", Path.Combine(".", "VEC")), + new(VSystemID.Raw.VEC, 1, "ROM", "."), + new(VSystemID.Raw.VEC, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.VEC, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.VEC, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.VEC, 5, "Cheats", Path.Combine(".", "Cheats")), - new("O2", 0, "Base", Path.Combine(".", "O2")), - new("O2", 1, "ROM", "."), - new("O2", 2, "Savestates", Path.Combine(".", "State")), - new("O2", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("O2", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("O2", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.O2, 0, "Base", Path.Combine(".", "O2")), + new(VSystemID.Raw.O2, 1, "ROM", "."), + new(VSystemID.Raw.O2, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.O2, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.O2, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.O2, 5, "Cheats", Path.Combine(".", "Cheats")), - new("MSX", 0, "Base", Path.Combine(".", "MSX")), - new("MSX", 1, "ROM", "."), - new("MSX", 2, "Savestates", Path.Combine(".", "State")), - new("MSX", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("MSX", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("MSX", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.MSX, 0, "Base", Path.Combine(".", "MSX")), + new(VSystemID.Raw.MSX, 1, "ROM", "."), + new(VSystemID.Raw.MSX, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.MSX, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.MSX, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.MSX, 5, "Cheats", Path.Combine(".", "Cheats")), - new("UZE", 0, "Base", Path.Combine(".", "VEC")), - new("UZE", 1, "ROM", "."), - new("UZE", 2, "Savestates", Path.Combine(".", "State")), - new("UZE", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("UZE", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("UZE", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.UZE, 0, "Base", Path.Combine(".", "VEC")), + new(VSystemID.Raw.UZE, 1, "ROM", "."), + new(VSystemID.Raw.UZE, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.UZE, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.UZE, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.UZE, 5, "Cheats", Path.Combine(".", "Cheats")), - new("NDS", 0, "Base", Path.Combine(".", "NDS")), - new("NDS", 1, "ROM", "."), - new("NDS", 2, "Savestates", Path.Combine(".", "State")), - new("NDS", 3, "Save RAM", Path.Combine(".", "SaveRAM")), - new("NDS", 4, "Screenshots", Path.Combine(".", "Screenshots")), - new("NDS", 5, "Cheats", Path.Combine(".", "Cheats")), + new(VSystemID.Raw.NDS, 0, "Base", Path.Combine(".", "NDS")), + new(VSystemID.Raw.NDS, 1, "ROM", "."), + new(VSystemID.Raw.NDS, 2, "Savestates", Path.Combine(".", "State")), + new(VSystemID.Raw.NDS, 3, "Save RAM", Path.Combine(".", "SaveRAM")), + new(VSystemID.Raw.NDS, 4, "Screenshots", Path.Combine(".", "Screenshots")), + new(VSystemID.Raw.NDS, 5, "Cheats", Path.Combine(".", "Cheats")), }; } } diff --git a/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs b/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs index 6b4d288afa..f88b72d6e3 100644 --- a/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs +++ b/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs @@ -21,7 +21,7 @@ namespace BizHawk.Client.Common 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 (globalBase.StartsWith("%exe%", StringComparison.InvariantCultureIgnoreCase)) @@ -50,7 +50,7 @@ namespace BizHawk.Client.Common { return (collection[systemId, pathType] ?? collection[systemId, "Base"]) - ?? collection["Global", "Base"]; + ?? collection[PathEntryCollection.GLOBAL, "Base"]; } 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) { - var path = collection["Global", "Movies"].Path; + var path = collection[PathEntryCollection.GLOBAL, "Movies"].Path; return collection.AbsolutePathFor(path, null); } 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); } 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); } 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); } @@ -167,31 +167,31 @@ namespace BizHawk.Client.Common 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); } 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); } 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); } 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); } 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); } @@ -199,7 +199,7 @@ namespace BizHawk.Client.Common { 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) @@ -211,7 +211,7 @@ namespace BizHawk.Client.Common if (!path.Path.PathIsSet()) { - path = collection["Global", "ROM"]; + path = collection[PathEntryCollection.GLOBAL, "ROM"]; if (path.Path.PathIsSet()) { @@ -333,7 +333,7 @@ namespace BizHawk.Client.Common 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 if (subPath == "Tools") diff --git a/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs b/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs index 8f861905d6..4be60859db 100644 --- a/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs +++ b/src/BizHawk.Client.Common/fwmanager/FirmwareManager.cs @@ -30,7 +30,7 @@ namespace BizHawk.Client.Common var @base = File.ReadAllBytes(baseFilename); var (patched, actualHash) = PerformPatchInMemory(@base, in patchOption); 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); var ff = FirmwareDatabase.FirmwareFilesByHash[patchOption.TargetHash]; var patchedFilePath = Path.Combine(patchedParentDir, ff.RecommendedName); diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2MnemonicLookup.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2MnemonicLookup.cs index 6f4b8a54de..ef0b5a177e 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2MnemonicLookup.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2MnemonicLookup.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; +using BizHawk.Emulation.Common; + // ReSharper disable StyleCop.SA1509 namespace BizHawk.Client.Common { @@ -174,7 +176,7 @@ namespace BizHawk.Client.Common private static readonly Dictionary> SystemOverrides = new Dictionary> { - ["NES"] = new Dictionary + [VSystemID.Raw.NES] = new() { ["FDS Eject"] = 'E', ["FDS Insert 0"] = '0', @@ -200,7 +202,7 @@ namespace BizHawk.Client.Common ["Click"] = 'C', ["Touch"] = 'T', }, - ["SNES"] = new Dictionary + [VSystemID.Raw.SNES] = new() { ["Cursor"] = 'c', ["Turbo"] = 't', @@ -239,7 +241,7 @@ namespace BizHawk.Client.Common ["B30"] = 'u', ["B31"] = 'v' }, - ["TI83"] = new Dictionary + [VSystemID.Raw.TI83] = new() { ["UP"] = 'U', ["DOWN"] = 'D', @@ -282,7 +284,7 @@ namespace BizHawk.Client.Common ["COMMA"] = ',', ["SIN"] = 'S' }, - ["C64"] = new Dictionary + [VSystemID.Raw.C64] = new() { ["L"] = 'L', ["R"] = 'R', @@ -313,7 +315,7 @@ namespace BizHawk.Client.Common ["Cursor Left/Right"] = 'l', ["Space"] = '_' }, - ["ZXSpectrum"] = new Dictionary + [VSystemID.Raw.ZXSpectrum] = new() { ["Caps Shift"] = '^', ["Caps Lock"] = 'L', @@ -348,7 +350,7 @@ namespace BizHawk.Client.Common ["Left Cursor"] = 'l', ["Right Cursor"] = 'r' }, - ["N64"] = new Dictionary + [VSystemID.Raw.N64] = new() { ["C Up"] = 'u', ["C Down"] = 'd', @@ -365,33 +367,33 @@ namespace BizHawk.Client.Common ["DPad L"] = 'L', ["DPad R"] = 'R', }, - ["DGB"] = new Dictionary + [VSystemID.Raw.DGB] = new() { ["Toggle Cable"] = 'L' }, - ["GB3x"] = new Dictionary + [VSystemID.Raw.GB3x] = new() { ["Toggle Cable LC"] = 'L', ["Toggle Cable CR"] = 'C', ["Toggle Cable RL"] = 'R' }, - ["GB4x"] = new Dictionary + [VSystemID.Raw.GB4x] = new() { ["Toggle Cable UD"] = 'U', ["Toggle Cable LR"] = 'L', ["Toggle Cable X"] = 'X', ["Toggle Cable 4x"] = '4' }, - ["Lynx"] = new Dictionary + [VSystemID.Raw.Lynx] = new() { ["Option 1"] = '1', ["Option 2"] = '2' }, - ["NGP"] = new Dictionary + [VSystemID.Raw.NGP] = new() { ["Option"] = 'O' }, - ["AppleII"] = new Dictionary + [VSystemID.Raw.AppleII] = new() { ["Tab"] = 't' , ["Return"] = 'e' , @@ -406,7 +408,7 @@ namespace BizHawk.Client.Common ["L"] = 'L' , ["R"] = 'R' }, - ["INTV"] = new Dictionary + [VSystemID.Raw.INTV] = new() { ["Clear"] = 'C' , ["Enter"] = 'E' , @@ -424,14 +426,14 @@ namespace BizHawk.Client.Common ["NW"] = '\\' , ["NNW"] = 'n' }, - ["Coleco"] = new Dictionary + [VSystemID.Raw.Coleco] = new() { ["Yellow"] = 'Y', ["Red"] = 'R', ["Blue"] = 'B', ["Purple"] = 'P' }, - ["VB"] = new Dictionary + [VSystemID.Raw.VB] = new() { ["L_Up"] = 'U', ["L_Down"] = 'D', @@ -442,7 +444,7 @@ namespace BizHawk.Client.Common ["R_Left"] = 'l', ["R_Right"] = 'r', }, - ["PCFX"] = new Dictionary + [VSystemID.Raw.PCFX] = new() { ["I"] = '1', ["II"] = '2', @@ -455,7 +457,7 @@ namespace BizHawk.Client.Common ["Mode 2: Set A"] = 'A', ["Mode 2: Set B"] = 'B' }, - ["PCE"] = new Dictionary + [VSystemID.Raw.PCE] = new() { ["I"] = '1', ["II"] = '2', @@ -466,7 +468,7 @@ namespace BizHawk.Client.Common ["Mode: Set 2-button"] = 'm', ["Mode: Set 6-button"] = 'M' }, - ["PCECD"] = new Dictionary + [VSystemID.Raw.PCECD] = new() { ["I"] = '1', ["II"] = '2', @@ -477,13 +479,13 @@ namespace BizHawk.Client.Common ["Mode: Set 2-button"] = 'm', ["Mode: Set 6-button"] = 'M' }, - ["NDS"] = new Dictionary + [VSystemID.Raw.NDS] = new() { ["LidOpen"] = 'o', ["LidClose"] = 'c', ["Touch"] = 'T' }, - ["O2"] = new Dictionary + [VSystemID.Raw.O2] = new() { ["PERIOD"] = '.', ["SPC"] = 's', @@ -492,7 +494,7 @@ namespace BizHawk.Client.Common ["CLR"] = 'c', ["ENT"] = 'e' }, - ["MAME"] = new Dictionary + [VSystemID.Raw.MAME] = new() { ["1 Player Start"] = '1', ["2 Players Start"] = '2', @@ -577,7 +579,7 @@ namespace BizHawk.Client.Common ["VR3 (Yellow)"] = 'Y', ["VR4 (Green)"] = 'G', }, - ["SAT"] = new Dictionary + [VSystemID.Raw.SAT] = new() { ["Smpc Reset"] = 's', ["D-Pad Up"] = 'U', @@ -613,7 +615,7 @@ namespace BizHawk.Client.Common private static readonly Dictionary> AxisSystemOverrides = new Dictionary> { - ["A78"] = new Dictionary + [VSystemID.Raw.A78] = new() { ["VPos"] = "X", ["HPos"] = "Y" diff --git a/src/BizHawk.Client.Common/movie/import/DsmImport.cs b/src/BizHawk.Client.Common/movie/import/DsmImport.cs index 5b2370bf93..8873f6b8a0 100644 --- a/src/BizHawk.Client.Common/movie/import/DsmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/DsmImport.cs @@ -13,7 +13,7 @@ namespace BizHawk.Client.Common { protected override void RunImport() { - Result.Movie.HeaderEntries[HeaderKeys.Platform] = "NDS"; + Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NDS; var syncSettings = new NDS.NDSSyncSettings(); diff --git a/src/BizHawk.Client.Common/movie/import/FcmImport.cs b/src/BizHawk.Client.Common/movie/import/FcmImport.cs index bb1e2e0bc1..78d3142f82 100644 --- a/src/BizHawk.Client.Common/movie/import/FcmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/FcmImport.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Text; using BizHawk.Common.BufferExtensions; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores.Nintendo.NES; @@ -27,7 +28,7 @@ namespace BizHawk.Client.Common.movie.import return; } - Result.Movie.HeaderEntries[HeaderKeys.Platform] = "NES"; + Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NES; var syncSettings = new NES.NESSyncSettings(); diff --git a/src/BizHawk.Client.Common/movie/import/Fm2Import.cs b/src/BizHawk.Client.Common/movie/import/Fm2Import.cs index 7d627871a2..dff9852566 100644 --- a/src/BizHawk.Client.Common/movie/import/Fm2Import.cs +++ b/src/BizHawk.Client.Common/movie/import/Fm2Import.cs @@ -2,6 +2,7 @@ using BizHawk.Common; using BizHawk.Common.BufferExtensions; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores.Nintendo.NES; @@ -16,7 +17,7 @@ namespace BizHawk.Client.Common { Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.NesHawk; const string emulator = "FCEUX"; - var platform = "NES"; // TODO: FDS? + var platform = VSystemID.Raw.NES; // TODO: FDS? var syncSettings = new NES.NESSyncSettings(); diff --git a/src/BizHawk.Client.Common/movie/import/FmvImport.cs b/src/BizHawk.Client.Common/movie/import/FmvImport.cs index 529725a921..b0f1c84b9c 100644 --- a/src/BizHawk.Client.Common/movie/import/FmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/FmvImport.cs @@ -1,4 +1,6 @@ using System.IO; + +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Nintendo.NES; namespace BizHawk.Client.Common.movie.import @@ -32,7 +34,7 @@ namespace BizHawk.Client.Common.movie.import return; } - Result.Movie.HeaderEntries[HeaderKeys.Platform] = "NES"; + Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.NES; var syncSettings = new NES.NESSyncSettings(); // other bits: unknown, set to 0 diff --git a/src/BizHawk.Client.Common/movie/import/GmvImport.cs b/src/BizHawk.Client.Common/movie/import/GmvImport.cs index 59212d0c24..6c6cc8700f 100644 --- a/src/BizHawk.Client.Common/movie/import/GmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/GmvImport.cs @@ -1,4 +1,6 @@ using System.IO; + +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Consoles.Sega.gpgx; namespace BizHawk.Client.Common.movie.import @@ -21,7 +23,7 @@ namespace BizHawk.Client.Common.movie.import 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'. (?) string version = new string(r.ReadChars(1)); diff --git a/src/BizHawk.Client.Common/movie/import/LsmvImport.cs b/src/BizHawk.Client.Common/movie/import/LsmvImport.cs index 84bbf3551d..4f22b26d0b 100644 --- a/src/BizHawk.Client.Common/movie/import/LsmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/LsmvImport.cs @@ -43,7 +43,7 @@ namespace BizHawk.Client.Common.movie.import }; _deck = new LibsnesControllerDeck(ss); - string platform = "SNES"; + string platform = VSystemID.Raw.SNES; foreach (var item in zip.Entries) { @@ -106,15 +106,15 @@ namespace BizHawk.Client.Common.movie.import switch (gametype) { case "gdmg": - platform = "GB"; + platform = VSystemID.Raw.GB; break; case "ggbc": case "ggbca": - platform = "GBC"; + platform = VSystemID.Raw.GBC; break; case "sgb_ntsc": case "sgb_pal": - platform = "SNES"; + platform = VSystemID.Raw.SNES; Config.GbAsSgb = true; break; } @@ -145,7 +145,7 @@ namespace BizHawk.Client.Common.movie.import // lsnes' frame boundary occurs at V = 241, after which the input is read; // 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 - 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 // 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.SyncSettingsJson = ConfigService.SaveWithType(ss); - MaybeSetCorePreference(sysID: "SNES", CoreNames.Bsnes, fileExt: ".lsmv"); + MaybeSetCorePreference(VSystemID.Raw.SNES, CoreNames.Bsnes, fileExt: ".lsmv"); } 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" }; - if (platform == "GB" || platform == "GBC") + if (platform == VSystemID.Raw.GB || platform == VSystemID.Raw.GBC) { buttons = new[] { "A", "B", "Select", "Start", "Right", "Left", "Up", "Down" }; } diff --git a/src/BizHawk.Client.Common/movie/import/Mc2Import.cs b/src/BizHawk.Client.Common/movie/import/Mc2Import.cs index 56a695ea17..8e7e88ca61 100644 --- a/src/BizHawk.Client.Common/movie/import/Mc2Import.cs +++ b/src/BizHawk.Client.Common/movie/import/Mc2Import.cs @@ -1,4 +1,5 @@ -using BizHawk.Emulation.Cores.PCEngine; +using BizHawk.Emulation.Common; +using BizHawk.Emulation.Cores.PCEngine; namespace BizHawk.Client.Common.movie.import { @@ -27,7 +28,7 @@ namespace BizHawk.Client.Common.movie.import ss.Port4, ss.Port5); - Result.Movie.HeaderEntries[HeaderKeys.Platform] = "PCE"; + Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PCE; using var sr = SourceFile.OpenText(); string line; @@ -84,7 +85,7 @@ namespace BizHawk.Client.Common.movie.import } 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")) { diff --git a/src/BizHawk.Client.Common/movie/import/MmvImport.cs b/src/BizHawk.Client.Common/movie/import/MmvImport.cs index 8a40306179..863d939955 100644 --- a/src/BizHawk.Client.Common/movie/import/MmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/MmvImport.cs @@ -1,5 +1,6 @@ using System.IO; using BizHawk.Common.BufferExtensions; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Sega.MasterSystem; namespace BizHawk.Client.Common.movie.import @@ -80,7 +81,7 @@ namespace BizHawk.Client.Common.movie.import 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 r.ReadBytes(3); diff --git a/src/BizHawk.Client.Common/movie/import/PjmImport.cs b/src/BizHawk.Client.Common/movie/import/PjmImport.cs index db496dd050..22ecc992b8 100644 --- a/src/BizHawk.Client.Common/movie/import/PjmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/PjmImport.cs @@ -1,4 +1,6 @@ using System.IO; + +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Sony.PSX; namespace BizHawk.Client.Common @@ -8,7 +10,7 @@ namespace BizHawk.Client.Common { 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 br = new BinaryReader(fs); diff --git a/src/BizHawk.Client.Common/movie/import/PxmImport.cs b/src/BizHawk.Client.Common/movie/import/PxmImport.cs index 5f1d3dfec1..c2200d7cc6 100644 --- a/src/BizHawk.Client.Common/movie/import/PxmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/PxmImport.cs @@ -1,5 +1,7 @@ using System.IO; +using BizHawk.Emulation.Common; + namespace BizHawk.Client.Common.Movie.Import { // 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() { var movie = Result.Movie; - movie.HeaderEntries[HeaderKeys.Platform] = "PSX"; + movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.PSX; using var fs = SourceFile.OpenRead(); using var br = new BinaryReader(fs); diff --git a/src/BizHawk.Client.Common/movie/import/SmvImport.cs b/src/BizHawk.Client.Common/movie/import/SmvImport.cs index 21f054c745..26d592a1cd 100644 --- a/src/BizHawk.Client.Common/movie/import/SmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/SmvImport.cs @@ -1,6 +1,8 @@ using System.IO; using System.Linq; using System.Text; + +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores; using BizHawk.Emulation.Cores.Nintendo.SNES; @@ -28,7 +30,7 @@ namespace BizHawk.Client.Common.movie.import return; } - Result.Movie.HeaderEntries[HeaderKeys.Platform] = "SNES"; + Result.Movie.HeaderEntries[HeaderKeys.Platform] = VSystemID.Raw.SNES; // 004 4-byte little-endian unsigned int: version number uint versionNumber = r.ReadUInt32(); @@ -311,7 +313,7 @@ namespace BizHawk.Client.Common.movie.import Result.Movie.AppendFrame(controllers); Result.Movie.SyncSettingsJson = ConfigService.SaveWithType(ss); - MaybeSetCorePreference(sysID: "SNES", CoreNames.Bsnes, fileExt: ".smv"); + MaybeSetCorePreference(VSystemID.Raw.SNES, CoreNames.Bsnes, fileExt: ".smv"); } } } diff --git a/src/BizHawk.Client.Common/movie/import/VbmImport.cs b/src/BizHawk.Client.Common/movie/import/VbmImport.cs index f30901f94c..16c6e17e39 100644 --- a/src/BizHawk.Client.Common/movie/import/VbmImport.cs +++ b/src/BizHawk.Client.Common/movie/import/VbmImport.cs @@ -110,17 +110,17 @@ namespace BizHawk.Client.Common.movie.import bool isSGB = ((flags >> 2) & 0x1) != 0; // (If all 3 of these bits are "0", it is for regular GB.) - string platform = "GB"; + string platform = VSystemID.Raw.GB; if (isGBA) { - platform = "GBA"; + platform = VSystemID.Raw.GBA; Result.Movie.HeaderEntries[HeaderKeys.Core] = CoreNames.Mgba; } if (isGBC) { is_GBC = true; - platform = "GB"; + platform = VSystemID.Raw.GB; Result.Movie.HeaderEntries.Add("IsCGBMode", "1"); } @@ -176,7 +176,7 @@ namespace BizHawk.Client.Common.movie.import GBA */ uint gameCodeUnitCode = r.ReadUInt32(); - if (platform == "GBA") + if (platform == VSystemID.Raw.GBA) { Result.Movie.HeaderEntries["CRC16"] = checksumCRC16.ToString(); Result.Movie.HeaderEntries["GameCode"] = gameCodeUnitCode.ToString(); @@ -278,7 +278,7 @@ namespace BizHawk.Client.Common.movie.import } 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(); if (is_GBC) { tempSync.ConsoleMode = GBHawk.GBSyncSettings.ConsoleModeType.GBC; } diff --git a/src/BizHawk.Client.Common/movie/import/YmvImport.cs b/src/BizHawk.Client.Common/movie/import/YmvImport.cs index aed16f2f73..0bcb88b466 100644 --- a/src/BizHawk.Client.Common/movie/import/YmvImport.cs +++ b/src/BizHawk.Client.Common/movie/import/YmvImport.cs @@ -12,7 +12,7 @@ namespace BizHawk.Client.Common.movie.import { 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 { PortDevices = diff --git a/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs b/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs index f168e116c8..21687d8296 100644 --- a/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs +++ b/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs @@ -42,7 +42,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions { NullEmulator => string.Empty, #if false - IGameboyCommon gb when gb.IsCGBMode() => EmulatorExtensions.SystemIDToDisplayName("GBC"), + IGameboyCommon gb when gb.IsCGBMode() => EmulatorExtensions.SystemIDToDisplayName(VSystemID.Raw.GBC), #endif _ => EmulatorExtensions.SystemIDToDisplayName(emulator.SystemId) }; diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index d4c32d0694..607cd62a0b 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -1559,7 +1559,7 @@ namespace BizHawk.Client.EmuHawk } else { - ofd.InitialDirectory = Config.PathEntries.AbsolutePathForType("Libretro", "Cores"); + ofd.InitialDirectory = Config.PathEntries.AbsolutePathForType(VSystemID.Raw.Libretro, "Cores"); if (!Directory.Exists(ofd.InitialDirectory)) { Directory.CreateDirectory(ofd.InitialDirectory); @@ -1961,60 +1961,60 @@ namespace BizHawk.Client.EmuHawk switch (Emulator.SystemId) { - case "NULL": + case VSystemID.Raw.NULL: break; - case "A78": + case VSystemID.Raw.A78: A7800SubMenu.Visible = true; break; - case "AmstradCPC": + case VSystemID.Raw.AmstradCPC: amstradCPCToolStripMenuItem.Visible = true; break; - case "AppleII": + case VSystemID.Raw.AppleII: AppleSubMenu.Visible = true; break; - case "C64": + case VSystemID.Raw.C64: C64SubMenu.Visible = true; break; - case "Coleco": + case VSystemID.Raw.Coleco: ColecoSubMenu.Visible = true; break; - case "INTV": + case VSystemID.Raw.INTV: IntvSubMenu.Visible = true; break; - case "N64": + case VSystemID.Raw.N64: N64SubMenu.Visible = true; break; - case "NES": + case VSystemID.Raw.NES: NESSubMenu.Visible = true; break; - case "PSX": + case VSystemID.Raw.PSX: PSXSubMenu.Visible = true; break; - case "TI83": + case VSystemID.Raw.TI83: TI83SubMenu.Visible = true; break; - case "ZXSpectrum": + case VSystemID.Raw.ZXSpectrum: zXSpectrumToolStripMenuItem.Visible = true; break; - case "DGB" when Emulator is GambatteLink: + case VSystemID.Raw.DGB when Emulator is GambatteLink: DGBSubMenu.Visible = true; break; - case "GB": - case "GBC": - case "SGB" when Emulator is Gameboy: + case VSystemID.Raw.GB: + case VSystemID.Raw.GBC: + case VSystemID.Raw.SGB when Emulator is Gameboy: GBSubMenu.Visible = true; 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.Visible = true; SnesGfxDebuggerMenuItem.Visible = true; break; - case "SNES" when Emulator is LibsnesCore { IsSGB: false }: + case VSystemID.Raw.SNES when Emulator is LibsnesCore { IsSGB: false }: SNESSubMenu.Text = "&SNES"; SNESSubMenu.Visible = true; SnesGfxDebuggerMenuItem.Visible = true; break; - case "SNES" when Emulator is BsnesCore bsnesCore: + case VSystemID.Raw.SNES when Emulator is BsnesCore bsnesCore: SNESSubMenu.Text = bsnesCore.IsSGB ? "&SGB" : "&SNES"; SnesGfxDebuggerMenuItem.Visible = false; SNESSubMenu.Visible = true; @@ -2869,13 +2869,13 @@ namespace BizHawk.Client.EmuHawk CoreNameStatusBarButton.ToolTipText = attributes is PortedCoreAttribute ? "(ported) " : ""; - if (Emulator.SystemId == "ZXSpectrum") + if (Emulator.SystemId == VSystemID.Raw.ZXSpectrum) { var core = (Emulation.Cores.Computers.SinclairSpectrum.ZXSpectrum)Emulator; CoreNameStatusBarButton.ToolTipText = core.GetMachineType(); } - if (Emulator.SystemId == "AmstradCPC") + if (Emulator.SystemId == VSystemID.Raw.AmstradCPC) { var core = (Emulation.Cores.Computers.AmstradCPC.AmstradCPC)Emulator; CoreNameStatusBarButton.ToolTipText = core.GetMachineType(); @@ -4341,9 +4341,9 @@ namespace BizHawk.Client.EmuHawk return Emulator switch { - Snes9x => PromptToSwitchCore(CoreNames.Snes9X, CoreNames.Bsnes, () => Config.PreferredCores["SNES"] = CoreNames.Bsnes), - QuickNES => PromptToSwitchCore(CoreNames.QuickNes, CoreNames.NesHawk, () => Config.PreferredCores["NES"] = CoreNames.NesHawk), - HyperNyma => PromptToSwitchCore(CoreNames.HyperNyma, CoreNames.TurboNyma, () => Config.PreferredCores["PCE"] = CoreNames.TurboNyma), + Snes9x => PromptToSwitchCore(CoreNames.Snes9X, CoreNames.Bsnes, () => Config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Bsnes), + QuickNES => PromptToSwitchCore(CoreNames.QuickNes, CoreNames.NesHawk, () => Config.PreferredCores[VSystemID.Raw.NES] = CoreNames.NesHawk), + HyperNyma => PromptToSwitchCore(CoreNames.HyperNyma, CoreNames.TurboNyma, () => Config.PreferredCores[VSystemID.Raw.PCE] = CoreNames.TurboNyma), _ => true }; } diff --git a/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs b/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs index e135c1ccfa..d24bebaecb 100644 --- a/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs +++ b/src/BizHawk.Client.EmuHawk/config/GB/ColorChooserForm.cs @@ -304,7 +304,7 @@ namespace BizHawk.Client.EmuHawk { using var ofd = new OpenFileDialog { - InitialDirectory = _config.PathEntries.ScreenshotAbsolutePathFor("GB"), + InitialDirectory = _config.PathEntries.ScreenshotAbsolutePathFor(VSystemID.Raw.GB), Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), RestoreDirectory = true }; @@ -340,7 +340,7 @@ namespace BizHawk.Client.EmuHawk { using var sfd = new SaveFileDialog { - InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor("GB"), + InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor(VSystemID.Raw.GB), FileName = $"{_game.Name}.pal", Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), RestoreDirectory = true diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs index 96c05a77e2..34ce13c946 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NESGraphicsConfig.cs @@ -4,6 +4,7 @@ using System.Windows.Forms; using BizHawk.Common; using BizHawk.Client.Common; +using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Nintendo.NES; namespace BizHawk.Client.EmuHawk @@ -55,7 +56,7 @@ namespace BizHawk.Client.EmuHawk { using var ofd = new OpenFileDialog { - InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor("NES"), + InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor(VSystemID.Raw.NES), Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), RestoreDirectory = true }; diff --git a/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs index 25a725e567..964833f8fb 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/QuickNesConfig.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; using BizHawk.Client.Common; using BizHawk.Common; +using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { @@ -82,7 +83,7 @@ namespace BizHawk.Client.EmuHawk { using var ofd = new OpenFileDialog { - InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor("NES"), + InitialDirectory = _config.PathEntries.PalettesAbsolutePathFor(VSystemID.Raw.NES), Filter = new FilesystemFilterSet(FilesystemFilter.Palettes).ToString(), RestoreDirectory = true }; diff --git a/src/BizHawk.Client.EmuHawk/config/PathConfig.cs b/src/BizHawk.Client.EmuHawk/config/PathConfig.cs index 6bddcdbfeb..a87d209b26 100644 --- a/src/BizHawk.Client.EmuHawk/config/PathConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/PathConfig.cs @@ -6,6 +6,7 @@ using System.Windows.Forms; using BizHawk.Client.Common; using BizHawk.Common; +using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { @@ -26,7 +27,7 @@ namespace BizHawk.Client.EmuHawk 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) { @@ -153,14 +154,13 @@ namespace BizHawk.Client.EmuHawk .OrderBy(tuple => tuple.DisplayName) .ToList(); // add the Global tab first... - const string idGlobal = "Global_NULL"; - tpGlobal.Name = idGlobal; // required for SaveSettings - systems.RemoveAll(tuple => tuple.SysGroup == idGlobal); + tpGlobal.Name = PathEntryCollection.GLOBAL; // required for SaveSettings + systems.RemoveAll(tuple => tuple.SysGroup == PathEntryCollection.GLOBAL); var hack = tpGlobal.Size.Width - UIHelper.ScaleX(220); // whyyyyyyyyyy textBoxWidth += hack; widgetOffset += hack; 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 - 2].Location -= hack1; // Button textBoxWidth -= hack; @@ -168,9 +168,9 @@ namespace BizHawk.Client.EmuHawk // ...then continue with the others 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) } @@ -180,7 +180,7 @@ namespace BizHawk.Client.EmuHawk 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 - if (name == "Base" || system == "Global" || system == "Global_NULL") + if (name == "Base" || system == "Global" || system == PathEntryCollection.GLOBAL) { BrowseFolder(box, name, system: null); return; @@ -261,7 +261,7 @@ namespace BizHawk.Client.EmuHawk } 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) { diff --git a/src/BizHawk.Client.EmuHawk/config/ProfileConfig.cs b/src/BizHawk.Client.EmuHawk/config/ProfileConfig.cs index 0f6a5d8d4d..bdc724a055 100644 --- a/src/BizHawk.Client.EmuHawk/config/ProfileConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/ProfileConfig.cs @@ -113,7 +113,7 @@ namespace BizHawk.Client.EmuHawk PutSyncSettings(n64Settings); // SNES - _config.PreferredCores["SNES"] = CoreNames.Snes9X; + _config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Snes9X; // Genesis var genesisSettings = GetSyncSettings(); @@ -138,11 +138,11 @@ namespace BizHawk.Client.EmuHawk PutSyncSettings(a2600Settings); // NES - _config.PreferredCores["NES"] = CoreNames.QuickNes; + _config.PreferredCores[VSystemID.Raw.NES] = CoreNames.QuickNes; // GB - _config.PreferredCores["GB"] = CoreNames.Gambatte; - _config.PreferredCores["GBC"] = CoreNames.Gambatte; + _config.PreferredCores[VSystemID.Raw.GB] = CoreNames.Gambatte; + _config.PreferredCores[VSystemID.Raw.GBC] = CoreNames.Gambatte; var s = GetSyncSettings(); s.EnableBIOS = false; PutSyncSettings(s); @@ -153,7 +153,7 @@ namespace BizHawk.Client.EmuHawk _config.Savestates.CompressionLevelNormal = 5; // SNES - _config.PreferredCores["SNES"] = CoreNames.Bsnes; + _config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Bsnes; // SMS var smsSettings = GetSyncSettings(); @@ -168,11 +168,11 @@ namespace BizHawk.Client.EmuHawk PutSyncSettings(a2600Settings); // NES - _config.PreferredCores["NES"] = CoreNames.NesHawk; + _config.PreferredCores[VSystemID.Raw.NES] = CoreNames.NesHawk; // GB - _config.PreferredCores["GB"] = CoreNames.Gambatte; - _config.PreferredCores["GBC"] = CoreNames.Gambatte; + _config.PreferredCores[VSystemID.Raw.GB] = CoreNames.Gambatte; + _config.PreferredCores[VSystemID.Raw.GBC] = CoreNames.Gambatte; var s = GetSyncSettings(); s.EnableBIOS = true; PutSyncSettings(s); @@ -197,7 +197,7 @@ namespace BizHawk.Client.EmuHawk PutSyncSettings(n64Settings); // SNES - _config.PreferredCores["SNES"] = CoreNames.Bsnes; + _config.PreferredCores[VSystemID.Raw.SNES] = CoreNames.Bsnes; // Genesis var genesisSettings = GetSyncSettings(); @@ -217,11 +217,11 @@ namespace BizHawk.Client.EmuHawk PutSyncSettings(a2600Settings); // NES - _config.PreferredCores["NES"] = CoreNames.NesHawk; + _config.PreferredCores[VSystemID.Raw.NES] = CoreNames.NesHawk; // GB - _config.PreferredCores["GB"] = CoreNames.Gambatte; - _config.PreferredCores["GBC"] = CoreNames.Gambatte; + _config.PreferredCores[VSystemID.Raw.GB] = CoreNames.Gambatte; + _config.PreferredCores[VSystemID.Raw.GBC] = CoreNames.Gambatte; var s = GetSyncSettings(); s.EnableBIOS = true; PutSyncSettings(s); diff --git a/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs b/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs index d90aa045b5..11bb02bf74 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs @@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk DirectoryMonitor.Created -= DirectoryMonitor_Created; DirectoryMonitor.Dispose(); } - var path = _paths["Global", "External Tools"].Path; + var path = _paths[PathEntryCollection.GLOBAL, "External Tools"].Path; if (Directory.Exists(path)) { DirectoryMonitor = new FileSystemWatcher(path, "*.dll") @@ -86,7 +86,7 @@ namespace BizHawk.Client.EmuHawk var toolAttribute = allAttrs.OfType().First(); 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().FirstOrDefault(); if (embeddedIconAttr != null) diff --git a/src/BizHawk.Client.EmuHawk/tools/GameShark.cs b/src/BizHawk.Client.EmuHawk/tools/GameShark.cs index dbc3c33549..fcfdc1eb2a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GameShark.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GameShark.cs @@ -14,7 +14,7 @@ namespace BizHawk.Client.EmuHawk { [Tool( 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 })] public partial class GameShark : ToolFormBase, IToolFormAutoConfig { diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs index e5415efec2..77d0178571 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs @@ -258,7 +258,7 @@ namespace BizHawk.Client.EmuHawk public static string SuggestedFolder(Config config, IGameInfo game = null) { return config.PathEntries.AbsolutePathFor(Path.Combine( - config.PathEntries["Global", "Macros"].Path, + config.PathEntries[PathEntryCollection.GLOBAL, "Macros"].Path, game?.FilesystemSafeName()), null); } diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs index 74c9e30875..88cf23bd97 100644 --- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs +++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs @@ -60,7 +60,7 @@ namespace BizHawk.Client.EmuHawk } else if (Emulator is SMS sms && sms.IsGameGear) { - SystemDropDown.SelectedItem = "GGL"; + SystemDropDown.SelectedItem = VSystemID.Raw.GGL; } FileSelectors.First().Path = MainForm.CurrentlyOpenRom; @@ -279,7 +279,7 @@ namespace BizHawk.Client.EmuHawk } } while (FileSelectorPanel.Controls.Count != 0); - if (SystemDropDown.SelectedItem.ToString() == "GB") + if (SystemDropDown.SelectedItem.ToString() == VSystemID.Raw.GB) { AddButton.Enabled = false; btnRemove.Enabled = false; diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs index 0686d92123..208498864b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs +++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs @@ -4,6 +4,7 @@ using System.Windows.Forms; using BizHawk.Common; using BizHawk.Client.Common; +using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { @@ -91,7 +92,7 @@ namespace BizHawk.Client.EmuHawk if (hf.IsArchive) { // 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."); return; diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs index b25c911068..c0b565afb9 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs @@ -188,7 +188,7 @@ namespace BizHawk.Client.EmuHawk { NameTableView .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) diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs index 69a0beaa95..90c38be422 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs @@ -314,7 +314,7 @@ namespace BizHawk.Client.EmuHawk 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) diff --git a/src/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs b/src/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs index 2348ee546f..3dd9c8cd79 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Common public int Frame => 0; - public string SystemId => "NULL"; + public string SystemId => VSystemID.Raw.NULL; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Common/DSKIdentifier.cs b/src/BizHawk.Emulation.Common/DSKIdentifier.cs index c5408af2d0..e68f7287f0 100644 --- a/src/BizHawk.Emulation.Common/DSKIdentifier.cs +++ b/src/BizHawk.Emulation.Common/DSKIdentifier.cs @@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Common /// /// Default fallthrough to AppleII /// - public string IdentifiedSystem { get; set; } = "AppleII"; + public string IdentifiedSystem { get; set; } = VSystemID.Raw.AppleII; // dsk header 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 && 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(); if (str.Contains("PLUS3DOS")) { - IdentifiedSystem = "ZXSpectrum"; + IdentifiedSystem = VSystemID.Raw.ZXSpectrum; return; } } @@ -95,13 +95,13 @@ namespace BizHawk.Emulation.Common switch (trk.Sectors[0].GetChecksum256()) { case 3: - IdentifiedSystem = "ZXSpectrum"; + IdentifiedSystem = VSystemID.Raw.ZXSpectrum; return; case 1: case 255: // different Amstrad PCW boot records // just return CPC for now - IdentifiedSystem = "AmstradCPC"; + IdentifiedSystem = VSystemID.Raw.AmstradCPC; return; } @@ -109,7 +109,7 @@ namespace BizHawk.Emulation.Common { case 65: case 193: - IdentifiedSystem = "AmstradCPC"; + IdentifiedSystem = VSystemID.Raw.AmstradCPC; return; } } @@ -124,19 +124,19 @@ namespace BizHawk.Emulation.Common switch (trk.Sectors[0].GetChecksum256()) { case 3: - IdentifiedSystem = "ZXSpectrum"; + IdentifiedSystem = VSystemID.Raw.ZXSpectrum; return; case 1: case 255: // different Amstrad PCW checksums // just return CPC for now - IdentifiedSystem = "AmstradCPC"; + IdentifiedSystem = VSystemID.Raw.AmstradCPC; return; } break; case 65: case 193: - IdentifiedSystem = "AmstradCPC"; + IdentifiedSystem = VSystemID.Raw.AmstradCPC; return; } } @@ -148,14 +148,14 @@ namespace BizHawk.Emulation.Common if (trk.Sectors.Length == 8) { // CPC IBM - IdentifiedSystem = "AmstradCPC"; + IdentifiedSystem = VSystemID.Raw.AmstradCPC; return; } break; case 65: case 193: // possible CPC custom - _possibleIdent = "AmstradCPC"; + _possibleIdent = VSystemID.Raw.AmstradCPC; break; } @@ -174,16 +174,16 @@ namespace BizHawk.Emulation.Common switch (Tracks[1].Sectors[0].SectorID) { case 7: - IdentifiedSystem = "ZXSpectrum"; + IdentifiedSystem = VSystemID.Raw.ZXSpectrum; return; default: - _possibleIdent = "ZXSpectrum"; + _possibleIdent = VSystemID.Raw.ZXSpectrum; break; } } else { - _possibleIdent = "ZXSpectrum"; + _possibleIdent = VSystemID.Raw.ZXSpectrum; } break; case 1: @@ -193,13 +193,13 @@ namespace BizHawk.Emulation.Common { case 7: case 1: - IdentifiedSystem = "ZXSpectrum"; + IdentifiedSystem = VSystemID.Raw.ZXSpectrum; return; } } else { - _possibleIdent = "ZXSpectrum"; + _possibleIdent = VSystemID.Raw.ZXSpectrum; } break; } @@ -209,16 +209,16 @@ namespace BizHawk.Emulation.Common trk.Sectors[0].SectorData[9] == 23 && trk.Sectors[0].SectorData[2] == 40) { - IdentifiedSystem = "ZXSpectrum"; + IdentifiedSystem = VSystemID.Raw.ZXSpectrum; return; } } } // last chance. use the possible value - if (IdentifiedSystem == "AppleII" && _possibleIdent != "") + if (IdentifiedSystem == VSystemID.Raw.AppleII && _possibleIdent != "") { - IdentifiedSystem = "ZXSpectrum"; + IdentifiedSystem = VSystemID.Raw.ZXSpectrum; } } diff --git a/src/BizHawk.Emulation.Common/Database/Database.cs b/src/BizHawk.Emulation.Common/Database/Database.cs index 6962b7c70f..6a8612c883 100644 --- a/src/BizHawk.Emulation.Common/Database/Database.cs +++ b/src/BizHawk.Emulation.Common/Database/Database.cs @@ -226,68 +226,68 @@ namespace BizHawk.Emulation.Common case ".NES": case ".UNF": case ".FDS": - game.System = "NES"; + game.System = VSystemID.Raw.NES; break; case ".SFC": case ".SMC": - game.System = "SNES"; + game.System = VSystemID.Raw.SNES; break; case ".GB": - game.System = "GB"; + game.System = VSystemID.Raw.GB; break; case ".GBC": - game.System = "GBC"; + game.System = VSystemID.Raw.GBC; break; case ".GBA": - game.System = "GBA"; + game.System = VSystemID.Raw.GBA; break; case ".NDS": - game.System = "NDS"; + game.System = VSystemID.Raw.NDS; break; case ".SMS": - game.System = "SMS"; + game.System = VSystemID.Raw.SMS; break; case ".GG": - game.System = "GG"; + game.System = VSystemID.Raw.GG; break; case ".SG": - game.System = "SG"; + game.System = VSystemID.Raw.SG; break; case ".GEN": case ".MD": case ".SMD": - game.System = "GEN"; + game.System = VSystemID.Raw.GEN; break; case ".PSF": case ".MINIPSF": - game.System = "PSX"; + game.System = VSystemID.Raw.PSX; break; case ".PCE": - game.System = "PCE"; + game.System = VSystemID.Raw.PCE; break; case ".SGX": - game.System = "SGX"; + game.System = VSystemID.Raw.SGX; break; case ".A26": - game.System = "A26"; + game.System = VSystemID.Raw.A26; break; case ".A78": - game.System = "A78"; + game.System = VSystemID.Raw.A78; break; case ".COL": - game.System = "Coleco"; + game.System = VSystemID.Raw.Coleco; break; case ".INT": - game.System = "INTV"; + game.System = VSystemID.Raw.INTV; break; case ".PRG": @@ -295,48 +295,48 @@ namespace BizHawk.Emulation.Common case ".T64": case ".G64": case ".CRT": - game.System = "C64"; + game.System = VSystemID.Raw.C64; break; case ".TZX": case ".PZX": case ".CSW": case ".WAV": - game.System = "ZXSpectrum"; + game.System = VSystemID.Raw.ZXSpectrum; break; case ".CDT": - game.System = "AmstradCPC"; + game.System = VSystemID.Raw.AmstradCPC; break; case ".TAP": byte[] head = romData.Take(8).ToArray(); game.System = Encoding.Default.GetString(head).Contains("C64-TAPE") - ? "C64" - : "ZXSpectrum"; + ? VSystemID.Raw.C64 + : VSystemID.Raw.ZXSpectrum; break; case ".Z64": case ".V64": case ".N64": - game.System = "N64"; + game.System = VSystemID.Raw.N64; break; case ".DEBUG": - game.System = "DEBUG"; + game.System = VSystemID.Raw.DEBUG; break; case ".WS": case ".WSC": - game.System = "WSWAN"; + game.System = VSystemID.Raw.WSWAN; break; case ".LNX": - game.System = "Lynx"; + game.System = VSystemID.Raw.Lynx; break; case ".83P": - game.System = "83P"; + game.System = VSystemID.Raw.TI83P; break; case ".DSK": @@ -346,40 +346,40 @@ namespace BizHawk.Emulation.Common case ".PO": case ".DO": - game.System = "AppleII"; + game.System = VSystemID.Raw.AppleII; break; case ".VB": - game.System = "VB"; + game.System = VSystemID.Raw.VB; break; case ".NGP": case ".NGC": - game.System = "NGP"; + game.System = VSystemID.Raw.NGP; break; case ".O2": - game.System = "O2"; + game.System = VSystemID.Raw.O2; break; case ".UZE": - game.System = "UZE"; + game.System = VSystemID.Raw.UZE; break; case ".32X": - game.System = "32X"; + game.System = VSystemID.Raw.Sega32X; game.AddOption("32X", "true"); break; case ".VEC": - game.System = "VEC"; + game.System = VSystemID.Raw.VEC; game.AddOption("VEC", "true"); break; // 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? case ".ZIP": - game.System = "MAME"; + game.System = VSystemID.Raw.MAME; break; } diff --git a/src/BizHawk.Emulation.Common/Database/GameInfo.cs b/src/BizHawk.Emulation.Common/Database/GameInfo.cs index 7503631886..ccc2e513ad 100644 --- a/src/BizHawk.Emulation.Common/Database/GameInfo.cs +++ b/src/BizHawk.Emulation.Common/Database/GameInfo.cs @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Common public static GameInfo NullInstance => new GameInfo { Name = "Null", - System = "NULL", + System = VSystemID.Raw.NULL, Hash = "", Region = "", Status = RomStatus.GoodDump, @@ -175,7 +175,7 @@ namespace BizHawk.Emulation.Common { 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) diff --git a/src/BizHawk.Emulation.Common/Extensions.cs b/src/BizHawk.Emulation.Common/Extensions.cs index 3bf7318180..1ba5ea40c9 100644 --- a/src/BizHawk.Emulation.Common/Extensions.cs +++ b/src/BizHawk.Emulation.Common/Extensions.cs @@ -17,46 +17,46 @@ namespace BizHawk.Emulation.Common { public static readonly IReadOnlyDictionary SystemIDDisplayNames = new Dictionary { - ["A26"] = "Atari 2600", - ["A78"] = "Atari 7800", - ["AmstradCPC"] = "Amstrad CPC", - ["AppleII"] = "Apple II", - ["C64"] = "Commodore 64", - ["ChannelF"] = "Channel F", - ["Coleco"] = "ColecoVision", - ["DGB"] = "Game Boy Link", - ["GB"] = "GB", - ["SGB"] = "SGB", - ["GB3x"] = "Game Boy Link 3x", - ["GB4x"] = "Game Boy Link 4x", - ["GBA"] = "Gameboy Advance", - ["GBC"] = "Gameboy Color", - ["GEN"] = "Genesis", - ["GG"] = "Game Gear", - ["INTV"] = "Intellivision", - ["Libretro"] = "Libretro", - ["Lynx"] = "Lynx", - ["MAME"] = "MAME", - ["N64"] = "Nintendo 64", - ["NDS"] = "NDS", - ["NES"] = "NES", - ["NGP"] = "Neo-Geo Pocket", - ["O2"] = "Odyssey2", - ["PCE"] = "TurboGrafx-16", - ["PCECD"] = "TurboGrafx - 16(CD)", - ["PCFX"] = "PCFX", - ["PSX"] = "PlayStation", - ["SAT"] = "Saturn", - ["SG"] = "SG-1000", - ["SGX"] = "SuperGrafx", - ["SMS"] = "Sega Master System", - ["SNES"] = "SNES", - ["TI83"] = "TI - 83", - ["UZE"] = "Uzebox", - ["VB"] = "Virtual Boy", - ["VEC"] = "Vectrex", - ["WSWAN"] = "WonderSwan", - ["ZXSpectrum"] = "ZX Spectrum", + [VSystemID.Raw.A26] = "Atari 2600", + [VSystemID.Raw.A78] = "Atari 7800", + [VSystemID.Raw.AmstradCPC] = "Amstrad CPC", + [VSystemID.Raw.AppleII] = "Apple II", + [VSystemID.Raw.C64] = "Commodore 64", + [VSystemID.Raw.ChannelF] = "Channel F", + [VSystemID.Raw.Coleco] = "ColecoVision", + [VSystemID.Raw.DGB] = "Game Boy Link", + [VSystemID.Raw.GB] = "GB", + [VSystemID.Raw.SGB] = "SGB", + [VSystemID.Raw.GB3x] = "Game Boy Link 3x", + [VSystemID.Raw.GB4x] = "Game Boy Link 4x", + [VSystemID.Raw.GBA] = "Gameboy Advance", + [VSystemID.Raw.GBC] = "Gameboy Color", + [VSystemID.Raw.GEN] = "Genesis", + [VSystemID.Raw.GG] = "Game Gear", + [VSystemID.Raw.INTV] = "Intellivision", + [VSystemID.Raw.Libretro] = "Libretro", + [VSystemID.Raw.Lynx] = "Lynx", + [VSystemID.Raw.MAME] = "MAME", + [VSystemID.Raw.N64] = "Nintendo 64", + [VSystemID.Raw.NDS] = "NDS", + [VSystemID.Raw.NES] = "NES", + [VSystemID.Raw.NGP] = "Neo-Geo Pocket", + [VSystemID.Raw.O2] = "Odyssey2", + [VSystemID.Raw.PCE] = "TurboGrafx-16", + [VSystemID.Raw.PCECD] = "TurboGrafx - 16(CD)", + [VSystemID.Raw.PCFX] = "PCFX", + [VSystemID.Raw.PSX] = "PlayStation", + [VSystemID.Raw.SAT] = "Saturn", + [VSystemID.Raw.SG] = "SG-1000", + [VSystemID.Raw.SGX] = "SuperGrafx", + [VSystemID.Raw.SMS] = "Sega Master System", + [VSystemID.Raw.SNES] = "SNES", + [VSystemID.Raw.TI83] = "TI - 83", + [VSystemID.Raw.UZE] = "Uzebox", + [VSystemID.Raw.VB] = "Virtual Boy", + [VSystemID.Raw.VEC] = "Vectrex", + [VSystemID.Raw.WSWAN] = "WonderSwan", + [VSystemID.Raw.ZXSpectrum] = "ZX Spectrum", }; public static CoreAttribute Attributes(this IEmulator core) diff --git a/src/BizHawk.Emulation.Common/SystemLookup.cs b/src/BizHawk.Emulation.Common/SystemLookup.cs index ccedf2be4d..78c02690e9 100644 --- a/src/BizHawk.Emulation.Common/SystemLookup.cs +++ b/src/BizHawk.Emulation.Common/SystemLookup.cs @@ -10,33 +10,33 @@ namespace BizHawk.Emulation.Common { private readonly List _systems = new List { - new SystemInfo("A26", "Atari 2600"), - new SystemInfo("A78", "Atari 7800"), - new SystemInfo("Lynx", "Atari Lynx"), - new SystemInfo("NES", "NES"), - new SystemInfo("SNES", "Super NES"), - new SystemInfo("N64", "Nintendo 64"), - new SystemInfo("GB", "Gameboy"), - new SystemInfo("GBA", "Gameboy Advance"), - new SystemInfo("PSX", "Playstation"), - new SystemInfo("SMS", "Sega Master System"), - new SystemInfo("GEN", "Sega Genesis/Mega Drive"), - new SystemInfo("32X", "Sega Genesis 32X/Mega Drive 32X"), - new SystemInfo("SAT", "Sega Saturn"), - new SystemInfo("PCE", "PC Engine/TurboGrafx 16"), - new SystemInfo("Coleco", "ColecoVision"), - new SystemInfo("TI83", "TI-83 Calculator"), - new SystemInfo("WSWAN", "WonderSwan"), - new SystemInfo("C64", "Commodore 64"), - new SystemInfo("AppleII", "Apple II"), - new SystemInfo("INTV", "IntelliVision"), - new SystemInfo("ZXSpectrum", "Sinclair ZX Spectrum"), - new SystemInfo("AmstradCPC", "Amstrad CPC"), - new SystemInfo("ChannelF", "Fairchild Channel F"), - new SystemInfo("O2", "Odyssey2"), - new SystemInfo("VEC", "Vectrex"), - new SystemInfo("MSX", "MSX"), - new SystemInfo("NDS", "Nintendo DS") + new(VSystemID.Raw.A26, "Atari 2600"), + new(VSystemID.Raw.A78, "Atari 7800"), + new(VSystemID.Raw.Lynx, "Atari Lynx"), + new(VSystemID.Raw.NES, "NES"), + new(VSystemID.Raw.SNES, "Super NES"), + new(VSystemID.Raw.N64, "Nintendo 64"), + new(VSystemID.Raw.GB, "Gameboy"), + new(VSystemID.Raw.GBA, "Gameboy Advance"), + new(VSystemID.Raw.PSX, "Playstation"), + new(VSystemID.Raw.SMS, "Sega Master System"), + new(VSystemID.Raw.GEN, "Sega Genesis/Mega Drive"), + new(VSystemID.Raw.Sega32X, "Sega Genesis 32X/Mega Drive 32X"), + new(VSystemID.Raw.SAT, "Sega Saturn"), + new(VSystemID.Raw.PCE, "PC Engine/TurboGrafx 16"), + new(VSystemID.Raw.Coleco, "ColecoVision"), + new(VSystemID.Raw.TI83, "TI-83 Calculator"), + new(VSystemID.Raw.WSWAN, "WonderSwan"), + new(VSystemID.Raw.C64, "Commodore 64"), + new(VSystemID.Raw.AppleII, "Apple II"), + new(VSystemID.Raw.INTV, "IntelliVision"), + new(VSystemID.Raw.ZXSpectrum, "Sinclair ZX Spectrum"), + new(VSystemID.Raw.AmstradCPC, "Amstrad CPC"), + new(VSystemID.Raw.ChannelF, "Fairchild Channel F"), + new(VSystemID.Raw.O2, "Odyssey2"), + new(VSystemID.Raw.VEC, "Vectrex"), + new(VSystemID.Raw.MSX, "MSX"), + new(VSystemID.Raw.NDS, "Nintendo DS") }; public SystemInfo this[string systemId] diff --git a/src/BizHawk.Emulation.Common/VSystemID.cs b/src/BizHawk.Emulation.Common/VSystemID.cs new file mode 100644 index 0000000000..157d0e05a6 --- /dev/null +++ b/src/BizHawk.Emulation.Common/VSystemID.cs @@ -0,0 +1,77 @@ +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace BizHawk.Emulation.Common +{ + /// + /// You probably want . + /// It's laid out this way to match a local branch of mine where this is a struct. --yoshi + /// + 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? _allSysIDs = null; + + private static List AllSysIDs + => _allSysIDs ??= typeof(Raw).GetFields(BindingFlags.Public | BindingFlags.Static) + .Select(x => (string) x.GetRawConstantValue()) + .OrderBy(s => s) + .ToList(); + + /// iff it's in the valid list, else + public static string? Validate(string sysID) + => AllSysIDs.BinarySearch(sysID) < 0 ? null : sysID; + } +} diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IEmulator.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IEmulator.cs index 60bb27ab88..cd4128e23b 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IEmulator.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME { public partial class MAME : IEmulator { - public string SystemId => "MAME"; + public string SystemId => VSystemID.Raw.MAME; public bool DeterministicEmulation => true; public int Frame { get; private set; } public IEmulatorServiceProvider ServiceProvider { get; } diff --git a/src/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs b/src/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs index 7b101fe099..95b16665b4 100644 --- a/src/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Calculator/TI83.IEmulator.cs @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Calculators private set => _frame = value; } - public string SystemId => "TI83"; + public string SystemId => VSystemID.Raw.TI83; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Calculator/TI83.cs b/src/BizHawk.Emulation.Cores/Calculator/TI83.cs index 4641aac1ca..f557cd723e 100644 --- a/src/BizHawk.Emulation.Cores/Calculator/TI83.cs +++ b/src/BizHawk.Emulation.Cores/Calculator/TI83.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Calculators [ServiceNotApplicable(new[] { typeof(IBoardInfo), typeof(IDriveLight), typeof(IRegionable), typeof(ISaveRam), typeof(ISoundProvider) })] public partial class TI83 : IEmulator, IVideoProvider, IDebuggable, IInputPollable, ISettable { - [CoreConstructor("83P")] + [CoreConstructor(VSystemID.Raw.TI83P)] public TI83(CoreLoadParameters lp) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IEmulator.cs index 323bdfb869..d4b93e58b5 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.IEmulator.cs @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC public int Frame => _machine?.FrameCount ?? 0; - public string SystemId => "AmstradCPC"; + public string SystemId => VSystemID.Raw.AmstradCPC; public bool DeterministicEmulation { get; } diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs index 58549b1474..ed350e6650 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/AmstradCPC.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC [Core(CoreNames.CPCHawk, "Asnivor", isReleased: false)] public partial class AmstradCPC : IRegionable, IDriveLight { - [CoreConstructor("AmstradCPC")] + [CoreConstructor(VSystemID.Raw.AmstradCPC)] public AmstradCPC(CoreLoadParameters lp) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs index 71bf018a6d..ab28873df4 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IEmulator.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII private int _frame; public int Frame { get => _frame; set => _frame = value; } - public string SystemId => "AppleII"; + public string SystemId => VSystemID.Raw.AppleII; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs index ab8f5d8640..91bd264141 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII AppleIIController.BoolButtons.AddRange(ExtraButtons); } - [CoreConstructor("AppleII")] + [CoreConstructor(VSystemID.Raw.AppleII)] public AppleII(CoreLoadParameters lp) { _romSet = lp.Roms.Select(r => r.RomData).ToList(); diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs index 5cb70d7064..ff435e71db 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.IEmulator.cs @@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 public int Frame => _frame; - public string SystemId => "C64"; + public string SystemId => VSystemID.Raw.C64; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs index 7e72c1a0a4..acfa2f5f20 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 [Core(CoreNames.C64Hawk, "SaxxonPike")] public sealed partial class C64 : IEmulator, IRegionable, IBoardInfo, IRomInfo { - [CoreConstructor("C64")] + [CoreConstructor(VSystemID.Raw.C64)] public C64(CoreLoadParameters lp) { PutSyncSettings((C64SyncSettings)lp.SyncSettings ?? new C64SyncSettings()); diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs index feca758d61..7f7a15e715 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.IEmulator.cs @@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX public int Frame => _frame; - public string SystemId => "MSX"; + public string SystemId => VSystemID.Raw.MSX; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs index 8cf843bfce..6b8bab8804 100644 --- a/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs +++ b/src/BizHawk.Emulation.Cores/Computers/MSX/MSX.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX [ServiceNotApplicable(new[] { typeof(IDriveLight) })] public partial class MSX : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IRegionable, ISettable { - [CoreConstructor("MSX")] + [CoreConstructor(VSystemID.Raw.MSX)] public MSX(CoreComm comm, GameInfo game, byte[] rom, MSX.MSXSettings settings, MSX.MSXSyncSettings syncSettings) { ServiceProvider = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs index 123c2ba263..c06b3c0d55 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum public int Frame => _machine?.FrameCount ?? 0; - public string SystemId => "ZXSpectrum"; + public string SystemId => VSystemID.Raw.ZXSpectrum; public bool DeterministicEmulation { get; } diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs index 487a675b07..25dfabc178 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs @@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum [Core(CoreNames.ZXHawk, "Asnivor, Alyosha")] public partial class ZXSpectrum : IRegionable, IDriveLight { - [CoreConstructor("ZXSpectrum")] + [CoreConstructor(VSystemID.Raw.ZXSpectrum)] public ZXSpectrum( CoreLoadParameters lp) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IEmulator.cs index 9849eef8d2..e49065a038 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IEmulator.cs @@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public int Frame => _frame; - public string SystemId => "A26"; + public string SystemId => VSystemID.Raw.A26; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index ad19392f9d..307cddf265 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public const string Tapper = /*sha1:*/"E986E1818E747BEB9B33CE4DFF1CDC6B55BDB620"; } - [CoreConstructor("A26")] + [CoreConstructor(VSystemID.Raw.A26)] public Atari2600(GameInfo game, byte[] rom, Atari2600.A2600Settings settings, Atari2600.A2600SyncSettings syncSettings) { var ser = new BasicServiceProvider(this); @@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 return new CompactGameInfo { Name = _game.Name, - System = "A26", + System = VSystemID.Raw.A26, MetaData = "m=" + _mapper.GetType().ToString().Split('.').Last(), Hash = Rom.HashSHA1(), Region = _game.Region, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs index 4b811bf834..67946a5598 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs @@ -315,7 +315,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk public int Frame => _frame; - public string SystemId => "A78"; + public string SystemId => VSystemID.Raw.A78; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs index 68ce12aac3..3cbf03575e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.cs @@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk 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) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs b/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs index 6f87267f22..15c7dd616a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable), typeof(ISettable<,>) })] public partial class Lynx : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable { - [CoreConstructor("Lynx")] + [CoreConstructor(VSystemID.Raw.Lynx)] public Lynx(byte[] file, GameInfo game, CoreComm comm) { ServiceProvider = new BasicServiceProvider(this); @@ -141,7 +141,7 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx public int Frame { get; private set; } - public string SystemId => "Lynx"; + public string SystemId => VSystemID.Raw.Lynx; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs b/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs index 2ac61aac6f..709f77306c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Belogic/Uzem.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Belogic private LibUzem _uze; private readonly bool _mouseEnabled; - [CoreConstructor("UZE")] + [CoreConstructor(VSystemID.Raw.UZE)] public Uzem(CoreComm comm, byte[] rom) : base(comm, new Configuration { @@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Belogic MaxWidth = 720, MaxHeight = 224, MaxSamples = 4096, - SystemId = "UZE", + SystemId = VSystemID.Raw.UZE, DefaultFpsNumerator = 28618182, DefaultFpsDenominator = 476840 }) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs index 81e70e8c9d..a3e7d77ca8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs @@ -179,7 +179,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision public int Frame => _frame; - public string SystemId => "Coleco"; + public string SystemId => VSystemID.Raw.Coleco; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index 4e08d4fb7a..bb8f216120 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(ISaveRam) })] public sealed partial class ColecoVision : IEmulator, IDebuggable, IInputPollable, ISettable { - [CoreConstructor("Coleco")] + [CoreConstructor(VSystemID.Raw.Coleco)] public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, ColecoSettings settings, ColecoSyncSettings syncSettings) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs index 692c346811..7ed033c0bd 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF public ControllerDefinition ControllerDefinition { get; set; } - public string SystemId => "ChannelF"; + public string SystemId => VSystemID.Raw.ChannelF; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs index a70d4673e7..c4be8b5024 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF [ServiceNotApplicable(new[] { typeof(IDriveLight) })] public partial class ChannelF { - [CoreConstructor("ChannelF")] + [CoreConstructor(VSystemID.Raw.ChannelF)] public ChannelF(CoreComm comm, GameInfo game, byte[] rom) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs index 2fa297ddb9..cd7936b0eb 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs @@ -97,7 +97,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex public int Frame => _frame; - public string SystemId => "VEC"; + public string SystemId => VSystemID.Raw.VEC; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs index 29281b784f..4906952849 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex public Audio audio; public SerialPort serialport; - [CoreConstructor("VEC")] + [CoreConstructor(VSystemID.Raw.VEC)] public VectrexHawk(CoreComm comm, byte[] rom, VectrexHawk.VectrexSyncSettings syncSettings) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index 589d9849e0..4ceef49121 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Intellivision public int Frame => _frame; - public string SystemId => "INTV"; + public string SystemId => VSystemID.Raw.INTV; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs index 6c0f692b75..061f320b47 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Intellivision public sealed partial class Intellivision : IEmulator, IInputPollable, IDisassemblable, IBoardInfo, IDebuggable, ISettable { - [CoreConstructor("INTV")] + [CoreConstructor(VSystemID.Raw.INTV)] public Intellivision(CoreComm comm, byte[] rom, Intellivision.IntvSettings settings, Intellivision.IntvSyncSettings syncSettings) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs index 9175a52b68..f21dae0389 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs @@ -192,7 +192,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public int Frame => _frame; - public string SystemId => "O2"; + public string SystemId => VSystemID.Raw.O2; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs index f335fc6298..a7d0659008 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk public bool is_XROM; - [CoreConstructor("O2")] + [CoreConstructor(VSystemID.Raw.O2)] public O2Hawk(CoreComm comm, GameInfo game, byte[] rom, O2Settings settings, O2SyncSettings syncSettings) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs index afc8146376..01ec44389c 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/HyperNyma.cs @@ -15,11 +15,11 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE private readonly LibHyperNyma _hyperNyma; private readonly bool _hasCds; - [CoreConstructor("PCE", Priority = CorePriority.Low)] - [CoreConstructor("SGX", Priority = CorePriority.Low)] - [CoreConstructor("PCECD", Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.PCE, Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.SGX, Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.PCECD, Priority = CorePriority.Low)] public HyperNyma(CoreLoadParameters 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(); if (lp.Discs.Count > 0) @@ -32,8 +32,8 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE } public override string SystemId => IsSgx - ? _hasCds ? "SGXCD" : "SGX" - : _hasCds ? "PCECD" : "PCE"; + ? _hasCds ? VSystemID.Raw.SGXCD : VSystemID.Raw.SGX + : _hasCds ? VSystemID.Raw.PCECD : VSystemID.Raw.PCE; protected override IDictionary SettingOverrides { get; } = new Dictionary { diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs index f282442cc5..31031ac30d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TurboNyma.cs @@ -17,11 +17,11 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE private readonly LibTurboNyma _turboNyma; private readonly bool _hasCds; - [CoreConstructor("PCE")] - [CoreConstructor("SGX")] - [CoreConstructor("PCECD")] + [CoreConstructor(VSystemID.Raw.PCE)] + [CoreConstructor(VSystemID.Raw.SGX)] + [CoreConstructor(VSystemID.Raw.PCECD)] public TurboNyma(CoreLoadParameters 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(); if (lp.Discs.Count > 0) @@ -43,8 +43,8 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE } public override string SystemId => IsSgx - ? _hasCds ? "SGXCD" : "SGX" - : _hasCds ? "PCECD" : "PCE"; + ? _hasCds ? VSystemID.Raw.SGXCD : VSystemID.Raw.SGX + : _hasCds ? VSystemID.Raw.PCECD : VSystemID.Raw.PCE; protected override IDictionary SettingOverrides { get; } = new Dictionary { diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs index 41dce0a43e..6f1201f8d0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCFX/Tst.cs @@ -8,9 +8,9 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCFX [PortedCore(CoreNames.TST, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")] public class Tst : NymaCore { - [CoreConstructor("PCFX")] + [CoreConstructor(VSystemID.Raw.PCFX)] public Tst(CoreLoadParameters 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) throw new InvalidOperationException("To load a PC-FX game, please load the CUE file and not the BIN file."); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs index 91998b2b46..76ecc43dbc 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs @@ -17,8 +17,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES { private BsnesApi.SNES_REGION _region; - [CoreConstructor("SGB")] - [CoreConstructor("SNES")] + [CoreConstructor(VSystemID.Raw.SGB)] + [CoreConstructor(VSystemID.Raw.SNES)] public BsnesCore(GameInfo game, byte[] rom, CoreComm comm, SnesSettings settings, SnesSyncSettings syncSettings) :this(game, rom, null, null, comm, settings, syncSettings) @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES _settings = settings ?? new SnesSettings(); _syncSettings = syncSettings ?? new SnesSyncSettings(); - if (game.System == "SGB") + if (game.System == VSystemID.Raw.SGB) { if ((romData[0x143] & 0xc0) == 0xc0) { @@ -76,10 +76,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES InitAudio(); ser.Register(_resampler); - if (game.System == "SGB") + if (game.System == VSystemID.Raw.SGB) { IsSGB = true; - SystemId = "SNES"; + SystemId = VSystemID.Raw.SNES; ser.Register(new SGBBoardInfo()); _currLoadParams = new LoadParams @@ -112,7 +112,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES } } - SystemId = "SNES"; + SystemId = VSystemID.Raw.SNES; _currLoadParams = new LoadParams { type = LoadParamType.Normal, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs index b4849514cd..28252e8cf3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Faust/Faust.cs @@ -7,10 +7,10 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Faust [PortedCore(CoreNames.Faust, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")] public class Faust : NymaCore, IRegionable { - [CoreConstructor("SNES")] + [CoreConstructor(VSystemID.Raw.SNES)] public Faust(GameInfo game, byte[] rom, CoreComm comm, string extension, NymaSettings settings, NymaSyncSettings syncSettings, bool deterministic) - : base(comm, "SNES", "SNES Controller", settings, syncSettings) + : base(comm, VSystemID.Raw.SNES, "SNES Controller", settings, syncSettings) { if (deterministic) // force ST renderer diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs index a8247992a3..97789f6862 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.cs @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA LibmGBA = BizInvoker.GetInvoker(resolver, CallingConventionAdapters.Native); } - [CoreConstructor("GBA")] + [CoreConstructor(VSystemID.Raw.GBA)] public MGBAHawk(byte[] file, CoreComm comm, SyncSettings syncSettings, Settings settings, bool deterministic, GameInfo game) { _syncSettings = syncSettings ?? new SyncSettings(); @@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA public int Frame { get; private set; } - public string SystemId => "GBA"; + public string SystemId => VSystemID.Raw.GBA; public bool DeterministicEmulation { get; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs index 315ac5361d..7b7d4b2207 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs @@ -411,7 +411,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk public int Frame => _frame; - public string SystemId => "GB"; + public string SystemId => VSystemID.Raw.GB; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs index 5e256f13ba..e1ad0b2a48 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs @@ -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 }; - [CoreConstructor("GB")] - [CoreConstructor("GBC")] + [CoreConstructor(VSystemID.Raw.GB)] + [CoreConstructor(VSystemID.Raw.GBC)] public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ GBSettings settings, GBSyncSettings syncSettings) { var ser = new BasicServiceProvider(this); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs index 1b6a7c91a8..43877b25f0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs @@ -225,7 +225,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink public int Frame => _frame; - public string SystemId => "DGB"; + public string SystemId => VSystemID.Raw.DGB; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs index c248243e9f..d68df846d5 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.cs @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink public bool do_frame_fill; - [CoreConstructor("DGB")] + [CoreConstructor(VSystemID.Raw.DGB)] public GBHawkLink(CoreLoadParameters lp) { if (lp.Roms.Count != 2) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.IEmulator.cs index 9c42ec885b..7f2ed5dcb1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.IEmulator.cs @@ -420,7 +420,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x public int Frame => _frame; - public string SystemId => "GB3x"; + public string SystemId => VSystemID.Raw.GB3x; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs index 74036426d1..2ff6884203 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink3x/GBHawkLink3x.cs @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x public bool do_frame_fill; - [CoreConstructor("GB3x")] + [CoreConstructor(VSystemID.Raw.GB3x)] public GBHawkLink3x(CoreLoadParameters lp) { if (lp.Roms.Count != 3) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs index 1c0d467006..cf8967a331 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.IEmulator.cs @@ -999,7 +999,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x public int Frame => _frame; - public string SystemId => "GB4x"; + public string SystemId => VSystemID.Raw.GB4x; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs index cd25ca2324..d40b7f63f2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink4x/GBHawkLink4x.cs @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x public bool do_frame_fill; - [CoreConstructor("GB4x")] + [CoreConstructor(VSystemID.Raw.GB4x)] public GBHawkLink4x(CoreLoadParameters lp) { if (lp.Roms.Count != 4) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs index c6ba5c7f98..c682106145 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IEmulator.cs @@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy 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; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index e61631b580..1672309a17 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -18,9 +18,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy IBoardInfo, IRomInfo, IDebuggable, ISettable, IGameboyCommon, ICycleTiming, ILinkable { - [CoreConstructor("GB")] - [CoreConstructor("GBC")] - [CoreConstructor("SGB")] + [CoreConstructor(VSystemID.Raw.GB)] + [CoreConstructor(VSystemID.Raw.GBC)] + [CoreConstructor(VSystemID.Raw.SGB)] public Gameboy(CoreComm comm, GameInfo game, byte[] file, Gameboy.GambatteSettings settings, Gameboy.GambatteSyncSettings syncSettings, bool deterministic) { var ser = new BasicServiceProvider(this); @@ -62,12 +62,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy flags |= LibGambatte.LoadFlags.CGB_MODE | LibGambatte.LoadFlags.GBA_FLAG; break; default: - if (game.System == "GBC") + if (game.System == VSystemID.Raw.GBC) flags |= LibGambatte.LoadFlags.CGB_MODE; break; } - if (game.System == "SGB") + if (game.System == VSystemID.Raw.SGB) { flags &= ~(LibGambatte.LoadFlags.CGB_MODE | LibGambatte.LoadFlags.GBA_FLAG); flags |= LibGambatte.LoadFlags.SGB_MODE; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs index de0074358b..4d5a1dc062 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs @@ -161,7 +161,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy public int Frame { get; private set; } - public string SystemId => "DGB"; + public string SystemId => VSystemID.Raw.DGB; public bool DeterministicEmulation => L.DeterministicEmulation && R.DeterministicEmulation; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs index 619e56ec3d..77d0cb3429 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy public partial class GambatteLink : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, ISaveRam, IStatable, ILinkable, IBoardInfo, IRomInfo, IDebuggable, ISettable, ICodeDataLogger { - [CoreConstructor("DGB")] + [CoreConstructor(VSystemID.Raw.DGB)] public GambatteLink(CoreLoadParameters lp) { if (lp.Roms.Count != 2) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index 955e04de86..0d2dcea9ca 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 /// Rom that should be loaded /// rom data with consistent endianness/order /// N64SyncSettings object - [CoreConstructor("N64")] + [CoreConstructor(VSystemID.Raw.N64)] public N64(GameInfo game, byte[] file, byte[] rom, N64Settings settings, N64SyncSettings syncSettings) { ServiceProvider = new BasicServiceProvider(this); @@ -242,7 +242,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 return true; } - public string SystemId => "N64"; + public string SystemId => VSystemID.Raw.N64; public DisplayType Region => _display_type; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs index 22f423d68a..a444abe2e1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS private readonly NDSDisassembler _disassembler; private SpeexResampler _resampler; - [CoreConstructor("NDS")] + [CoreConstructor(VSystemID.Raw.NDS)] public NDS(CoreLoadParameters lp) : base(lp.Comm, new Configuration { @@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS MaxSamples = 1024, DefaultFpsNumerator = 33513982, DefaultFpsDenominator = 560190, - SystemId = "NDS" + SystemId = VSystemID.Raw.NDS, }) { var roms = lp.Roms.Select(r => r.RomData).ToList(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs index df21bce748..2734285b0d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs @@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public partial class NES : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, IVideoLogicalOffsets, IBoardInfo, IRomInfo, ISettable, ICodeDataLogger { - [CoreConstructor("NES")] + [CoreConstructor(VSystemID.Raw.NES)] public NES(CoreComm comm, GameInfo game, byte[] rom, NESSettings settings, NESSyncSettings syncSettings) { var ser = new BasicServiceProvider(this); @@ -277,7 +277,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public bool DeterministicEmulation => true; - public string SystemId => "NES"; + public string SystemId => VSystemID.Raw.NES; public string GameName => game_name; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs index f1508b7bd2..423b9f62d3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs @@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES QN.qn_setup_mappers(); } - [CoreConstructor("NES", Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.NES, Priority = CorePriority.Low)] public QuickNES(byte[] file, QuickNESSettings settings, QuickNESSyncSettings syncSettings) { FP = OSTailoredCode.IsUnixHost @@ -218,7 +218,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES private IntPtr Context; public int Frame { get; private set; } - public string SystemId => "NES"; + public string SystemId => VSystemID.Raw.NES; public bool DeterministicEmulation => true; public string BoardName { get; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index 3e59feb8e8..71beb04d91 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -22,8 +22,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public unsafe partial class LibsnesCore : IEmulator, IVideoProvider, ISaveRam, IStatable, IInputPollable, IRegionable, ICodeDataLogger, IDebuggable, ISettable { - [CoreConstructor("SGB")] - [CoreConstructor("SNES")] + [CoreConstructor(VSystemID.Raw.SGB)] + [CoreConstructor(VSystemID.Raw.SNES)] public LibsnesCore(GameInfo game, byte[] rom, CoreComm comm, LibsnesCore.SnesSettings settings, LibsnesCore.SnesSyncSettings syncSettings) :this(game, rom, null, null, comm, settings, syncSettings) @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES CoreComm = comm; byte[] sgbRomData = null; - if (game.System == "SGB") + if (game.System == VSystemID.Raw.SGB) { if ((romData[0x143] & 0xc0) == 0xc0) { @@ -110,10 +110,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES romData = newData; } - if (game.System == "SGB") + if (game.System == VSystemID.Raw.SGB) { IsSGB = true; - SystemId = "SNES"; + SystemId = VSystemID.Raw.SNES; ser.Register(new SGBBoardInfo()); _currLoadParams = new LoadParams @@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES } } - SystemId = "SNES"; + SystemId = VSystemID.Raw.SNES; _currLoadParams = new LoadParams { type = LoadParamType.Normal, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs index 4c16b15fe5..b3040d33dc 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES9X/Snes9x.cs @@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES9X { private readonly LibSnes9x _core; - [CoreConstructor("SNES")] + [CoreConstructor(VSystemID.Raw.SNES)] public Snes9x(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings) :base(comm, new Configuration { @@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES9X MaxWidth = 512, MaxHeight = 480, MaxSamples = 8192, - SystemId = "SNES" + SystemId = VSystemID.Raw.SNES, }) { settings ??= new Settings(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs index 3834011c7e..f8698ae7d6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.IEmulator.cs @@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk public int Frame => _frame; - public string SystemId => "GB"; + public string SystemId => VSystemID.Raw.GB; public bool DeterministicEmulation => _GBCore.DeterministicEmulation; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs index 0c8f9cd808..3809da22a1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubGBHawk/SubGBHawk.cs @@ -10,8 +10,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubGBHawk public partial class SubGBHawk : IEmulator, IStatable, IInputPollable, ISettable, IDebuggable { - [CoreConstructor("GB", Priority = CorePriority.SuperLow)] - [CoreConstructor("GBC", Priority = CorePriority.SuperLow)] + [CoreConstructor(VSystemID.Raw.GB, 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) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs index 197f38e99c..3cfc8d22c6 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs @@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk public int Frame => _frame; - public string SystemId => "NES"; + public string SystemId => VSystemID.Raw.NES; public bool DeterministicEmulation => _nesCore.DeterministicEmulation; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs index 9517345448..3f59a91cfa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk public partial class SubNESHawk : IEmulator, IStatable, IInputPollable, ISettable { - [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) { var subNesSettings = (NES.NES.NESSettings)settings ?? new NES.NES.NESSettings(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs index 995e9f5fb7..70056decd8 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.VB { private readonly LibVirtualBoyee _boyee; - [CoreConstructor("VB")] + [CoreConstructor(VSystemID.Raw.VB)] public VirtualBoyee(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings) : base(comm, new Configuration { @@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.VB MaxWidth = 1024, MaxHeight = 1024, MaxSamples = 8192, - SystemId = "VB" + SystemId = VSystemID.Raw.VB, }) { _settings = settings ?? new Settings(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index 1a71588e29..252468b125 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -20,14 +20,14 @@ namespace BizHawk.Emulation.Cores.PCEngine int IVideoLogicalOffsets.ScreenY => Settings.TopLine; - [CoreConstructor("PCE", Priority = CorePriority.Low)] - [CoreConstructor("SGX", Priority = CorePriority.Low)] - [CoreConstructor("PCECD", Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.PCE, Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.SGX, Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.PCECD, Priority = CorePriority.Low)] public PCEngine(CoreLoadParameters lp) { if (lp.Discs.Count == 1 && lp.Roms.Count == 0) { - SystemId = "PCECD"; + SystemId = VSystemID.Raw.PCECD; Type = NecSystemType.TurboCD; this.disc = lp.Discs[0].DiscData; Settings = (PCESettings)lp.Settings ?? new PCESettings(); @@ -84,15 +84,13 @@ namespace BizHawk.Emulation.Cores.PCEngine } else if (lp.Discs.Count == 0 && lp.Roms.Count == 1) { - switch (lp.Game.System) + switch (SystemId = lp.Game.System) { default: - case "PCE": - SystemId = "PCE"; + case VSystemID.Raw.PCE: Type = NecSystemType.TurboGrafx; break; - case "SGX": - SystemId = "SGX"; + case VSystemID.Raw.SGX: Type = NecSystemType.SuperGrafx; break; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs b/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs index 09a8227734..7a9d35c02e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/SNK/NeoGeoPort.cs @@ -11,10 +11,10 @@ namespace BizHawk.Emulation.Cores.Consoles.SNK { private readonly LibNeoGeoPort _neopop; - [CoreConstructor("NGP")] + [CoreConstructor(VSystemID.Raw.NGP)] public NeoGeoPort(CoreComm comm, byte[] rom, GameInfo game, NymaSettings settings, NymaSyncSettings syncSettings, bool deterministic, string extension) - : base(comm, "NGP", "NeoGeo Portable Controller", settings, syncSettings) + : base(comm, VSystemID.Raw.NGP, "NeoGeo Portable Controller", settings, syncSettings) { _neopop = DoInit(game, rom, null, "ngp.wbx", extension, deterministic); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs index 4684c167e5..8b6d4c9797 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.IEmulator.cs @@ -273,7 +273,7 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink public int Frame => _frame; - public string SystemId => "GGL"; + public string SystemId => VSystemID.Raw.GGL; public bool DeterministicEmulation { get; set; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs index 08ad31ab3b..6e59a44d12 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs @@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink private bool do_r_next = false; - [CoreConstructor("GGL")] + [CoreConstructor(VSystemID.Raw.GGL)] public GGHawkLink(CoreLoadParameters lp) { if (lp.Roms.Count != 2) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs index f5ab516b9f..6e777e94f0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs @@ -18,8 +18,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive private readonly DiscSectorReader _cdReader; private readonly bool _isPal; - [CoreConstructor("GEN", Priority = CorePriority.Low)] - [CoreConstructor("32X")] + [CoreConstructor(VSystemID.Raw.GEN, Priority = CorePriority.Low)] + [CoreConstructor(VSystemID.Raw.Sega32X)] public PicoDrive(CoreComm comm, GameInfo game, byte[] rom, bool deterministic, SyncSettings syncSettings) : this(comm, game, rom, null, deterministic, syncSettings) { } @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive DefaultHeight = 224, MaxWidth = 320, MaxHeight = 480, - SystemId = "GEN" + SystemId = VSystemID.Raw.GEN, }) { var biosg = comm.CoreFileProvider.GetFirmware(new("32X", "G")); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index b553dcb91c..e3574087d0 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -19,9 +19,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem public partial class SMS : IEmulator, ISoundProvider, ISaveRam, IInputPollable, IRegionable, IDebuggable, ISettable, ICodeDataLogger { - [CoreConstructor("SMS")] - [CoreConstructor("SG")] - [CoreConstructor("GG")] + [CoreConstructor(VSystemID.Raw.SMS)] + [CoreConstructor(VSystemID.Raw.SG)] + [CoreConstructor(VSystemID.Raw.GG)] public SMS(CoreComm comm, GameInfo game, byte[] rom, SmsSettings settings, SmsSyncSettings syncSettings) { var ser = new BasicServiceProvider(this); @@ -29,9 +29,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem Settings = (SmsSettings)settings ?? new SmsSettings(); SyncSettings = (SmsSyncSettings)syncSettings ?? new SmsSyncSettings(); - IsGameGear = game.System == "GG"; - IsGameGear_C = game.System == "GG"; - IsSG1000 = game.System == "SG"; + IsGameGear = game.System == VSystemID.Raw.GG; + IsGameGear_C = game.System == VSystemID.Raw.GG; + IsSG1000 = game.System == VSystemID.Raw.SG; RomData = rom; if (RomData.Length % BankSize != 0) @@ -93,7 +93,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem // in SMS compatibility mode (it will fail the check sum if played on an actual SMS though.) IsGameGear = false; IsGameGear_C = true; - game.System = "GG"; + game.System = VSystemID.Raw.GG; Console.WriteLine("Using SMS Compatibility mode for Game Gear System"); } @@ -159,7 +159,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem Port3E = 0xF7; // Disable cartridge, enable BIOS rom InitBiosMapper(); } - else if (game.System == "SMS" && !game["GG_in_SMS"]) + else if (game.System == VSystemID.Raw.SMS && !game["GG_in_SMS"]) { BiosRom = comm.CoreFileProvider.GetFirmware(new("SMS", _region.ToString())); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs index de2c5b61b9..fa51db5120 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs @@ -8,9 +8,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn [PortedCore(CoreNames.Saturnus, "Mednafen Team", "1.27.1", "https://mednafen.github.io/releases/")] public class Saturnus : NymaCore, IRegionable { - [CoreConstructor("SAT")] + [CoreConstructor(VSystemID.Raw.SAT)] public Saturnus(CoreLoadParameters lp) - : base(lp.Comm, "SAT", "Saturn Controller", lp.Settings, lp.SyncSettings) + : base(lp.Comm, VSystemID.Raw.SAT, "Saturn Controller", lp.Settings, lp.SyncSettings) { if (lp.Roms.Count > 0) throw new InvalidOperationException("To load a Saturn game, please load the CUE file and not the BIN file."); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs index 531b3d1b3a..4b6ef954b1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs @@ -77,7 +77,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx public int Frame { get; private set; } - public string SystemId => "GEN"; + public string SystemId => VSystemID.Raw.GEN; public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs index 1854061165..b448e9f626 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx public partial class GPGX : IEmulator, IVideoProvider, ISaveRam, IStatable, IRegionable, IInputPollable, IDebuggable, IDriveLight, ICodeDataLogger, IDisassemblable { - [CoreConstructor("GEN")] + [CoreConstructor(VSystemID.Raw.GEN)] public GPGX(CoreLoadParameters lp) { LoadCallback = new LibGPGX.load_archive_cb(load_archive); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PS2/DobieStation.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PS2/DobieStation.cs index 460c015413..fccf4b5618 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PS2/DobieStation.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PS2/DobieStation.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Sony.PS2 public unsafe class DobieStation : WaterboxCore, ISettable { private readonly LibDobieStation _core; - [CoreConstructor("PS2")] + [CoreConstructor(VSystemID.Raw.PS2)] public DobieStation(CoreLoadParameters lp) :base(lp.Comm, new Configuration { @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Sony.PS2 DefaultFpsNumerator = 294912000, DefaultFpsDenominator = 4920115, MaxSamples = 1024, - SystemId = "PS2" + SystemId = VSystemID.Raw.PS2, }) { if (lp.Discs.Count != 1) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs index b0d52a6df3..31205030fa 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX //note: its annoying that we have to have a disc before constructing this. //might want to change that later. HOWEVER - we need to definitely have a region, at least - [CoreConstructor("PSX")] + [CoreConstructor(VSystemID.Raw.PSX)] public Octoshock(CoreLoadParameters lp) { string romDetails; @@ -281,7 +281,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX public string RomDetails { get; private set; } - public string SystemId => "PSX"; + public string SystemId => VSystemID.Raw.PSX; public static ControllerDefinition CreateControllerDefinition(SyncSettings syncSettings) { diff --git a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs index 401f3501a4..3bfb16f81e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/WonderSwan/WonderSwan.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.WonderSwan public partial class WonderSwan : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, IDebuggable { - [CoreConstructor("WSWAN")] + [CoreConstructor(VSystemID.Raw.WSWAN)] public WonderSwan(byte[] file, bool deterministic, WonderSwan.Settings settings, WonderSwan.SyncSettings syncSettings) { ServiceProvider = new BasicServiceProvider(this); @@ -96,7 +96,7 @@ namespace BizHawk.Emulation.Cores.WonderSwan public int LagCount { get; set; } public bool IsLagFrame { get; set; } - public string SystemId => "WSWAN"; + public string SystemId => VSystemID.Raw.WSWAN; public bool DeterministicEmulation { get; } private readonly InputCallbackSystem _inputCallbacks = new InputCallbackSystem(); diff --git a/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs b/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs index 0a6769e7ec..1efe9ece05 100644 --- a/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs +++ b/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs @@ -289,7 +289,7 @@ namespace BizHawk.Emulation.Cores.Libretro } public int LagCount { get; set; } public bool IsLagFrame { get; set; } - public string SystemId => "Libretro"; + public string SystemId => VSystemID.Raw.Libretro; public bool DeterministicEmulation => false; //TODO - terrible things will happen if this changes at runtime diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/A26Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/A26Schema.cs index 1bfb0be085..706ec27971 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/A26Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/A26Schema.cs @@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Atari.Atari2600; namespace BizHawk.Emulation.Cores { - [Schema("A26")] + [Schema(VSystemID.Raw.A26)] // ReSharper disable once UnusedMember.Global public class A26Schema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/A78Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/A78Schema.cs index d020c83fad..70abc244b4 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/A78Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/A78Schema.cs @@ -8,7 +8,7 @@ using BizHawk.Emulation.Cores.Atari.A7800Hawk; namespace BizHawk.Emulation.Cores { - [Schema("A78")] + [Schema(VSystemID.Raw.A78)] // ReSharper disable once UnusedMember.Global public class A78Schema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs index 6fe9dd2c87..cc2384478b 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/AppleIISchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("AppleII")] + [Schema(VSystemID.Raw.AppleII)] // ReSharper disable once UnusedMember.Global public class AppleIISchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/C64Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/C64Schema.cs index c2131c6264..74317ab13c 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/C64Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/C64Schema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("C64")] + [Schema(VSystemID.Raw.C64)] // ReSharper disable once UnusedMember.Global public class C64Schema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/ColecoSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/ColecoSchema.cs index d9e63d27ca..63b88e38d4 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/ColecoSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/ColecoSchema.cs @@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.ColecoVision; namespace BizHawk.Emulation.Cores { - [Schema("Coleco")] + [Schema(VSystemID.Raw.Coleco)] // ReSharper disable once UnusedMember.Global public class ColecoSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/DualGBSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/DualGBSchema.cs index 99958aa6da..4bb2fa7bba 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/DualGBSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/DualGBSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("DGB")] + [Schema(VSystemID.Raw.DGB)] // ReSharper disable once UnusedMember.Global public class DualGbSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/GBASchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/GBASchema.cs index 861f029df8..8770bbc88a 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/GBASchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/GBASchema.cs @@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Nintendo.GBA; namespace BizHawk.Emulation.Cores { - [Schema("GBA")] + [Schema(VSystemID.Raw.GBA)] // ReSharper disable once UnusedMember.Global public class GbaSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs index 922301725c..8072f7586a 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/GBSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("GB")] + [Schema(VSystemID.Raw.GB)] // ReSharper disable once UnusedMember.Global public class GbSchema : IVirtualPadSchema { @@ -111,7 +111,7 @@ namespace BizHawk.Emulation.Cores } } - [Schema("GB3x")] + [Schema(VSystemID.Raw.GB3x)] public class Gb3XSchema : GbSchema { public override IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) @@ -123,7 +123,7 @@ namespace BizHawk.Emulation.Cores } } - [Schema("GB4x")] + [Schema(VSystemID.Raw.GB4x)] public class Gb4XSchema : GbSchema { public override IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/GGLSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/GGLSchema.cs index 12b70abb43..524cdcfa58 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/GGLSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/GGLSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("GGL")] + [Schema(VSystemID.Raw.GGL)] // ReSharper disable once UnusedMember.Global public class GGLSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/GenSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/GenSchema.cs index ca9d03bb10..5c24e52b5d 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/GenSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/GenSchema.cs @@ -9,7 +9,7 @@ using BizHawk.Emulation.Cores.Consoles.Sega.gpgx; namespace BizHawk.Emulation.Cores { - [Schema("GEN")] + [Schema(VSystemID.Raw.GEN)] // ReSharper disable once UnusedMember.Global public class GenSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/IntvSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/IntvSchema.cs index 7e97778ed2..94aaa6b6f6 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/IntvSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/IntvSchema.cs @@ -9,7 +9,7 @@ using BizHawk.Emulation.Cores.Intellivision; namespace BizHawk.Emulation.Cores { - [Schema("INTV")] + [Schema(VSystemID.Raw.INTV)] // ReSharper disable once UnusedMember.Global public class IntvSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/LynxSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/LynxSchema.cs index 81716d3e76..f82b281140 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/LynxSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/LynxSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("Lynx")] + [Schema(VSystemID.Raw.Lynx)] // ReSharper disable once UnusedMember.Global public class LynxSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs index 5ae774d06a..f0eef1a5c7 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs @@ -8,7 +8,7 @@ using BizHawk.Emulation.Cores.Nintendo.N64; namespace BizHawk.Emulation.Cores { - [Schema("N64")] + [Schema(VSystemID.Raw.N64)] // ReSharper disable once UnusedMember.Global public class N64Schema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/NdsSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/NdsSchema.cs index e4576b196f..ce2ba7ca9c 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/NdsSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/NdsSchema.cs @@ -5,7 +5,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("NDS")] + [Schema(VSystemID.Raw.NDS)] // ReSharper disable once UnusedMember.Global public class NdsSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs index 07541c0690..5080855395 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/NesSchema.cs @@ -10,7 +10,7 @@ using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; namespace BizHawk.Emulation.Cores { - [Schema("NES")] + [Schema(VSystemID.Raw.NES)] // ReSharper disable once UnusedMember.Global public class NesSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/NgpSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/NgpSchema.cs index 048b032a3c..7dba1f4459 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/NgpSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/NgpSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("NGP")] + [Schema(VSystemID.Raw.NGP)] // ReSharper disable once UnusedMember.Global public class NgpSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs index d417ff6049..70919a6296 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/O2Schema.cs @@ -5,7 +5,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("O2")] + [Schema(VSystemID.Raw.O2)] // ReSharper disable once UnusedMember.Global public class O2Schema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/PSXSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/PSXSchema.cs index 503fa0a6f9..b68b609983 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/PSXSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/PSXSchema.cs @@ -8,7 +8,7 @@ using BizHawk.Emulation.Cores.Sony.PSX; namespace BizHawk.Emulation.Cores { - [Schema("PSX")] + [Schema(VSystemID.Raw.PSX)] // ReSharper disable once UnusedMember.Global public class PsxSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs index 0d129db0a0..e2c983657f 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/PceSchema.cs @@ -10,15 +10,15 @@ using BizHawk.Emulation.Cores.Waterbox; namespace BizHawk.Emulation.Cores { - [Schema("PCECD")] + [Schema(VSystemID.Raw.PCECD)] // ReSharper disable once UnusedMember.Global public class PceCdSchema : PceSchema { } - [Schema("SGX")] + [Schema(VSystemID.Raw.SGX)] // ReSharper disable once UnusedMember.Global public class SgxSchema : PceSchema { } - [Schema("PCE")] + [Schema(VSystemID.Raw.PCE)] public class PceSchema : IVirtualPadSchema { public virtual IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs index 964a9d5887..38878abdcf 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/PcfxSchema.cs @@ -9,7 +9,7 @@ using BizHawk.Emulation.Cores.Waterbox; namespace BizHawk.Emulation.Cores { - [Schema("PCFX")] + [Schema(VSystemID.Raw.PCFX)] // ReSharper disable once UnusedMember.Global public class PcfxSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/SGBSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/SGBSchema.cs index 77bffb1e95..35ffd65b24 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/SGBSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/SGBSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("SGB")] + [Schema(VSystemID.Raw.SGB)] // ReSharper disable once UnusedMember.Global public class SgbSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs index b3a0698644..a6e2a6925d 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/SaturnSchema.cs @@ -9,7 +9,7 @@ using BizHawk.Emulation.Cores.Waterbox; namespace BizHawk.Emulation.Cores { - [Schema("SAT")] + [Schema(VSystemID.Raw.SAT)] // ReSharper disable once UnusedMember.Global public class SaturnSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs index 97fdaf178d..8753ab6294 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs @@ -9,7 +9,7 @@ using BizHawk.Emulation.Cores.Sega.MasterSystem; namespace BizHawk.Emulation.Cores { - [Schema("GG")] + [Schema(VSystemID.Raw.GG)] public class GameGearSchema : IVirtualPadSchema { public IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) @@ -57,10 +57,10 @@ namespace BizHawk.Emulation.Cores } } - [Schema("SG")] + [Schema(VSystemID.Raw.SG)] public class SG1000Schema : SMSSchema { } // are these really the same controller layouts? --yoshi - [Schema("SMS")] + [Schema(VSystemID.Raw.SMS)] public class SMSSchema : IVirtualPadSchema { private static string StandardControllerName => typeof(SmsController).DisplayName(); diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/SnesSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/SnesSchema.cs index 9f6a5321f1..b823caa268 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/SnesSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/SnesSchema.cs @@ -10,7 +10,7 @@ using BizHawk.Emulation.Cores.Waterbox; namespace BizHawk.Emulation.Cores { - [Schema("SNES")] + [Schema(VSystemID.Raw.SNES)] // ReSharper disable once UnusedMember.Global public class SnesSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs index 72778e60db..536ed66823 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/VECSchema.cs @@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Consoles.Vectrex; namespace BizHawk.Emulation.Cores { - [Schema("VEC")] + [Schema(VSystemID.Raw.VEC)] // ReSharper disable once UnusedMember.Global public class VecSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/VirtualBoySchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/VirtualBoySchema.cs index e9c26415bd..7b96abf959 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/VirtualBoySchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/VirtualBoySchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("VB")] + [Schema(VSystemID.Raw.VB)] // ReSharper disable once UnusedMember.Global public class VirtualBoySchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/WonderSwanSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/WonderSwanSchema.cs index 5443f63b6a..a82f71a281 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/WonderSwanSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/WonderSwanSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("WSWAN")] + [Schema(VSystemID.Raw.WSWAN)] // ReSharper disable once UnusedMember.Global public class WonderSwanSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs index 68fb83de28..6cbc24de5d 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/ZXSpectrumSchema.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores { - [Schema("ZXSpectrum")] + [Schema(VSystemID.Raw.ZXSpectrum)] // ReSharper disable once UnusedMember.Global internal class ZxSpectrumSchema : IVirtualPadSchema { diff --git a/src/BizHawk.Tests/Client.Common/cheats/CheatDecoderTests.cs b/src/BizHawk.Tests/Client.Common/cheats/CheatDecoderTests.cs index bb9fc87d0f..16ce11f286 100644 --- a/src/BizHawk.Tests/Client.Common/cheats/CheatDecoderTests.cs +++ b/src/BizHawk.Tests/Client.Common/cheats/CheatDecoderTests.cs @@ -7,6 +7,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using BizHawk.Client.Common; using BizHawk.Client.Common.cheats; +using BizHawk.Emulation.Common; namespace BizHawk.Tests.Client.Common.cheats { @@ -40,13 +41,13 @@ namespace BizHawk.Tests.Client.Common.cheats private static readonly IEnumerable NonsenseData = new[] { - new[] { "GBA", "33003D0E0020", ERROR_GBA_CODEBREAKER }, + new[] { VSystemID.Raw.GBA, "33003D0E0020", ERROR_GBA_CODEBREAKER }, }; private static readonly IEnumerable RealData = new[] { - new object?[] { "GBA", "4012F5B7 3B7801A6", 0x00000006, 0xB7, NO_COMPARE, WatchSize.Byte }, - new object?[] { "GBA", "686D7FC3 24B5B832", 0x00000032, 0x7FC3, NO_COMPARE, WatchSize.Word }, + new object?[] { VSystemID.Raw.GBA, "4012F5B7 3B7801A6", 0x00000006, 0xB7, NO_COMPARE, WatchSize.Byte }, + new object?[] { VSystemID.Raw.GBA, "686D7FC3 24B5B832", 0x00000032, 0x7FC3, NO_COMPARE, WatchSize.Word }, }; [DataTestMethod]