more new core config framework; this time GAEMBOY

This commit is contained in:
goyuken 2013-12-23 02:51:41 +00:00
parent 05e2f67771
commit d37796ab1c
30 changed files with 549 additions and 501 deletions

View File

@ -671,12 +671,12 @@ namespace BizHawk.Client.Common
//TI 83 settings
//GB settings
public bool GB_ForceDMG = false;
public bool GB_GBACGB = false;
public bool GB_MulticartCompat = false;
public string GB_PaletteFile = "";
//public bool GB_ForceDMG = false;
//public bool GB_GBACGB = false;
//public bool GB_MulticartCompat = false;
//public string GB_PaletteFile = "";
public bool GB_AsSGB = false;
public GBColors.ColorType CGBColors = GBColors.ColorType.gambatte;
//public GBColors.ColorType CGBColors = GBColors.ColorType.gambatte;
//Dual Gb

View File

@ -1498,28 +1498,33 @@ namespace BizHawk.Client.EmuHawk
private void GBSubMenu_DropDownOpened(object sender, EventArgs e)
{
GBForceDMGMenuItem.Checked = Global.Config.GB_ForceDMG;
GBAInCGBModeMenuItem.Checked = Global.Config.GB_GBACGB;
GBMulticartCompatibilityMenuItem.Checked = Global.Config.GB_MulticartCompat;
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
GBForceDMGMenuItem.Checked = s.ForceDMG;
GBAInCGBModeMenuItem.Checked = s.GBACGB;
GBMulticartCompatibilityMenuItem.Checked = s.MulticartCompat;
LoadGBInSGBMenuItem.Checked = Global.Config.GB_AsSGB;
}
private void GBForceDMGMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GB_ForceDMG ^= true;
FlagNeedsReboot();
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
s.ForceDMG ^= true;
PutCoreSyncSettings(s);
}
private void GBAInCGBModeMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GB_GBACGB ^= true;
FlagNeedsReboot();
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
s.GBACGB ^= true;
PutCoreSyncSettings(s);
}
private void GBMulticartCompatibilityMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GB_MulticartCompat ^= true;
FlagNeedsReboot();
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
s.MulticartCompat ^= true;
PutCoreSyncSettings(s);
}
private void GBPaletteConfigMenuItem_Click(object sender, EventArgs e)
@ -1528,16 +1533,9 @@ namespace BizHawk.Client.EmuHawk
{
var gb = Global.Emulator as Gameboy;
if (gb.IsCGBMode())
{
if (CGBColorChooserForm.DoCGBColorChooserFormDialog(this))
{
gb.SetCGBColors(Global.Config.CGBColors);
}
}
CGBColorChooserForm.DoCGBColorChooserFormDialog(this);
else
{
ColorChooserForm.DoColorChooserFormDialog(gb.ChangeDMGColors, this);
}
ColorChooserForm.DoColorChooserFormDialog(this);
}
}

View File

