From 309626b8c83b9cb0e2ff1b1c25b67c1a6df69051 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 7 Jan 2014 01:12:48 +0000 Subject: [PATCH] lock down NES Sound config settings on quicknes, show Game Genie button on cheats dialog for it, do Toolbox logic --- BizHawk.Client.EmuHawk/MainForm.Events.cs | 1 + .../config/NES/NESSoundConfig.cs | 43 ++++++++++--------- BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs | 4 +- BizHawk.Client.EmuHawk/tools/ToolBox.cs | 3 +- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 3b82813edb..510391787b 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1175,6 +1175,7 @@ namespace BizHawk.Client.EmuHawk NESDebuggerMenuItem.Enabled = NESPPUViewerMenuItem.Enabled = NESNametableViewerMenuItem.Enabled = + NESSoundChannelsMenuItem.Enabled = Global.Emulator is NES; } diff --git a/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs b/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs index b777591b8e..d6f41dacbe 100644 --- a/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs +++ b/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs @@ -8,8 +8,8 @@ namespace BizHawk.Client.EmuHawk { public partial class NESSoundConfig : Form, IToolForm { - private NES.NESSettings oldsettings; - private NES.NESSettings settings; + private NES.NESSettings _oldSettings; + private NES.NESSettings _settings; public bool AskSave() { return true; } public bool UpdateBefore { get { return false; } } @@ -20,6 +20,7 @@ namespace BizHawk.Client.EmuHawk Close(); } } + public void Restart() { if (!(Global.Emulator is NES)) @@ -42,14 +43,14 @@ namespace BizHawk.Client.EmuHawk private void NESSoundConfig_Load(object sender, EventArgs e) { - oldsettings = (NES.NESSettings)Global.Emulator.GetSettings(); - settings = oldsettings.Clone(); + _oldSettings = (NES.NESSettings)Global.Emulator.GetSettings(); + _settings = _oldSettings.Clone(); - trackBar1.Value = settings.Square1; - trackBar2.Value = settings.Square2; - trackBar3.Value = settings.Triangle; - trackBar4.Value = settings.Noise; - trackBar5.Value = settings.DMC; + trackBar1.Value = _settings.Square1; + trackBar2.Value = _settings.Square2; + trackBar3.Value = _settings.Triangle; + trackBar4.Value = _settings.Noise; + trackBar5.Value = _settings.DMC; } private void OK_Click(object sender, EventArgs e) @@ -59,44 +60,44 @@ namespace BizHawk.Client.EmuHawk private void Cancel_Click(object sender, EventArgs e) { - //restore previous value - Global.Emulator.PutSettings(oldsettings); + // restore previous value + Global.Emulator.PutSettings(_oldSettings); Close(); } private void trackBar1_ValueChanged(object sender, EventArgs e) { label6.Text = trackBar1.Value.ToString(); - settings.Square1 = trackBar1.Value; - Global.Emulator.PutSettings(settings); + _settings.Square1 = trackBar1.Value; + Global.Emulator.PutSettings(_settings); } private void trackBar2_ValueChanged(object sender, EventArgs e) { label7.Text = trackBar2.Value.ToString(); - settings.Square2 = trackBar2.Value; - Global.Emulator.PutSettings(settings); + _settings.Square2 = trackBar2.Value; + Global.Emulator.PutSettings(_settings); } private void trackBar3_ValueChanged(object sender, EventArgs e) { label8.Text = trackBar3.Value.ToString(); - settings.Triangle = trackBar3.Value; - Global.Emulator.PutSettings(settings); + _settings.Triangle = trackBar3.Value; + Global.Emulator.PutSettings(_settings); } private void trackBar4_ValueChanged(object sender, EventArgs e) { label9.Text = trackBar4.Value.ToString(); - settings.Noise = trackBar4.Value; - Global.Emulator.PutSettings(settings); + _settings.Noise = trackBar4.Value; + Global.Emulator.PutSettings(_settings); } private void trackBar5_ValueChanged(object sender, EventArgs e) { label10.Text = trackBar5.Value.ToString(); - settings.DMC = trackBar5.Value; - Global.Emulator.PutSettings(settings); + _settings.DMC = trackBar5.Value; + Global.Emulator.PutSettings(_settings); } } } diff --git a/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs b/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs index b569c04114..fa523d9dd2 100644 --- a/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs +++ b/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs @@ -180,7 +180,7 @@ namespace BizHawk.Client.EmuHawk { GameGenieToolbarSeparator.Visible = LoadGameGenieToolbarItem.Visible = - (Global.Emulator is NES) + (Global.Emulator.SystemId == "NES") || (Global.Emulator.SystemId == "GEN" && VersionInfo.INTERIM) || (Global.Emulator.SystemId == "GB") || (Global.Game.System == "GG") @@ -496,7 +496,7 @@ namespace BizHawk.Client.EmuHawk GameGenieSeparator.Visible = OpenGameGenieEncoderDecoderMenuItem.Visible = - (Global.Emulator is NES) + (Global.Emulator.SystemId == "NES") || (Global.Emulator is Genesis) || (Global.Emulator.SystemId == "GB") || (Global.Game.System == "GG") diff --git a/BizHawk.Client.EmuHawk/tools/ToolBox.cs b/BizHawk.Client.EmuHawk/tools/ToolBox.cs index 99b49acfc9..e37ecef1cb 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolBox.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolBox.cs @@ -47,10 +47,11 @@ namespace BizHawk.Client.EmuHawk { NesPPUToolbarItem.Visible = NesDebuggerToolbarItem.Visible = - NesGameGenieToolbarItem.Visible = NesNameTableToolbarItem.Visible = Global.Emulator is NES; + NesGameGenieToolbarItem.Visible = Global.Emulator.SystemId == "NES"; + TI83KeypadToolbarItem.Visible = Global.Emulator is TI83; SNESGraphicsDebuggerToolbarItem.Visible =