lock down NES Sound config settings on quicknes, show Game Genie button on cheats dialog for it, do Toolbox logic

This commit is contained in:
adelikat 2014-01-07 01:12:48 +00:00
parent 1cfa050dba
commit 309626b8c8
4 changed files with 27 additions and 24 deletions

View File

@ -1175,6 +1175,7 @@ namespace BizHawk.Client.EmuHawk
NESDebuggerMenuItem.Enabled =
NESPPUViewerMenuItem.Enabled =
NESNametableViewerMenuItem.Enabled =
NESSoundChannelsMenuItem.Enabled =
Global.Emulator is NES;
}

View File

@ -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);
}
}
}

View File

@ -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")

View File

@ -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 =