Refactor 32x loading

less code is good good
This commit is contained in:
nattthebear 2020-07-11 20:38:09 -04:00
parent 502aef73a0
commit 467f0aff2b
2 changed files with 7 additions and 7 deletions

View File

@ -568,9 +568,6 @@ namespace BizHawk.Client.Common
case "GEN": case "GEN":
core = CoreInventory.Instance["GEN", game.ForcedCore?.ToLower() == "pico" ? CoreNames.PicoDrive : CoreNames.Gpgx]; core = CoreInventory.Instance["GEN", game.ForcedCore?.ToLower() == "pico" ? CoreNames.PicoDrive : CoreNames.Gpgx];
break; break;
case "32X":
core = CoreInventory.Instance["GEN", CoreNames.PicoDrive];
break;
default: default:
core = _config.PreferredCores.TryGetValue(game.System, out var coreName) core = _config.PreferredCores.TryGetValue(game.System, out var coreName)
? CoreInventory.Instance[game.System, coreName] ? CoreInventory.Instance[game.System, coreName]
@ -916,7 +913,8 @@ namespace BizHawk.Client.Common
LoadM3U(path, nextComm, file, out nextEmulator, out game); LoadM3U(path, nextComm, file, out nextEmulator, out game);
break; break;
case ".xml": 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; break;
case ".psf": case ".psf":
case ".minipsf": case ".minipsf":
@ -925,8 +923,10 @@ namespace BizHawk.Client.Common
default: default:
if (Disc.IsValidExtension(ext)) if (Disc.IsValidExtension(ext))
{ {
if (file.IsArchive) throw new InvalidOperationException("Can't load CD files from archives!"); if (file.IsArchive)
if (!LoadDisc(path, nextComm, file, ext, out nextEmulator, out game)) return false; throw new InvalidOperationException("Can't load CD files from archives!");
if (!LoadDisc(path, nextComm, file, ext, out nextEmulator, out game))
return false;
} }
else else
{ {

View File

@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive
private DiscSectorReader _cdReader; private DiscSectorReader _cdReader;
private bool _isPal; private bool _isPal;
[CoreConstructor("GEN")] [CoreConstructor(new[] { "GEN", "32X" })]
public PicoDrive(CoreComm comm, GameInfo game, byte[] rom, bool deterministic, SyncSettings syncSettings) public PicoDrive(CoreComm comm, GameInfo game, byte[] rom, bool deterministic, SyncSettings syncSettings)
: this(comm, game, rom, null, deterministic, syncSettings) : this(comm, game, rom, null, deterministic, syncSettings)
{ } { }