SMS VDP Viewer: correct BG size for 192 line mode
This commit is contained in:
parent
b294c69046
commit
4174751212
|
@ -85,7 +85,15 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
unsafe void DrawBG(int* pal)
|
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* dest = (int*)lockdata.Scan0;
|
||||||
int pitch = lockdata.Stride / sizeof(int);
|
int pitch = lockdata.Stride / sizeof(int);
|
||||||
|
|
||||||
|
@ -95,7 +103,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
short* map = (short*)(vram + vdp.CalcNameTableBase());
|
short* map = (short*)(vram + vdp.CalcNameTableBase());
|
||||||
|
|
||||||
for (int tile = 0; tile < 1024; tile++)
|
for (int tile = 0; tile < maxtile; tile++)
|
||||||
{
|
{
|
||||||
short bgent = *map++;
|
short bgent = *map++;
|
||||||
bool hflip = (bgent & 1 << 9) != 0;
|
bool hflip = (bgent & 1 << 9) != 0;
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
||||||
public int IPeriod = 228;
|
public int IPeriod = 228;
|
||||||
public VdpMode VdpMode { get { return mode; } }
|
public VdpMode VdpMode { get { return mode; } }
|
||||||
|
|
||||||
int FrameHeight = 192;
|
public int FrameHeight = 192;
|
||||||
public int ScanLine;
|
public int ScanLine;
|
||||||
public int[] FrameBuffer = new int[256 * 192];
|
public int[] FrameBuffer = new int[256 * 192];
|
||||||
public int[] GameGearFrameBuffer = new int[160 * 144];
|
public int[] GameGearFrameBuffer = new int[160 * 144];
|
||||||
|
|
Loading…
Reference in New Issue