GBHawk: Initialization fixes

This commit is contained in:
alyosha-tas 2017-11-19 15:16:15 -05:00
parent bc425ba44c
commit a3ae61f03f
3 changed files with 14 additions and 10 deletions
BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk

View File

@ -11,8 +11,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
"GBHawk",
"",
isPorted: false,
isReleased: true)]
[ServiceNotApplicable(typeof(ISettable<,>), typeof(IDriveLight))]
isReleased: false)]
[ServiceNotApplicable(typeof(IDriveLight))]
public partial class GBHawk : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable,
ISettable<GBHawk.GBSettings, GBHawk.GBSyncSettings>
{
@ -87,6 +87,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
_controllerDeck = new GBHawkControllerDeck(_syncSettings.Port1);
byte[] Bios = comm.CoreFileProvider.GetFirmware("GB", "World", false, "BIOS Not Found, Cannot Load");
if (Bios == null)
{
throw new MissingFirmwareException("Missing Gamboy Bios");
}
_bios = Bios;
Buffer.BlockCopy(rom, 0x100, header, 0, 0x50);
@ -108,6 +114,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
ser.Register<ISoundProvider>(audio);
ServiceProvider = ser;
_settings = (GBSettings)settings ?? new GBSettings();
_syncSettings = (GBSyncSettings)syncSettings ?? new GBSyncSettings();
_tracer = new TraceBuffer { Header = cpu.TraceHeader };
ser.Register<ITraceable>(_tracer);

View File

@ -23,11 +23,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
{
Name = Port1.Definition.Name,
BoolButtons = Port1.Definition.BoolButtons
.Concat(new[]
{
"Power",
"Reset",
})
.ToList()
};

View File

@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
int PortNum { get; }
}
[DisplayName("Standard controls")]
[DisplayName("Gameboy Controller")]
public class StandardControls : IPort
{
public StandardControls(int portNum)
@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
PortNum = portNum;
Definition = new ControllerDefinition
{
Name = "Game Boy",
Name = "Gameboy Controller",
BoolButtons = BaseDefinition
.Select(b => "P" + PortNum + " " + b)
.ToList()
@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
private static readonly string[] BaseDefinition =
{
"Right", "Left", "Up", "Down", "A", "B", "Select", "Start"
"Up", "Down", "Left", "Right", "Start", "Select", "B", "A", "Power"
};
public void SyncState(Serializer ser)