pce: connect to new settings system

This commit is contained in:
goyuken 2013-12-22 05:58:24 +00:00
parent 0e4c507d08
commit a5cdee3780
8 changed files with 61 additions and 36 deletions

View File

@ -100,12 +100,12 @@ namespace BizHawk.Client.Common
//target.NES_UnlimitedSprites = Global.Config.NESAllowMoreThanEightSprites;
//target.NES_ShowBG = Global.Config.NESDispBackground;
//target.NES_ShowOBJ = Global.Config.NESDispSprites;
target.PCE_ShowBG1 = Global.Config.PCEDispBG1;
target.PCE_ShowOBJ1 = Global.Config.PCEDispOBJ1;
target.PCE_ShowBG2 = Global.Config.PCEDispBG2;
target.PCE_ShowOBJ2 = Global.Config.PCEDispOBJ2;
target.SMS_ShowBG = Global.Config.SMSDispBG;
target.SMS_ShowOBJ = Global.Config.SMSDispOBJ;
//target.PCE_ShowBG1 = Global.Config.PCEDispBG1;
//target.PCE_ShowOBJ1 = Global.Config.PCEDispOBJ1;
//target.PCE_ShowBG2 = Global.Config.PCEDispBG2;
//target.PCE_ShowOBJ2 = Global.Config.PCEDispOBJ2;
//target.SMS_ShowBG = Global.Config.SMSDispBG;
//target.SMS_ShowOBJ = Global.Config.SMSDispOBJ;
target.SNES_ShowBG1_0 = Global.Config.SNES_ShowBG1_0;
target.SNES_ShowBG1_1 = Global.Config.SNES_ShowBG1_1;

View File

@ -388,10 +388,10 @@ namespace BizHawk.Client.Common
public int SaturnGLH = 480;
// PCE Graphics settings
public bool PCEDispBG1 = true;
public bool PCEDispOBJ1 = true;
public bool PCEDispBG2 = true;
public bool PCEDispOBJ2 = true;
//public bool PCEDispBG1 = true;
//public bool PCEDispOBJ1 = true;
//public bool PCEDispBG2 = true;
//public bool PCEDispOBJ2 = true;
// PCE BG Viewer settings
public bool PCEBGViewerSaveWIndowPosition = true;

View File

@ -58,13 +58,15 @@ namespace BizHawk.Client.Common
}
else if (Global.Emulator is PCEngine)
{
Global.CoreComm.PCE_ShowOBJ1 = Global.Config.PCEDispOBJ1 = (bool)lua_p[0];
Global.CoreComm.PCE_ShowBG1 = Global.Config.PCEDispBG1 = (bool)lua_p[1];
PCEngine.PCESettings s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
s.ShowOBJ1 = (bool)lua_p[0];
s.ShowBG1 = (bool)lua_p[1];
if (lua_p.Length > 2)
{
Global.CoreComm.PCE_ShowOBJ2 = Global.Config.PCEDispOBJ2 = (bool)lua_p[2];
Global.CoreComm.PCE_ShowBG2 = Global.Config.PCEDispBG2 = (bool)lua_p[3];
s.ShowOBJ2 = (bool)lua_p[2];
s.ShowBG2 = (bool)lua_p[3];
}
Global.Emulator.PutSettings(s);
}
else if (Global.Emulator is SMS)
{

View File

@ -2,6 +2,7 @@
using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Emulation.Cores.PCEngine;
namespace BizHawk.Client.EmuHawk
{
@ -14,19 +15,22 @@ namespace BizHawk.Client.EmuHawk
private void PCEGraphicsConfig_Load(object sender, EventArgs e)
{
DispOBJ1.Checked = Global.Config.PCEDispOBJ1;
DispBG1.Checked = Global.Config.PCEDispBG1;
DispOBJ2.Checked = Global.Config.PCEDispOBJ2;
DispBG2.Checked = Global.Config.PCEDispBG2;
PCEngine.PCESettings s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
DispOBJ1.Checked = s.ShowOBJ1;
DispBG1.Checked = s.ShowBG1;
DispOBJ2.Checked = s.ShowOBJ2;
DispBG2.Checked = s.ShowBG2;
}
private void OK_Click(object sender, EventArgs e)
{
Global.Config.PCEDispOBJ1 = DispOBJ1.Checked;
Global.Config.PCEDispBG1 = DispBG1.Checked;
Global.Config.PCEDispOBJ2 = DispOBJ2.Checked;
Global.Config.PCEDispBG2 = DispBG2.Checked;
PCEngine.PCESettings s = (PCEngine.PCESettings)Global.Emulator.GetSettings();
s.ShowOBJ1 = DispOBJ1.Checked;
s.ShowBG1 = DispBG1.Checked;
s.ShowOBJ2 = DispOBJ2.Checked;
s.ShowBG2 = DispBG2.Checked;
Global.Emulator.PutSettings(s);
Close();
}
}

View File

@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Common
//public int NES_BackdropColor;
//public bool NES_UnlimitedSprites = false;
//public bool NES_ShowBG = true, NES_ShowOBJ = true;
public bool PCE_ShowBG1 = true, PCE_ShowOBJ1 = true, PCE_ShowBG2 = true, PCE_ShowOBJ2 = true;
//public bool PCE_ShowBG1 = true, PCE_ShowOBJ1 = true, PCE_ShowBG2 = true, PCE_ShowOBJ2 = true;
public bool SMS_ShowBG = true, SMS_ShowOBJ = true;
public bool GG_ShowClippedRegions;
public bool GG_HighlightActiveDisplayRegion;

View File

@ -624,8 +624,27 @@ namespace BizHawk.Emulation.Cores.PCEngine
disc.Dispose();
}
public object GetSettings() { return null; }
public PCESettings Settings = new PCESettings();
public object GetSettings() { return Settings.Clone(); }
public object GetSyncSettings() { return null; }
public bool PutSettings(object o) { return false; }
public bool PutSettings(object o)
{
Settings = (PCESettings)o;
return false;
}
public class PCESettings
{
public bool ShowBG1 = true;
public bool ShowOBJ1 = true;
public bool ShowBG2 = true;
public bool ShowOBJ2 = true;
public PCESettings Clone()
{
return (PCESettings)MemberwiseClone();
}
}
}
}

View File

@ -108,8 +108,8 @@ namespace BizHawk.Emulation.Cores.PCEngine
if (ActiveLine >= FrameHeight)
return;
RenderBackgroundScanline(pce.CoreComm.PCE_ShowBG1);
RenderSpritesScanline(pce.CoreComm.PCE_ShowOBJ1);
RenderBackgroundScanline(pce.Settings.ShowBG1);
RenderSpritesScanline(pce.Settings.ShowOBJ1);
}
void RenderBackgroundScanline(bool show)

View File

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