This commit is contained in:
goyuken 2014-08-03 22:05:32 +00:00
parent 84ad460d20
commit 768c2762a5
6 changed files with 31 additions and 30 deletions

View File

@ -1288,14 +1288,9 @@ namespace BizHawk.Client.EmuHawk
private void PceControllerSettingsMenuItem_Click(object sender, EventArgs e) private void PceControllerSettingsMenuItem_Click(object sender, EventArgs e)
{ {
if (new PCEControllerConfig().ShowDialog() == DialogResult.OK) using (var dlg = new PCEControllerConfig())
{ {
GlobalWin.MainForm.FlagNeedsReboot(); dlg.ShowDialog();
GlobalWin.OSD.AddMessage("Controller settings saved but a core reboot is required");
}
else
{
GlobalWin.OSD.AddMessage("Controller settings aborted");
} }
} }

View File

@ -9,6 +9,7 @@ using System.Windows.Forms;
using BizHawk.Emulation.Cores.PCEngine; using BizHawk.Emulation.Cores.PCEngine;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
@ -51,6 +52,7 @@ namespace BizHawk.Client.EmuHawk
var index = int.Parse(c.Name.Replace("Controller", "")); var index = int.Parse(c.Name.Replace("Controller", ""));
pceSettings.Controllers[index].IsConnected = c.Checked; pceSettings.Controllers[index].IsConnected = c.Checked;
}); });
GlobalWin.MainForm.PutCoreSyncSettings(pceSettings);
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();
} }

View File

@ -53,7 +53,6 @@
<Compile Include="Colors.cs" /> <Compile Include="Colors.cs" />
<Compile Include="CustomCollections.cs" /> <Compile Include="CustomCollections.cs" />
<Compile Include="DeepEquality.cs" /> <Compile Include="DeepEquality.cs" />
<Compile Include="DeepEquals.cs" />
<Compile Include="Extensions\BufferExtensions.cs" /> <Compile Include="Extensions\BufferExtensions.cs" />
<Compile Include="Extensions\CollectionExtensions.cs" /> <Compile Include="Extensions\CollectionExtensions.cs" />
<Compile Include="Extensions\IOExtensions.cs" /> <Compile Include="Extensions\IOExtensions.cs" />

View File

@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
Type = NecSystemType.SuperGrafx; Type = NecSystemType.SuperGrafx;
break; break;
} }
this.Settings = (PCESettings)Settings ?? new PCESettings(); this._settings = (PCESettings)Settings ?? new PCESettings();
_syncSettings = (PCESyncSettings)syncSettings ?? new PCESyncSettings(); _syncSettings = (PCESyncSettings)syncSettings ?? new PCESyncSettings();
Init(game, rom); Init(game, rom);
SetControllerButtons(); SetControllerButtons();
@ -96,7 +96,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
systemid = "PCECD"; systemid = "PCECD";
Type = NecSystemType.TurboCD; Type = NecSystemType.TurboCD;
this.disc = disc; this.disc = disc;
this.Settings = (PCESettings)Settings ?? new PCESettings(); this._settings = (PCESettings)Settings ?? new PCESettings();
_syncSettings = (PCESyncSettings)syncSettings ?? new PCESyncSettings(); _syncSettings = (PCESyncSettings)syncSettings ?? new PCESyncSettings();
GameInfo biosInfo; GameInfo biosInfo;
@ -238,7 +238,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
{ {
ArcadeRam = new byte[0x200000]; ArcadeRam = new byte[0x200000];
ArcadeCard = true; ArcadeCard = true;
ArcadeCardRewindHack = Settings.ArcadeCardRewindHack; ArcadeCardRewindHack = _settings.ArcadeCardRewindHack;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
ArcadePage[i] = new ArcadeCardPage(); ArcadePage[i] = new ArcadeCardPage();
} }
@ -261,7 +261,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
if (game["AdpcmVol"]) if (game["AdpcmVol"])
ADPCM.MaxVolume = int.Parse(game.OptionValue("AdpcmVol")); ADPCM.MaxVolume = int.Parse(game.OptionValue("AdpcmVol"));
// the gamedb can also force equalizevolumes on // the gamedb can also force equalizevolumes on
if (TurboCD && (Settings.EqualizeVolume || game["EqualizeVolumes"] || game.NotInDatabase)) if (TurboCD && (_settings.EqualizeVolume || game["EqualizeVolumes"] || game.NotInDatabase))
SoundMixer.EqualizeVolumes(); SoundMixer.EqualizeVolumes();
// Ok, yes, HBlankPeriod's only purpose is game-specific hax. // Ok, yes, HBlankPeriod's only purpose is game-specific hax.
@ -331,7 +331,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
void CheckSpriteLimit() void CheckSpriteLimit()
{ {
bool spriteLimit = ForceSpriteLimit | Settings.SpriteLimit; bool spriteLimit = ForceSpriteLimit | _settings.SpriteLimit;
VDC1.PerformSpriteLimit = spriteLimit; VDC1.PerformSpriteLimit = spriteLimit;
if (VDC2 != null) if (VDC2 != null)
VDC2.PerformSpriteLimit = spriteLimit; VDC2.PerformSpriteLimit = spriteLimit;
@ -563,22 +563,22 @@ namespace BizHawk.Emulation.Cores.PCEngine
disc.Dispose(); disc.Dispose();
} }
public PCESettings Settings; public PCESettings _settings;
private PCESyncSettings _syncSettings; private PCESyncSettings _syncSettings;
public object GetSettings() { return Settings.Clone(); } public object GetSettings() { return _settings.Clone(); }
public object GetSyncSettings() { return _syncSettings; } public object GetSyncSettings() { return _syncSettings.Clone(); }
public bool PutSettings(object o) public bool PutSettings(object o)
{ {
PCESettings n = (PCESettings)o; PCESettings n = (PCESettings)o;
bool ret; bool ret;
if (n.ArcadeCardRewindHack != Settings.ArcadeCardRewindHack || if (n.ArcadeCardRewindHack != _settings.ArcadeCardRewindHack ||
n.EqualizeVolume != Settings.EqualizeVolume) n.EqualizeVolume != _settings.EqualizeVolume)
ret = true; ret = true;
else else
ret = false; ret = false;
Settings = n; _settings = n;
SetControllerButtons(); SetControllerButtons();
return ret; return ret;
} }
@ -616,7 +616,12 @@ namespace BizHawk.Emulation.Cores.PCEngine
public PCESyncSettings Clone() public PCESyncSettings Clone()
{ {
return (PCESyncSettings)MemberwiseClone(); var ret = new PCESyncSettings();
for (int i = 0; i < Controllers.Length; i++)
{
ret.Controllers[i].IsConnected = Controllers[i].IsConnected;
}
return ret;
} }
public class ControllerSetting public class ControllerSetting

