From fece6cf7c4e0ad8042032ad2559967db5087730a Mon Sep 17 00:00:00 2001
From: YoshiRulz <OSSYoshiRulz@gmail.com>
Date: Thu, 25 Feb 2021 16:17:56 +1000
Subject: [PATCH] Cleanup system IDs (see desc.)

* `Game Gear` was used instead of `GGL` for linked GG multi-disk bundles and
core constructor (I assume the latter was a hack to fix loading bundles made
with the former bug in effect)
* `Arcade` was used instead of `MAME` in rom loading ("Arcade" is also assigned
to an out param in the MAME ctor but I assume that's an intentional placeholder)
* `Saturn` was used instead of `SAT` in `GameSharkDecoder.CheatDomainName`,
making it non-functional (a comment said it was probably incorrect, so I'm
assuming that if it runs something will break and putting it in #if false)
* `G7400` was only used in firmware IDs, replaced with `O2`
* `Vectrex` was only used in firmware IDs, replaced with `VEC`
* `uzem` (core name) was used instead of `UZE` for MainForm title lookup, making
it non-functional
* `DNGP` doesn't exist
---
 .../Api/BizHawkSystemIdToCoreSystemEnumConverter.cs       | 1 -
 src/BizHawk.Client.Common/RomLoader.cs                    | 2 +-
 src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs      | 4 +++-
 src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs   | 2 +-
 src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs      | 5 ++---
 .../tools/MultiDiskBundler/MultiDiskBundler.Designer.cs   | 2 +-
 .../tools/MultiDiskBundler/MultiDiskBundler.cs            | 2 +-
 src/BizHawk.Emulation.Common/Database/Database.cs         | 2 +-
 src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs | 8 ++++----
 .../Consoles/GCE/Vectrex/VectrexHawk.cs                   | 4 ++--
 .../Consoles/Magnavox/Odyssey2/O2Hawk.cs                  | 4 ++--
 .../Consoles/Sega/GGHawkLink/GGHawkLink.cs                | 3 +--
 12 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs b/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs
index 6a6565cccb..28207b3f54 100644
--- a/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs
+++ b/src/BizHawk.Client.Common/Api/BizHawkSystemIdToCoreSystemEnumConverter.cs
@@ -62,7 +62,6 @@ namespace BizHawk.Client.Common
 				"MSX" => CoreSystem.MSX,
 				"VB" => CoreSystem.VirtualBoy,
 				"NGP" => CoreSystem.NeoGeoPocket,
-				"DNGP" => CoreSystem.NeoGeoPocket,
 				"SGB" => CoreSystem.SuperGameBoy,
 				"UZE" => CoreSystem.UzeBox,
 				"PCFX" => CoreSystem.PcFx,
diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs
index fdb5e6d251..2ad6908c8a 100644
--- a/src/BizHawk.Client.Common/RomLoader.cs
+++ b/src/BizHawk.Client.Common/RomLoader.cs
@@ -460,7 +460,7 @@ namespace BizHawk.Client.Common
 						game.System = "SGB";
 					}
 					break;
-				case "Arcade":
+				case "MAME":
 					nextEmulator = new MAME(
 						file.Directory,
 						file.CanonicalName,
diff --git a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs
index ddda6f1698..2ba60bc803 100644
--- a/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs
+++ b/src/BizHawk.Client.Common/cheats/GameSharkDecoder.cs
@@ -42,7 +42,9 @@ namespace BizHawk.Client.Common.cheats
 		{
 			"N64" => "RDRAM",
 			"PSX" => "MainRAM",
-			"Saturn" => "Work Ram High", // Work RAM High may be incorrect?
+#if false
+			"SAT" => "Work Ram High", // Work RAM High may be incorrect?
+#endif
 			_ => null
 
 		};
diff --git a/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs b/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs
index 0eb3b8cfce..da792e127d 100644
--- a/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs
+++ b/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs
@@ -91,7 +91,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions
 			"ChannelF" => "Channel F",
 			"O2" => "Odyssey2",
 			"MAME" => "MAME",
-			"uzem" => "uzem",
+			"UZE" => "uzem",
 			"PCFX" => "PCFX",
 			_ => string.Empty
 		};
diff --git a/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs b/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs
index 0e78da8639..357e834525 100644
--- a/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs
+++ b/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.cs
@@ -58,7 +58,7 @@ namespace BizHawk.Client.EmuHawk
 			["PSX"] = "PlayStation",
 			["Lynx"] = "Lynx",
 			["AppleII"] = "Apple II",
-			["O2"] = "Odyssey 2",
+			["O2"] = "Odyssey 2 / Philips Videopac+ G7400",
 			["GB"] = "Game Boy",
 			["GBC"] = "Game Boy Color",
 			["PCFX"] = "PC-FX",
@@ -66,9 +66,8 @@ namespace BizHawk.Client.EmuHawk
 			["ZXSpectrum"] = "ZX Spectrum",
 			["AmstradCPC"] = "Amstrad CPC",
 			["ChannelF"] = "Channel F",
-			["Vectrex"] = "Vectrex",
+			["VEC"] = "Vectrex",
 			["MSX"] = "MSX",
-			["G7400"] = "Philips Videopac+ G7400",
 			["PS2"] = "Sony PlayStation 2",
 		};
 
diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs
index 3bb09725d9..ff158b3a9f 100644
--- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs
+++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs
@@ -149,7 +149,7 @@
             "SAT",
             "ZXSpectrum",
             "AmstradCPC",
-            "Game Gear"});
+            "GGL"});
 			this.SystemDropDown.Location = new System.Drawing.Point(405, 75);
 			this.SystemDropDown.Name = "SystemDropDown";
 			this.SystemDropDown.Size = new System.Drawing.Size(89, 21);
diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs
index 1a00d10eb4..efb72d76cd 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 = "Game Gear";
+					SystemDropDown.SelectedItem = "GGL";
 				}
 
 				FileSelectors.First().Path = MainForm.CurrentlyOpenRom;
diff --git a/src/BizHawk.Emulation.Common/Database/Database.cs b/src/BizHawk.Emulation.Common/Database/Database.cs
index 6cbf49d36d..0806878674 100644
--- a/src/BizHawk.Emulation.Common/Database/Database.cs
+++ b/src/BizHawk.Emulation.Common/Database/Database.cs
@@ -382,7 +382,7 @@ namespace BizHawk.Emulation.Common
 				// 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 = "Arcade";
+					game.System = "MAME";
 					break;
 			}
 
diff --git a/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs b/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs
index 2b794e94a3..7138f62a05 100644
--- a/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs
+++ b/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs
@@ -79,8 +79,8 @@ namespace BizHawk.Emulation.Common
 
 			FirmwareAndOption("45BEDC4CBDEAC66C7DF59E9E599195C778D86A92", 8192, "Coleco", "Bios", "Coleco_Bios.bin", "Bios");
 
-			FirmwareAndOption("B9BBF5BB0EAC52D039A4A993A2D8064B862C9E28", 4096, "Vectrex", "Bios", "Vectrex_Bios.bin", "Bios");
-			FirmwareAndOption("65D07426B520DDD3115D40F255511E0FD2E20AE7", 8192, "Vectrex", "Minestorm", "Vectrex_Minestorm.vec", "Game");
+			FirmwareAndOption("B9BBF5BB0EAC52D039A4A993A2D8064B862C9E28", 4096, "VEC", "Bios", "Vectrex_Bios.bin", "Bios");
+			FirmwareAndOption("65D07426B520DDD3115D40F255511E0FD2E20AE7", 8192, "VEC", "Minestorm", "Vectrex_Minestorm.vec", "Game");
 
 			var gbaNormal = File("300C20DF6731A33952DED8C436F7F186D25D3492", 16384, "GBA_bios.rom", "Bios (World)");
 			var gbaJDebug = File("AA98A2AD32B86106340665D1222D7D973A1361C7", 16384, "GBA_bios_Debug-(J).rom", "Bios (J Debug)");
