snes-support high-res (2x=512 width) display modes by doubling the vertical lines. maybe we'll need to do this differently if we can find a game thats controlling the interlacing options.

This commit is contained in:
zeromus 2012-09-24 08:00:42 +00:00
parent 52edee63d8
commit f53aa56f1c
1 changed files with 21 additions and 1 deletions

View File

@ -389,17 +389,37 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
{ {
vidWidth = width; vidWidth = width;
vidHeight = height; vidHeight = height;
//if we are in high-res mode, we get double width. so, lets double the height here to keep it square.
//TODO - does interlacing have something to do with the correct way to handle this? need an example that turns it on.
int yskip = 1;
if (width == 512)
{
vidHeight *= 2;
yskip = 2;
}
int size = vidWidth * vidHeight; int size = vidWidth * vidHeight;
if (vidBuffer.Length != size) if (vidBuffer.Length != size)
vidBuffer = new int[size]; vidBuffer = new int[size];
for (int y = 0; y < height; y++) for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++) for (int x = 0; x < width; x++)
{ {
int si = y * 1024 + x; int si = y * 1024 + x;
int di = y * vidWidth + x; int di = y * vidWidth * yskip + x;
int rgb = data[si]; int rgb = data[si];
vidBuffer[di] = rgb; vidBuffer[di] = rgb;
} }
//alternate scanlines
if (width == 512)
for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++)
{
int si = y * 1024 + x;
int di = y * vidWidth * yskip + x + 512;
int rgb = data[si];
vidBuffer[di] = rgb;
}
} }
public void FrameAdvance(bool render, bool rendersound) public void FrameAdvance(bool render, bool rendersound)