Fix SMSHawk's system ID (#2650)

This commit is contained in:
James Groom 2021-03-10 11:18:25 +10:00 committed by GitHub
parent d524da3530
commit 43ba7f94dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 31 deletions

View File

@ -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",

View File

@ -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;

View File

@ -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;

View File

@ -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<IVideoProvider>(Vdp);
PSG = new SN76489sms();

View File

@ -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<PadSchema> GetPadSchemas(IEmulator core, Action<string> 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<ButtonSchema> StandardButtons(int controller, bool isSms)
public static IEnumerable<ButtonSchema> 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<ButtonSchema> ConsoleButtons(bool isSms)
public static IEnumerable<ButtonSchema> 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<PadSchema> GetPadSchemas(IEmulator core, Action<string> 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<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox)
{
yield return SmsSchemaControls.StandardController(1, true);
yield return SmsSchemaControls.StandardController(2, true);
yield return SmsSchemaControls.Console(true);
}
}
}