PCE: added settings to show/hide BG/OBJ for TurboGrafx (not for SuperGrafx)

Now setrenderplanes() works for TurboGrafx (not for SuperGrafx)
This commit is contained in:
taotao54321 2012-03-11 06:50:46 +00:00
parent beb0b5a74d
commit 30b0dc6780
7 changed files with 28 additions and 15 deletions

View File

@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
Controller = NullController.GetNullController(); Controller = NullController.GetNullController();
Cpu = new HuC6280(); Cpu = new HuC6280();
VCE = new VCE(); VCE = new VCE();
VDC1 = new VDC(Cpu, VCE); VDC1 = new VDC(this, Cpu, VCE);
PSG = new HuC6280PSG(); PSG = new HuC6280PSG();
SCSI = new ScsiCDBus(this, disc); SCSI = new ScsiCDBus(this, disc);
@ -100,7 +100,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
else if (SuperGrafx) else if (SuperGrafx)
{ {
VDC2 = new VDC(Cpu, VCE); VDC2 = new VDC(this, Cpu, VCE);
VPC = new VPC(VDC1, VDC2, VCE, Cpu); VPC = new VPC(VDC1, VDC2, VCE, Cpu);
Ram = new byte[0x8000]; Ram = new byte[0x8000];
Cpu.ReadMemory21 = ReadMemorySGX; Cpu.ReadMemory21 = ReadMemorySGX;

View File

@ -108,11 +108,11 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
if (ActiveLine >= FrameHeight) if (ActiveLine >= FrameHeight)
return; return;
RenderBackgroundScanline(); RenderBackgroundScanline(pce.CoreInputComm.PCE_ShowBG);
RenderSpritesScanline(); RenderSpritesScanline(pce.CoreInputComm.PCE_ShowOBJ);
} }
void RenderBackgroundScanline() void RenderBackgroundScanline(bool show)
{ {
Array.Clear(PriorityBuffer, 0, FrameWidth); Array.Clear(PriorityBuffer, 0, FrameWidth);
@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
FrameBuffer[(ActiveLine * FramePitch) + x] = vce.Palette[0]; FrameBuffer[(ActiveLine * FramePitch) + x] = vce.Palette[0];
else else
{ {
FrameBuffer[(ActiveLine * FramePitch) + x] = vce.Palette[paletteBase + c]; FrameBuffer[(ActiveLine * FramePitch) + x] = show ? vce.Palette[paletteBase + c] : vce.Palette[0];
PriorityBuffer[x] = 1; PriorityBuffer[x] = 1;
} }
} }
@ -154,7 +154,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
byte[] heightTable = { 16, 32, 64, 64 }; byte[] heightTable = { 16, 32, 64, 64 };
public void RenderSpritesScanline() public void RenderSpritesScanline(bool show)
{ {
if (SpritesEnabled == false) if (SpritesEnabled == false)
return; return;
@ -274,7 +274,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0) if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0)
{ {
InterSpritePriorityBuffer[xs] = 1; InterSpritePriorityBuffer[xs] = 1;
if (priority || PriorityBuffer[xs] == 0) if ((priority || PriorityBuffer[xs] == 0) && show)
FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel]; FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel];
} }
} }
@ -291,7 +291,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0) if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0)
{ {
InterSpritePriorityBuffer[xs] = 1; InterSpritePriorityBuffer[xs] = 1;
if (priority || PriorityBuffer[xs] == 0) if ((priority || PriorityBuffer[xs] == 0) && show)
FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel]; FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel];
} }
@ -312,7 +312,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0) if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0)
{ {
InterSpritePriorityBuffer[xs] = 1; InterSpritePriorityBuffer[xs] = 1;
if (priority || PriorityBuffer[xs] == 0) if ((priority || PriorityBuffer[xs] == 0) && show)
FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel]; FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel];
} }
} }
@ -328,7 +328,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0) if (pixel != 0 && InterSpritePriorityBuffer[xs] == 0)
{ {
InterSpritePriorityBuffer[xs] = 1; InterSpritePriorityBuffer[xs] = 1;
if (priority || PriorityBuffer[xs] == 0) if ((priority || PriorityBuffer[xs] == 0) && show)
FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel]; FrameBuffer[(ActiveLine * FramePitch) + xs] = vce.Palette[paletteBase + pixel];
} }
} }

View File

@ -85,13 +85,15 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
const int VramSize = 0x8000; const int VramSize = 0x8000;
PCEngine pce;
HuC6280 cpu; HuC6280 cpu;
VCE vce; VCE vce;
public int MultiResHack = 0; public int MultiResHack = 0;
public VDC(HuC6280 cpu, VCE vce) public VDC(PCEngine pce, HuC6280 cpu, VCE vce)
{ {
this.pce = pce;
this.cpu = cpu; this.cpu = cpu;
this.vce = vce; this.vce = vce;

View File

@ -5,6 +5,7 @@
public int NES_BackdropColor; public int NES_BackdropColor;
public bool NES_UnlimitedSprites; public bool NES_UnlimitedSprites;
public bool NES_ShowBG, NES_ShowOBJ; public bool NES_ShowBG, NES_ShowOBJ;
public bool PCE_ShowBG, PCE_ShowOBJ;
} }
public class CoreOutputComm public class CoreOutputComm

View File

@ -296,6 +296,9 @@
public int NESTopLine = 8; public int NESTopLine = 8;
public int NESBottomLine = 231; public int NESBottomLine = 231;
public bool PCEDispBackground = true;
public bool PCEDispSprites = true;
//GB Debugger settings //GB Debugger settings
public bool AutoloadGBDebugger = false; public bool AutoloadGBDebugger = false;
public bool GBDebuggerSaveWindowPosition = true; public bool GBDebuggerSaveWindowPosition = true;

View File

@ -366,6 +366,11 @@ namespace BizHawk.MultiClient
Global.CoreInputComm.NES_ShowOBJ = Global.Config.NESDispSprites = (bool)lua_p0; Global.CoreInputComm.NES_ShowOBJ = Global.Config.NESDispSprites = (bool)lua_p0;
Global.CoreInputComm.NES_ShowBG = Global.Config.NESDispBackground = (bool)lua_p1; Global.CoreInputComm.NES_ShowBG = Global.Config.NESDispBackground = (bool)lua_p1;
} }
else if(Global.Emulator is BizHawk.Emulation.Consoles.TurboGrafx.PCEngine)
{
Global.CoreInputComm.PCE_ShowOBJ = Global.Config.PCEDispSprites = (bool)lua_p0;
Global.CoreInputComm.PCE_ShowBG = Global.Config.PCEDispBackground = (bool)lua_p1;
}
} }
//---------------------------------------------------- //----------------------------------------------------

View File

@ -252,6 +252,8 @@ namespace BizHawk.MultiClient
Global.CoreInputComm.NES_UnlimitedSprites = Global.Config.NESAllowMoreThanEightSprites; Global.CoreInputComm.NES_UnlimitedSprites = Global.Config.NESAllowMoreThanEightSprites;
Global.CoreInputComm.NES_ShowBG = Global.Config.NESDispBackground; Global.CoreInputComm.NES_ShowBG = Global.Config.NESDispBackground;
Global.CoreInputComm.NES_ShowOBJ = Global.Config.NESDispSprites; Global.CoreInputComm.NES_ShowOBJ = Global.Config.NESDispSprites;
Global.CoreInputComm.PCE_ShowBG = Global.Config.PCEDispBackground;
Global.CoreInputComm.PCE_ShowOBJ = Global.Config.PCEDispSprites;
} }
void SyncPresentationMode() void SyncPresentationMode()