Revert c18298c8a5 and reimplement it, also connecting profiles

Part of the reason no one uses Bizhawk is because we make changes like c18298c8a5 without considering the needs of all users.
This commit is contained in:
nattthebear 2020-05-27 13:11:44 -04:00
parent da844c8eee
commit 684fca66c5
3 changed files with 32 additions and 5 deletions

View File

@ -9,6 +9,7 @@ using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
using BizHawk.Emulation.Cores.Sega.MasterSystem;
using BizHawk.Emulation.Cores.ColecoVision;
using BizHawk.Emulation.Cores.Atari.Atari2600;
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
namespace BizHawk.Client.EmuHawk
{
@ -139,6 +140,14 @@ namespace BizHawk.Client.EmuHawk
// NES
_config.PreferredCores["NES"] = CoreNames.QuickNes;
// GB
{
var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>();
s.EnableBIOS = false;
// TODO: Do we want to set anything else here?
PutSyncSettings<Gameboy>(s);
}
}
private void SetLongPlay()
@ -206,6 +215,14 @@ namespace BizHawk.Client.EmuHawk
// NES
_config.PreferredCores["NES"] = CoreNames.NesHawk;
// GB
{
var s = GetSyncSettings<Gameboy, Gameboy.GambatteSyncSettings>();
s.EnableBIOS = true;
// TODO: Do we want to set anything else here?
PutSyncSettings<Gameboy>(s);
}
}
private void SetN64Tas()

View File

@ -88,6 +88,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public class GambatteSyncSettings
{
[DisplayName("Enable BIOS: WARNING: File must exist!")]
[Description("Boots game using system BIOS. Should be used for TASing")]
[DefaultValue(false)]
public bool EnableBIOS { get; set; }
public enum ConsoleModeType
{
Auto,

View File

@ -83,21 +83,26 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
throw new InvalidOperationException($"{nameof(LibGambatte.gambatte_load)}() returned non-zero (is this not a gb or gbc rom?)");
}
byte[] Bios;
string biosName;
if ((flags & LibGambatte.LoadFlags.FORCE_DMG) == LibGambatte.LoadFlags.FORCE_DMG)
{
Bios = comm.CoreFileProvider.GetFirmware("GB", "World", true, "BIOS Not Found, Cannot Load");
biosName = "GB";
IsCgb = false;
}
else
{
Bios = comm.CoreFileProvider.GetFirmware("GBC", "World", true, "BIOS Not Found, Cannot Load");
biosName = "GBC";
IsCgb = true;
}
if (LibGambatte.gambatte_loadbios(GambatteState, Bios, (uint)Bios.Length) != 0)
if (_syncSettings.EnableBIOS)
{
throw new InvalidOperationException($"{nameof(LibGambatte.gambatte_loadbios)}() returned non-zero (bios error)");
byte[] Bios;
Bios = comm.CoreFileProvider.GetFirmware(biosName, "World", true, "BIOS Not Found, Cannot Load. Change SyncSettings to run without BIOS.");
if (LibGambatte.gambatte_loadbios(GambatteState, Bios, (uint)Bios.Length) != 0)
{
throw new InvalidOperationException($"{nameof(LibGambatte.gambatte_loadbios)}() returned non-zero (bios error)");
}
}
// set real default colors (before anyone mucks with them at all)