Disable interlace mode for bg modes not 5 or 6.

This commit is contained in:
Brandon Wright 2018-06-25 18:02:10 -05:00
parent 146e9084f5
commit ff1925cc0a
2 changed files with 12 additions and 36 deletions

42
gfx.cpp
View File

@ -369,12 +369,7 @@ void S9xStartScreenRefresh (void)
} }
else else
{ {
#ifdef USE_OPENGL GFX.RealPPL = GFX.Pitch >> 1;
if (Settings.OpenGLEnable)
GFX.RealPPL = SNES_WIDTH;
else
#endif
GFX.RealPPL = GFX.Pitch >> 1;
IPPU.DoubleWidthPixels = FALSE; IPPU.DoubleWidthPixels = FALSE;
IPPU.RenderedScreenWidth = SNES_WIDTH; IPPU.RenderedScreenWidth = SNES_WIDTH;
} }
@ -685,37 +680,14 @@ void S9xUpdateScreen (void)
{ {
if (!IPPU.DoubleWidthPixels && (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.PseudoHires)) if (!IPPU.DoubleWidthPixels && (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.PseudoHires))
{ {
#ifdef USE_OPENGL // Have to back out of the regular speed hack
if (Settings.OpenGLEnable && GFX.RealPPL == 256) for (register uint32 y = 0; y < GFX.StartY; y++)
{ {
// Have to back out of the speed up hack where the low res. register uint16 *p = GFX.Screen + y * GFX.PPL + 255;
// SNES image was rendered into a 256x239 sized buffer, register uint16 *q = GFX.Screen + y * GFX.PPL + 510;
// ignoring the true, larger size of the buffer.
GFX.RealPPL = GFX.Pitch >> 1;
for (register int32 y = (int32) GFX.StartY - 1; y >= 0; y--) for (register int x = 255; x >= 0; x--, p--, q -= 2)
{ *q = *(q + 1) = *p;
register uint16 *p = GFX.Screen + y * GFX.PPL + 255;
register uint16 *q = GFX.Screen + y * GFX.RealPPL + 510;
for (register int x = 255; x >= 0; x--, p--, q -= 2)
*q = *(q + 1) = *p;
}
GFX.PPL = GFX.RealPPL; // = GFX.Pitch >> 1 above
}
else
#endif
{
// Have to back out of the regular speed hack
for (register uint32 y = 0; y < GFX.StartY; y++)
{
register uint16 *p = GFX.Screen + y * GFX.PPL + 255;
register uint16 *q = GFX.Screen + y * GFX.PPL + 510;
for (register int x = 255; x >= 0; x--, p--, q -= 2)
*q = *(q + 1) = *p;
}
} }
IPPU.DoubleWidthPixels = TRUE; IPPU.DoubleWidthPixels = TRUE;

View File

@ -546,7 +546,10 @@ void S9xSetPPU (uint8 Byte, uint16 Address)
PPU.BGMode = Byte & 7; PPU.BGMode = Byte & 7;
// BJ: BG3Priority only takes effect if BGMode == 1 and the bit is set // BJ: BG3Priority only takes effect if BGMode == 1 and the bit is set
PPU.BG3Priority = ((Byte & 0x0f) == 0x09); PPU.BG3Priority = ((Byte & 0x0f) == 0x09);
IPPU.Interlace = Memory.FillRAM[0x2133] & 1; if (PPU.BGMode == 6 || PPU.BGMode == 5)
IPPU.Interlace = Memory.FillRAM[0x2133] & 1;
else
IPPU.Interlace = 0;
#ifdef DEBUGGER #ifdef DEBUGGER
missing.modes[PPU.BGMode] = 1; missing.modes[PPU.BGMode] = 1;
#endif #endif
@ -1068,6 +1071,7 @@ void S9xSetPPU (uint8 Byte, uint16 Address)
FLUSH_REDRAW(); FLUSH_REDRAW();
if ((Memory.FillRAM[0x2133] ^ Byte) & 2) if ((Memory.FillRAM[0x2133] ^ Byte) & 2)
IPPU.OBJChanged = TRUE; IPPU.OBJChanged = TRUE;
IPPU.Interlace = Byte & 1; IPPU.Interlace = Byte & 1;
IPPU.InterlaceOBJ = Byte & 2; IPPU.InterlaceOBJ = Byte & 2;
} }