BizHawk/BizHawk.Client.EmuHawk/config/NES/NESVSSettings.cs

61 lines
1.8 KiB
C#

using System;
using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Emulation.Cores.Nintendo.NES;
namespace BizHawk.Client.EmuHawk
{
public partial class NesVsSettings : Form
{
private NES.NESSyncSettings _settings;
private NES _nes;
public NesVsSettings()
{
InitializeComponent();
}
private void NesVsSettings_Load(object sender, EventArgs e)
{
_nes = (NES)Global.Emulator;
_settings = _nes.GetSyncSettings();
Dipswitch1CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_1;
Dipswitch2CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_2;
Dipswitch3CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_3;
Dipswitch4CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_4;
Dipswitch5CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_5;
Dipswitch6CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_6;
Dipswitch7CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_7;
Dipswitch8CheckBox.Checked = _settings.VSDipswitches.Dip_Switch_8;
}
private void OkBtn_Click(object sender, EventArgs e)
{
_settings.VSDipswitches.Dip_Switch_1 = Dipswitch1CheckBox.Checked;
_settings.VSDipswitches.Dip_Switch_2 = Dipswitch2CheckBox.Checked;
_settings.VSDipswitches.Dip_Switch_3 = Dipswitch3CheckBox.Checked;
_settings.VSDipswitches.Dip_Switch_4 = Dipswitch4CheckBox.Checked;
_settings.VSDipswitches.Dip_Switch_5 = Dipswitch5CheckBox.Checked;
_settings.VSDipswitches.Dip_Switch_6 = Dipswitch6CheckBox.Checked;
_settings.VSDipswitches.Dip_Switch_7 = Dipswitch7CheckBox.Checked;
_settings.VSDipswitches.Dip_Switch_8 = Dipswitch8CheckBox.Checked;
var changes = _nes.PutSyncSettings(_settings);
if (changes)
{
GlobalWin.MainForm.FlagNeedsReboot();
}
Close();
}
private void CancelBtn_Click(object sender, EventArgs e)
{
Close();
}
}
}