aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorNebuleon Fumika2013-01-14 23:35:53 -0500
committerNebuleon Fumika2013-01-14 23:35:53 -0500
commit87680e69f5e4803b3d20b8b954fc725d33904282 (patch)
tree94e5a318f9be308f25f9ae52894ad4e2876e483c /source
parentbe4d4495ba93bac57f436e7949b8b4b903102dec (diff)
downloadsnes9x2005-87680e69f5e4803b3d20b8b954fc725d33904282.tar.gz
snes9x2005-87680e69f5e4803b3d20b8b954fc725d33904282.tar.bz2
snes9x2005-87680e69f5e4803b3d20b8b954fc725d33904282.zip
Handle a game switching BG modes in the middle of a frame, to hi-res and to lo-res. This fixes Seiken Densetsu 3.
Diffstat (limited to 'source')
-rw-r--r--source/gfx.cpp42
1 files changed, 27 insertions, 15 deletions
diff --git a/source/gfx.cpp b/source/gfx.cpp
index decd195..d2b8b6e 100644
--- a/source/gfx.cpp
+++ b/source/gfx.cpp
@@ -663,18 +663,9 @@ void S9xStartScreenRefresh ()
IPPU.Interlace = (Memory.FillRAM[0x2133] & 1);
if (Settings.SupportHiRes && (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.Interlace))
{
- if (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.Interlace)
- {
- IPPU.RenderedScreenWidth = 512;
- IPPU.DoubleWidthPixels = TRUE;
- IPPU.HalfWidthPixels = FALSE;
- }
- else
- {
- IPPU.RenderedScreenWidth = 256;
- IPPU.DoubleWidthPixels = FALSE;
- IPPU.HalfWidthPixels = FALSE;
- }
+ IPPU.RenderedScreenWidth = 512;
+ IPPU.DoubleWidthPixels = TRUE;
+ IPPU.HalfWidthPixels = FALSE;
if (IPPU.Interlace)
{
@@ -707,13 +698,13 @@ void S9xStartScreenRefresh ()
GFX.PPLx2 = GFX.PPL << 1;
}
}
- else if (!Settings.SupportHiRes && (PPU.BGMode == 5))
+ else if (!Settings.SupportHiRes && (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.Interlace))
{
+ IPPU.RenderedScreenWidth = 256;
+ IPPU.DoubleWidthPixels = FALSE;
// Secret of Mana displays menus with mode 5.
// Make them readable.
- IPPU.DoubleWidthPixels = FALSE;
IPPU.HalfWidthPixels = TRUE;
- IPPU.DoubleHeightPixels = FALSE;
}
else
{
@@ -3741,6 +3732,27 @@ void S9xUpdateScreen ()
}
}
}
+ else if (!Settings.SupportHiRes)
+ {
+ if (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.Interlace)
+ {
+ if (!IPPU.HalfWidthPixels)
+ {
+ // The game has switched from lo-res to hi-res mode part way down
+ // the screen. Hi-res pixels must now be drawn at half width.
+ IPPU.HalfWidthPixels = TRUE;
+ }
+ }
+ else
+ {
+ if (IPPU.HalfWidthPixels)
+ {
+ // The game has switched from hi-res to lo-res mode part way down
+ // the screen. Lo-res pixels must now be drawn at FULL width.
+ IPPU.HalfWidthPixels = FALSE;
+ }
+ }
+ }
uint32 black = BLACK | (BLACK << 16);