add winform edit for dual gameboy settings
This commit is contained in:
parent
70078b24f2
commit
bf20188462
|
@ -215,6 +215,12 @@
|
|||
<Compile Include="config\GB\ColorChooserForm.Designer.cs">
|
||||
<DependentUpon>ColorChooserForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="config\GB\DGBPrefs.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="config\GB\DGBPrefs.Designer.cs">
|
||||
<DependentUpon>DGBPrefs.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="config\GB\DualGBFileSelector.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -227,6 +233,12 @@
|
|||
<Compile Include="config\GB\DualGBXMLCreator.Designer.cs">
|
||||
<DependentUpon>DualGBXMLCreator.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="config\GB\GBPrefControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="config\GB\GBPrefControl.Designer.cs">
|
||||
<DependentUpon>GBPrefControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="config\HotkeyConfig.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -845,12 +857,18 @@
|
|||
<EmbeddedResource Include="config\GB\ColorChooserForm.resx">
|
||||
<DependentUpon>ColorChooserForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="config\GB\DGBPrefs.resx">
|
||||
<DependentUpon>DGBPrefs.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="config\GB\DualGBFileSelector.resx">
|
||||
<DependentUpon>DualGBFileSelector.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="config\GB\DualGBXMLCreator.resx">
|
||||
<DependentUpon>DualGBXMLCreator.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="config\GB\GBPrefControl.resx">
|
||||
<DependentUpon>GBPrefControl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="config\HotkeyConfig.resx">
|
||||
<DependentUpon>HotkeyConfig.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1730,6 +1730,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#endregion
|
||||
|
||||
#region DGB
|
||||
|
||||
private void DGBsettingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
BizHawk.Client.EmuHawk.config.GB.DGBPrefs.DoDGBPrefsDialog(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Help
|
||||
|
||||
private void OnlineHelpMenuItem_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -1479,6 +1479,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
ColecoSubMenu.Visible = false;
|
||||
N64SubMenu.Visible = false;
|
||||
SaturnSubMenu.Visible = false;
|
||||
DGBSubMenu.Visible = false;
|
||||
|
||||
switch (system)
|
||||
{
|
||||
|
@ -1531,7 +1532,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
SNESSubMenu.Text = "&SNES";
|
||||
}
|
||||
|
||||
SNESSubMenu.Visible = true;
|
||||
break;
|
||||
case "Coleco":
|
||||
|
@ -1543,6 +1543,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
case "SAT":
|
||||
SaturnSubMenu.Visible = true;
|
||||
break;
|
||||
case "DGB":
|
||||
DGBSubMenu.Visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3742,5 +3745,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
InitializeComponent();
|
||||
bmpView1.ChangeBitmapSize(bmpView1.Size);
|
||||
type = ((Gameboy.GambatteSettings)Global.Emulator.GetSettings()).CGBColors;
|
||||
}
|
||||
|
||||
void LoadType(Gameboy.GambatteSettings s)
|
||||
{
|
||||
type = s.CGBColors;
|
||||
switch (type)
|
||||
{
|
||||
case GBColors.ColorType.gambatte: radioButton1.Checked = true; break;
|
||||
|
@ -24,6 +28,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
case GBColors.ColorType.gba: radioButton6.Checked = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
GBColors.ColorType type;
|
||||
|
||||
unsafe void RefreshType()
|
||||
|
@ -71,10 +76,23 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshType();
|
||||
}
|
||||
|
||||
public static void DoCGBColorChoserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s)
|
||||
{
|
||||
using (var dlg = new CGBColorChooserForm())
|
||||
{
|
||||
dlg.LoadType(s);
|
||||
var result = dlg.ShowDialog(parent);
|
||||
if (result == DialogResult.OK)
|
||||
s.CGBColors = dlg.type;
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoCGBColorChooserFormDialog(IWin32Window parent)
|
||||
{
|
||||
using (var dlg = new CGBColorChooserForm())
|
||||
{
|
||||
dlg.LoadType((Gameboy.GambatteSettings)Global.Emulator.GetSettings());
|
||||
|
||||
var result = dlg.ShowDialog(parent);
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
|
|
|
@ -228,12 +228,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshAllBackdrops();
|
||||
}
|
||||
|
||||
public static void DoColorChooserFormDialog(IWin32Window parent)
|
||||
static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s, bool fromemu)
|
||||
{
|
||||
using (var dlg = new ColorChooserForm())
|
||||
{
|
||||
var s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
|
||||
|
||||
if (fromemu)
|
||||
s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
|
||||
dlg.SetAllColors(s.GBPalette);
|
||||
|
||||
var result = dlg.ShowDialog(parent);
|
||||
|
@ -244,11 +244,22 @@ namespace BizHawk.Client.EmuHawk
|
|||
colorints[i] = dlg.colors[i].ToArgb();
|
||||
|
||||
s.GBPalette = colorints;
|
||||
Global.Emulator.PutSettings(s);
|
||||
if (fromemu)
|
||||
Global.Emulator.PutSettings(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoColorChooserFormDialog(IWin32Window parent)
|
||||
{
|
||||
DoColorChooserFormDialog(parent, null, true);
|
||||
}
|
||||
|
||||
public static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s)
|
||||
{
|
||||
DoColorChooserFormDialog(parent, s, false);
|
||||
}
|
||||
|
||||
void LoadColorFile(string filename, bool alert)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -0,0 +1,148 @@
|
|||
namespace BizHawk.Client.EmuHawk.config.GB
|
||||
{
|
||||
partial class DGBPrefs
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.buttonOK = new System.Windows.Forms.Button();
|
||||
this.gbPrefControl1 = new BizHawk.Client.EmuHawk.config.GB.GBPrefControl();
|
||||
this.gbPrefControl2 = new BizHawk.Client.EmuHawk.config.GB.GBPrefControl();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControl1
|
||||
//
|
||||
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tabControl1.Controls.Add(this.tabPage1);
|
||||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Location = new System.Drawing.Point(12, 12);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(517, 334);
|
||||
this.tabControl1.TabIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.gbPrefControl1);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(509, 308);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "Left Gameboy";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.gbPrefControl2);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(509, 308);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Right Gameboy";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.buttonCancel.Location = new System.Drawing.Point(454, 360);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonCancel.TabIndex = 1;
|
||||
this.buttonCancel.Text = "Cancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonOK
|
||||
//
|
||||
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.buttonOK.Location = new System.Drawing.Point(373, 360);
|
||||
this.buttonOK.Name = "buttonOK";
|
||||
this.buttonOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonOK.TabIndex = 2;
|
||||
this.buttonOK.Text = "OK";
|
||||
this.buttonOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// gbPrefControl1
|
||||
//
|
||||
this.gbPrefControl1.ColorGameBoy = false;
|
||||
this.gbPrefControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gbPrefControl1.Location = new System.Drawing.Point(3, 3);
|
||||
this.gbPrefControl1.Name = "gbPrefControl1";
|
||||
this.gbPrefControl1.Size = new System.Drawing.Size(503, 302);
|
||||
this.gbPrefControl1.TabIndex = 0;
|
||||
//
|
||||
// gbPrefControl2
|
||||
//
|
||||
this.gbPrefControl2.ColorGameBoy = false;
|
||||
this.gbPrefControl2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gbPrefControl2.Location = new System.Drawing.Point(3, 3);
|
||||
this.gbPrefControl2.Name = "gbPrefControl2";
|
||||
this.gbPrefControl2.Size = new System.Drawing.Size(503, 302);
|
||||
this.gbPrefControl2.TabIndex = 0;
|
||||
//
|
||||
// DGBPrefs
|
||||
//
|
||||
this.AcceptButton = this.buttonOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.buttonCancel;
|
||||
this.ClientSize = new System.Drawing.Size(541, 395);
|
||||
this.Controls.Add(this.buttonOK);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Name = "DGBPrefs";
|
||||
this.Text = "Gameboy Link Settings";
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private System.Windows.Forms.TabPage tabPage1;
|
||||
private System.Windows.Forms.TabPage tabPage2;
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Button buttonOK;
|
||||
private GBPrefControl gbPrefControl1;
|
||||
private GBPrefControl gbPrefControl2;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk.config.GB
|
||||
{
|
||||
public partial class DGBPrefs : Form
|
||||
{
|
||||
DGBPrefs()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void PutSettings(GambatteLink.GambatteLinkSettings s, GambatteLink.GambatteLinkSyncSettings ss)
|
||||
{
|
||||
gbPrefControl1.PutSettings(s.L, ss.L);
|
||||
gbPrefControl2.PutSettings(s.R, ss.R);
|
||||
}
|
||||
|
||||
void GetSettings(out GambatteLink.GambatteLinkSettings s, out GambatteLink.GambatteLinkSyncSettings ss)
|
||||
{
|
||||
Gameboy.GambatteSettings sl;
|
||||
Gameboy.GambatteSyncSettings ssl;
|
||||
Gameboy.GambatteSettings sr;
|
||||
Gameboy.GambatteSyncSettings ssr;
|
||||
gbPrefControl1.GetSettings(out sl, out ssl);
|
||||
gbPrefControl2.GetSettings(out sr, out ssr);
|
||||
|
||||
s = new GambatteLink.GambatteLinkSettings { L = sl, R = sr };
|
||||
ss = new GambatteLink.GambatteLinkSyncSettings { L = ssl, R = ssr };
|
||||
}
|
||||
|
||||
public static void DoDGBPrefsDialog(IWin32Window owner)
|
||||
{
|
||||
var s = (GambatteLink.GambatteLinkSettings)Global.Emulator.GetSettings();
|
||||
var ss = (GambatteLink.GambatteLinkSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
|
||||
using (var dlg = new DGBPrefs())
|
||||
{
|
||||
dlg.PutSettings(s, ss);
|
||||
|
||||
var emu = (GambatteLink)Global.Emulator;
|
||||
dlg.gbPrefControl1.ColorGameBoy = emu.IsCGBMode(false);
|
||||
dlg.gbPrefControl2.ColorGameBoy = emu.IsCGBMode(true);
|
||||
|
||||
if (dlg.ShowDialog(owner) == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
dlg.GetSettings(out s, out ss);
|
||||
Global.Emulator.PutSettings(s);
|
||||
Global.Emulator.PutSyncSettings(ss);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,87 @@
|
|||
namespace BizHawk.Client.EmuHawk.config.GB
|
||||
{
|
||||
partial class GBPrefControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
|
||||
this.buttonDefaults = new System.Windows.Forms.Button();
|
||||
this.buttonPalette = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// propertyGrid1
|
||||
//
|
||||
this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.propertyGrid1.Location = new System.Drawing.Point(3, 3);
|
||||
this.propertyGrid1.Name = "propertyGrid1";
|
||||
this.propertyGrid1.Size = new System.Drawing.Size(318, 276);
|
||||
this.propertyGrid1.TabIndex = 0;
|
||||
//
|
||||
// buttonDefaults
|
||||
//
|
||||
this.buttonDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonDefaults.Location = new System.Drawing.Point(246, 285);
|
||||
this.buttonDefaults.Name = "buttonDefaults";
|
||||
this.buttonDefaults.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonDefaults.TabIndex = 1;
|
||||
this.buttonDefaults.Text = "Defaults";
|
||||
this.buttonDefaults.UseVisualStyleBackColor = true;
|
||||
this.buttonDefaults.Click += new System.EventHandler(this.buttonDefaults_Click);
|
||||
//
|
||||
// buttonPalette
|
||||
//
|
||||
this.buttonPalette.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.buttonPalette.Location = new System.Drawing.Point(3, 285);
|
||||
this.buttonPalette.Name = "buttonPalette";
|
||||
this.buttonPalette.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonPalette.TabIndex = 2;
|
||||
this.buttonPalette.Text = "Palette...";
|
||||
this.buttonPalette.UseVisualStyleBackColor = true;
|
||||
this.buttonPalette.Click += new System.EventHandler(this.buttonPalette_Click);
|
||||
//
|
||||
// GBPrefControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.buttonPalette);
|
||||
this.Controls.Add(this.buttonDefaults);
|
||||
this.Controls.Add(this.propertyGrid1);
|
||||
this.Name = "GBPrefControl";
|
||||
this.Size = new System.Drawing.Size(324, 311);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PropertyGrid propertyGrid1;
|
||||
private System.Windows.Forms.Button buttonDefaults;
|
||||
private System.Windows.Forms.Button buttonPalette;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk.config.GB
|
||||
{
|
||||
public partial class GBPrefControl : UserControl
|
||||
{
|
||||
public GBPrefControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public bool ColorGameBoy { get; set; }
|
||||
|
||||
Gameboy.GambatteSettings s;
|
||||
Gameboy.GambatteSyncSettings ss;
|
||||
|
||||
public void PutSettings(Gameboy.GambatteSettings s, Gameboy.GambatteSyncSettings ss)
|
||||
{
|
||||
this.s = s ?? Gameboy.GambatteSettings.GetDefaults();
|
||||
this.ss = ss ?? Gameboy.GambatteSyncSettings.GetDefaults();
|
||||
propertyGrid1.SelectedObject = this.ss;
|
||||
}
|
||||
|
||||
public void GetSettings(out Gameboy.GambatteSettings s, out Gameboy.GambatteSyncSettings ss)
|
||||
{
|
||||
s = this.s;
|
||||
ss = this.ss;
|
||||
}
|
||||
|
||||
private void buttonDefaults_Click(object sender, EventArgs e)
|
||||
{
|
||||
PutSettings(null, null);
|
||||
}
|
||||
|
||||
private void buttonPalette_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ColorGameBoy)
|
||||
CGBColorChooserForm.DoCGBColorChoserFormDialog(this.ParentForm, s);
|
||||
else
|
||||
ColorChooserForm.DoColorChooserFormDialog(this.ParentForm, s);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -147,13 +147,16 @@ namespace BizHawk.Emulation.Common
|
|||
// will take a SyncSettings object to set the initial state of the core (and possibly a settings object?)
|
||||
|
||||
/// <summary>
|
||||
/// get the current core settings, excepting movie settings
|
||||
/// get the current core settings, excepting movie settings. should be a clone of the active in-core object, and changes to the return
|
||||
/// should not affect emulation (unless the object is later passed to PutSettings)
|
||||
/// </summary>
|
||||
/// <returns>a json-serializable object</returns>
|
||||
object GetSettings();
|
||||
|
||||
/// <summary>
|
||||
/// get the current core settings that affect movie sync
|
||||
/// get the current core settings that affect movie sync. these go in movie 2.0 files, so don't make the JSON too extravagant, please
|
||||
/// should be a clone of the active in-core object, and changes to the return
|
||||
/// should not affect emulation (unless the object is later passed to PutSyncSettings)
|
||||
/// </summary>
|
||||
/// <returns>a json-serializable object</returns>
|
||||
object GetSyncSettings();
|
||||
|
|
|
@ -908,8 +908,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
|
||||
public bool PutSyncSettings(object o)
|
||||
{
|
||||
SyncSettings = (GambatteSyncSettings)o;
|
||||
return true;
|
||||
var s = (GambatteSyncSettings)o;
|
||||
bool ret;
|
||||
if (s.ForceDMG != SyncSettings.ForceDMG ||
|
||||
s.GBACGB != SyncSettings.GBACGB ||
|
||||
s.MulticartCompat != SyncSettings.MulticartCompat)
|
||||
ret = true;
|
||||
else
|
||||
ret = false;
|
||||
|
||||
SyncSettings = s;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public class GambatteSettings
|
||||
|
@ -940,17 +949,26 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
|
||||
public class GambatteSyncSettings
|
||||
{
|
||||
public bool ForceDMG = false;
|
||||
public bool GBACGB = false;
|
||||
public bool MulticartCompat = false;
|
||||
[System.ComponentModel.Description("Force the game to run on DMG hardware, even if it's detected as a CGB game. Relevant for games that are \"CGB Enhanced\" but do not require CGB.")]
|
||||
public bool ForceDMG { get; set; }
|
||||
[System.ComponentModel.Description("Emulate GBA hardware running a CGB game, instead of CGB hardware. Relevant only for titles that detect the presense of a GBA, such as Shantae.")]
|
||||
public bool GBACGB { get; set; }
|
||||
[System.ComponentModel.Description("Use special compatibility hacks for certain multicart games. Relevant only for specific multicarts.")]
|
||||
public bool MulticartCompat { get; set; }
|
||||
|
||||
public static GambatteSyncSettings GetDefaults()
|
||||
{
|
||||
return new GambatteSyncSettings();
|
||||
return new GambatteSyncSettings
|
||||
{
|
||||
ForceDMG = false,
|
||||
GBACGB = false,
|
||||
MulticartCompat = false
|
||||
};
|
||||
}
|
||||
|
||||
public GambatteSyncSettings Clone()
|
||||
{
|
||||
// this does include anonymous backing fields for auto properties
|
||||
return (GambatteSyncSettings)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
LibsnesCore.SnesSaveController LCont = new LibsnesCore.SnesSaveController(Gameboy.GbController);
|
||||
LibsnesCore.SnesSaveController RCont = new LibsnesCore.SnesSaveController(Gameboy.GbController);
|
||||
|
||||
public bool IsCGBMode(bool right)
|
||||
{
|
||||
return right ? R.IsCGBMode() : L.IsCGBMode();
|
||||
}
|
||||
|
||||
public GambatteLink(CoreComm comm, GameInfo leftinfo, byte[] leftrom, GameInfo rightinfo, byte[] rightrom, object Settings, object SyncSettings)
|
||||
{
|
||||
GambatteLinkSettings _Settings = (GambatteLinkSettings)Settings ?? GambatteLinkSettings.GetDefaults();
|
||||
|
|
Loading…
Reference in New Issue