@@ -281,9 +281,9 @@ namespace BizHawk.Emulation.Common
 			var appleII_DiskII = File("D4181C9F046AAFC3FB326B381BAAC809D9E38D16", 256, "AppleIIe_DiskII.rom", "Disk II");
 			Option("AppleII", "DiskII", in appleII_DiskII);
 
-			FirmwareAndOption("B2E1955D957A475DE2411770452EFF4EA19F4CEE", 1024, "O2", "BIOS", "O2_Odyssey2.bin", "Odyssey 2 Bios");
+			FirmwareAndOption("B2E1955D957A475DE2411770452EFF4EA19F4CEE", 1024, "O2", "BIOS-O2", "O2_Odyssey2.bin", "Odyssey 2 Bios");
 			FirmwareAndOption("A6120AED50831C9C0D95DBDF707820F601D9452E", 1024, "O2", "BIOS-C52", "O2_PhillipsC52.bin", "Phillips C52 Bios");
-			FirmwareAndOption("5130243429B40B01A14E1304D0394B8459A6FBAE", 1024, "G7400", "BIOS", "G7400_bios.bin", "G7400 Bios");
+			FirmwareAndOption("5130243429B40B01A14E1304D0394B8459A6FBAE", 1024, "O2", "BIOS-G7400", "G7400_bios.bin", "G7400 Bios");
 
 			Firmware("GB", "World", "Game Boy Boot Rom");
 			Option("GB", "World", File("4ED31EC6B0B175BB109C0EB5FD3D193DA823339F", 256, "dmg.bin", "Game Boy Boot Rom"), FirmwareOptionStatus.Ideal);
diff --git a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs
index 9c17d5bda2..e3564a7583 100644
--- a/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs
+++ b/src/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs
@@ -57,10 +57,10 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
 			byte[] Bios = null;
 			byte[] Mine = null;
 
-			Bios = comm.CoreFileProvider.GetFirmware("Vectrex", "Bios", true, "BIOS Not Found, Cannot Load");
+			Bios = comm.CoreFileProvider.GetFirmware("VEC", "Bios", true, "BIOS Not Found, Cannot Load");
 			_bios = Bios;
 
-			Mine = comm.CoreFileProvider.GetFirmware("Vectrex", "Minestorm", true, "Minestorm Not Found, Cannot Load");
+			Mine = comm.CoreFileProvider.GetFirmware("VEC", "Minestorm", true, "Minestorm Not Found, Cannot Load");
 			minestorm = Mine;
 
 			Console.WriteLine("SHA1:" + rom.HashSHA1(0, rom.Length));
diff --git a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs
index b8fbc20c1d..c432d1cff3 100644
--- a/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs
+++ b/src/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs
@@ -70,12 +70,12 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
 
 			if (is_G7400)
 			{
-				_bios = comm.CoreFileProvider.GetFirmware("G7400", "BIOS", true, "BIOS Not Found, Cannot Load")
+				_bios = comm.CoreFileProvider.GetFirmware("O2", "BIOS-G7400", true, "BIOS Not Found, Cannot Load")
 				?? throw new MissingFirmwareException("Missing G7400 Bios");
 			}
 			else
 			{
-				_bios = comm.CoreFileProvider.GetFirmware("O2", "BIOS", true, "BIOS Not Found, Cannot Load")
+				_bios = comm.CoreFileProvider.GetFirmware("O2", "BIOS-O2", true, "BIOS Not Found, Cannot Load")
 				?? throw new MissingFirmwareException("Missing Odyssey2 Bios");
 			}
 			
diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs
index 82bb60a7de..ea61e409cf 100644
--- a/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs
+++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/GGHawkLink/GGHawkLink.cs
@@ -26,8 +26,7 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
 
 		private bool do_r_next = false;
 
-		// TODO: Are there really xml games in the wild with this SystemId?
-		[CoreConstructor("Game Gear")]
+		[CoreConstructor("GGL")]
 		public GGHawkLink(CoreLoadParameters<GGLinkSettings, GGLinkSyncSettings> lp)
 		{
 			if (lp.Roms.Count != 2)