diff --git a/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs b/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs index da792e127d..fd015e2ac5 100644 --- a/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs +++ b/src/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs @@ -53,9 +53,8 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions "NULL" => string.Empty, "NES" => "NES", "INTV" => "Intellivision", + "GG" => "Game Gear", "SG" => "SG-1000", - "SMS" when emulator is SMS { IsGameGear: true } => "Game Gear", - "SMS" when emulator is SMS { IsSG1000: true } => "SG-1000", "SMS" => "Sega Master System", "PCECD" => "TurboGrafx - 16(CD)", "PCE" => "TurboGrafx-16", diff --git a/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index ccf838677a..1a6f8cc392 100644 --- a/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/src/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -408,12 +408,6 @@ namespace BizHawk.Client.EmuHawk } break; case HeaderKeys.Platform: - // feos: previously it was compared against _game.System, but when the movie is created - // its platform is copied from _emulator.SystemId, see PopulateWithDefaultHeaderValues() - // the problem is that for GameGear and SG100, those mismatch, resulting in false positive here - // I have a patch to make GG and SG appear as platforms in movie header (issue #1246) - // but even with it, for all the old movies, this false positive would have to be worked around anyway - // TODO: actually check header flags like "IsGGMode" and "IsSegaCDMode" (those are never parsed by BizHawk) if (kvp.Value != _emulator.SystemId) { item.BackColor = Color.Pink; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs index cf1027e99b..d317ffb423 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.IEmulator.cs @@ -160,7 +160,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem public int Frame => _frame; - public string SystemId => "SMS"; + public string SystemId { get; } public bool DeterministicEmulation => true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index 46a1a2e490..232b28dbd9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -101,6 +101,8 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem Console.WriteLine("Using SMS Compatibility mode for Game Gear System"); } + SystemId = game.System; + Vdp = new VDP(this, Cpu, IsGameGear ? VdpMode.GameGear : VdpMode.SMS, Region); ser.Register(Vdp); PSG = new SN76489sms(); diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs index 824bc1a2ec..e8d05942dd 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/SmsSchema.cs @@ -6,26 +6,9 @@ using BizHawk.Emulation.Cores.Sega.MasterSystem; namespace BizHawk.Emulation.Cores { - [Schema("SMS")] - // ReSharper disable once UnusedMember.Global - public class SmsSchema : IVirtualPadSchema + internal abstract class SmsSchemaControls { - public IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) - { - if (((SMS)core).IsGameGear) - { - yield return StandardController(1, false); - yield return Console(false); - } - else - { - yield return StandardController(1, true); - yield return StandardController(2, true); - yield return Console(true); - } - } - - private static PadSchema StandardController(int controller, bool isSms) + public static PadSchema StandardController(int controller, bool isSms) { return new PadSchema { @@ -34,7 +17,7 @@ namespace BizHawk.Emulation.Cores }; } - private static IEnumerable StandardButtons(int controller, bool isSms) + public static IEnumerable StandardButtons(int controller, bool isSms) { yield return ButtonSchema.Up(14, 12, controller); @@ -49,7 +32,7 @@ namespace BizHawk.Emulation.Cores } } - private static PadSchema Console(bool isSms) + public static PadSchema Console(bool isSms) { return new ConsoleSchema { @@ -58,7 +41,7 @@ namespace BizHawk.Emulation.Cores }; } - private static IEnumerable ConsoleButtons(bool isSms) + public static IEnumerable ConsoleButtons(bool isSms) { yield return new ButtonSchema(10, 15, "Reset"); if (isSms) @@ -67,4 +50,28 @@ namespace BizHawk.Emulation.Cores } } } + + [Schema("GG")] + public class GameGearSchema : IVirtualPadSchema + { + public IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) + { + yield return SmsSchemaControls.StandardController(1, false); + yield return SmsSchemaControls.Console(false); + } + } + + [Schema("SG")] + public class SG1000Schema : SMSSchema {} // are these really the same controller layouts? --yoshi + + [Schema("SMS")] + public class SMSSchema : IVirtualPadSchema + { + public IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) + { + yield return SmsSchemaControls.StandardController(1, true); + yield return SmsSchemaControls.StandardController(2, true); + yield return SmsSchemaControls.Console(true); + } + } }