@ -2118,6 +2118,23 @@ namespace BizHawk.Client.EmuHawk
FlagNeedsReboot();
}
/// <summary>
/// send core sync settings to emu, setting reboot flag if needed
/// </summary>
/// <param name="o"></param>
private void PutCoreSyncSettings(object o)
{
if (Global.MovieSession.Movie.IsActive)
{
GlobalWin.OSD.AddMessage("Attempt to change sync-relevant setings while recording BLOCKED.");
}
else
{
if (Global.Emulator.PutSyncSettings(o))
FlagNeedsReboot();
}
}
private void SaveConfig()
{
if (Global.Config.SaveWindowPosition)
@ -3239,37 +3256,9 @@ namespace BizHawk.Client.EmuHawk
var L = Database.GetGameInfo(XMLG.Assets["LeftRom"], "left.gb");
var R = Database.GetGameInfo(XMLG.Assets["RightRom"], "right.gb");
if (Global.Config.GB_ForceDMG)
{
L.AddOption("ForceDMG");
}
if (Global.Config.GB_GBACGB)
{
L.AddOption("GBACGB");
}
if (Global.Config.GB_MulticartCompat)
{
L.AddOption("MulitcartCompat");
}
if (Global.Config.GB_ForceDMG)
{
R.AddOption("ForceDMG");
}
if (Global.Config.GB_GBACGB)
{
R.AddOption("GBACGB");
}
if (Global.Config.GB_MulticartCompat)
{
R.AddOption("MulitcartCompat");
}
var gbl = new GambatteLink(nextComm, L, XMLG.Assets["LeftRom"], R, XMLG.Assets["RightRom"]);
var gbl = new GambatteLink(nextComm, L, XMLG.Assets["LeftRom"], R, XMLG.Assets["RightRom"],
Global.Config.GetCoreSettings<GambatteLink>(),
Global.Config.GetCoreSyncSettings<GambatteLink>());
nextEmulator = gbl;
// other stuff todo
@ -3385,42 +3374,10 @@ namespace BizHawk.Client.EmuHawk
case "GBC":
if (!Global.Config.GB_AsSGB)
{
if (Global.Config.GB_ForceDMG)
{
game.AddOption("ForceDMG");
}
if (Global.Config.GB_GBACGB)
{
game.AddOption("GBACGB");
}
if (Global.Config.GB_MulticartCompat)
{
game.AddOption("MulitcartCompat");
}
var gb = new Gameboy(nextComm, game, rom.FileData);
var gb = new Gameboy(nextComm, game, rom.FileData,
Global.Config.GetCoreSettings<Gameboy>(),
Global.Config.GetCoreSyncSettings<Gameboy>());
nextEmulator = gb;
if (gb.IsCGBMode())
{
gb.SetCGBColors(Global.Config.CGBColors);
}
else
{
try
{
using (var f = new StreamReader(Global.Config.GB_PaletteFile))
{
int[] colors = ColorChooserForm.LoadPalFile(f);
if (colors != null)
{
gb.ChangeDMGColors(colors);
}
}
}
catch { }
}
}
else
{
@ -3711,6 +3668,8 @@ namespace BizHawk.Client.EmuHawk
// save settings object
Type t = Global.Emulator.GetType();
Global.Config.PutCoreSettings(Global.Emulator.GetSettings(), t);
// don't trample config with loaded-from-movie settings
if (!Global.MovieSession.Movie.IsActive)
Global.Config.PutCoreSyncSettings(Global.Emulator.GetSyncSettings(), t);
}

View File

@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk
{
InitializeComponent();
bmpView1.ChangeBitmapSize(bmpView1.Size);
type = Global.Config.CGBColors;
type = ((Gameboy.GambatteSettings)Global.Emulator.GetSettings()).CGBColors;
switch (type)
{
case GBColors.ColorType.gambatte: radioButton1.Checked = true; break;
@ -71,18 +71,17 @@ namespace BizHawk.Client.EmuHawk
RefreshType();
}
public static bool DoCGBColorChooserFormDialog(IWin32Window parent)
public static void DoCGBColorChooserFormDialog(IWin32Window parent)
{
using (var dlg = new CGBColorChooserForm())
{
var result = dlg.ShowDialog(parent);
if (result == DialogResult.OK)
{
Global.Config.CGBColors = dlg.type;
return true;
var s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
s.CGBColors = dlg.type;
Global.Emulator.PutSettings(s);
}
else
return false;
}
}

View File

@ -50,8 +50,6 @@
this.buttonInterpolateSP2 = new System.Windows.Forms.Button();
this.buttonLoad = new System.Windows.Forms.Button();
this.buttonSave = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.DefaultButton = new System.Windows.Forms.Button();
this.DefaultButtonCGB = new System.Windows.Forms.Button();
this.SuspendLayout();
@ -264,27 +262,6 @@
this.buttonSave.UseVisualStyleBackColor = true;
this.buttonSave.Click += new System.EventHandler(this.button7_Click);
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.BackColor = System.Drawing.SystemColors.Control;
this.textBox1.Location = new System.Drawing.Point(17, 195);
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(282, 20);
this.textBox1.TabIndex = 30;
//
// label4
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(14, 179);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(95, 13);
this.label4.TabIndex = 31;
this.label4.Text = "Current palette file:";
//
// DefaultButton
//
this.DefaultButton.Location = new System.Drawing.Point(149, 137);
@ -315,8 +292,6 @@
this.ClientSize = new System.Drawing.Size(313, 254);
this.Controls.Add(this.DefaultButtonCGB);
this.Controls.Add(this.DefaultButton);
this.Controls.Add(this.label4);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.buttonSave);
this.Controls.Add(this.buttonLoad);
this.Controls.Add(this.buttonInterpolateSP2);
@ -376,8 +351,6 @@
private System.Windows.Forms.Button buttonInterpolateSP2;
private System.Windows.Forms.Button buttonLoad;
private System.Windows.Forms.Button buttonSave;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button DefaultButton;
private System.Windows.Forms.Button DefaultButtonCGB;
}

