snes - handle interlaced modes differently

This commit is contained in:
zeromus 2015-09-23 20:28:38 -05:00
parent 60555db3cc
commit f42a585fee
1 changed files with 9 additions and 11 deletions

View File

@ -1,4 +1,4 @@
//TODO - add serializer, add interlace field variable to serializer
//TODO - add serializer (?)
//http://wiki.superfamicom.org/snes/show/Backgrounds
@ -502,7 +502,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
IsLagFrame = false;
}
int field = 0;
void snes_video_refresh(int* data, int width, int height)
{
bool doubleSize = Settings.AlwaysDoubleSize;
@ -514,7 +513,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
int yskip = 1, xskip = 1;
//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.
if (width == 512)
{
vidHeight *= 2;
@ -533,18 +531,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
int srcPitch = 1024;
int srcStart = 0;
//for interlaced mode, we're gonna alternate fields. you know, like we're supposed to
bool interlaced = (height == 478 || height == 448);
if (interlaced)
{
srcPitch = 1024;
if (field == 1)
srcStart = 512; //start on second field
//really only half as high as the video output
//from bsnes in interlaced mode we have each field side by side
//so we will come in with a dimension of 512x448, say
//but the fields are side by side, so it's actually 1024x224.
//copy the first scanline from row 0, then the 2nd scanline from row 0 (offset 512)
//EXAMPLE: yu yu hakushu legal screens
lineDouble = false;
srcPitch = 512;
yskip = 1;
vidHeight /= 2;
height /= 2;
//alternate fields
field ^= 1;
}
if (dotDouble)