mirror of https://github.com/snes9xgit/snes9x.git
resize viewport on load state
This commit is contained in:
parent
ade94ccac6
commit
1067b3d0ca
81
gfx.cpp
81
gfx.cpp
|
@ -329,6 +329,48 @@ void S9xGraphicsDeinit (void)
|
||||||
if (GFX.SubZBuffer) { free(GFX.SubZBuffer); GFX.SubZBuffer = NULL; }
|
if (GFX.SubZBuffer) { free(GFX.SubZBuffer); GFX.SubZBuffer = NULL; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void S9xGraphicsScreenResize (void)
|
||||||
|
{
|
||||||
|
IPPU.MaxBrightness = PPU.Brightness;
|
||||||
|
|
||||||
|
IPPU.Interlace = Memory.FillRAM[0x2133] & 1;
|
||||||
|
IPPU.InterlaceOBJ = Memory.FillRAM[0x2133] & 2;
|
||||||
|
IPPU.PseudoHires = Memory.FillRAM[0x2133] & 8;
|
||||||
|
|
||||||
|
if (Settings.SupportHiRes && (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.PseudoHires))
|
||||||
|
{
|
||||||
|
GFX.RealPPL = GFX.Pitch >> 1;
|
||||||
|
IPPU.DoubleWidthPixels = TRUE;
|
||||||
|
IPPU.RenderedScreenWidth = SNES_WIDTH << 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef USE_OPENGL
|
||||||
|
if (Settings.OpenGLEnable)
|
||||||
|
GFX.RealPPL = SNES_WIDTH;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
GFX.RealPPL = GFX.Pitch >> 1;
|
||||||
|
|
||||||
|
IPPU.DoubleWidthPixels = FALSE;
|
||||||
|
IPPU.RenderedScreenWidth = SNES_WIDTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Settings.SupportHiRes && IPPU.Interlace)
|
||||||
|
{
|
||||||
|
GFX.PPL = GFX.RealPPL << 1;
|
||||||
|
IPPU.DoubleHeightPixels = TRUE;
|
||||||
|
IPPU.RenderedScreenHeight = PPU.ScreenHeight << 1;
|
||||||
|
GFX.DoInterlace++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GFX.PPL = GFX.RealPPL;
|
||||||
|
IPPU.DoubleHeightPixels = FALSE;
|
||||||
|
IPPU.RenderedScreenHeight = PPU.ScreenHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void S9xBuildDirectColourMaps (void)
|
void S9xBuildDirectColourMaps (void)
|
||||||
{
|
{
|
||||||
IPPU.XB = mul_brightness[PPU.Brightness];
|
IPPU.XB = mul_brightness[PPU.Brightness];
|
||||||
|
@ -355,44 +397,7 @@ void S9xStartScreenRefresh (void)
|
||||||
if (GFX.DoInterlace)
|
if (GFX.DoInterlace)
|
||||||
GFX.DoInterlace--;
|
GFX.DoInterlace--;
|
||||||
|
|
||||||
IPPU.MaxBrightness = PPU.Brightness;
|
S9xGraphicsScreenResize();
|
||||||
|
|
||||||
IPPU.Interlace = Memory.FillRAM[0x2133] & 1;
|
|
||||||
IPPU.InterlaceOBJ = Memory.FillRAM[0x2133] & 2;
|
|
||||||
IPPU.PseudoHires = Memory.FillRAM[0x2133] & 8;
|
|
||||||
|
|
||||||
if (Settings.SupportHiRes && (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.PseudoHires))
|
|
||||||
{
|
|
||||||
GFX.RealPPL = GFX.Pitch >> 1;
|
|
||||||
IPPU.DoubleWidthPixels = TRUE;
|
|
||||||
IPPU.RenderedScreenWidth = SNES_WIDTH << 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef USE_OPENGL
|
|
||||||
if (Settings.OpenGLEnable)
|
|
||||||
GFX.RealPPL = SNES_WIDTH;
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
GFX.RealPPL = GFX.Pitch >> 1;
|
|
||||||
|
|
||||||
IPPU.DoubleWidthPixels = FALSE;
|
|
||||||
IPPU.RenderedScreenWidth = SNES_WIDTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Settings.SupportHiRes && IPPU.Interlace)
|
|
||||||
{
|
|
||||||
GFX.PPL = GFX.RealPPL << 1;
|
|
||||||
IPPU.DoubleHeightPixels = TRUE;
|
|
||||||
IPPU.RenderedScreenHeight = PPU.ScreenHeight << 1;
|
|
||||||
GFX.DoInterlace++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GFX.PPL = GFX.RealPPL;
|
|
||||||
IPPU.DoubleHeightPixels = FALSE;
|
|
||||||
IPPU.RenderedScreenHeight = PPU.ScreenHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
IPPU.RenderedFramesCount++;
|
IPPU.RenderedFramesCount++;
|
||||||
}
|
}
|
||||||
|
|
1
gfx.h
1
gfx.h
|
@ -359,6 +359,7 @@ void S9xBuildDirectColourMaps (void);
|
||||||
void RenderLine (uint8);
|
void RenderLine (uint8);
|
||||||
void S9xComputeClipWindows (void);
|
void S9xComputeClipWindows (void);
|
||||||
void S9xDisplayChar (uint16 *, uint8);
|
void S9xDisplayChar (uint16 *, uint8);
|
||||||
|
void S9xGraphicsScreenResize (void);
|
||||||
// called automatically unless Settings.AutoDisplayMessages is false
|
// called automatically unless Settings.AutoDisplayMessages is false
|
||||||
void S9xDisplayMessages (uint16 *, int, int, int, int);
|
void S9xDisplayMessages (uint16 *, int, int, int, int);
|
||||||
#ifdef GFX_MULTI_FORMAT
|
#ifdef GFX_MULTI_FORMAT
|
||||||
|
|
|
@ -204,6 +204,7 @@
|
||||||
#include "movie.h"
|
#include "movie.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
#include "gfx.h"
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
@ -1844,6 +1845,14 @@ int S9xUnfreezeFromStream (STREAM stream)
|
||||||
IPPU.OBJChanged = TRUE;
|
IPPU.OBJChanged = TRUE;
|
||||||
IPPU.RenderThisFrame = TRUE;
|
IPPU.RenderThisFrame = TRUE;
|
||||||
|
|
||||||
|
GFX.InterlaceFrame = Timings.InterlaceField;
|
||||||
|
GFX.DoInterlace = 0;
|
||||||
|
|
||||||
|
S9xGraphicsScreenResize();
|
||||||
|
|
||||||
|
if (Settings.FastSavestates == 0)
|
||||||
|
memset(GFX.Screen,0,GFX.Pitch * MAX_SNES_HEIGHT);
|
||||||
|
|
||||||
uint8 hdma_byte = Memory.FillRAM[0x420c];
|
uint8 hdma_byte = Memory.FillRAM[0x420c];
|
||||||
S9xSetCPU(hdma_byte, 0x420c);
|
S9xSetCPU(hdma_byte, 0x420c);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue