diff --git a/BizHawk.Client.Common/CoreFileProvider.cs b/BizHawk.Client.Common/CoreFileProvider.cs index 4cf7f8c938..06f0a3b33c 100644 --- a/BizHawk.Client.Common/CoreFileProvider.cs +++ b/BizHawk.Client.Common/CoreFileProvider.cs @@ -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; diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 5c414992bb..feb1d077ff 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -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; diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs index 35616da12c..8d1556d71c 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs @@ -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) { diff --git a/BizHawk.Client.EmuHawk/config/PCE/PCEGraphicsConfig.cs b/BizHawk.Client.EmuHawk/config/PCE/PCEGraphicsConfig.cs index fdfdf9c7c7..bf393a4699 100644 --- a/BizHawk.Client.EmuHawk/config/PCE/PCEGraphicsConfig.cs +++ b/BizHawk.Client.EmuHawk/config/PCE/PCEGraphicsConfig.cs @@ -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(); } } diff --git a/BizHawk.Emulation.Common/Interfaces/CoreComms.cs b/BizHawk.Emulation.Common/Interfaces/CoreComms.cs index f922c241d4..db140b12e3 100644 --- a/BizHawk.Emulation.Common/Interfaces/CoreComms.cs +++ b/BizHawk.Emulation.Common/Interfaces/CoreComms.cs @@ -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; diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index 74444a87f8..e571fc45a1 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -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(); + } + } } } diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs index 2230ff4935..0657404e00 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs @@ -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) diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs index 26285381c8..d9cf4299bb 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/VPC.cs @@ -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; } }