View File

@ -5,6 +5,7 @@ using System.Windows.Forms;
using System.IO;
using BizHawk.Client.Common;
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
namespace BizHawk.Client.EmuHawk
{
@ -17,11 +18,6 @@ namespace BizHawk.Client.EmuHawk
private readonly Color[] colors = new Color[12];
/// <summary>
/// the most recently loaded or saved palette file
/// </summary>
string currentfile;
/// <summary>
/// gambatte's default dmg colors
/// </summary>
@ -42,8 +38,6 @@ namespace BizHawk.Client.EmuHawk
10798341, 8956165, 1922333, 337157
};
private void RefreshAllBackdrops()
{
panel1.BackColor = colors[0];
@ -151,7 +145,6 @@ namespace BizHawk.Client.EmuHawk
{
colors[i] = dlg.Color;
sender.BackColor = colors[i];
label4.Text = "Current palette file (modified):";
}
}
}
@ -232,39 +225,26 @@ namespace BizHawk.Client.EmuHawk
{
colors[i] = Color.FromArgb(255, Color.FromArgb(_colors[i]));
}
RefreshAllBackdrops();
}
public static bool DoColorChooserFormDialog(Action<int[]> ColorUpdater, IWin32Window parent)
public static void DoColorChooserFormDialog(IWin32Window parent)
{
using (var dlg = new ColorChooserForm())
{
//if (colors != null)
// dlg.SetAllColors(colors);
var s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
dlg.SetAllColors(DefaultDMGColors);
dlg.textBox1.Text = "(none)";
dlg.currentfile = "";
if (!string.IsNullOrEmpty(Global.Config.GB_PaletteFile))
{
dlg.LoadColorFile(Global.Config.GB_PaletteFile, false);
}
dlg.SetAllColors(s.GBPalette);
var result = dlg.ShowDialog(parent);
if (result != DialogResult.OK)
{
return false;
}
else
if (result == DialogResult.OK)
{
int[] colorints = new int[12];
for (int i = 0; i < 12; i++)
colorints[i] = dlg.colors[i].ToArgb();
ColorUpdater(colorints);
Global.Config.GB_PaletteFile = dlg.currentfile;
return true;
s.GBPalette = colorints;
Global.Emulator.PutSettings(s);
}
}
}
@ -280,9 +260,6 @@ namespace BizHawk.Client.EmuHawk
throw new Exception();
SetAllColors(newcolors);
textBox1.Text = Path.GetFileName(filename);
currentfile = filename;
label4.Text = "Current palette file:";
}
}
catch
@ -303,9 +280,6 @@ namespace BizHawk.Client.EmuHawk
// clear alpha because gambatte color files don't usually contain it
savecolors[i] = colors[i].ToArgb() & 0xffffff;
SavePalFile(f, savecolors);
currentfile = filename;
label4.Text = "Current palette file:";
textBox1.Text = Path.GetFileName(filename);
}
}
catch
@ -323,11 +297,7 @@ namespace BizHawk.Client.EmuHawk
ofd.RestoreDirectory = true;
var result = ofd.ShowDialog(this);
if (result != DialogResult.OK)
{
return;
}
if (result == DialogResult.OK)
LoadColorFile(ofd.FileName, true);
}
}
@ -355,25 +325,14 @@ namespace BizHawk.Client.EmuHawk
private void button7_Click(object sender, EventArgs e)
{
using (var sfd = new SaveFileDialog())
{
if (!String.IsNullOrWhiteSpace(currentfile))
{
sfd.InitialDirectory = Path.GetDirectoryName(currentfile);
sfd.FileName = Path.GetFileName(currentfile);
}
else
{
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries["GB", "Palettes"].Path, "GB");
sfd.FileName = Global.Game.Name + ".pal";
}
sfd.Filter = "Gambatte Palettes (*.pal)|*.pal|All Files|*.*";
sfd.RestoreDirectory = true;
var result = sfd.ShowDialog(this);
if (result != DialogResult.OK)
{
return;
}
if (result == DialogResult.OK)
SaveColorFile(sfd.FileName);
}
}
@ -384,15 +343,11 @@ namespace BizHawk.Client.EmuHawk
private void DefaultButton_Click(object sender, EventArgs e)
{
textBox1.Text = "(none)";
currentfile = "";
SetAllColors(DefaultDMGColors);
}
private void DefaultButtonCGB_Click(object sender, EventArgs e)
{
textBox1.Text = "(none)";
currentfile = "";
SetAllColors(DefaultCGBColors);
}

