Create ISettable<T,T2>/ISettable interfaces. This checkin has not been extensively tested.
This commit is contained in:
parent
2401de6ba2
commit
a64017366c
|
@ -306,7 +306,7 @@ namespace BizHawk.Client.Common
|
|||
// Bsnes profiles have incompatible savestates so save the profile name
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
name += "." + ((LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings()).Profile;
|
||||
name += "." + (Global.Emulator as LibsnesCore).GetSyncSettings().Profile;
|
||||
}
|
||||
|
||||
if (Global.MovieSession.Movie.IsActive)
|
||||
|
|
|
@ -64,14 +64,14 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
try
|
||||
{
|
||||
var debuggable = Global.Emulator as IDebuggable;
|
||||
if (debuggable == null)
|
||||
throw new NotImplementedException();
|
||||
var debuggable = Global.Emulator as IDebuggable;
|
||||
if (debuggable == null)
|
||||
throw new NotImplementedException();
|
||||
|
||||
var registers = debuggable.GetCpuFlagsAndRegisters();
|
||||
return registers.ContainsKey(name)
|
||||
? registers[name]
|
||||
: 0;
|
||||
var registers = debuggable.GetCpuFlagsAndRegisters();
|
||||
return registers.ContainsKey(name)
|
||||
? registers[name]
|
||||
: 0;
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
|
@ -93,11 +93,11 @@ namespace BizHawk.Client.Common
|
|||
|
||||
try
|
||||
{
|
||||
var debuggable = Global.Emulator as IDebuggable;
|
||||
if (debuggable == null)
|
||||
throw new NotImplementedException();
|
||||
var debuggable = Global.Emulator as IDebuggable;
|
||||
if (debuggable == null)
|
||||
throw new NotImplementedException();
|
||||
|
||||
foreach (var kvp in debuggable.GetCpuFlagsAndRegisters())
|
||||
foreach (var kvp in debuggable.GetCpuFlagsAndRegisters())
|
||||
{
|
||||
table[kvp.Key] = kvp.Value;
|
||||
}
|
||||
|
@ -120,11 +120,11 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
try
|
||||
{
|
||||
var debuggable = Global.Emulator as IDebuggable;
|
||||
if (debuggable == null)
|
||||
throw new NotImplementedException();
|
||||
var debuggable = Global.Emulator as IDebuggable;
|
||||
if (debuggable == null)
|
||||
throw new NotImplementedException();
|
||||
|
||||
debuggable.SetCpuRegister(register, value);
|
||||
debuggable.SetCpuRegister(register, value);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
|
@ -189,25 +189,28 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
// in the future, we could do something more arbitrary here.
|
||||
// but this isn't any worse than the old system
|
||||
var s = (NES.NESSettings)Global.Emulator.GetSettings();
|
||||
var nes = Global.Emulator as NES;
|
||||
var s = nes.GetSettings();
|
||||
s.DispSprites = (bool)luaParam[0];
|
||||
s.DispBackground = (bool)luaParam[1];
|
||||
Global.Emulator.PutSettings(s);
|
||||
nes.PutSettings(s);
|
||||
}
|
||||
else if (Global.Emulator is QuickNES)
|
||||
{
|
||||
var s = (QuickNES.QuickNESSettings)Global.Emulator.GetSettings();
|
||||
var quicknes = Global.Emulator as QuickNES;
|
||||
var s = quicknes.GetSettings();
|
||||
// this core doesn't support disabling BG
|
||||
bool showsp = GetSetting(0, luaParam);
|
||||
if (showsp && s.NumSprites == 0)
|
||||
s.NumSprites = 8;
|
||||
else if (!showsp && s.NumSprites > 0)
|
||||
s.NumSprites = 0;
|
||||
Global.Emulator.PutSettings(s);
|
||||
quicknes.PutSettings(s);
|
||||
}
|
||||
else if (Global.Emulator is PCEngine)
|
||||
{
|
||||
var s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
|
||||
var pce = Global.Emulator as PCEngine;
|
||||
var s = pce.GetSettings();
|
||||
s.ShowOBJ1 = GetSetting(0, luaParam);
|
||||
s.ShowBG1 = GetSetting(1, luaParam);
|
||||
if (luaParam.Length > 2)
|
||||
|
@ -216,22 +219,24 @@ namespace BizHawk.Client.Common
|
|||
s.ShowBG2 = GetSetting(3, luaParam);
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
pce.PutSettings(s);
|
||||
}
|
||||
else if (Global.Emulator is SMS)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var sms = Global.Emulator as SMS;
|
||||
var s = sms.GetSettings();
|
||||
s.DispOBJ = GetSetting(0, luaParam);
|
||||
s.DispBG = GetSetting(1, luaParam);
|
||||
Global.Emulator.PutSettings(s);
|
||||
sms.PutSettings(s);
|
||||
}
|
||||
else if (Global.Emulator is WonderSwan)
|
||||
{
|
||||
var s = (WonderSwan.Settings)Global.Emulator.GetSettings();
|
||||
var ws = Global.Emulator as WonderSwan;
|
||||
var s = ws.GetSettings();
|
||||
s.EnableSprites = GetSetting(0, luaParam);
|
||||
s.EnableFG = GetSetting(1, luaParam);
|
||||
s.EnableBG = GetSetting(2, luaParam);
|
||||
Global.Emulator.PutSettings(s);
|
||||
ws.PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,18 +48,21 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
private static QuickNES AsQuickNES { get { return Global.Emulator as QuickNES; } }
|
||||
private static NES AsNES { get { return Global.Emulator as NES; } }
|
||||
|
||||
[LuaMethodAttributes(
|
||||
"getallowmorethaneightsprites",
|
||||
"Gets the NES setting 'Allow more than 8 sprites per scanline' value"
|
||||
)]
|
||||
public static bool GetAllowMoreThanEightSprites()
|
||||
{
|
||||
if (Global.Config.NES_InQuickNES)
|
||||
if (AsQuickNES != null)
|
||||
{
|
||||
return ((QuickNES.QuickNESSettings)Global.Emulator.GetSettings()).NumSprites != 8;
|
||||
return AsQuickNES.GetSettings().NumSprites != 8;
|
||||
}
|
||||
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).AllowMoreThanEightSprites;
|
||||
return AsNES.GetSettings().AllowMoreThanEightSprites;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -68,17 +71,14 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static int GetBottomScanline(bool pal = false)
|
||||
{
|
||||
if (Global.Config.NES_InQuickNES)
|
||||
if (AsQuickNES != null)
|
||||
{
|
||||
return ((QuickNES.QuickNESSettings)Global.Emulator.GetSettings()).ClipTopAndBottom ? 231 : 239;
|
||||
return AsQuickNES.GetSettings().ClipTopAndBottom ? 231 : 239;
|
||||
}
|
||||
|
||||
if (pal)
|
||||
{
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).PAL_BottomLine;
|
||||
}
|
||||
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).NTSC_BottomLine;
|
||||
return pal
|
||||
? AsNES.GetSettings().PAL_BottomLine
|
||||
: AsNES.GetSettings().NTSC_BottomLine;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -87,12 +87,12 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetClipLeftAndRight()
|
||||
{
|
||||
if (Global.Config.NES_InQuickNES)
|
||||
if (AsQuickNES != null)
|
||||
{
|
||||
return ((QuickNES.QuickNESSettings)Global.Emulator.GetSettings()).ClipLeftAndRight;
|
||||
return AsQuickNES.GetSettings().ClipLeftAndRight;
|
||||
}
|
||||
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).ClipLeftAndRight;
|
||||
return AsNES.GetSettings().ClipLeftAndRight;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -101,12 +101,12 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetDisplayBackground()
|
||||
{
|
||||
if (Global.Config.NES_InQuickNES)
|
||||
if (AsQuickNES != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).DispBackground;
|
||||
return AsNES.GetSettings().DispBackground;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -115,12 +115,12 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetDisplaySprites()
|
||||
{
|
||||
if (Global.Config.NES_InQuickNES)
|
||||
if (AsQuickNES != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).DispSprites;
|
||||
return AsNES.GetSettings().DispSprites;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -129,17 +129,14 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static int GetTopScanline(bool pal = false)
|
||||
{
|
||||
if (Global.Config.NES_InQuickNES)
|
||||
if (AsQuickNES != null)
|
||||
{
|
||||
return ((QuickNES.QuickNESSettings)Global.Emulator.GetSettings()).ClipTopAndBottom ? 8 : 0;
|
||||
return AsQuickNES.GetSettings().ClipTopAndBottom ? 8 : 0;
|
||||
}
|
||||
|
||||
if (pal)
|
||||
{
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).PAL_TopLine;
|
||||
}
|
||||
|
||||
return ((NES.NESSettings)Global.Emulator.GetSettings()).NTSC_TopLine;
|
||||
return pal
|
||||
? AsNES.GetSettings().PAL_TopLine
|
||||
: AsNES.GetSettings().NTSC_TopLine;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -164,15 +161,15 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is NES)
|
||||
{
|
||||
var s = (NES.NESSettings)Global.Emulator.GetSettings();
|
||||
var s = AsNES.GetSettings();
|
||||
s.AllowMoreThanEightSprites = allow;
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsNES.PutSettings(s);
|
||||
}
|
||||
else if (Global.Emulator is QuickNES)
|
||||
{
|
||||
var s = (QuickNES.QuickNESSettings)Global.Emulator.GetSettings();
|
||||
var s = AsQuickNES.GetSettings();
|
||||
s.NumSprites = allow ? 64 : 8;
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsQuickNES.PutSettings(s);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -185,16 +182,15 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is NES)
|
||||
{
|
||||
var s = (NES.NESSettings)Global.Emulator.GetSettings();
|
||||
var s = AsNES.GetSettings();
|
||||
s.ClipLeftAndRight = leftandright;
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsNES.PutSettings(s);
|
||||
}
|
||||
else if (Global.Emulator is QuickNES)
|
||||
{
|
||||
var s = (QuickNES.QuickNESSettings)Global.Emulator.GetSettings();
|
||||
var s = AsQuickNES.GetSettings();
|
||||
s.ClipLeftAndRight = leftandright;
|
||||
Global.Emulator.PutSettings(s);
|
||||
|
||||
AsQuickNES.PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,9 +202,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is NES)
|
||||
{
|
||||
var s = (NES.NESSettings)Global.Emulator.GetSettings();
|
||||
var s = AsNES.GetSettings();
|
||||
s.DispBackground = show;
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsNES.PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,9 +216,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is NES)
|
||||
{
|
||||
var s = (NES.NESSettings)Global.Emulator.GetSettings();
|
||||
var s = AsNES.GetSettings();
|
||||
s.DispSprites = show;
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsNES.PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,7 +248,7 @@ namespace BizHawk.Client.Common
|
|||
bottom = 128;
|
||||
}
|
||||
|
||||
var s = (NES.NESSettings)Global.Emulator.GetSettings();
|
||||
var s = AsNES.GetSettings();
|
||||
|
||||
if (pal)
|
||||
{
|
||||
|
@ -265,7 +261,7 @@ namespace BizHawk.Client.Common
|
|||
s.NTSC_BottomLine = bottom;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsNES.PutSettings(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using LuaInterface;
|
||||
using BizHawk.Emulation.Cores.Nintendo.SNES;
|
||||
|
||||
|
@ -17,13 +17,22 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public override string Name { get { return "snes"; } }
|
||||
|
||||
private static LibsnesCore.SnesSettings GetSettings()
|
||||
{
|
||||
return ((LibsnesCore)Global.Emulator).GetSettings();
|
||||
}
|
||||
|
||||
private static void PutSettings(LibsnesCore.SnesSettings settings) {
|
||||
((LibsnesCore)Global.Emulator).PutSettings(settings);
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
"getlayer_bg_1",
|
||||
"Returns whether the bg 1 layer is displayed"
|
||||
)]
|
||||
public static bool GetLayerBg1()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowBG1_1;
|
||||
return GetSettings().ShowBG1_1;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -32,7 +41,7 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetLayerBg2()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowBG2_1;
|
||||
return GetSettings().ShowBG2_1;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -41,7 +50,7 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetLayerBg3()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowBG3_1;
|
||||
return GetSettings().ShowBG3_1;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -50,7 +59,7 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetLayerBg4()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowBG4_1;
|
||||
return GetSettings().ShowBG4_1;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -59,7 +68,7 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetLayerObj1()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowOBJ_0;
|
||||
return GetSettings().ShowOBJ_0;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -68,7 +77,7 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetLayerObj2()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowOBJ_1;
|
||||
return GetSettings().ShowOBJ_1;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -77,7 +86,7 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetLayerObj3()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowOBJ_2;
|
||||
return GetSettings().ShowOBJ_2;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -86,7 +95,7 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public static bool GetLayerObj4()
|
||||
{
|
||||
return ((LibsnesCore.SnesSettings)Global.Emulator.GetSettings()).ShowOBJ_3;
|
||||
return GetSettings().ShowOBJ_3;
|
||||
}
|
||||
|
||||
[LuaMethodAttributes(
|
||||
|
@ -97,9 +106,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowBG1_1 = s.ShowBG1_0 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,9 +120,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowBG2_1 = s.ShowBG2_0 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,9 +134,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowBG3_1 = s.ShowBG3_0 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,9 +148,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowBG4_1 = s.ShowBG4_0 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,9 +162,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowOBJ_0 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,9 +176,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowOBJ_1 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,9 +190,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowOBJ_2 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,9 +204,9 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = GetSettings();
|
||||
s.ShowOBJ_3 = value;
|
||||
Global.Emulator.PutSettings(s);
|
||||
PutSettings(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,11 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
|
|||
movie.EmulatorVersion = VersionInfo.GetEmuVersion();
|
||||
movie.SystemID = Global.Emulator.SystemId;
|
||||
|
||||
movie.SyncSettingsJson = ConfigService.SaveWithType(Global.Emulator.GetSyncSettings());
|
||||
var settable = Global.Emulator as ISettable<object, object>;
|
||||
if (settable == null)
|
||||
throw new NotImplementedException("ISettable");
|
||||
|
||||
movie.SyncSettingsJson = ConfigService.SaveWithType(settable.GetSyncSettings());
|
||||
|
||||
if (Global.Game != null)
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions
|
|||
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
str += " (" + ((LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings()).Profile + ")";
|
||||
str += " (" + (((LibsnesCore)Global.Emulator).GetSyncSettings()).Profile + ")";
|
||||
}
|
||||
|
||||
return str;
|
||||
|
|
|
@ -412,7 +412,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
var ss = (LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var snes = (LibsnesCore)Global.Emulator;
|
||||
var ss = snes.GetSyncSettings();
|
||||
if (ss.Profile == "Performance")
|
||||
{
|
||||
var box = new MsgBox(
|
||||
|
@ -431,7 +432,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (result == DialogResult.Yes)
|
||||
{
|
||||
ss.Profile = "Compatibility";
|
||||
Global.Emulator.PutSyncSettings(ss);
|
||||
snes.PutSyncSettings(ss);
|
||||
}
|
||||
else if (result == DialogResult.Cancel)
|
||||
{
|
||||
|
@ -1300,7 +1301,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void PCESubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
var s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
|
||||
var s = ((PCEngine)Global.Emulator).GetSettings();
|
||||
|
||||
PceControllerSettingsMenuItem.Enabled = !Global.MovieSession.Movie.IsActive;
|
||||
|
||||
|
@ -1344,21 +1345,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void PCEAlwaysPerformSpriteLimitMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
|
||||
var s = ((PCEngine)Global.Emulator).GetSettings();
|
||||
s.SpriteLimit ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
||||
private void PCEAlwaysEqualizeVolumesMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
|
||||
var s = ((PCEngine)Global.Emulator).GetSettings();
|
||||
s.EqualizeVolume ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
||||
private void PCEArcadeCardRewindEnableMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
|
||||
var s = ((PCEngine)Global.Emulator).GetSettings();
|
||||
s.ArcadeCardRewindHack ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
@ -1369,8 +1370,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SMSSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
SMSregionExportToolStripMenuItem.Checked = ss.ConsoleRegion == "Export";
|
||||
SMSregionJapanToolStripMenuItem.Checked = ss.ConsoleRegion == "Japan";
|
||||
SMSregionAutoToolStripMenuItem.Checked = ss.ConsoleRegion == "Auto";
|
||||
|
@ -1408,98 +1409,98 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SMS_RegionExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.ConsoleRegion = "Export";
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMS_RegionJapan_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.ConsoleRegion = "Japan";
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMS_RegionAuto_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.ConsoleRegion = "Auto";
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMS_DisplayNTSC_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.DisplayType = "NTSC";
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMS_DisplayPAL_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.DisplayType = "PAL";
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMS_DisplayAuto_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.DisplayType = "Auto";
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMS_BIOS_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.UseBIOS ^= true;
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMSEnableFMChipMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.EnableFM ^= true;
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMSOverclockMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (SMS.SMSSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((SMS)Global.Emulator).GetSyncSettings();
|
||||
ss.AllowOverlock ^= true;
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
||||
private void SMSForceStereoMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
s.ForceStereoSeparation ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
||||
private void SMSSpriteLimitMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
s.SpriteLimit ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
||||
private void SMSFix3DDisplayMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
s.Fix3D ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
||||
private void ShowClippedRegionsMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
s.ShowClippedRegions ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
||||
private void HighlightActiveDisplayRegionMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
s.HighlightActiveDisplayRegion ^= true;
|
||||
PutCoreSettings(s);
|
||||
}
|
||||
|
@ -1617,21 +1618,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void GBForceDMGMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var s = ((Gameboy)Global.Emulator).GetSyncSettings();
|
||||
s.ForceDMG ^= true;
|
||||
PutCoreSyncSettings(s);
|
||||
}
|
||||
|
||||
private void GBAInCGBModeMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var s = ((Gameboy)Global.Emulator).GetSyncSettings();
|
||||
s.GBACGB ^= true;
|
||||
PutCoreSyncSettings(s);
|
||||
}
|
||||
|
||||
private void GBMulticartCompatibilityMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var s = ((Gameboy)Global.Emulator).GetSyncSettings();
|
||||
s.MulticartCompat ^= true;
|
||||
PutCoreSyncSettings(s);
|
||||
}
|
||||
|
@ -1691,7 +1692,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SNESDisplayMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = ((LibsnesCore)Global.Emulator).GetSettings();
|
||||
|
||||
SnesBg1MenuItem.Checked = s.ShowBG1_1;
|
||||
SnesBg2MenuItem.Checked = s.ShowBG2_1;
|
||||
|
@ -1781,13 +1782,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ColecoSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (ColecoVision.ColecoSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((ColecoVision)Global.Emulator).GetSyncSettings();
|
||||
ColecoSkipBiosMenuItem.Checked = ss.SkipBiosIntro;
|
||||
}
|
||||
|
||||
private void ColecoSkipBiosMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (ColecoVision.ColecoSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((ColecoVision)Global.Emulator).GetSyncSettings();
|
||||
ss.SkipBiosIntro ^= true;
|
||||
PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
@ -1805,7 +1806,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
N64CircularAnalogRangeMenuItem.Checked = Global.Config.N64UseCircularAnalogConstraint;
|
||||
|
||||
var s = (N64Settings)Global.Emulator.GetSettings();
|
||||
var s = ((N64)Global.Emulator).GetSettings();
|
||||
MupenStyleLagMenuItem.Checked = s.UseMupenStyleLag;
|
||||
|
||||
//var ss = (N64SyncSettings)Global.Emulator.GetSyncSettings();
|
||||
|
@ -1854,16 +1855,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void MupenStyleLagMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (N64Settings)Global.Emulator.GetSettings();
|
||||
var n64 = (N64)Global.Emulator;
|
||||
var s = n64.GetSettings();
|
||||
s.UseMupenStyleLag ^= true;
|
||||
Global.Emulator.PutSettings(s);
|
||||
n64.PutSettings(s);
|
||||
}
|
||||
|
||||
private void N64ExpansionSlotMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ss = (N64SyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var n64 = (N64)Global.Emulator;
|
||||
var ss = n64.GetSyncSettings();
|
||||
ss.DisableExpansionSlot ^= true;
|
||||
Global.Emulator.PutSyncSettings(ss);
|
||||
n64.PutSyncSettings(ss);
|
||||
FlagNeedsReboot();
|
||||
}
|
||||
|
||||
|
|
|
@ -507,8 +507,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
Global.AutofireStickyXORAdapter.MassToggleStickyState(Global.ActiveController.PressedButtons);
|
||||
}
|
||||
|
||||
// autohold/autofire must not be affected by the following inputs
|
||||
Global.ActiveController.Overrides(Global.LuaAndAdaptor);
|
||||
// autohold/autofire must not be affected by the following inputs
|
||||
Global.ActiveController.Overrides(Global.LuaAndAdaptor);
|
||||
|
||||
if (GlobalWin.Tools.Has<LuaConsole>())
|
||||
{
|
||||
|
@ -1068,9 +1068,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private static LibsnesCore AsSNES { get { return Global.Emulator as LibsnesCore; } }
|
||||
|
||||
public void SNES_ToggleBG1(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowBG1_1 = s.ShowBG1_0 = setto.Value;
|
||||
|
@ -1080,13 +1082,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
s.ShowBG1_1 = s.ShowBG1_0 ^= true;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowBG1_1 ? "BG 1 Layer On" : "BG 1 Layer Off");
|
||||
}
|
||||
|
||||
public void SNES_ToggleBG2(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowBG2_1 = s.ShowBG2_0 = setto.Value;
|
||||
|
@ -1096,13 +1098,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
s.ShowBG2_1 = s.ShowBG2_0 ^= true;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowBG2_1 ? "BG 2 Layer On" : "BG 2 Layer Off");
|
||||
}
|
||||
|
||||
public void SNES_ToggleBG3(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowBG3_1 = s.ShowBG3_0 = setto.Value;
|
||||
|
@ -1112,13 +1114,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
s.ShowBG3_1 = s.ShowBG3_0 ^= true;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowBG3_1 ? "BG 3 Layer On" : "BG 3 Layer Off");
|
||||
}
|
||||
|
||||
public void SNES_ToggleBG4(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowBG4_1 = s.ShowBG4_0 = setto.Value;
|
||||
|
@ -1128,13 +1130,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
s.ShowBG4_1 = s.ShowBG4_0 ^= true;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowBG4_1 ? "BG 4 Layer On" : "BG 4 Layer Off");
|
||||
}
|
||||
|
||||
public void SNES_ToggleObj1(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowOBJ_0 = setto.Value;
|
||||
|
@ -1144,13 +1146,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
s.ShowOBJ_0 ^= true;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowOBJ_0 ? "OBJ 1 Layer On" : "OBJ 1 Layer Off");
|
||||
}
|
||||
|
||||
public void SNES_ToggleObj2(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowOBJ_1 = setto.Value;
|
||||
|
@ -1159,13 +1161,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
s.ShowOBJ_1 ^= true;
|
||||
}
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowOBJ_1 ? "OBJ 2 Layer On" : "OBJ 2 Layer Off");
|
||||
}
|
||||
|
||||
public void SNES_ToggleOBJ3(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowOBJ_2 = setto.Value;
|
||||
|
@ -1175,13 +1177,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
s.ShowOBJ_2 ^= true;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowOBJ_2 ? "OBJ 3 Layer On" : "OBJ 3 Layer Off");
|
||||
}
|
||||
|
||||
public void SNES_ToggleOBJ4(bool? setto = null)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = AsSNES.GetSettings();
|
||||
if (setto.HasValue)
|
||||
{
|
||||
s.ShowOBJ_3 = setto.Value;
|
||||
|
@ -1191,7 +1193,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
s.ShowOBJ_3 ^= true;
|
||||
}
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
AsSNES.PutSettings(s);
|
||||
GlobalWin.OSD.AddMessage(s.ShowOBJ_3 ? "OBJ 4 Layer On" : "OBJ 4 Layer Off");
|
||||
}
|
||||
|
||||
|
@ -1484,108 +1486,108 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
private void HandlePlatformMenus()
|
||||
{
|
||||
var system = string.Empty;
|
||||
if (!Global.Game.IsNullInstance)
|
||||
{
|
||||
//New Code
|
||||
{
|
||||
var system = string.Empty;
|
||||
if (!Global.Game.IsNullInstance)
|
||||
{
|
||||
//New Code
|
||||
//We use SystemID as that has the system we are playing on.
|
||||
system = Global.Emulator.SystemId;
|
||||
//Old Code below.
|
||||
//system = Global.Game.System;
|
||||
system = Global.Emulator.SystemId;
|
||||
//Old Code below.
|
||||
//system = Global.Game.System;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
TI83SubMenu.Visible = false;
|
||||
NESSubMenu.Visible = false;
|
||||
PCESubMenu.Visible = false;
|
||||
SMSSubMenu.Visible = false;
|
||||
GBSubMenu.Visible = false;
|
||||
GBASubMenu.Visible = false;
|
||||
AtariSubMenu.Visible = false;
|
||||
SNESSubMenu.Visible = false;
|
||||
ColecoSubMenu.Visible = false;
|
||||
N64SubMenu.Visible = false;
|
||||
SaturnSubMenu.Visible = false;
|
||||
DGBSubMenu.Visible = false;
|
||||
GenesisSubMenu.Visible = false;
|
||||
wonderSwanToolStripMenuItem.Visible = false;
|
||||
TI83SubMenu.Visible = false;
|
||||
NESSubMenu.Visible = false;
|
||||
PCESubMenu.Visible = false;
|
||||
SMSSubMenu.Visible = false;
|
||||
GBSubMenu.Visible = false;
|
||||
GBASubMenu.Visible = false;
|
||||
AtariSubMenu.Visible = false;
|
||||
SNESSubMenu.Visible = false;
|
||||
ColecoSubMenu.Visible = false;
|
||||
N64SubMenu.Visible = false;
|
||||
SaturnSubMenu.Visible = false;
|
||||
DGBSubMenu.Visible = false;
|
||||
GenesisSubMenu.Visible = false;
|
||||
wonderSwanToolStripMenuItem.Visible = false;
|
||||
|
||||
switch (system)
|
||||
{
|
||||
case "GEN":
|
||||
GenesisSubMenu.Visible = true;
|
||||
break;
|
||||
case "TI83":
|
||||
TI83SubMenu.Visible = true;
|
||||
break;
|
||||
case "NES":
|
||||
NESSubMenu.Visible = true;
|
||||
break;
|
||||
case "PCE":
|
||||
case "PCECD":
|
||||
case "SGX":
|
||||
PCESubMenu.Visible = true;
|
||||
break;
|
||||
case "SMS":
|
||||
SMSSubMenu.Text = "&SMS";
|
||||
SMSSubMenu.Visible = true;
|
||||
break;
|
||||
case "SG":
|
||||
SMSSubMenu.Text = "&SG";
|
||||
SMSSubMenu.Visible = true;
|
||||
break;
|
||||
case "GG":
|
||||
SMSSubMenu.Text = "&GG";
|
||||
SMSSubMenu.Visible = true;
|
||||
break;
|
||||
case "GB":
|
||||
case "GBC":
|
||||
GBSubMenu.Visible = true;
|
||||
break;
|
||||
case "GBA":
|
||||
GBASubMenu.Visible = true;
|
||||
break;
|
||||
case "A26":
|
||||
AtariSubMenu.Visible = true;
|
||||
break;
|
||||
case "SNES":
|
||||
case "SGB":
|
||||
// TODO: fix SNES9x here
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
if ((Global.Emulator as LibsnesCore).IsSGB)
|
||||
{
|
||||
SNESSubMenu.Text = "&SGB";
|
||||
}
|
||||
else
|
||||
{
|
||||
SNESSubMenu.Text = "&SNES";
|
||||
}
|
||||
SNESSubMenu.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SNESSubMenu.Visible = false;
|
||||
}
|
||||
break;
|
||||
case "Coleco":
|
||||
ColecoSubMenu.Visible = true;
|
||||
break;
|
||||
case "N64":
|
||||
N64SubMenu.Visible = true;
|
||||
break;
|
||||
case "SAT":
|
||||
SaturnSubMenu.Visible = true;
|
||||
break;
|
||||
case "DGB":
|
||||
DGBSubMenu.Visible = true;
|
||||
break;
|
||||
case "WSWAN":
|
||||
wonderSwanToolStripMenuItem.Visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (system)
|
||||
{
|
||||
case "GEN":
|
||||
GenesisSubMenu.Visible = true;
|
||||
break;
|
||||
case "TI83":
|
||||
TI83SubMenu.Visible = true;
|
||||
break;
|
||||
case "NES":
|
||||
NESSubMenu.Visible = true;
|
||||
break;
|
||||
case "PCE":
|
||||
case "PCECD":
|
||||
case "SGX":
|
||||
PCESubMenu.Visible = true;
|
||||
break;
|
||||
case "SMS":
|
||||
SMSSubMenu.Text = "&SMS";
|
||||
SMSSubMenu.Visible = true;
|
||||
break;
|
||||
case "SG":
|
||||
SMSSubMenu.Text = "&SG";
|
||||
SMSSubMenu.Visible = true;
|
||||
break;
|
||||
case "GG":
|
||||
SMSSubMenu.Text = "&GG";
|
||||
SMSSubMenu.Visible = true;
|
||||
break;
|
||||
case "GB":
|
||||
case "GBC":
|
||||
GBSubMenu.Visible = true;
|
||||
break;
|
||||
case "GBA":
|
||||
GBASubMenu.Visible = true;
|
||||
break;
|
||||
case "A26":
|
||||
AtariSubMenu.Visible = true;
|
||||
break;
|
||||
case "SNES":
|
||||
case "SGB":
|
||||
// TODO: fix SNES9x here
|
||||
if (Global.Emulator is LibsnesCore)
|
||||
{
|
||||
if ((Global.Emulator as LibsnesCore).IsSGB)
|
||||
{
|
||||
SNESSubMenu.Text = "&SGB";
|
||||
}
|
||||
else
|
||||
{
|
||||
SNESSubMenu.Text = "&SNES";
|
||||
}
|
||||
SNESSubMenu.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SNESSubMenu.Visible = false;
|
||||
}
|
||||
break;
|
||||
case "Coleco":
|
||||
ColecoSubMenu.Visible = true;
|
||||
break;
|
||||
case "N64":
|
||||
N64SubMenu.Visible = true;
|
||||
break;
|
||||
case "SAT":
|
||||
SaturnSubMenu.Visible = true;
|
||||
break;
|
||||
case "DGB":
|
||||
DGBSubMenu.Visible = true;
|
||||
break;
|
||||
case "WSWAN":
|
||||
wonderSwanToolStripMenuItem.Visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitControls()
|
||||
{
|
||||
|
@ -1724,9 +1726,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
var sfd = new SaveFileDialog();
|
||||
sfd.AddExtension = true;
|
||||
sfd.DefaultExt = "State";
|
||||
sfd.Filter = "Save States (*.State)|*.State|All Files|*.*";
|
||||
sfd.AddExtension = true;
|
||||
sfd.DefaultExt = "State";
|
||||
sfd.Filter = "Save States (*.State)|*.State|All Files|*.*";
|
||||
var path = PathManager.GetSaveStatePath(Global.Game);
|
||||
sfd.InitialDirectory = path;
|
||||
sfd.FileName = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave0.State";
|
||||
|
@ -1923,7 +1925,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
public void PutCoreSettings(object o)
|
||||
{
|
||||
if (Global.Emulator.PutSettings(o))
|
||||
var settable = Global.Emulator as ISettable;
|
||||
if (settable != null && settable.PutSettings(o))
|
||||
{
|
||||
FlagNeedsReboot();
|
||||
}
|
||||
|
@ -1934,11 +1937,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
public void PutCoreSyncSettings(object o)
|
||||
{
|
||||
var settable = Global.Emulator as ISettable;
|
||||
if (Global.MovieSession.Movie.IsActive)
|
||||
{
|
||||
GlobalWin.OSD.AddMessage("Attempt to change sync-relevant settings while recording BLOCKED.");
|
||||
}
|
||||
else if (Global.Emulator.PutSyncSettings(o))
|
||||
else if (settable != null && settable.PutSyncSettings(o))
|
||||
{
|
||||
FlagNeedsReboot();
|
||||
}
|
||||
|
@ -3182,7 +3186,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// the new settings objects
|
||||
CommitCoreSettingsToConfig(); // adelikat: I Think by reordering things, this isn't necessary anymore
|
||||
CloseGame();
|
||||
|
||||
|
||||
var nextComm = CreateCoreComm();
|
||||
CoreFileProvider.SyncCoreCommInputSignals(nextComm);
|
||||
var result = loader.LoadRom(path, nextComm);
|
||||
|
@ -3289,7 +3293,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else
|
||||
{
|
||||
//This shows up if there's a problem
|
||||
//This shows up if there's a problem
|
||||
// TODO: put all these in a single method or something
|
||||
HandlePlatformMenus();
|
||||
_stateSlots.Clear();
|
||||
|
@ -3344,19 +3348,23 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
// save settings object
|
||||
var t = Global.Emulator.GetType();
|
||||
Global.Config.PutCoreSettings(Global.Emulator.GetSettings(), t);
|
||||
var settable = Global.Emulator as ISettable;
|
||||
if (settable == null)
|
||||
return;
|
||||
|
||||
Global.Config.PutCoreSettings(settable.GetSettings(), t);
|
||||
|
||||
// don't trample config with loaded-from-movie settings
|
||||
if (!Global.MovieSession.Movie.IsActive)
|
||||
{
|
||||
Global.Config.PutCoreSyncSettings(Global.Emulator.GetSyncSettings(), t);
|
||||
Global.Config.PutCoreSyncSettings(settable.GetSyncSettings(), t);
|
||||
}
|
||||
}
|
||||
|
||||
// whats the difference between these two methods??
|
||||
// its very tricky. rename to be more clear or combine them.
|
||||
// This gets called whenever a core related thing is changed.
|
||||
// Like reboot core.
|
||||
// This gets called whenever a core related thing is changed.
|
||||
// Like reboot core.
|
||||
private void CloseGame(bool clearSram = false)
|
||||
{
|
||||
if (clearSram)
|
||||
|
@ -3392,8 +3400,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void CloseRom(bool clearSram = false)
|
||||
{
|
||||
//This gets called after Close Game gets called.
|
||||
//Tested with NESHawk and SMB3 (U)
|
||||
//This gets called after Close Game gets called.
|
||||
//Tested with NESHawk and SMB3 (U)
|
||||
if (GlobalWin.Tools.AskSave())
|
||||
{
|
||||
CloseGame(clearSram);
|
||||
|
@ -3447,48 +3455,48 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#endregion
|
||||
|
||||
#region Tool Control API
|
||||
#region Tool Control API
|
||||
|
||||
// TODO: move me
|
||||
public IControlMainform master { get; private set; }
|
||||
// TODO: move me
|
||||
public IControlMainform master { get; private set; }
|
||||
public void RelinquishControl(IControlMainform master)
|
||||
{
|
||||
this.master = master;
|
||||
}
|
||||
|
||||
private void ToggleReadOnly()
|
||||
{
|
||||
if (IsSlave && master.WantsToControlReadOnly)
|
||||
{
|
||||
master.ToggleReadOnly();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Global.MovieSession.Movie.IsActive)
|
||||
{
|
||||
Global.MovieSession.ReadOnly ^= true;
|
||||
GlobalWin.OSD.AddMessage(Global.MovieSession.ReadOnly ? "Movie read-only mode" : "Movie read+write mode");
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalWin.OSD.AddMessage("No movie active");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ToggleReadOnly()
|
||||
{
|
||||
if (IsSlave && master.WantsToControlReadOnly)
|
||||
{
|
||||
master.ToggleReadOnly();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Global.MovieSession.Movie.IsActive)
|
||||
{
|
||||
Global.MovieSession.ReadOnly ^= true;
|
||||
GlobalWin.OSD.AddMessage(Global.MovieSession.ReadOnly ? "Movie read-only mode" : "Movie read+write mode");
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalWin.OSD.AddMessage("No movie active");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StopMovie(bool saveChanges = true)
|
||||
{
|
||||
if (IsSlave && master.WantsToControlStopMovie)
|
||||
{
|
||||
master.StopMovie();
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.MovieSession.StopMovie(saveChanges);
|
||||
SetMainformMovieInfo();
|
||||
UpdateStatusSlots();
|
||||
}
|
||||
}
|
||||
public void StopMovie(bool saveChanges = true)
|
||||
{
|
||||
if (IsSlave && master.WantsToControlStopMovie)
|
||||
{
|
||||
master.StopMovie();
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.MovieSession.StopMovie(saveChanges);
|
||||
SetMainformMovieInfo();
|
||||
UpdateStatusSlots();
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsSlave
|
||||
{
|
||||
|
@ -3503,7 +3511,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void GBAcoresettingsToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenericCoreConfig.DoDialog(this, "Gameboy Advance Settings");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void CaptureRewind(bool suppressCaptureRewind)
|
||||
|
@ -3542,11 +3550,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
return isRewinding;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
private void LinkConnectStatusBarButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
// TODO: it would be cool if clicking this toggled the state
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,14 +91,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
using (var dlg = new CGBColorChooserForm())
|
||||
{
|
||||
dlg.LoadType((Gameboy.GambatteSettings)Global.Emulator.GetSettings());
|
||||
var gb = Global.Emulator as Gameboy;
|
||||
dlg.LoadType(gb.GetSettings());
|
||||
|
||||
var result = dlg.ShowDialog(parent);
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
var s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
|
||||
var s = gb.GetSettings();
|
||||
s.CGBColors = dlg.type;
|
||||
Global.Emulator.PutSettings(s);
|
||||
gb.PutSettings(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,8 +232,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
using (var dlg = new ColorChooserForm())
|
||||
{
|
||||
var gb = Global.Emulator as Gameboy;
|
||||
if (fromemu)
|
||||
s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
|
||||
s = gb.GetSettings();
|
||||
dlg.SetAllColors(s.GBPalette);
|
||||
|
||||
var result = dlg.ShowDialog(parent);
|
||||
|
@ -245,7 +246,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
s.GBPalette = colorints;
|
||||
if (fromemu)
|
||||
Global.Emulator.PutSettings(s);
|
||||
gb.PutSettings(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,9 @@ namespace BizHawk.Client.EmuHawk.config.GB
|
|||
|
||||
public static void DoDGBPrefsDialog(IWin32Window owner)
|
||||
{
|
||||
var s = (GambatteLink.GambatteLinkSettings)Global.Emulator.GetSettings();
|
||||
var ss = (GambatteLink.GambatteLinkSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var gambatte = (GambatteLink)Global.Emulator;
|
||||
var s = gambatte.GetSettings();
|
||||
var ss = gambatte.GetSyncSettings();
|
||||
|
||||
using (var dlg = new DGBPrefs())
|
||||
{
|
||||
|
@ -61,7 +62,7 @@ namespace BizHawk.Client.EmuHawk.config.GB
|
|||
if (dlg.ShowDialog(owner) == DialogResult.OK)
|
||||
{
|
||||
dlg.GetSettings(out s, out ss);
|
||||
Global.Emulator.PutSettings(s);
|
||||
gambatte.PutSettings(s);
|
||||
if (dlg.SyncSettingsChanged)
|
||||
GlobalWin.MainForm.PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
|
|
@ -20,17 +20,18 @@ namespace BizHawk.Client.EmuHawk.config.GB
|
|||
|
||||
public static void DoGBPrefsDialog(IWin32Window owner)
|
||||
{
|
||||
var s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings();
|
||||
var ss = (Gameboy.GambatteSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var gb = ((Gameboy)Global.Emulator);
|
||||
var s = gb.GetSettings();
|
||||
var ss = gb.GetSyncSettings();
|
||||
|
||||
using (var dlg = new GBPrefs())
|
||||
{
|
||||
dlg.gbPrefControl1.PutSettings(s, ss);
|
||||
dlg.gbPrefControl1.ColorGameBoy = ((Gameboy)Global.Emulator).IsCGBMode();
|
||||
dlg.gbPrefControl1.ColorGameBoy = gb.IsCGBMode();
|
||||
if (dlg.ShowDialog(owner) == DialogResult.OK)
|
||||
{
|
||||
dlg.gbPrefControl1.GetSettings(out s, out ss);
|
||||
Global.Emulator.PutSettings(s);
|
||||
gb.PutSettings(s);
|
||||
if (dlg.gbPrefControl1.SyncSettingsChanged)
|
||||
GlobalWin.MainForm.PutCoreSyncSettings(ss);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ using System.Text;
|
|||
using System.Windows.Forms;
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
@ -21,8 +22,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
InitializeComponent();
|
||||
|
||||
s = Global.Emulator.GetSettings();
|
||||
ss = Global.Emulator.GetSyncSettings();
|
||||
var settable = Global.Emulator as ISettable;
|
||||
|
||||
if (settable != null)
|
||||
{
|
||||
s = settable.GetSettings();
|
||||
ss = settable.GetSyncSettings();
|
||||
}
|
||||
|
||||
if (s != null)
|
||||
propertyGrid1.SelectedObject = s;
|
||||
|
@ -39,8 +45,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (s != null)
|
||||
Global.Emulator.PutSettings(s);
|
||||
var settable = Global.Emulator as ISettable;
|
||||
if (s != null && settable != null)
|
||||
{
|
||||
settable.PutSettings(s);
|
||||
}
|
||||
|
||||
if (ss != null && syncsettingschanged)
|
||||
GlobalWin.MainForm.PutCoreSyncSettings(ss);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void N64ControllersSetup_Load(object sender, EventArgs e)
|
||||
{
|
||||
var n64Settings = (N64SyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var n64Settings = ((N64)Global.Emulator).GetSyncSettings();
|
||||
|
||||
ControllerSettingControls
|
||||
.ForEach(c =>
|
||||
|
@ -45,7 +45,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void OkBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var n64Settings = (N64SyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var n64 = (N64)Global.Emulator;
|
||||
var n64Settings = n64.GetSyncSettings();
|
||||
|
||||
ControllerSettingControls
|
||||
.ForEach(c =>
|
||||
|
@ -54,7 +55,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
n64Settings.Controllers[c.ControllerNumber - 1].PakType = c.PakType;
|
||||
});
|
||||
|
||||
Global.Emulator.PutSyncSettings(n64Settings);
|
||||
n64.PutSyncSettings(n64Settings);
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Global.Emulator is N64)
|
||||
{
|
||||
return (N64SyncSettings)Global.Emulator.GetSyncSettings();
|
||||
return ((N64)Global.Emulator).GetSyncSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Global.Emulator is N64)
|
||||
{
|
||||
return (N64Settings)Global.Emulator.GetSettings();
|
||||
return ((N64)Global.Emulator).GetSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Global.Emulator is N64)
|
||||
{
|
||||
return (N64SyncSettings)Global.Emulator.GetSyncSettings();
|
||||
return ((N64)Global.Emulator).GetSyncSettings();
|
||||
}
|
||||
|
||||
return (N64SyncSettings)Global.Config.GetCoreSyncSettings<N64>()
|
||||
|
@ -96,7 +96,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Global.Emulator is N64)
|
||||
{
|
||||
return (N64Settings)Global.Emulator.GetSettings();
|
||||
return ((N64)Global.Emulator).GetSettings();
|
||||
}
|
||||
|
||||
return (N64Settings)Global.Config.GetCoreSettings<N64>()
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private static NES AsNES { get { return Global.Emulator as NES; } }
|
||||
|
||||
public NESSoundConfig()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -48,7 +50,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void NESSoundConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
_oldSettings = (NES.NESSettings)Global.Emulator.GetSettings();
|
||||
_oldSettings = AsNES.GetSettings();
|
||||
_settings = _oldSettings.Clone();
|
||||
|
||||
trackBar1.Value = _settings.Square1;
|
||||
|
@ -66,7 +68,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
// restore previous value
|
||||
Global.Emulator.PutSettings(_oldSettings);
|
||||
AsNES.PutSettings(_oldSettings);
|
||||
Close();
|
||||
}
|
||||
|
||||
|
@ -74,35 +76,35 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
label6.Text = trackBar1.Value.ToString();
|
||||
_settings.Square1 = trackBar1.Value;
|
||||
Global.Emulator.PutSettings(_settings);
|
||||
AsNES.PutSettings(_settings);
|
||||
}
|
||||
|
||||
private void trackBar2_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
label7.Text = trackBar2.Value.ToString();
|
||||
_settings.Square2 = trackBar2.Value;
|
||||
Global.Emulator.PutSettings(_settings);
|
||||
AsNES.PutSettings(_settings);
|
||||
}
|
||||
|
||||
private void trackBar3_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
label8.Text = trackBar3.Value.ToString();
|
||||
_settings.Triangle = trackBar3.Value;
|
||||
Global.Emulator.PutSettings(_settings);
|
||||
AsNES.PutSettings(_settings);
|
||||
}
|
||||
|
||||
private void trackBar4_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
label9.Text = trackBar4.Value.ToString();
|
||||
_settings.Noise = trackBar4.Value;
|
||||
Global.Emulator.PutSettings(_settings);
|
||||
AsNES.PutSettings(_settings);
|
||||
}
|
||||
|
||||
private void trackBar5_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
label10.Text = trackBar5.Value.ToString();
|
||||
_settings.DMC = trackBar5.Value;
|
||||
Global.Emulator.PutSettings(_settings);
|
||||
AsNES.PutSettings(_settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public NESSyncSettingsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
SyncSettings = (NES.NESSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
SyncSettings = ((NES)Global.Emulator).GetSyncSettings();
|
||||
DTDB = new DataTableDictionaryBind<string, string>(SyncSettings.BoardProperties);
|
||||
dataGridView1.DataSource = DTDB.Table;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
public NesControllerSettings()
|
||||
{
|
||||
InitializeComponent();
|
||||
SyncSettings = (NES.NESSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
SyncSettings = ((NES)Global.Emulator).GetSyncSettings();
|
||||
|
||||
// TODO: use combobox extension and add descriptions to enum values
|
||||
comboBoxFamicom.Items.AddRange(NESControlSettings.GetFamicomExpansionValues().ToArray());
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void QuickNesConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
Settings = (QuickNES.QuickNESSettings)Global.Emulator.GetSettings();
|
||||
Settings = ((QuickNES)Global.Emulator).GetSettings();
|
||||
propertyGrid1.SelectedObject = Settings;
|
||||
SetPaletteImage();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void PCEControllerConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
var pceSettings = (PCEngine.PCESyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var pceSettings = ((PCEngine)Global.Emulator).GetSyncSettings();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Controls.Add(new Label
|
||||
|
@ -42,7 +42,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void OkBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var pceSettings = (PCEngine.PCESyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var pceSettings = ((PCEngine)Global.Emulator).GetSyncSettings();
|
||||
|
||||
Controls
|
||||
.OfType<CheckBox>()
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void PCEGraphicsConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
PCEngine.PCESettings s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
|
||||
PCEngine.PCESettings s = ((PCEngine)Global.Emulator).GetSettings();
|
||||
|
||||
DispOBJ1.Checked = s.ShowOBJ1;
|
||||
DispBG1.Checked = s.ShowBG1;
|
||||
|
@ -25,12 +25,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
PCEngine.PCESettings s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
|
||||
var pce = (PCEngine)Global.Emulator;
|
||||
PCEngine.PCESettings s = pce.GetSettings();
|
||||
s.ShowOBJ1 = DispOBJ1.Checked;
|
||||
s.ShowBG1 = DispBG1.Checked;
|
||||
s.ShowOBJ2 = DispOBJ2.Checked;
|
||||
s.ShowBG2 = DispBG2.Checked;
|
||||
Global.Emulator.PutSettings(s);
|
||||
pce.PutSettings(s);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
where TEmulator : IEmulator
|
||||
{
|
||||
// should we complain if we get a successful object from the config file, but it is the wrong type?
|
||||
return Global.Emulator.GetSyncSettings() as TSetting
|
||||
return ((ISettable)Global.Emulator).GetSyncSettings() as TSetting
|
||||
?? Global.Config.GetCoreSyncSettings<TEmulator>() as TSetting
|
||||
?? new TSetting(); // guaranteed to give sensible defaults
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
where TEmulator : IEmulator
|
||||
{
|
||||
// should we complain if we get a successful object from the config file, but it is the wrong type?
|
||||
return Global.Emulator.GetSettings() as TSetting
|
||||
return ((ISettable)Global.Emulator).GetSettings() as TSetting
|
||||
?? Global.Config.GetCoreSettings<TEmulator>() as TSetting
|
||||
?? new TSetting(); // guaranteed to give sensible defaults
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Global.Emulator is TEmulator)
|
||||
{
|
||||
Global.Emulator.PutSettings(o);
|
||||
((ISettable)Global.Emulator).PutSettings(o);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -16,14 +16,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SMSGraphicsConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
DispOBJ.Checked = s.DispOBJ;
|
||||
DispBG.Checked = s.DispBG;
|
||||
}
|
||||
|
||||
private void OK_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (SMS.SMSSettings)Global.Emulator.GetSettings();
|
||||
var s = ((SMS)Global.Emulator).GetSettings();
|
||||
s.DispOBJ = DispOBJ.Checked;
|
||||
s.DispBG = DispBG.Checked;
|
||||
GlobalWin.MainForm.PutCoreSettings(s);
|
||||
|
|
|
@ -59,8 +59,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public static void DoSettingsDialog(IWin32Window owner)
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var ss = (LibsnesCore.SnesSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var s = ((LibsnesCore)Global.Emulator).GetSettings();
|
||||
var ss = ((LibsnesCore)Global.Emulator).GetSyncSettings();
|
||||
var dlg = new SNESOptions
|
||||
{
|
||||
UseRingBuffer = s.UseRingBuffer,
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void TI83PaletteConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
var s = (TI83.TI83Settings)Global.Emulator.GetSettings();
|
||||
var s = ((TI83)Global.Emulator).GetSettings();
|
||||
|
||||
// Alpha hack because Winform is lame with colors
|
||||
BackgroundPanel.BackColor = Color.FromArgb(255, Color.FromArgb((int)s.BGColor));
|
||||
|
@ -30,11 +30,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void OkBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var s = (TI83.TI83Settings)Global.Emulator.GetSettings();
|
||||
var ti83 = (TI83)Global.Emulator;
|
||||
var s = ti83.GetSettings();
|
||||
s.BGColor = (uint)BackgroundPanel.BackColor.ToArgb();
|
||||
s.ForeColor = (uint)ForeGroundPanel.BackColor.ToArgb();
|
||||
|
||||
Global.Emulator.PutSettings(s);
|
||||
ti83.PutSettings(s);
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
|
|
|
@ -1350,7 +1350,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (suppression) return;
|
||||
var pal = (SnesColors.ColorType)comboPalette.SelectedValue;
|
||||
Console.WriteLine("set {0}", pal);
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = ((LibsnesCore)Global.Emulator).GetSettings();
|
||||
s.Palette = pal.ToString();
|
||||
if (currentSnesCore != null)
|
||||
{
|
||||
|
@ -1364,7 +1364,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
void RefreshBGENCheckStatesFromConfig()
|
||||
{
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var s = ((LibsnesCore)Global.Emulator).GetSettings();
|
||||
checkEN0_BG1.Checked = s.ShowBG1_0;
|
||||
checkEN0_BG2.Checked = s.ShowBG2_0;
|
||||
checkEN0_BG3.Checked = s.ShowBG3_0;
|
||||
|
@ -1382,7 +1382,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void checkEN_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(suppression) return;
|
||||
var s = (LibsnesCore.SnesSettings)Global.Emulator.GetSettings();
|
||||
var snes = ((LibsnesCore)Global.Emulator);
|
||||
var s = snes.GetSettings();
|
||||
if (sender == checkEN0_BG1) s.ShowBG1_0 = checkEN0_BG1.Checked;
|
||||
if (sender == checkEN0_BG2) s.ShowBG2_0 = checkEN0_BG2.Checked;
|
||||
if (sender == checkEN0_BG3) s.ShowBG3_0 = checkEN0_BG3.Checked;
|
||||
|
@ -1414,7 +1415,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshBGENCheckStatesFromConfig();
|
||||
suppression = false;
|
||||
}
|
||||
Global.Emulator.PutSettings(s);
|
||||
snes.PutSettings(s);
|
||||
}
|
||||
|
||||
private void lblEnPrio0_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas()
|
||||
{
|
||||
var ss = (N64SyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((N64)Global.Emulator).GetSyncSettings();
|
||||
for (var i = 0; i < 4; i++)
|
||||
{
|
||||
if (ss.Controllers[i].IsConnected)
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Global.Emulator is NES)
|
||||
{
|
||||
var ss = (NES.NESSyncSettings)Global.Emulator.GetSyncSettings();
|
||||
var ss = ((NES)Global.Emulator).GetSyncSettings();
|
||||
var core = (Global.Emulator as NES);
|
||||
var isFds = core.BoardName == "FDS";
|
||||
if (ss.Controls.Famicom)
|
||||
|
|
|
@ -118,11 +118,6 @@ namespace BizHawk.Emulation.Common
|
|||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -126,9 +126,34 @@ namespace BizHawk.Emulation.Common
|
|||
/// the corecomm module in use by this core.
|
||||
/// </summary>
|
||||
CoreComm CoreComm { get; }
|
||||
}
|
||||
|
||||
// ====settings interface====
|
||||
public interface IDebuggable : IEmulator
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a list of Cpu registers and their current state
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Dictionary<string, int> GetCpuFlagsAndRegisters();
|
||||
|
||||
/// <summary>
|
||||
/// Sets a given Cpu register to the given value
|
||||
/// </summary>
|
||||
/// <param name="register"></param>
|
||||
/// <param name="value"></param>
|
||||
void SetCpuRegister(string register, int value);
|
||||
}
|
||||
|
||||
public interface ISettable : IEmulator
|
||||
{
|
||||
object GetSettings();
|
||||
object GetSyncSettings();
|
||||
bool PutSettings(object o);
|
||||
bool PutSyncSettings(object o);
|
||||
}
|
||||
|
||||
public interface ISettable<TSettings, TSync> : ISettable
|
||||
{
|
||||
// in addition to these methods, it's expected that the constructor or Load() method
|
||||
// will take a Settings and SyncSettings object to set the initial state of the core
|
||||
// (if those are null, default settings are to be used)
|
||||
|
@ -139,7 +164,7 @@ namespace BizHawk.Emulation.Common
|
|||
/// (unless the object is later passed to PutSettings)
|
||||
/// </summary>
|
||||
/// <returns>a json-serializable object</returns>
|
||||
object GetSettings();
|
||||
new TSettings GetSettings();
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
|
@ -148,14 +173,14 @@ namespace BizHawk.Emulation.Common
|
|||
/// (unless the object is later passed to PutSyncSettings)
|
||||
/// </summary>
|
||||
/// <returns>a json-serializable object</returns>
|
||||
object GetSyncSettings();
|
||||
new TSync GetSyncSettings();
|
||||
|
||||
/// <summary>
|
||||
/// change the core settings, excepting movie settings
|
||||
/// </summary>
|
||||
/// <param name="o">an object of the same type as the return for GetSettings</param>
|
||||
/// <returns>true if a core reboot will be required to make the changes effective</returns>
|
||||
bool PutSettings(object o);
|
||||
new bool PutSettings(TSettings o);
|
||||
|
||||
/// <summary>
|
||||
/// changes the movie-sync relevant settings. THIS SHOULD NEVER BE CALLED WHILE RECORDING
|
||||
|
@ -163,24 +188,8 @@ namespace BizHawk.Emulation.Common
|
|||
/// </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 make the changes effective</returns>
|
||||
bool PutSyncSettings(object o);
|
||||
new bool PutSyncSettings(TSync o);
|
||||
}
|
||||
|
||||
public interface IDebuggable : IEmulator
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a list of Cpu registers and their current state
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Dictionary<string, int> GetCpuFlagsAndRegisters();
|
||||
|
||||
/// <summary>
|
||||
/// Sets a given Cpu register to the given value
|
||||
/// </summary>
|
||||
/// <param name="register"></param>
|
||||
/// <param name="value"></param>
|
||||
void SetCpuRegister(string register, int value);
|
||||
}
|
||||
|
||||
public enum DisplayType { NTSC, PAL, DENDY }
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Calculators
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public class TI83 : IEmulator, IMemoryDomains, IDebuggable
|
||||
public class TI83 : IEmulator, IMemoryDomains, IDebuggable, ISettable<TI83.TI83Settings, object>
|
||||
{
|
||||
//hardware
|
||||
private readonly Z80A cpu = new Z80A();
|
||||
|
@ -350,7 +350,7 @@ namespace BizHawk.Emulation.Cores.Calculators
|
|||
[CoreConstructor("TI83")]
|
||||
public TI83(CoreComm comm, GameInfo game, byte[] rom, object Settings)
|
||||
{
|
||||
PutSettings(Settings ?? new TI83Settings());
|
||||
PutSettings((TI83Settings)Settings ?? new TI83Settings());
|
||||
|
||||
CoreComm = comm;
|
||||
cpu.ReadMemory = ReadMemory;
|
||||
|
@ -997,14 +997,23 @@ namespace BizHawk.Emulation.Cores.Calculators
|
|||
|
||||
TI83Settings Settings;
|
||||
|
||||
public object GetSettings() { return Settings.Clone(); }
|
||||
public TI83Settings GetSettings() { return Settings.Clone(); }
|
||||
|
||||
public bool PutSettings(object o)
|
||||
public bool PutSettings(TI83Settings o)
|
||||
{
|
||||
Settings = (TI83Settings)o;
|
||||
Settings = o;
|
||||
return false;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o) {
|
||||
return PutSettings((TI83Settings)o);
|
||||
}
|
||||
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
PAL
|
||||
}
|
||||
|
||||
sealed public partial class C64 : IEmulator, IDebuggable
|
||||
sealed public partial class C64 : IEmulator, IDebuggable
|
||||
{
|
||||
private Motherboard board;
|
||||
private bool loadPrg;
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
{
|
||||
board.inputRead = false;
|
||||
board.PollInput();
|
||||
board.cpu.LagCycles = 0;
|
||||
board.cpu.LagCycles = 0;
|
||||
|
||||
for (int count = 0; count < cyclesPerFrame; count++)
|
||||
{
|
||||
|
@ -201,10 +201,5 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
//domains.Add(new MemoryDomain("1541 RAM", 0x1000, MemoryDomain.Endian.Little, new Func<int, byte>(disk.PeekRam), new Action<int, byte>(disk.PokeRam)));
|
||||
memoryDomains = new MemoryDomainList(domains);
|
||||
}
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,42 +1,62 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using BizHawk.Emulation.Common;
|
||||
using Newtonsoft.Json;
|
||||
using BizHawk.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
||||
{
|
||||
public partial class Atari2600
|
||||
public partial class Atari2600 : ISettable<Atari2600.A2600Settings, Atari2600.A2600SyncSettings>
|
||||
{
|
||||
public object GetSettings()
|
||||
public A2600Settings GetSettings()
|
||||
{
|
||||
return Settings.Clone();
|
||||
}
|
||||
|
||||
public object GetSyncSettings()
|
||||
public A2600SyncSettings GetSyncSettings()
|
||||
{
|
||||
return SyncSettings.Clone();
|
||||
}
|
||||
|
||||
public bool PutSettings(object o)
|
||||
public bool PutSettings(A2600Settings o)
|
||||
{
|
||||
A2600Settings newSettings = (A2600Settings)o;
|
||||
if (Settings == null || Settings.SECAMColors != newSettings.SECAMColors)
|
||||
if (Settings == null || Settings.SECAMColors != o.SECAMColors)
|
||||
{
|
||||
if (_tia != null)
|
||||
_tia.SetSECAM(newSettings.SECAMColors);
|
||||
_tia.SetSECAM(o.SECAMColors);
|
||||
}
|
||||
|
||||
Settings = newSettings;
|
||||
Settings = o;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(A2600SyncSettings o)
|
||||
{
|
||||
SyncSettings = (A2600SyncSettings)o;
|
||||
SyncSettings = o;
|
||||
return false;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((A2600Settings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((A2600SyncSettings)o);
|
||||
}
|
||||
|
||||
public class A2600Settings
|
||||
{
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public partial class Atari2600 : IEmulator, IMemoryDomains, IDebuggable
|
||||
public partial class Atari2600 : IEmulator, IMemoryDomains, IDebuggable
|
||||
{
|
||||
private readonly GameInfo _game;
|
||||
private bool _islag = true;
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800
|
|||
portedVersion: "v1.5",
|
||||
portedUrl: "http://emu7800.sourceforge.net/"
|
||||
)]
|
||||
public partial class Atari7800 : IEmulator, IMemoryDomains, IDebuggable
|
||||
public partial class Atari7800 : IEmulator, IMemoryDomains, IDebuggable
|
||||
{
|
||||
// TODO:
|
||||
// some things don't work when you try to plug in a 2600 game
|
||||
|
@ -457,10 +457,5 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -366,30 +366,5 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Settings
|
||||
|
||||
public object GetSettings()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public object GetSyncSettings()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool PutSettings(object o)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public sealed partial class ColecoVision : IEmulator, IMemoryDomains, IDebuggable
|
||||
public sealed partial class ColecoVision : IEmulator, IMemoryDomains, IDebuggable, ISettable<object, ColecoVision.ColecoSyncSettings>
|
||||
{
|
||||
// ROM
|
||||
public byte[] RomData;
|
||||
|
@ -239,16 +239,25 @@ namespace BizHawk.Emulation.Cores.ColecoVision
|
|||
public void EndAsyncSound() { }
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public ColecoSyncSettings GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(ColecoSyncSettings o)
|
||||
{
|
||||
var n = (ColecoSyncSettings)o;
|
||||
bool ret = n.SkipBiosIntro != SyncSettings.SkipBiosIntro;
|
||||
SyncSettings = n;
|
||||
bool ret = o.SkipBiosIntro != SyncSettings.SkipBiosIntro;
|
||||
SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSettings((ColecoSyncSettings)o);
|
||||
}
|
||||
|
||||
ColecoSyncSettings SyncSettings;
|
||||
|
||||
public class ColecoSyncSettings
|
||||
|
|
|
@ -205,10 +205,5 @@ namespace BizHawk.Emulation.Cores.Intellivision
|
|||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
isPorted: true,
|
||||
isReleased: false
|
||||
)]
|
||||
public class GBA : IEmulator, IVideoProvider, ISyncSoundProvider, IGBAGPUViewable, IMemoryDomains, IDebuggable
|
||||
public class GBA : IEmulator, IVideoProvider, ISyncSoundProvider, IGBAGPUViewable, IMemoryDomains, IDebuggable
|
||||
{
|
||||
public Dictionary<string, int> GetCpuFlagsAndRegisters()
|
||||
{
|
||||
|
@ -544,10 +544,5 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@ using BizHawk.Common;
|
|||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
[CoreAttributes("VBA-Next", "many authors", true, true, "cd508312a29ed8c29dacac1b11c2dce56c338a54", "https://github.com/libretro/vba-next")]
|
||||
public class VBANext : IEmulator, IVideoProvider, ISyncSoundProvider, IGBAGPUViewable, IMemoryDomains, IDebuggable
|
||||
public class VBANext : IEmulator, IVideoProvider, ISyncSoundProvider,
|
||||
IGBAGPUViewable, IMemoryDomains, IDebuggable, ISettable<object, VBANext.SyncSettings>
|
||||
{
|
||||
IntPtr Core;
|
||||
|
||||
|
@ -399,7 +400,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
return null;
|
||||
}
|
||||
|
||||
public object GetSyncSettings()
|
||||
public SyncSettings GetSyncSettings()
|
||||
{
|
||||
return _SyncSettings.Clone();
|
||||
}
|
||||
|
@ -412,14 +413,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(SyncSettings o)
|
||||
{
|
||||
var s = (SyncSettings)o;
|
||||
bool ret = SyncSettings.NeedsReboot(s, _SyncSettings);
|
||||
_SyncSettings = s;
|
||||
bool ret = SyncSettings.NeedsReboot(o, _SyncSettings);
|
||||
_SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings(o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((SyncSettings)o);
|
||||
}
|
||||
|
||||
public class SyncSettings
|
||||
{
|
||||
[DisplayName("Skip BIOS")]
|
||||
|
|
|
@ -22,7 +22,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
portedVersion: "SVN 344",
|
||||
portedUrl: "http://gambatte.sourceforge.net/"
|
||||
)]
|
||||
public class Gameboy : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains, IDebuggable
|
||||
public class Gameboy : IEmulator, IVideoProvider, ISyncSoundProvider,
|
||||
IMemoryDomains, IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>
|
||||
{
|
||||
#region ALL SAVESTATEABLE STATE GOES HERE
|
||||
|
||||
|
@ -163,7 +164,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
throw new InvalidOperationException("gambatte_load() returned non-zero (is this not a gb or gbc rom?)");
|
||||
|
||||
// set real default colors (before anyone mucks with them at all)
|
||||
PutSettings(Settings ?? new GambatteSettings());
|
||||
PutSettings((GambatteSettings)Settings ?? new GambatteSettings());
|
||||
|
||||
InitSound();
|
||||
|
||||
|
@ -986,11 +987,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
GambatteSettings _Settings;
|
||||
GambatteSyncSettings _SyncSettings;
|
||||
|
||||
public object GetSettings() { return _Settings.Clone(); }
|
||||
public object GetSyncSettings() { return _SyncSettings.Clone(); }
|
||||
public bool PutSettings(object o)
|
||||
public GambatteSettings GetSettings() { return _Settings.Clone(); }
|
||||
public GambatteSyncSettings GetSyncSettings() { return _SyncSettings.Clone(); }
|
||||
public bool PutSettings(GambatteSettings o)
|
||||
{
|
||||
_Settings = (GambatteSettings)o;
|
||||
_Settings = o;
|
||||
if (IsCGBMode())
|
||||
SetCGBColors(_Settings.CGBColors);
|
||||
else
|
||||
|
@ -998,14 +999,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(GambatteSyncSettings o)
|
||||
{
|
||||
var s = (GambatteSyncSettings)o;
|
||||
bool ret = GambatteSyncSettings.NeedsReboot(_SyncSettings, s);
|
||||
_SyncSettings = s;
|
||||
bool ret = GambatteSyncSettings.NeedsReboot(_SyncSettings, o);
|
||||
_SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((GambatteSettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((GambatteSyncSettings)o);
|
||||
}
|
||||
|
||||
public class GambatteSettings
|
||||
{
|
||||
private static readonly int[] DefaultPalette = new[]
|
||||
|
|
|
@ -17,7 +17,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
isPorted: true,
|
||||
isReleased: true
|
||||
)]
|
||||
public class GambatteLink : IEmulator, IVideoProvider, ISyncSoundProvider, IDebuggable
|
||||
public class GambatteLink : IEmulator, IVideoProvider, ISyncSoundProvider,
|
||||
IDebuggable, ISettable<GambatteLink.GambatteLinkSettings, GambatteLink.GambatteLinkSyncSettings>
|
||||
{
|
||||
bool disposed = false;
|
||||
|
||||
|
@ -516,31 +517,49 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
|
||||
#region settings
|
||||
|
||||
public object GetSettings()
|
||||
public GambatteLinkSettings GetSettings()
|
||||
{
|
||||
return new GambatteLinkSettings
|
||||
(
|
||||
(Gameboy.GambatteSettings)L.GetSettings(),
|
||||
(Gameboy.GambatteSettings)R.GetSettings()
|
||||
L.GetSettings(),
|
||||
R.GetSettings()
|
||||
);
|
||||
}
|
||||
public object GetSyncSettings()
|
||||
public GambatteLinkSyncSettings GetSyncSettings()
|
||||
{
|
||||
return new GambatteLinkSyncSettings
|
||||
(
|
||||
(Gameboy.GambatteSyncSettings)L.GetSyncSettings(),
|
||||
(Gameboy.GambatteSyncSettings)R.GetSyncSettings()
|
||||
L.GetSyncSettings(),
|
||||
R.GetSyncSettings()
|
||||
);
|
||||
}
|
||||
public bool PutSettings(object o)
|
||||
public bool PutSettings(GambatteLinkSettings o)
|
||||
{
|
||||
var s = (GambatteLinkSettings)o;
|
||||
return L.PutSettings(s.L) || R.PutSettings(s.R);
|
||||
return L.PutSettings(o.L) || R.PutSettings(o.R);
|
||||
}
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(GambatteLinkSyncSettings o)
|
||||
{
|
||||
var s = (GambatteLinkSyncSettings)o;
|
||||
return L.PutSyncSettings(s.L) || R.PutSyncSettings(s.R);
|
||||
return L.PutSyncSettings(o.L) || R.PutSyncSettings(o.R);
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((GambatteLinkSettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((GambatteLinkSyncSettings)o);
|
||||
}
|
||||
|
||||
public class GambatteLinkSettings
|
||||
|
|
|
@ -17,7 +17,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
|
|||
portedVersion: "2.0",
|
||||
portedUrl: "https://code.google.com/p/mupen64plus/"
|
||||
)]
|
||||
public partial class N64 : IEmulator, IMemoryDomains, IDebuggable
|
||||
public partial class N64 : IEmulator, IMemoryDomains, IDebuggable,
|
||||
ISettable<N64Settings, N64SyncSettings>
|
||||
{
|
||||
private readonly N64Input _inputProvider;
|
||||
private readonly N64VideoProvider _videoProvider;
|
||||
|
@ -481,29 +482,49 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
|
|||
|
||||
#region Settings
|
||||
|
||||
public object GetSettings()
|
||||
public N64Settings GetSettings()
|
||||
{
|
||||
return _settings.Clone();
|
||||
}
|
||||
|
||||
public object GetSyncSettings()
|
||||
public N64SyncSettings GetSyncSettings()
|
||||
{
|
||||
return _syncSettings.Clone();
|
||||
}
|
||||
|
||||
public bool PutSettings(object o)
|
||||
public bool PutSettings(N64Settings o)
|
||||
{
|
||||
_settings = (N64Settings)o;
|
||||
_settings = o;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(N64SyncSettings o)
|
||||
{
|
||||
_syncSettings = (N64SyncSettings)o;
|
||||
_syncSettings = o;
|
||||
SetControllerButtons();
|
||||
return true;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((N64Settings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((N64SyncSettings)o);
|
||||
}
|
||||
|
||||
private void SetControllerButtons()
|
||||
{
|
||||
ControllerDefinition.BoolButtons.Clear();
|
||||
|
|
|
@ -17,7 +17,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public partial class NES : IEmulator, IMemoryDomains, IDebuggable
|
||||
public partial class NES : IEmulator, IMemoryDomains, IDebuggable,
|
||||
ISettable<NES.NESSettings, NES.NESSyncSettings>
|
||||
{
|
||||
static readonly bool USE_DATABASE = true;
|
||||
public RomStatus RomStatus;
|
||||
|
@ -46,7 +47,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
CoreComm.UsesDriveLed = true;
|
||||
(board as FDS).SetDriveLightCallback((val) => CoreComm.DriveLED = val);
|
||||
}
|
||||
PutSettings(Settings ?? new NESSettings());
|
||||
PutSettings((NESSettings)Settings ?? new NESSettings());
|
||||
}
|
||||
|
||||
private NES()
|
||||
|
@ -931,11 +932,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
NESSettings Settings = new NESSettings();
|
||||
NESSyncSettings SyncSettings = new NESSyncSettings();
|
||||
|
||||
public object GetSettings() { return Settings.Clone(); }
|
||||
public object GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(object o)
|
||||
public NESSettings GetSettings() { return Settings.Clone(); }
|
||||
public NESSyncSettings GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(NESSettings o)
|
||||
{
|
||||
Settings = (NESSettings)o;
|
||||
Settings = o;
|
||||
if (Settings.ClipLeftAndRight)
|
||||
{
|
||||
videoProvider.left = 8;
|
||||
|
@ -959,14 +960,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
return false;
|
||||
}
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(NESSyncSettings o)
|
||||
{
|
||||
var n = (NESSyncSettings)o;
|
||||
bool ret = NESSyncSettings.NeedsReboot(SyncSettings, n);
|
||||
SyncSettings = n;
|
||||
bool ret = NESSyncSettings.NeedsReboot(SyncSettings, o);
|
||||
SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((NESSettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((NESSyncSettings)o);
|
||||
}
|
||||
|
||||
public class NESSettings
|
||||
{
|
||||
public bool AllowMoreThanEightSprites = false;
|
||||
|
|
|
@ -21,7 +21,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
|||
portedVersion: "0.7.0",
|
||||
portedUrl: "https://github.com/kode54/QuickNES"
|
||||
)]
|
||||
public class QuickNES : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains, IDebuggable
|
||||
public class QuickNES : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains,
|
||||
IDebuggable, ISettable<QuickNES.QuickNESSettings, QuickNES.QuickNESSyncSettings>
|
||||
{
|
||||
#region FPU precision
|
||||
|
||||
|
@ -84,7 +85,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
|||
BoardName = mappername;
|
||||
CoreComm.VsyncNum = 39375000;
|
||||
CoreComm.VsyncDen = 655171;
|
||||
PutSettings(Settings ?? new QuickNESSettings());
|
||||
PutSettings((QuickNESSettings)Settings ?? new QuickNESSettings());
|
||||
|
||||
ComputeBootGod();
|
||||
}
|
||||
|
@ -502,30 +503,50 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
|||
}
|
||||
}
|
||||
|
||||
public object GetSettings()
|
||||
public QuickNESSettings GetSettings()
|
||||
{
|
||||
return _Settings.Clone();
|
||||
}
|
||||
|
||||
public object GetSyncSettings()
|
||||
public QuickNESSyncSettings GetSyncSettings()
|
||||
{
|
||||
return new QuickNESSyncSettings();
|
||||
}
|
||||
|
||||
public bool PutSettings(object o)
|
||||
public bool PutSettings(QuickNESSettings o)
|
||||
{
|
||||
_Settings = (QuickNESSettings)o;
|
||||
_Settings = o;
|
||||
LibQuickNES.qn_set_sprite_limit(Context, _Settings.NumSprites);
|
||||
RecalculateCrops();
|
||||
CalculatePalette();
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(QuickNESSyncSettings o)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((QuickNESSettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((QuickNESSyncSettings)o);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -66,7 +66,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
portedVersion: "v87",
|
||||
portedUrl: "http://byuu.org/"
|
||||
)]
|
||||
public unsafe class LibsnesCore : IEmulator, IVideoProvider, IMemoryDomains, IDebuggable
|
||||
public unsafe class LibsnesCore : IEmulator, IVideoProvider, IMemoryDomains,
|
||||
IDebuggable, ISettable<LibsnesCore.SnesSettings, LibsnesCore.SnesSyncSettings>
|
||||
{
|
||||
public bool IsSGB { get; private set; }
|
||||
|
||||
|
@ -1183,25 +1184,43 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
SnesSettings Settings;
|
||||
SnesSyncSettings SyncSettings;
|
||||
|
||||
public object GetSettings() { return Settings.Clone(); }
|
||||
public object GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(object o)
|
||||
public SnesSettings GetSettings() { return Settings.Clone(); }
|
||||
public SnesSyncSettings GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(SnesSettings o)
|
||||
{
|
||||
SnesSettings n = (SnesSettings)o;
|
||||
bool refreshneeded = n.Palette != Settings.Palette;
|
||||
Settings = n;
|
||||
bool refreshneeded = o.Palette != Settings.Palette;
|
||||
Settings = o;
|
||||
if (refreshneeded)
|
||||
RefreshPalette();
|
||||
return false;
|
||||
}
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(SnesSyncSettings o)
|
||||
{
|
||||
SnesSyncSettings n = (SnesSyncSettings)o;
|
||||
bool ret = n.Profile != SyncSettings.Profile;
|
||||
SyncSettings = n;
|
||||
bool ret = o.Profile != SyncSettings.Profile;
|
||||
SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((SnesSettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((SnesSyncSettings)o);
|
||||
}
|
||||
|
||||
public class SnesSettings
|
||||
{
|
||||
public bool ShowBG1_0 = true;
|
||||
|
|
|
@ -126,30 +126,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES9X
|
|||
|
||||
#endregion
|
||||
|
||||
#region settings
|
||||
|
||||
public object GetSettings()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public object GetSyncSettings()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool PutSettings(object o)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IVideoProvider
|
||||
|
||||
private int[] _vbuff = new int[512 * 480];
|
||||
|
|
|
@ -22,7 +22,8 @@ namespace BizHawk.Emulation.Cores.PCEngine
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public sealed partial class PCEngine : IEmulator, IMemoryDomains, IDebuggable
|
||||
public sealed partial class PCEngine : IEmulator, IMemoryDomains,
|
||||
IDebuggable, ISettable<PCEngine.PCESettings, PCEngine.PCESyncSettings>
|
||||
{
|
||||
// ROM
|
||||
public byte[] RomData;
|
||||
|
@ -567,31 +568,49 @@ namespace BizHawk.Emulation.Cores.PCEngine
|
|||
public PCESettings _settings;
|
||||
private PCESyncSettings _syncSettings;
|
||||
|
||||
public object GetSettings() { return _settings.Clone(); }
|
||||
public object GetSyncSettings() { return _syncSettings.Clone(); }
|
||||
public bool PutSettings(object o)
|
||||
public PCESettings GetSettings() { return _settings.Clone(); }
|
||||
public PCESyncSettings GetSyncSettings() { return _syncSettings.Clone(); }
|
||||
public bool PutSettings(PCESettings o)
|
||||
{
|
||||
PCESettings n = (PCESettings)o;
|
||||
bool ret;
|
||||
if (n.ArcadeCardRewindHack != _settings.ArcadeCardRewindHack ||
|
||||
n.EqualizeVolume != _settings.EqualizeVolume)
|
||||
if (o.ArcadeCardRewindHack != _settings.ArcadeCardRewindHack ||
|
||||
o.EqualizeVolume != _settings.EqualizeVolume)
|
||||
ret = true;
|
||||
else
|
||||
ret = false;
|
||||
|
||||
_settings = n;
|
||||
_settings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(PCESyncSettings o)
|
||||
{
|
||||
var newsyncsettings = (PCESyncSettings)o;
|
||||
bool ret = PCESyncSettings.NeedsReboot(newsyncsettings, _syncSettings);
|
||||
_syncSettings = newsyncsettings;
|
||||
bool ret = PCESyncSettings.NeedsReboot(o, _syncSettings);
|
||||
_syncSettings = o;
|
||||
// SetControllerButtons(); // not safe to change the controller during emulation, so instead make it a reboot event
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((PCESettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((PCESyncSettings)o);
|
||||
}
|
||||
|
||||
public class PCESettings
|
||||
{
|
||||
public bool ShowBG1 = true;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
|
|||
isPorted: false,
|
||||
isReleased: false
|
||||
)]
|
||||
public sealed partial class Genesis : IEmulator, IMemoryDomains, IDebuggable
|
||||
public sealed partial class Genesis : IEmulator, IMemoryDomains, IDebuggable
|
||||
{
|
||||
private int _lagcount = 0;
|
||||
private bool lagged = true;
|
||||
|
@ -138,8 +138,8 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
|
|||
Musashi.Reset();
|
||||
VDP.GetPC = () => Musashi.PC;
|
||||
#else
|
||||
MainCPU.Reset();
|
||||
VDP.GetPC = () => MainCPU.PC;
|
||||
MainCPU.Reset();
|
||||
VDP.GetPC = () => MainCPU.PC;
|
||||
#endif
|
||||
InitializeCartHardware(game);
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
|
|||
#if MUSASHI
|
||||
Musashi.Execute(cycles);
|
||||
#else
|
||||
MainCPU.ExecuteCycles(cycles);
|
||||
MainCPU.ExecuteCycles(cycles);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
|
|||
#if MUSASHI
|
||||
Musashi.SetIRQ(irq);
|
||||
#else
|
||||
MainCPU.Interrupt = irq;
|
||||
MainCPU.Interrupt = irq;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -491,10 +491,5 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
|
|||
public MemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
|
||||
public void Dispose() { }
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public sealed partial class SMS : IEmulator, IMemoryDomains, IDebuggable
|
||||
public sealed partial class SMS : IEmulator, IMemoryDomains,
|
||||
IDebuggable, ISettable<SMS.SMSSettings, SMS.SMSSyncSettings>
|
||||
{
|
||||
// Constants
|
||||
public const int BankSize = 16384;
|
||||
|
@ -101,14 +102,14 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
|
||||
IsGameGear = game.System == "GG";
|
||||
IsSG1000 = game.System == "SG";
|
||||
RomData = rom;
|
||||
CoreComm.CpuTraceAvailable = true;
|
||||
|
||||
if (RomData.Length % BankSize != 0)
|
||||
Array.Resize(ref RomData, ((RomData.Length / BankSize) + 1) * BankSize);
|
||||
RomBanks = (byte)(RomData.Length / BankSize);
|
||||
RomData = rom;
|
||||
CoreComm.CpuTraceAvailable = true;
|
||||
|
||||
if (RomData.Length % BankSize != 0)
|
||||
Array.Resize(ref RomData, ((RomData.Length / BankSize) + 1) * BankSize);
|
||||
RomBanks = (byte)(RomData.Length / BankSize);
|
||||
|
||||
DisplayType = DetermineDisplayType(SyncSettings.DisplayType, game.Region);
|
||||
DisplayType = DetermineDisplayType(SyncSettings.DisplayType, game.Region);
|
||||
if (game["PAL"] && DisplayType != DisplayType.PAL)
|
||||
{
|
||||
DisplayType = DisplayType.PAL;
|
||||
|
@ -128,26 +129,26 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
CoreComm.Notify("Region was forced to Japan for game compatibility.");
|
||||
}
|
||||
|
||||
if ((game.NotInDatabase || game["FM"]) && SyncSettings.EnableFM && !IsGameGear)
|
||||
HasYM2413 = true;
|
||||
if ((game.NotInDatabase || game["FM"]) && SyncSettings.EnableFM && !IsGameGear)
|
||||
HasYM2413 = true;
|
||||
|
||||
if (Controller == null)
|
||||
Controller = NullController.GetNullController();
|
||||
if (Controller == null)
|
||||
Controller = NullController.GetNullController();
|
||||
|
||||
Cpu = new Z80A();
|
||||
Cpu.RegisterSP = 0xDFF0;
|
||||
Cpu.ReadHardware = ReadPort;
|
||||
Cpu.WriteHardware = WritePort;
|
||||
Cpu = new Z80A();
|
||||
Cpu.RegisterSP = 0xDFF0;
|
||||
Cpu.ReadHardware = ReadPort;
|
||||
Cpu.WriteHardware = WritePort;
|
||||
|
||||
Vdp = new VDP(this, Cpu, IsGameGear ? VdpMode.GameGear : VdpMode.SMS, DisplayType);
|
||||
PSG = new SN76489();
|
||||
YM2413 = new YM2413();
|
||||
SoundMixer = new SoundMixer(YM2413, PSG);
|
||||
if (HasYM2413 && game["WhenFMDisablePSG"])
|
||||
SoundMixer.DisableSource(PSG);
|
||||
ActiveSoundProvider = HasYM2413 ? (ISoundProvider)SoundMixer : PSG;
|
||||
Vdp = new VDP(this, Cpu, IsGameGear ? VdpMode.GameGear : VdpMode.SMS, DisplayType);
|
||||
PSG = new SN76489();
|
||||
YM2413 = new YM2413();
|
||||
SoundMixer = new SoundMixer(YM2413, PSG);
|
||||
if (HasYM2413 && game["WhenFMDisablePSG"])
|
||||
SoundMixer.DisableSource(PSG);
|
||||
ActiveSoundProvider = HasYM2413 ? (ISoundProvider)SoundMixer : PSG;
|
||||
|
||||
SystemRam = new byte[0x2000];
|
||||
SystemRam = new byte[0x2000];
|
||||
|
||||
if (game["CMMapper"])
|
||||
InitCodeMastersMapper();
|
||||
|
@ -166,20 +167,20 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
else
|
||||
InitSegaMapper();
|
||||
|
||||
if (Settings.ForceStereoSeparation && !IsGameGear)
|
||||
{
|
||||
if (game["StereoByte"])
|
||||
{
|
||||
ForceStereoByte = byte.Parse(game.OptionValue("StereoByte"));
|
||||
}
|
||||
if (Settings.ForceStereoSeparation && !IsGameGear)
|
||||
{
|
||||
if (game["StereoByte"])
|
||||
{
|
||||
ForceStereoByte = byte.Parse(game.OptionValue("StereoByte"));
|
||||
}
|
||||
PSG.StereoPanning = ForceStereoByte;
|
||||
}
|
||||
}
|
||||
|
||||
if (SyncSettings.AllowOverlock && game["OverclockSafe"])
|
||||
Vdp.IPeriod = 512;
|
||||
if (SyncSettings.AllowOverlock && game["OverclockSafe"])
|
||||
Vdp.IPeriod = 512;
|
||||
|
||||
if (Settings.SpriteLimit)
|
||||
Vdp.SpriteLimit = true;
|
||||
if (Settings.SpriteLimit)
|
||||
Vdp.SpriteLimit = true;
|
||||
|
||||
if (game["3D"])
|
||||
IsGame3D = true;
|
||||
|
@ -593,23 +594,41 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
|
||||
public void Dispose() { }
|
||||
|
||||
public object GetSettings() { return Settings.Clone(); }
|
||||
public object GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(object o)
|
||||
public SMSSettings GetSettings() { return Settings.Clone(); }
|
||||
public SMSSyncSettings GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(SMSSettings o)
|
||||
{
|
||||
SMSSettings n = (SMSSettings)o;
|
||||
bool ret = SMSSettings.RebootNeeded(Settings, n);
|
||||
Settings = n;
|
||||
bool ret = SMSSettings.RebootNeeded(Settings, o);
|
||||
Settings = o;
|
||||
return ret;
|
||||
}
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(SMSSyncSettings o)
|
||||
{
|
||||
SMSSyncSettings n = (SMSSyncSettings)o;
|
||||
bool ret = SMSSyncSettings.RebootNeeded(SyncSettings, n);
|
||||
SyncSettings = n;
|
||||
bool ret = SMSSyncSettings.RebootNeeded(SyncSettings, o);
|
||||
SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((SMSSettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((SMSSyncSettings)o);
|
||||
}
|
||||
|
||||
public SMSSettings Settings;
|
||||
public SMSSyncSettings SyncSettings;
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
portedVersion: "9.12",
|
||||
portedUrl: "http://yabause.org"
|
||||
)]
|
||||
public class Yabause : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains
|
||||
public class Yabause : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains,
|
||||
ISettable<object, Yabause.SaturnSyncSettings>
|
||||
{
|
||||
public static ControllerDefinition SaturnController = new ControllerDefinition
|
||||
{
|
||||
|
@ -707,14 +708,13 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
SaturnSyncSettings SyncSettings;
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public SaturnSyncSettings GetSyncSettings() { return SyncSettings.Clone(); }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(SaturnSyncSettings o)
|
||||
{
|
||||
var n = (SaturnSyncSettings)o;
|
||||
bool ret = SaturnSyncSettings.NeedsReboot(SyncSettings, n);
|
||||
bool ret = SaturnSyncSettings.NeedsReboot(SyncSettings, o);
|
||||
|
||||
SyncSettings = n;
|
||||
SyncSettings = o;
|
||||
|
||||
if (GLMode && SyncSettings.UseGL)
|
||||
if (SyncSettings.DispFree)
|
||||
|
@ -724,6 +724,26 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((object)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((SaturnSyncSettings)o);
|
||||
}
|
||||
|
||||
public class SaturnSyncSettings
|
||||
{
|
||||
[DisplayName("Open GL Mode")]
|
||||
|
|
|
@ -24,7 +24,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
portedVersion: "r874",
|
||||
portedUrl: "https://code.google.com/p/genplus-gx/"
|
||||
)]
|
||||
public class GPGX : IEmulator, ISyncSoundProvider, IVideoProvider, IMemoryDomains, IDebuggable
|
||||
public class GPGX : IEmulator, ISyncSoundProvider, IVideoProvider, IMemoryDomains,
|
||||
IDebuggable, ISettable<GPGX.GPGXSettings, GPGX.GPGXSyncSettings>
|
||||
{
|
||||
static GPGX AttachedCore = null;
|
||||
|
||||
|
@ -163,7 +164,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
if (CD != null)
|
||||
CoreComm.UsesDriveLed = true;
|
||||
|
||||
PutSettings(Settings ?? new GPGXSettings());
|
||||
PutSettings((GPGXSettings)Settings ?? new GPGXSettings());
|
||||
|
||||
InitMemCallbacks();
|
||||
KillMemCallbacks();
|
||||
|
@ -786,23 +787,41 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
GPGXSyncSettings _SyncSettings;
|
||||
GPGXSettings _Settings;
|
||||
|
||||
public object GetSettings() { return _Settings.Clone(); }
|
||||
public object GetSyncSettings() { return _SyncSettings.Clone(); }
|
||||
public bool PutSettings(object o)
|
||||
public GPGXSettings GetSettings() { return _Settings.Clone(); }
|
||||
public GPGXSyncSettings GetSyncSettings() { return _SyncSettings.Clone(); }
|
||||
public bool PutSettings(GPGXSettings o)
|
||||
{
|
||||
_Settings = (GPGXSettings)o;
|
||||
_Settings = o;
|
||||
LibGPGX.gpgx_set_draw_mask(_Settings.GetDrawMask());
|
||||
return false;
|
||||
}
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(GPGXSyncSettings o)
|
||||
{
|
||||
bool ret;
|
||||
var n = (GPGXSyncSettings)o;
|
||||
ret = GPGXSyncSettings.NeedsReboot(_SyncSettings, n);
|
||||
_SyncSettings = n;
|
||||
bool ret = GPGXSyncSettings.NeedsReboot(_SyncSettings, o);
|
||||
_SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((GPGXSettings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((GPGXSyncSettings)o);
|
||||
}
|
||||
|
||||
public class GPGXSettings
|
||||
{
|
||||
[DisplayName("Background Layer A")]
|
||||
|
|
|
@ -213,10 +213,5 @@ namespace BizHawk.Emulation.Cores.Sony.PSP
|
|||
public void DiscardSamples()
|
||||
{
|
||||
}
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,10 +283,5 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
public int MaxVolume { get; set; }
|
||||
private List<MemoryDomain> memoryDomains = new List<MemoryDomain>();
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ using System.Runtime.InteropServices;
|
|||
namespace BizHawk.Emulation.Cores.WonderSwan
|
||||
{
|
||||
[CoreAttributes("Cygne/Mednafen", "Dox", true, true, "0.9.34.1", "http://mednafen.sourceforge.net/")]
|
||||
public class WonderSwan : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains, IDebuggable
|
||||
public class WonderSwan : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains,
|
||||
IDebuggable, ISettable<WonderSwan.Settings, WonderSwan.SyncSettings>
|
||||
{
|
||||
#region Controller
|
||||
|
||||
|
@ -496,32 +497,51 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
}
|
||||
}
|
||||
|
||||
public object GetSettings()
|
||||
public Settings GetSettings()
|
||||
{
|
||||
return _Settings.Clone();
|
||||
}
|
||||
|
||||
public object GetSyncSettings()
|
||||
public SyncSettings GetSyncSettings()
|
||||
{
|
||||
return _SyncSettings.Clone();
|
||||
}
|
||||
|
||||
public bool PutSettings(object o)
|
||||
public bool PutSettings(Settings o)
|
||||
{
|
||||
_Settings = (Settings)o;
|
||||
_Settings = o;
|
||||
var native = _Settings.GetNativeSettings();
|
||||
BizSwan.bizswan_putsettings(Core, ref native);
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(object o)
|
||||
public bool PutSyncSettings(SyncSettings o)
|
||||
{
|
||||
var newsettings = (SyncSettings)o;
|
||||
bool ret = SyncSettings.NeedsReboot(newsettings, _SyncSettings);
|
||||
_SyncSettings = newsettings;
|
||||
bool ret = SyncSettings.NeedsReboot(o, _SyncSettings);
|
||||
_SyncSettings = o;
|
||||
return ret;
|
||||
}
|
||||
|
||||
object ISettable.GetSettings()
|
||||
{
|
||||
return GetSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSettings(object o)
|
||||
{
|
||||
return PutSettings((Settings)o);
|
||||
}
|
||||
|
||||
object ISettable.GetSyncSettings()
|
||||
{
|
||||
return GetSyncSettings();
|
||||
}
|
||||
|
||||
bool ISettable.PutSyncSettings(object o)
|
||||
{
|
||||
return PutSyncSettings((SyncSettings)o);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IVideoProvider
|
||||
|
|
|
@ -562,10 +562,5 @@ namespace BizHawk.Emulation.Cores
|
|||
public int BackgroundColor { get { return unchecked((int)0xff000000); } }
|
||||
|
||||
#endregion
|
||||
|
||||
public object GetSettings() { return null; }
|
||||
public object GetSyncSettings() { return null; }
|
||||
public bool PutSettings(object o) { return false; }
|
||||
public bool PutSyncSettings(object o) { return false; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue