SMS VDP Viewer: correct BG size for 192 line mode

This commit is contained in:
goyuken 2014-02-13 19:10:39 +00:00
parent b294c69046
commit 4174751212
2 changed files with 11 additions and 3 deletions

View File

@ -85,7 +85,15 @@ namespace BizHawk.Client.EmuHawk
unsafe void DrawBG(int* pal)
{
var lockdata = bmpViewBG.bmp.LockBits(new Rectangle(0, 0, 256, 128), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int bgheight = vdp.FrameHeight == 192 ? 224 : 256;
int maxtile = bgheight * 4;
if (bgheight != bmpViewBG.bmp.Height)
{
bmpViewBG.Height = bgheight;
bmpViewBG.ChangeBitmapSize(256, bgheight);
}
var lockdata = bmpViewBG.bmp.LockBits(new Rectangle(0, 0, 256, bgheight), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int* dest = (int*)lockdata.Scan0;
int pitch = lockdata.Stride / sizeof(int);
@ -95,7 +103,7 @@ namespace BizHawk.Client.EmuHawk
{
short* map = (short*)(vram + vdp.CalcNameTableBase());
for (int tile = 0; tile < 1024; tile++)
for (int tile = 0; tile < maxtile; tile++)
{
short bgent = *map++;
bool hflip = (bgent & 1 << 9) != 0;

View File

@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
public int IPeriod = 228;
public VdpMode VdpMode { get { return mode; } }
int FrameHeight = 192;
public int FrameHeight = 192;
public int ScanLine;
public int[] FrameBuffer = new int[256 * 192];
public int[] GameGearFrameBuffer = new int[160 * 144];