mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-12-25 02:31:50 +01:00
new video code
This commit is contained in:
parent
e103c7bd4d
commit
d0813f8281
@ -195,12 +195,12 @@ void setFrameTimerMethod()
|
|||||||
(timerstyle: 0=NTSC vblank, 1=PAL int timer)
|
(timerstyle: 0=NTSC vblank, 1=PAL int timer)
|
||||||
*/
|
*/
|
||||||
if ( Settings.PAL ) {
|
if ( Settings.PAL ) {
|
||||||
if(vmode_60hz == 1)
|
if(vmode_60hz)
|
||||||
timerstyle = 1;
|
timerstyle = 1;
|
||||||
else
|
else
|
||||||
timerstyle = 0;
|
timerstyle = 0;
|
||||||
} else {
|
} else {
|
||||||
if(vmode_60hz == 1)
|
if(vmode_60hz)
|
||||||
timerstyle = 0;
|
timerstyle = 0;
|
||||||
else
|
else
|
||||||
timerstyle = 1;
|
timerstyle = 1;
|
||||||
|
@ -67,7 +67,7 @@ int gameScreenPngSize = 0;
|
|||||||
|
|
||||||
u32 FrameTimer = 0;
|
u32 FrameTimer = 0;
|
||||||
|
|
||||||
u8 vmode_60hz = 0;
|
bool vmode_60hz = true;
|
||||||
int timerstyle = 0;
|
int timerstyle = 0;
|
||||||
bool progressive = 0;
|
bool progressive = 0;
|
||||||
|
|
||||||
@ -390,7 +390,7 @@ void StopGX()
|
|||||||
static GXRModeObj * FindVideoMode()
|
static GXRModeObj * FindVideoMode()
|
||||||
{
|
{
|
||||||
GXRModeObj * mode;
|
GXRModeObj * mode;
|
||||||
|
|
||||||
// choose the desired video mode
|
// choose the desired video mode
|
||||||
switch(GCSettings.videomode)
|
switch(GCSettings.videomode)
|
||||||
{
|
{
|
||||||
@ -401,7 +401,7 @@ static GXRModeObj * FindVideoMode()
|
|||||||
mode = &TVNtsc480Prog;
|
mode = &TVNtsc480Prog;
|
||||||
break;
|
break;
|
||||||
case 3: // PAL (50Hz)
|
case 3: // PAL (50Hz)
|
||||||
mode = &TVPal528IntDf;
|
mode = &TVPal574IntDfScale;
|
||||||
break;
|
break;
|
||||||
case 4: // PAL (60Hz)
|
case 4: // PAL (60Hz)
|
||||||
mode = &TVEurgb60Hz480IntDf;
|
mode = &TVEurgb60Hz480IntDf;
|
||||||
@ -409,6 +409,9 @@ static GXRModeObj * FindVideoMode()
|
|||||||
default:
|
default:
|
||||||
mode = VIDEO_GetPreferredMode(NULL);
|
mode = VIDEO_GetPreferredMode(NULL);
|
||||||
|
|
||||||
|
if(mode == &TVPal528IntDf)
|
||||||
|
mode = &TVPal574IntDfScale;
|
||||||
|
|
||||||
#ifdef HW_DOL
|
#ifdef HW_DOL
|
||||||
/* we have component cables, but the preferred mode is interlaced
|
/* we have component cables, but the preferred mode is interlaced
|
||||||
* why don't we switch into progressive?
|
* why don't we switch into progressive?
|
||||||
@ -425,7 +428,7 @@ static GXRModeObj * FindVideoMode()
|
|||||||
{
|
{
|
||||||
case VI_PAL:
|
case VI_PAL:
|
||||||
// 576 lines (PAL 50Hz)
|
// 576 lines (PAL 50Hz)
|
||||||
vmode_60hz = 0;
|
vmode_60hz = false;
|
||||||
|
|
||||||
// Original Video modes (forced to PAL 50Hz)
|
// Original Video modes (forced to PAL 50Hz)
|
||||||
// set video signal mode
|
// set video signal mode
|
||||||
@ -438,7 +441,7 @@ static GXRModeObj * FindVideoMode()
|
|||||||
|
|
||||||
case VI_NTSC:
|
case VI_NTSC:
|
||||||
// 480 lines (NTSC 60Hz)
|
// 480 lines (NTSC 60Hz)
|
||||||
vmode_60hz = 1;
|
vmode_60hz = true;
|
||||||
|
|
||||||
// Original Video modes (forced to NTSC 60hz)
|
// Original Video modes (forced to NTSC 60hz)
|
||||||
// set video signal mode
|
// set video signal mode
|
||||||
@ -455,7 +458,7 @@ static GXRModeObj * FindVideoMode()
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
// 480 lines (PAL 60Hz)
|
// 480 lines (PAL 60Hz)
|
||||||
vmode_60hz = 1;
|
vmode_60hz = true;
|
||||||
|
|
||||||
// Original Video modes (forced to PAL 60hz)
|
// Original Video modes (forced to PAL 60hz)
|
||||||
// set video signal mode
|
// set video signal mode
|
||||||
@ -478,46 +481,21 @@ static GXRModeObj * FindVideoMode()
|
|||||||
progressive = false;
|
progressive = false;
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
bool pal = false;
|
|
||||||
|
|
||||||
if (mode == &TVPal528IntDf)
|
|
||||||
pal = true;
|
|
||||||
|
|
||||||
if (CONF_GetAspectRatio() == CONF_ASPECT_16_9)
|
if (CONF_GetAspectRatio() == CONF_ASPECT_16_9)
|
||||||
{
|
mode->viWidth = 678;
|
||||||
mode->fbWidth = 640;
|
|
||||||
mode->efbHeight = 456;
|
|
||||||
mode->viWidth = 686;
|
|
||||||
|
|
||||||
if (pal)
|
|
||||||
{
|
|
||||||
mode->xfbHeight = 542;
|
|
||||||
mode->viHeight = 542;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mode->xfbHeight = 456;
|
|
||||||
mode->viHeight = 456;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (pal)
|
|
||||||
mode = &TVPal574IntDfScale;
|
|
||||||
|
|
||||||
mode->viWidth = 672;
|
mode->viWidth = 672;
|
||||||
}
|
|
||||||
|
|
||||||
if (pal)
|
if (vmode_60hz)
|
||||||
{
|
|
||||||
mode->viXOrigin = (VI_MAX_WIDTH_PAL - mode->viWidth) / 2;
|
|
||||||
mode->viYOrigin = (VI_MAX_HEIGHT_PAL - mode->viHeight) / 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
mode->viXOrigin = (VI_MAX_WIDTH_NTSC - mode->viWidth) / 2;
|
mode->viXOrigin = (VI_MAX_WIDTH_NTSC - mode->viWidth) / 2;
|
||||||
mode->viYOrigin = (VI_MAX_HEIGHT_NTSC - mode->viHeight) / 2;
|
mode->viYOrigin = (VI_MAX_HEIGHT_NTSC - mode->viHeight) / 2;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mode->viXOrigin = (VI_MAX_WIDTH_PAL - mode->viWidth) / 2;
|
||||||
|
mode->viYOrigin = (VI_MAX_HEIGHT_PAL - mode->viHeight) / 2;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
@ -767,7 +745,10 @@ update_video (int width, int height)
|
|||||||
else // unfiltered and filtered mode
|
else // unfiltered and filtered mode
|
||||||
{
|
{
|
||||||
xscale = 320;
|
xscale = 320;
|
||||||
yscale = vmode->efbHeight/2;
|
if(vheight == 224 || vheight == 448)
|
||||||
|
yscale = 224;
|
||||||
|
else
|
||||||
|
yscale = 239;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GCSettings.widescreen)
|
if (GCSettings.widescreen)
|
||||||
|
@ -36,7 +36,7 @@ extern bool progressive;
|
|||||||
extern u8 * gameScreenPng;
|
extern u8 * gameScreenPng;
|
||||||
extern int gameScreenPngSize;
|
extern int gameScreenPngSize;
|
||||||
extern u32 FrameTimer;
|
extern u32 FrameTimer;
|
||||||
extern u8 vmode_60hz;
|
extern bool vmode_60hz;
|
||||||
extern int timerstyle;
|
extern int timerstyle;
|
||||||
extern int CheckVideo;
|
extern int CheckVideo;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user