add overscan option

This commit is contained in:
dborth 2008-11-10 03:36:21 +00:00
parent 7bf1b8a4fe
commit 5c465f680e
4 changed files with 40 additions and 23 deletions

View File

@ -33,6 +33,7 @@ DefaultSettings ()
GCSettings.ZoomLevel = 1.0; // zoom amount GCSettings.ZoomLevel = 1.0; // zoom amount
GCSettings.render = 2; // Unfiltered GCSettings.render = 2; // Unfiltered
GCSettings.widescreen = 0; // no aspect ratio correction GCSettings.widescreen = 0; // no aspect ratio correction
GCSettings.hideoverscan = 2; // hide both horizontal and vertical
GCSettings.LoadMethod = METHOD_AUTO; // Auto, SD, DVD, USB, Network (SMB) GCSettings.LoadMethod = METHOD_AUTO; // Auto, SD, DVD, USB, Network (SMB)
GCSettings.SaveMethod = METHOD_AUTO; // Auto, SD, Memory Card Slot A, Memory Card Slot B, USB, Network (SMB) GCSettings.SaveMethod = METHOD_AUTO; // Auto, SD, Memory Card Slot A, Memory Card Slot B, USB, Network (SMB)

View File

@ -53,6 +53,7 @@ struct SGCSettings{
int VerifySaves; int VerifySaves;
int render; // 0 - original, 1 - filtered, 2 - unfiltered int render; // 0 - original, 1 - filtered, 2 - unfiltered
int widescreen; int widescreen;
int hideoverscan;
int currpal; int currpal;
int timing; int timing;
int FSDisable; int FSDisable;

View File

@ -438,7 +438,7 @@ UpdateScaling()
square[3] = square[6] = (xscale); square[3] = square[6] = (xscale);
square[1] = square[4] = (yscale); square[1] = square[4] = (yscale);
square[7] = square[10] = (-yscale); square[7] = square[10] = (-yscale);
DCFlushRange (square, sizeof(square)); // update memory BEFORE the GPU accesses it! DCFlushRange (square, 32); // update memory BEFORE the GPU accesses it!
draw_init (); draw_init ();
if(updateScaling) if(updateScaling)
@ -637,6 +637,7 @@ ResetVideo_Emu ()
GX_InitTexObj (&texobj, texturemem, TEX_WIDTH, TEX_HEIGHT, GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE); // initialize the texture obj we are going to use GX_InitTexObj (&texobj, texturemem, TEX_WIDTH, TEX_HEIGHT, GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE); // initialize the texture obj we are going to use
if (!(GCSettings.render&1)) if (!(GCSettings.render&1))
GX_InitTexObjLOD(&texobj,GX_NEAR,GX_NEAR_MIP_NEAR,2.5,9.0,0.0,GX_FALSE,GX_FALSE,GX_ANISO_1); // original/unfiltered video mode: force texture filtering OFF GX_InitTexObjLOD(&texobj,GX_NEAR,GX_NEAR_MIP_NEAR,2.5,9.0,0.0,GX_FALSE,GX_FALSE,GX_ANISO_1); // original/unfiltered video mode: force texture filtering OFF
memset(texturemem, 0, TEX_WIDTH * TEX_HEIGHT * 2); // clear texture memory
// set aspect ratio // set aspect ratio
updateScaling = 5; updateScaling = 5;
@ -698,21 +699,21 @@ void RenderFrame(unsigned char *XBuf)
int width, height; int width, height;
int hideoverscan = 1; // 0 = off, 1 = vertical, 2 = both
u8 borderheight = GCSettings.hideoverscan < 1 ? 0 : 8;
u8 borderwidth = GCSettings.hideoverscan < 2 ? 0 : 8;
u8 borderwidth = (hideoverscan ? 8 : 0); u16 *texture = (unsigned short *)texturemem + (borderheight << 8) + (borderwidth << 2);
u8 *src1 = XBuf + (borderheight << 8) + borderwidth;
u16 *texture = (unsigned short *)texturemem + borderwidth * 260; u8 *src2 = XBuf + (borderheight << 8) + borderwidth + 256;
u8 *src1 = XBuf + borderwidth * 257; u8 *src3 = XBuf + (borderheight << 8) + borderwidth + 512;
u8 *src2 = XBuf + borderwidth * 257 + 256; u8 *src4 = XBuf + (borderheight << 8) + borderwidth + 768;
u8 *src3 = XBuf + borderwidth * 257 + 512;
u8 *src4 = XBuf + borderwidth * 257 + 768;
// clear texture objects // clear texture objects
GX_InvalidateTexAll(); GX_InvalidateTexAll();
// fill the texture // fill the texture
for (height = 0; height < 240 - (borderwidth << 1); height += 4) for (height = 0; height < 240 - (borderheight << 1); height += 4)
{ {
for (width = 0; width < 256 - (borderwidth << 1); width += 4) for (width = 0; width < 256 - (borderwidth << 1); width += 4)
{ {

View File

@ -109,6 +109,7 @@ static char videomenu[][50] = {
"Video Rendering", "Video Rendering",
"Video Scaling", "Video Scaling",
"Video Cropping"
"Palette", "Palette",
"Enable Zooming", "Enable Zooming",
"Timing", "Timing",
@ -130,26 +131,33 @@ VideoOptions ()
if (GCSettings.render==0 && progressive) if (GCSettings.render==0 && progressive)
GCSettings.render++; GCSettings.render++;
if ( GCSettings.render == 0 ) if (GCSettings.render == 0)
sprintf (videomenu[0], "Video Rendering Original"); sprintf (videomenu[0], "Video Rendering Original");
if ( GCSettings.render == 1 ) if (GCSettings.render == 1)
sprintf (videomenu[0], "Video Rendering Filtered"); sprintf (videomenu[0], "Video Rendering Filtered");
if ( GCSettings.render == 2 ) if (GCSettings.render == 2)
sprintf (videomenu[0], "Video Rendering Unfiltered"); sprintf (videomenu[0], "Video Rendering Unfiltered");
sprintf (videomenu[1], "Video Scaling %s", sprintf (videomenu[1], "Video Scaling %s",
GCSettings.widescreen == true ? "16:9 Correction" : "Default"); GCSettings.widescreen == true ? "16:9 Correction" : "Default");
sprintf (videomenu[2], "Palette - %s", if (GCSettings.hideoverscan == 0)
sprintf (videomenu[2], "Video Cropping Off");
if (GCSettings.hideoverscan == 1)
sprintf (videomenu[2], "Video Cropping Hide Vertical");
if (GCSettings.hideoverscan == 2)
sprintf (videomenu[2], "Video Cropping Hide All");
sprintf (videomenu[3], "Palette - %s",
GCSettings.currpal ? palettes[GCSettings.currpal-1].name : "Default"); GCSettings.currpal ? palettes[GCSettings.currpal-1].name : "Default");
sprintf (videomenu[3], "Enable Zooming %s", sprintf (videomenu[4], "Enable Zooming %s",
GCSettings.Zoom == true ? " ON" : "OFF"); GCSettings.Zoom == true ? " ON" : "OFF");
sprintf (videomenu[4], "Timing - %s", sprintf (videomenu[5], "Timing - %s",
GCSettings.timing == true ? " PAL" : "NTSC"); GCSettings.timing == true ? " PAL" : "NTSC");
sprintf (videomenu[5], "8 Sprite Limit - %s", sprintf (videomenu[6], "8 Sprite Limit - %s",
GCSettings.slimit == true ? " ON" : "OFF"); GCSettings.slimit == true ? " ON" : "OFF");
ret = RunMenu (videomenu, videomenuCount, (char*)"Video Options", 20, -1); ret = RunMenu (videomenu, videomenuCount, (char*)"Video Options", 20, -1);
@ -158,7 +166,7 @@ VideoOptions ()
{ {
case 0: case 0:
GCSettings.render++; GCSettings.render++;
if (GCSettings.render > 2 ) if (GCSettings.render > 2)
GCSettings.render = 0; GCSettings.render = 0;
// reset zoom // reset zoom
zoom_reset (); zoom_reset ();
@ -168,27 +176,33 @@ VideoOptions ()
GCSettings.widescreen ^= 1; GCSettings.widescreen ^= 1;
break; break;
case 2: // palette case 2:
GCSettings.hideoverscan++;
if (GCSettings.hideoverscan > 2)
GCSettings.hideoverscan = 0;
break;
case 3: // palette
if ( ++GCSettings.currpal > MAXPAL ) if ( ++GCSettings.currpal > MAXPAL )
GCSettings.currpal = 0; GCSettings.currpal = 0;
break; break;
case 3: case 4:
GCSettings.Zoom ^= 1; GCSettings.Zoom ^= 1;
break; break;
case 4: // timing case 5: // timing
GCSettings.timing ^= 1; GCSettings.timing ^= 1;
FCEUI_SetVidSystem(GCSettings.timing); // causes a small 'pop' in the audio FCEUI_SetVidSystem(GCSettings.timing); // causes a small 'pop' in the audio
break; break;
case 5: // 8 sprite limit case 6: // 8 sprite limit
GCSettings.slimit ^=1; GCSettings.slimit ^=1;
FCEUI_DisableSpriteLimitation(GCSettings.slimit); FCEUI_DisableSpriteLimitation(GCSettings.slimit);
break; break;
case -1: // Button B case -1: // Button B
case 6: case 7:
quit = 1; quit = 1;
break; break;