View File

@ -108,8 +108,8 @@ namespace BizHawk.Emulation.Cores.PCEngine
if (ActiveLine >= FrameHeight) if (ActiveLine >= FrameHeight)
return; return;
RenderBackgroundScanline(pce.Settings.ShowBG1); RenderBackgroundScanline(pce._settings.ShowBG1);
RenderSpritesScanline(pce.Settings.ShowOBJ1); RenderSpritesScanline(pce._settings.ShowOBJ1);
} }
Action<bool> RenderBackgroundScanline; Action<bool> RenderBackgroundScanline;

View File

@ -246,16 +246,16 @@ namespace BizHawk.Emulation.Cores.PCEngine
switch (EffectivePriorityMode) switch (EffectivePriorityMode)
{ {
case 0: case 0:
RenderBackgroundScanline(VDC1, 12, PCE.Settings.ShowBG1); RenderBackgroundScanline(VDC1, 12, PCE._settings.ShowBG1);
RenderBackgroundScanline(VDC2, 2, PCE.Settings.ShowBG2); RenderBackgroundScanline(VDC2, 2, PCE._settings.ShowBG2);
RenderSpritesScanline(VDC1, 11, 14, PCE.Settings.ShowOBJ1); RenderSpritesScanline(VDC1, 11, 14, PCE._settings.ShowOBJ1);
RenderSpritesScanline(VDC2, 1, 3, PCE.Settings.ShowOBJ2); RenderSpritesScanline(VDC2, 1, 3, PCE._settings.ShowOBJ2);
break; break;
case 1: case 1:
RenderBackgroundScanline(VDC1, 12, PCE.Settings.ShowBG1); RenderBackgroundScanline(VDC1, 12, PCE._settings.ShowBG1);
RenderBackgroundScanline(VDC2, 2, PCE.Settings.ShowBG2); RenderBackgroundScanline(VDC2, 2, PCE._settings.ShowBG2);
RenderSpritesScanline(VDC1, 11, 14, PCE.Settings.ShowOBJ1); RenderSpritesScanline(VDC1, 11, 14, PCE._settings.ShowOBJ1);
RenderSpritesScanline(VDC2, 1, 13, PCE.Settings.ShowOBJ2); RenderSpritesScanline(VDC2, 1, 13, PCE._settings.ShowOBJ2);
break; break;
} }
} }