GBHawk: Add core picker

This commit is contained in:
alyosha-tas 2017-11-19 10:17:23 -05:00
parent 821953348a
commit 8e1ba79e0a
4 changed files with 84 additions and 12 deletions

View File

@ -936,7 +936,31 @@ namespace BizHawk.Client.Common
break;
case "GB":
core = CoreInventory.Instance["GB", "GBHawk"];
if (!Global.Config.GB_AsSGB)
{
if (Global.Config.GB_UseGBHawk)
{
core = CoreInventory.Instance["GB", "GBHawk"];
}
else
{
core = CoreInventory.Instance["GB", "Gambatte"];
}
}
else
{
if (Global.Config.SGB_UseBsnes)
{
game.System = "SNES";
game.AddOption("SGB");
var snes = new LibsnesCore(game, rom.FileData, null, nextComm, GetCoreSettings<LibsnesCore>(), GetCoreSyncSettings<LibsnesCore>());
nextEmulator = snes;
}
else
{
core = CoreInventory.Instance["SGB", "SameBoy"];
}
}
break;
case "GBC":
if (!Global.Config.GB_AsSGB)

View File

@ -557,6 +557,7 @@ namespace BizHawk.Client.Common
public bool SNES_InSnes9x = true;
public bool GBA_UsemGBA = true;
public bool SGB_UseBsnes = false;
public bool GB_UseGBHawk = false;
public bool CoreForcingViaGameDB = true;
public string LibretroCore;
}

View File

@ -194,9 +194,12 @@
this.MgbaCoreMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Atari7800HawkCoreMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SGBCoreSubmenu = new System.Windows.Forms.ToolStripMenuItem();
this.SgbBsnesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SgbBsnesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SgbSameBoyMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.GBInSGBMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.GBCoreSubmenu = new System.Windows.Forms.ToolStripMenuItem();
this.GBGambatteMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.GBGBHawkMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.GBInSGBMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator();
this.allowGameDBCoreOverridesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
@ -1810,7 +1813,8 @@
this.CoreSNESSubMenu,
this.GbaCoreSubMenu,
this.SGBCoreSubmenu,
this.GBInSGBMenuItem,
this.GBCoreSubmenu,
this.GBInSGBMenuItem,
this.toolStripMenuItem16,
this.allowGameDBCoreOverridesToolStripMenuItem,
this.toolStripSeparator8,
@ -1908,10 +1912,20 @@
this.SGBCoreSubmenu.Size = new System.Drawing.Size(239, 22);
this.SGBCoreSubmenu.Text = "SGB";
this.SGBCoreSubmenu.DropDownOpened += new System.EventHandler(this.SGBCoreSubmenu_DropDownOpened);
//
// SgbBsnesMenuItem
//
this.SgbBsnesMenuItem.Name = "SgbBsnesMenuItem";
//
// GBCoreSubmenu
//
this.GBCoreSubmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.GBGambatteMenuItem,
this.GBGBHawkMenuItem});
this.GBCoreSubmenu.Name = "GBCoreSubmenu";
this.GBCoreSubmenu.Size = new System.Drawing.Size(239, 22);
this.GBCoreSubmenu.Text = "GB";
this.GBCoreSubmenu.DropDownOpened += new System.EventHandler(this.GBCoreSubmenu_DropDownOpened);
//
// SgbBsnesMenuItem
//
this.SgbBsnesMenuItem.Name = "SgbBsnesMenuItem";
this.SgbBsnesMenuItem.Size = new System.Drawing.Size(152, 22);
this.SgbBsnesMenuItem.Text = "BSNES";
this.SgbBsnesMenuItem.Click += new System.EventHandler(this.SgbCorePick_Click);
@ -1922,10 +1936,24 @@
this.SgbSameBoyMenuItem.Size = new System.Drawing.Size(152, 22);
this.SgbSameBoyMenuItem.Text = "SameBoy";
this.SgbSameBoyMenuItem.Click += new System.EventHandler(this.SgbCorePick_Click);
//
// GBInSGBMenuItem
//
this.GBInSGBMenuItem.Name = "GBInSGBMenuItem";
//
// GBGambatteMenuItem
//
this.GBGambatteMenuItem.Name = "GBGambatteMenuItem";
this.GBGambatteMenuItem.Size = new System.Drawing.Size(152, 22);
this.GBGambatteMenuItem.Text = "Gambatte";
this.GBGambatteMenuItem.Click += new System.EventHandler(this.GBCorePick_Click);
//
// GBGBHawkMenuItem
//
this.GBGBHawkMenuItem.Name = "GBGBHawkMenuItem";
this.GBGBHawkMenuItem.Size = new System.Drawing.Size(152, 22);
this.GBGBHawkMenuItem.Text = "GBHawk";
this.GBGBHawkMenuItem.Click += new System.EventHandler(this.GBCorePick_Click);
//
// GBInSGBMenuItem
//
this.GBInSGBMenuItem.Name = "GBInSGBMenuItem";
this.GBInSGBMenuItem.Size = new System.Drawing.Size(239, 22);
this.GBInSGBMenuItem.Text = "GB in SGB";
this.GBInSGBMenuItem.Click += new System.EventHandler(this.GbInSgbMenuItem_Click);
@ -4407,6 +4435,9 @@
private System.Windows.Forms.ToolStripMenuItem SGBCoreSubmenu;
private System.Windows.Forms.ToolStripMenuItem SgbBsnesMenuItem;
private System.Windows.Forms.ToolStripMenuItem SgbSameBoyMenuItem;
private System.Windows.Forms.ToolStripMenuItem GBCoreSubmenu;
private System.Windows.Forms.ToolStripMenuItem GBGambatteMenuItem;
private System.Windows.Forms.ToolStripMenuItem GBGBHawkMenuItem;
private System.Windows.Forms.ToolStripMenuItem pCFXToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem preferencesToolStripMenuItem3;
private System.Windows.Forms.ToolStripMenuItem SMSControllerToolStripMenuItem;

View File

@ -1244,6 +1244,12 @@ namespace BizHawk.Client.EmuHawk
SgbSameBoyMenuItem.Checked = !Global.Config.SGB_UseBsnes;
}
private void GBCoreSubmenu_DropDownOpened(object sender, EventArgs e)
{
GBGambatteMenuItem.Checked = !Global.Config.GB_UseGBHawk;
GBGBHawkMenuItem.Checked = Global.Config.GB_UseGBHawk;
}
private void SgbCorePick_Click(object sender, EventArgs e)
{
Global.Config.SGB_UseBsnes ^= true;
@ -1254,6 +1260,16 @@ namespace BizHawk.Client.EmuHawk
}
}
private void GBCorePick_Click(object sender, EventArgs e)
{
Global.Config.GB_UseGBHawk ^= true;
// TODO: only flag if one of these cores
if (!Emulator.IsNull())
{
FlagNeedsReboot();
}
}
private void GbInSgbMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GB_AsSGB ^= true;