View File

@ -127,8 +127,12 @@ namespace BizHawk.Client.EmuHawk
if (Global.Emulator is Gameboy)
{
_movieToRecord.Header[HeaderKeys.GB_FORCEDMG] = Global.Config.GB_ForceDMG.ToString();
_movieToRecord.Header[HeaderKeys.GB_GBA_IN_CGB] = Global.Config.GB_GBACGB.ToString();
// probably won't fix any of this in movie 1.0?? (movie 2.0 only??)
// FIXME: the multicartcompat is in the syncsettings object. is that supposed to go here?
// FIXME: these are never read back and given to the core, anywhere
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
_movieToRecord.Header[HeaderKeys.GB_FORCEDMG] = s.ForceDMG.ToString();
_movieToRecord.Header[HeaderKeys.GB_GBA_IN_CGB] = s.GBACGB.ToString();
}
if (Global.Emulator is LibsnesCore)

View File

@ -118,6 +118,7 @@ namespace BizHawk.Emulation.Common
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
public class NullSound : ISoundProvider

View File

@ -165,6 +165,12 @@ namespace BizHawk.Emulation.Common
/// <returns>true if a core reboot will be required to implement these</returns>
bool PutSettings(object o);
/// <summary>
/// changes the movie-sync relevant settings. THIS SHOULD NEVER BE CALLED WHILE RECORDING
/// </summary>
/// <param name="o">an object of the same type as the return for GetSyncSettings</param>
/// <returns>true if a core reboot will be required to implement these</returns>
bool PutSyncSettings(object o);
}
public enum DisplayType { NTSC, PAL, DENDY }

View File

