From 4cf30f4592e6bb994739a8d1503913782d6ae8e6 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Mon, 8 Jun 2020 08:06:42 +1000 Subject: [PATCH] Fix ClientApi.RunningSystem when using new PCE cores (fixes #2109) --- src/BizHawk.Client.EmuHawk/Api/ClientApi.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/Api/ClientApi.cs b/src/BizHawk.Client.EmuHawk/Api/ClientApi.cs index 2f99c59ee3..1370f26c1a 100644 --- a/src/BizHawk.Client.EmuHawk/Api/ClientApi.cs +++ b/src/BizHawk.Client.EmuHawk/Api/ClientApi.cs @@ -420,14 +420,16 @@ namespace BizHawk.Client.EmuHawk { switch (GlobalWin.Emulator.SystemId) { - case "PCE": - return ((PCEngine) GlobalWin.Emulator).Type switch + case "PCE" when GlobalWin.Emulator is PCEngine pceHawk: + return pceHawk.Type switch { NecSystemType.TurboGrafx => SystemInfo.PCE, NecSystemType.TurboCD => SystemInfo.PCECD, NecSystemType.SuperGrafx => SystemInfo.SGX, _ => throw new ArgumentOutOfRangeException() }; + case "PCE": + return SystemInfo.PCE; // not always accurate, but anyone wanting accuracy has probably figured out how to use IEmu.GetSystemId() case "SMS": var sms = (SMS) GlobalWin.Emulator; return sms.IsSG1000