TAStudio - change Reset button to Power on Gameboy Virtualpad, implement conditional Hard Reset menu item (dependent on the core implementing the power button)

This commit is contained in:
adelikat 2012-09-16 16:52:30 +00:00
parent 727e441bb4
commit 77564c6daa
4 changed files with 33 additions and 4 deletions

View File

@ -284,6 +284,7 @@
this.cmiScreenshotClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.cmiCloseRom = new System.Windows.Forms.ToolStripMenuItem();
this.cmiShowMenu = new System.Windows.Forms.ToolStripMenuItem();
this.hardResetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.StatusSlot0.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
@ -975,7 +976,8 @@
this.pauseToolStripMenuItem,
this.rebootCoreToolStripMenuItem,
this.toolStripSeparator1,
this.resetToolStripMenuItem});
this.resetToolStripMenuItem,
this.hardResetToolStripMenuItem});
this.emulationToolStripMenuItem.Name = "emulationToolStripMenuItem";
this.emulationToolStripMenuItem.Size = new System.Drawing.Size(73, 19);
this.emulationToolStripMenuItem.Text = "&Emulation";
@ -2445,6 +2447,13 @@
this.cmiShowMenu.Text = "Show Menu";
this.cmiShowMenu.Click += new System.EventHandler(this.showMenuToolStripMenuItem_Click);
//
// hardResetToolStripMenuItem
//
this.hardResetToolStripMenuItem.Name = "hardResetToolStripMenuItem";
this.hardResetToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.hardResetToolStripMenuItem.Text = "&Hard Reset";
this.hardResetToolStripMenuItem.Click += new System.EventHandler(this.hardResetToolStripMenuItem_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
@ -2741,6 +2750,7 @@
private System.Windows.Forms.ToolStripMenuItem gBAInCGBModeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem multicartCompatibilityToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenuItem hardResetToolStripMenuItem;
}
}

View File

@ -375,6 +375,11 @@ namespace BizHawk.MultiClient
SoftReset();
}
private void hardResetToolStripMenuItem_Click(object sender, EventArgs e)
{
HardReset();
}
private void pauseToolStripMenuItem_Click(object sender, EventArgs e)
{
if (EmulatorPaused == true)
@ -1480,6 +1485,7 @@ namespace BizHawk.MultiClient
{
rebootCoreToolStripMenuItem.Enabled = !IsNullEmulator();
resetToolStripMenuItem.Enabled = Global.Emulator.ControllerDefinition.BoolButtons.Contains("Reset");
hardResetToolStripMenuItem.Enabled = Global.Emulator.ControllerDefinition.BoolButtons.Contains("Power");
pauseToolStripMenuItem.Checked = EmulatorPaused;
if (didMenuPause) pauseToolStripMenuItem.Checked = wasPaused;

View File

@ -2937,6 +2937,19 @@ namespace BizHawk.MultiClient
}
}
private void HardReset()
{
//is it enough to run this for one frame? maybe..
if (Global.Emulator.ControllerDefinition.BoolButtons.Contains("Power"))
{
Global.ClickyVirtualPadController.Click("Power");
if (!Global.MovieSession.Movie.IsActive)
{
Global.Emulator.ResetFrameCounter();
}
}
}
public void UpdateStatusSlots()
{
StateSlots.Update();

View File

@ -29,7 +29,7 @@ namespace BizHawk.MultiClient
this.B1.AutoSize = true;
this.B1.Location = ButtonPoints[0];
this.B1.TabIndex = 5;
this.B1.Text = "Reset";
this.B1.Text = "Power";
this.B1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.B1.UseVisualStyleBackColor = true;
this.B1.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged);
@ -97,7 +97,7 @@ namespace BizHawk.MultiClient
}
else if (sender == B1)
{
Global.StickyXORAdapter.SetSticky("Reset", B1.Checked);
Global.StickyXORAdapter.SetSticky("Power", B1.Checked);
if (B1.Checked == true)
{
B1.BackColor = Color.Pink;
@ -118,7 +118,7 @@ namespace BizHawk.MultiClient
B1.Checked = false;
Global.StickyXORAdapter.SetSticky("Reset", false);
Global.StickyXORAdapter.SetSticky("Power", false);
}
}
}