@ -552,5 +552,6 @@ namespace BizHawk.Emulation.Common
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -1040,6 +1040,7 @@ namespace BizHawk.Emulation.Cores.Calculators
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -175,5 +175,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -134,6 +134,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -429,5 +429,6 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -293,5 +293,6 @@ namespace BizHawk.Emulation.Cores.ColecoVision
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -207,5 +207,6 @@ namespace BizHawk.Emulation.Cores.Intellivision
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -557,5 +557,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
return fn;
}
public Gameboy(CoreComm comm, GameInfo game, byte[] romdata)
public Gameboy(CoreComm comm, GameInfo game, byte[] romdata, object Settings, object SyncSettings)
{
CoreComm = comm;
@ -64,22 +64,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
try
{
this.SyncSettings = (GambatteSyncSettings)SyncSettings ?? GambatteSyncSettings.GetDefaults();
LibGambatte.LoadFlags flags = 0;
if (game["ForceDMG"])
if (this.SyncSettings.ForceDMG)
flags |= LibGambatte.LoadFlags.FORCE_DMG;
if (game["GBACGB"])
if (this.SyncSettings.GBACGB)
flags |= LibGambatte.LoadFlags.GBA_CGB;
if (game["MulitcartCompat"])
if (this.SyncSettings.MulticartCompat)
flags |= LibGambatte.LoadFlags.MULTICART_COMPAT;
if (LibGambatte.gambatte_load(GambatteState, romdata, (uint)romdata.Length, GetCurrentTime(), flags) != 0)
throw new Exception("gambatte_load() returned non-zero (is this not a gb or gbc rom?)");
// set real default colors (before anyone mucks with them at all)
ChangeDMGColors(new int[] { 10798341, 8956165, 1922333, 337157, 10798341, 8956165, 1922333, 337157, 10798341, 8956165, 1922333, 337157 });
SetCGBColors(GBColors.ColorType.gambatte);
PutSettings(Settings ?? GambatteSettings.GetDefaults());
InitSound();
@ -891,8 +891,68 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
}
#endregion
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
GambatteSettings Settings;
GambatteSyncSettings SyncSettings;
public object GetSettings() { return Settings.Clone(); }
public object GetSyncSettings() { return SyncSettings.Clone(); }
public bool PutSettings(object o)
{
Settings = (GambatteSettings)o;
if (IsCGBMode())
SetCGBColors(Settings.CGBColors);
else
ChangeDMGColors(Settings.GBPalette);
return false;
}
public bool PutSyncSettings(object o)
{
SyncSettings = (GambatteSyncSettings)o;
return true;
}
public class GambatteSettings
{
public int[] GBPalette;
public GBColors.ColorType CGBColors;
public static GambatteSettings GetDefaults()
{
var ret = new GambatteSettings();
ret.GBPalette = new[]
{
10798341, 8956165, 1922333, 337157,
10798341, 8956165, 1922333, 337157,
10798341, 8956165, 1922333, 337157
};
ret.CGBColors = GBColors.ColorType.gambatte;
return ret;
}
public GambatteSettings Clone()
{
var ret = (GambatteSettings)MemberwiseClone();
ret.GBPalette = (int[])GBPalette.Clone();
return ret;
}
}
public class GambatteSyncSettings
{
public bool ForceDMG = false;
public bool GBACGB = false;
public bool MulticartCompat = false;
public static GambatteSyncSettings GetDefaults()
{
return new GambatteSyncSettings();
}
public GambatteSyncSettings Clone()
{
return (GambatteSyncSettings)MemberwiseClone();
}
}
}
}

View File

