BizHawk/BizHawk.Client.EmuHawk/config/SNES/SNESOptions.cs

72 lines
1.6 KiB
C#
Raw Normal View History

using System;
using System.Windows.Forms;
using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
public partial class SNESOptions : Form
{
public SNESOptions()
{
InitializeComponent();
}
public string Profile
{
get { return rbCompatibility.Checked ? "Compatibility" : "Performance"; }
set
{
rbCompatibility.Checked = (value == "Compatibility");
rbPerformance.Checked = (value == "Performance");
}
}
public bool UseRingBuffer
{
get { return cbRingbuf.Checked; }
set { cbRingbuf.Checked = value; }
}
public bool AlwaysDoubleSize
{
get { return cbDoubleSize.Checked; }
set { cbDoubleSize.Checked = value; }
}
private void btnOk_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
public static void DoSettingsDialog(IWin32Window owner)
{
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
var ss = (LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings();
var dlg = new SNESOptions
{
UseRingBuffer = s.UseRingBuffer,
AlwaysDoubleSize = s.AlwaysDoubleSize,
Profile = ss.Profile
};
var result = dlg.ShowDialog(owner);
if (result == DialogResult.OK)
{
s.UseRingBuffer = dlg.UseRingBuffer;
s.AlwaysDoubleSize = dlg.AlwaysDoubleSize;
ss.Profile = dlg.Profile;
GlobalWin.MainForm.PutCoreSettings(s);
GlobalWin.MainForm.PutCoreSyncSettings(ss);
}
}
}
}