From 467f0aff2b485c028cb222059f3210d464c007e0 Mon Sep 17 00:00:00 2001 From: nattthebear Date: Sat, 11 Jul 2020 20:38:09 -0400 Subject: [PATCH] Refactor 32x loading less code is good good --- src/BizHawk.Client.Common/RomLoader.cs | 12 ++++++------ .../Consoles/Sega/PicoDrive/PicoDrive.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 6407da9591..9602c8826f 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -568,9 +568,6 @@ namespace BizHawk.Client.Common case "GEN": core = CoreInventory.Instance["GEN", game.ForcedCore?.ToLower() == "pico" ? CoreNames.PicoDrive : CoreNames.Gpgx]; break; - case "32X": - core = CoreInventory.Instance["GEN", CoreNames.PicoDrive]; - break; default: core = _config.PreferredCores.TryGetValue(game.System, out var coreName) ? CoreInventory.Instance[game.System, coreName] @@ -916,7 +913,8 @@ namespace BizHawk.Client.Common LoadM3U(path, nextComm, file, out nextEmulator, out game); break; case ".xml": - if (!LoadXML(path, nextComm, file, out nextEmulator, out rom, out game)) return false; + if (!LoadXML(path, nextComm, file, out nextEmulator, out rom, out game)) + return false; break; case ".psf": case ".minipsf": @@ -925,8 +923,10 @@ namespace BizHawk.Client.Common default: if (Disc.IsValidExtension(ext)) { - if (file.IsArchive) throw new InvalidOperationException("Can't load CD files from archives!"); - if (!LoadDisc(path, nextComm, file, ext, out nextEmulator, out game)) return false; + if (file.IsArchive) + throw new InvalidOperationException("Can't load CD files from archives!"); + if (!LoadDisc(path, nextComm, file, ext, out nextEmulator, out game)) + return false; } else { diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs index 2559b0edfb..1ba258f1ed 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive private DiscSectorReader _cdReader; private bool _isPal; - [CoreConstructor("GEN")] + [CoreConstructor(new[] { "GEN", "32X" })] public PicoDrive(CoreComm comm, GameInfo game, byte[] rom, bool deterministic, SyncSettings syncSettings) : this(comm, game, rom, null, deterministic, syncSettings) { }