@ -35,11 +35,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
LibsnesCore.SnesSaveController LCont = new LibsnesCore.SnesSaveController(Gameboy.GbController);
LibsnesCore.SnesSaveController RCont = new LibsnesCore.SnesSaveController(Gameboy.GbController);
public GambatteLink(CoreComm comm, GameInfo leftinfo, byte[] leftrom, GameInfo rightinfo, byte[] rightrom)
public GambatteLink(CoreComm comm, GameInfo leftinfo, byte[] leftrom, GameInfo rightinfo, byte[] rightrom, object Settings, object SyncSettings)
{
GambatteLinkSettings _Settings = (GambatteLinkSettings)Settings ?? GambatteLinkSettings.GetDefaults();
GambatteLinkSyncSettings _SyncSettings = (GambatteLinkSyncSettings)SyncSettings ?? GambatteLinkSyncSettings.GetDefaults();
CoreComm = comm;
L = new Gameboy(new CoreComm(comm.ShowMessage), leftinfo, leftrom);
R = new Gameboy(new CoreComm(comm.ShowMessage), rightinfo, rightrom);
L = new Gameboy(new CoreComm(comm.ShowMessage), leftinfo, leftrom, _Settings.L, _SyncSettings.L);
R = new Gameboy(new CoreComm(comm.ShowMessage), rightinfo, rightrom, _Settings.R, _SyncSettings.R);
// connect link cable
LibGambatte.gambatte_linkstatus(L.GambatteState, 259);
@ -418,8 +421,79 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
#endregion
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public object GetSettings()
{
return new GambatteLinkSettings
{
L = (Gameboy.GambatteSettings)L.GetSettings(),
R = (Gameboy.GambatteSettings)R.GetSettings()
};
}
public object GetSyncSettings()
{
return new GambatteLinkSyncSettings
{
L = (Gameboy.GambatteSyncSettings)L.GetSyncSettings(),
R = (Gameboy.GambatteSyncSettings)R.GetSyncSettings()
};
}
public bool PutSettings(object o)
{
var s = (GambatteLinkSettings)o;
return L.PutSettings(s.L) || R.PutSettings(s.R);
}
public bool PutSyncSettings(object o)
{
var s = (GambatteLinkSyncSettings)o;
return L.PutSyncSettings(s.L) || R.PutSyncSettings(s.R);
}
public class GambatteLinkSettings
{
public Gameboy.GambatteSettings L;
public Gameboy.GambatteSettings R;
public static GambatteLinkSettings GetDefaults()
{
return new GambatteLinkSettings
{
L = Gameboy.GambatteSettings.GetDefaults(),
R = Gameboy.GambatteSettings.GetDefaults()
};
}
public GambatteLinkSettings Clone()
{
return new GambatteLinkSettings
{
L = L.Clone(),
R = R.Clone()
};
}
}
public class GambatteLinkSyncSettings
{
public Gameboy.GambatteSyncSettings L;
public Gameboy.GambatteSyncSettings R;
public static GambatteLinkSyncSettings GetDefaults()
{
return new GambatteLinkSyncSettings
{
L = Gameboy.GambatteSyncSettings.GetDefaults(),
R = Gameboy.GambatteSyncSettings.GetDefaults()
};
}
public GambatteLinkSyncSettings Clone()
{
return new GambatteLinkSyncSettings
{
L = L.Clone(),
R = R.Clone()
};
}
}
}
}

View File

@ -103,7 +103,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
/// set cgb palette lookup
/// </summary>
/// <param name="core">opaque state pointer</param>
/// <param name="lut">uint32[32768], input color (r,g,b) is at lut[r | g << 5 | b << 10]</param>
/// <param name="lut">uint32[32768], input color (r,g,b) is at lut[r | g &lt;&lt; 5 | b &lt;&lt; 10]</param>
[DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void gambatte_setcgbpalette(IntPtr core, int[] lut);

View File

@ -438,5 +438,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -902,6 +902,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
return false;
}
public bool PutSyncSettings(object o) { return false; }
public class NESSettings
{
@ -926,7 +927,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public NESSettings Clone()
{
return (NESSettings)MemberwiseClone();
var ret = (NESSettings)MemberwiseClone();
ret.Palette = (int[,])ret.Palette.Clone();
return ret;
}
public NESSettings()

View File

@ -1049,5 +1049,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -644,6 +644,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
Settings = n;
return ret;
}
public bool PutSyncSettings(object o) { return false; }
public class PCESettings
{

View File

@ -483,5 +483,6 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -466,5 +466,6 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -635,5 +635,6 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -628,5 +628,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -215,5 +215,6 @@ namespace BizHawk.Emulation.Cores.Sony.PSP
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}

View File

@ -285,6 +285,6 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
public object GetSettings() { return null; }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSyncSettings(object o) { return false; }
}
}