mirror of
https://github.com/dborth/fceugx.git
synced 2024-10-31 22:45:05 +01:00
add sprite limit/zapper crosshair to menu, fix PAL video modes and original modes, menu disabled when loading a game
This commit is contained in:
parent
99985713d5
commit
1eeb4b0638
@ -54,10 +54,11 @@ DefaultSettings ()
|
||||
{
|
||||
ResetControls(); // controller button mappings
|
||||
|
||||
GCSettings.currpal = 0;
|
||||
GCSettings.currpal = 0; // color palette
|
||||
GCSettings.timing = 0; // 0 - NTSC, 1 - PAL
|
||||
GCSettings.Controller = CTRL_PAD2; // NES pad, Four Score, Zapper
|
||||
GCSettings.crosshair = 1;
|
||||
GCSettings.crosshair = 1; // show zapper crosshair
|
||||
GCSettings.spritelimit = 1; // enforce 8 sprite limit
|
||||
|
||||
GCSettings.ZoomLevel = 1.0; // zoom amount
|
||||
GCSettings.render = 2; // Unfiltered
|
||||
|
@ -290,6 +290,7 @@ int main(int argc, char *argv[])
|
||||
SetControllers();
|
||||
setFrameTimer(); // set frametimer method before emulation
|
||||
SetPalette();
|
||||
FCEUI_DisableSpriteLimitation(GCSettings.spritelimit ^ 1);
|
||||
|
||||
fskipc=0;
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define _FCEUGX_H_
|
||||
|
||||
#define APPNAME "FCE Ultra GX"
|
||||
#define APPVERSION "3.0.0"
|
||||
#define APPVERSION "3.0.1"
|
||||
#define PREF_FILE_NAME "settings.xml"
|
||||
|
||||
#define NOTSILENT 0
|
||||
@ -75,6 +75,7 @@ struct SGCSettings{
|
||||
int timing;
|
||||
int Controller;
|
||||
int crosshair;
|
||||
int spritelimit;
|
||||
int xshift; // video output shift
|
||||
int yshift;
|
||||
int WiimoteOrientation;
|
||||
|
@ -187,10 +187,6 @@ bool MountFAT(int method)
|
||||
mounted = false;
|
||||
else if(!fatMountSimple(name, disc))
|
||||
mounted = false;
|
||||
#ifdef HW_RVL
|
||||
else
|
||||
fatSetReadAhead(rootdir, 6, 64);
|
||||
#endif
|
||||
}
|
||||
|
||||
isMounted[method] = mounted;
|
||||
|
@ -489,27 +489,30 @@ InitGCVideo ()
|
||||
// get default video mode
|
||||
vmode = VIDEO_GetPreferredMode(NULL);
|
||||
|
||||
// set VI modes
|
||||
switch (vmode->viTVMode >> 2)
|
||||
{
|
||||
case VI_PAL:
|
||||
// 576 lines (PAL 50Hz)
|
||||
// display should be centered vertically (borders)
|
||||
vmode = &TVPal574IntDfScale;
|
||||
vmode->xfbHeight = 480;
|
||||
vmode->viYOrigin = (VI_MAX_HEIGHT_PAL - 480)/2;
|
||||
vmode->viHeight = 480;
|
||||
|
||||
case VI_PAL: // 574 lines (PAL 50Hz)
|
||||
vmode_60hz = 0;
|
||||
// 50Hz only
|
||||
NTSC_240p.viTVMode = VI_TVMODE_PAL_DS;
|
||||
NTSC_240p.viYOrigin = (VI_MAX_HEIGHT_PAL - 480)/2;
|
||||
break;
|
||||
|
||||
case VI_NTSC:
|
||||
// 480 lines (NTSC 60hz)
|
||||
case VI_NTSC: // 480 lines (NTSC 60Hz)
|
||||
vmode_60hz = 1;
|
||||
// 60Hz only
|
||||
PAL_240p.viTVMode = VI_TVMODE_NTSC_DS;
|
||||
PAL_240p.viYOrigin = (VI_MAX_HEIGHT_NTSC - 480)/2;
|
||||
NTSC_240p.viTVMode = VI_TVMODE_NTSC_DS;
|
||||
break;
|
||||
|
||||
default:
|
||||
// 480 lines (PAL 60Hz)
|
||||
default: // 480 lines (PAL 60Hz)
|
||||
vmode_60hz = 1;
|
||||
// supports both 50/60Hz but better use 60hz by default
|
||||
PAL_240p.viTVMode = VI_TVMODE(vmode->viTVMode >> 2, VI_NON_INTERLACE);
|
||||
PAL_240p.viYOrigin = (VI_MAX_HEIGHT_NTSC - 480)/2;
|
||||
NTSC_240p.viTVMode = VI_TVMODE(vmode->viTVMode >> 2, VI_NON_INTERLACE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -538,7 +541,7 @@ InitGCVideo ()
|
||||
VIDEO_Configure (vmode);
|
||||
|
||||
screenheight = 480;
|
||||
screenwidth = vmode->fbWidth;
|
||||
screenwidth = 640;
|
||||
|
||||
// Allocate the video buffers
|
||||
xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode));
|
||||
@ -580,45 +583,26 @@ ResetVideo_Emu ()
|
||||
GXRModeObj *rmode;
|
||||
Mtx44 p;
|
||||
|
||||
// set VI modes
|
||||
switch (vmode->viTVMode >> 2)
|
||||
{
|
||||
case VI_PAL: /* 574 lines (PAL 50Hz) */
|
||||
|
||||
// 50Hz only
|
||||
NTSC_240p.viTVMode = VI_TVMODE_PAL_DS;
|
||||
NTSC_240p.viYOrigin = (VI_MAX_HEIGHT_PAL - 480)/2;
|
||||
break;
|
||||
|
||||
case VI_NTSC: /* 480 lines (NTSC 60hz) */
|
||||
|
||||
// 60Hz only
|
||||
PAL_240p.viTVMode = VI_TVMODE_NTSC_DS;
|
||||
PAL_240p.viYOrigin = (VI_MAX_HEIGHT_NTSC - 480)/2;
|
||||
NTSC_240p.viTVMode = VI_TVMODE_NTSC_DS;
|
||||
break;
|
||||
|
||||
default: /* 480 lines (PAL 60Hz) */
|
||||
|
||||
// supports both 50/60Hz but better use 60hz by default
|
||||
PAL_240p.viTVMode = VI_TVMODE(vmode->viTVMode >> 2, VI_NON_INTERLACE);
|
||||
PAL_240p.viYOrigin = (VI_MAX_HEIGHT_NTSC - 480)/2;
|
||||
NTSC_240p.viTVMode = VI_TVMODE(vmode->viTVMode >> 2, VI_NON_INTERLACE);
|
||||
break;
|
||||
}
|
||||
|
||||
// choose current VI mode
|
||||
if (GCSettings.render == 0) // original render mode
|
||||
{
|
||||
rmode = tvmodes[GCSettings.timing];
|
||||
}
|
||||
else if (GCSettings.render == 2) // unfiltered
|
||||
else if (GCSettings.render == 2) // unfiltered
|
||||
{
|
||||
rmode = vmode;
|
||||
}
|
||||
else // filtered
|
||||
{
|
||||
rmode = vmode; // same mode as menu
|
||||
rmode = vmode; // same mode as menu
|
||||
|
||||
if(rmode->viTVMode >> 2 == VI_PAL)
|
||||
{
|
||||
rmode = &TVPal574IntDfScale;
|
||||
rmode->xfbHeight = 480;
|
||||
rmode->viYOrigin = (VI_MAX_HEIGHT_PAL - 480)/2;
|
||||
rmode->viHeight = 480;
|
||||
}
|
||||
}
|
||||
|
||||
// reconfigure VI
|
||||
@ -649,7 +633,7 @@ ResetVideo_Emu ()
|
||||
GX_SetZMode (GX_TRUE, GX_LEQUAL, GX_TRUE);
|
||||
GX_SetColorUpdate (GX_TRUE);
|
||||
|
||||
guOrtho(p, 480/2, -(480/2), -(640/2), 640/2, 100, 1000); // matrix, t, b, l, r, n, f
|
||||
guOrtho(p, rmode->efbHeight/2, -(rmode->efbHeight/2), -(rmode->fbWidth/2), rmode->fbWidth/2, 100, 1000); // matrix, t, b, l, r, n, f
|
||||
GX_LoadProjectionMtx (p, GX_ORTHOGRAPHIC);
|
||||
|
||||
// reinitialize texture
|
||||
|
@ -371,6 +371,7 @@ ProgressWindow(char *title, char *msg)
|
||||
return;
|
||||
|
||||
HaltGui();
|
||||
int oldState = mainWindow->GetState();
|
||||
mainWindow->SetState(STATE_DISABLED);
|
||||
mainWindow->Append(&promptWindow);
|
||||
mainWindow->ChangeFocus(&promptWindow);
|
||||
@ -402,7 +403,7 @@ ProgressWindow(char *title, char *msg)
|
||||
|
||||
HaltGui();
|
||||
mainWindow->Remove(&promptWindow);
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
mainWindow->SetState(oldState);
|
||||
ResumeGui();
|
||||
}
|
||||
|
||||
@ -982,7 +983,8 @@ static int MenuGameSelection()
|
||||
mainWindow->SetState(STATE_DISABLED);
|
||||
if(BrowserLoadFile(GCSettings.LoadMethod))
|
||||
menu = MENU_EXIT;
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
else
|
||||
mainWindow->SetState(STATE_DEFAULT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2742,6 +2744,8 @@ static int MenuSettingsVideo()
|
||||
sprintf(options.name[i++], "Timing");
|
||||
sprintf(options.name[i++], "Screen Zoom");
|
||||
sprintf(options.name[i++], "Screen Position");
|
||||
sprintf(options.name[i++], "Zapper Crosshair");
|
||||
sprintf(options.name[i++], "Sprite Limit");
|
||||
options.length = i;
|
||||
|
||||
GuiText titleTxt("Game Settings - Video", 28, (GXColor){255, 255, 255, 255});
|
||||
@ -2816,9 +2820,11 @@ static int MenuSettingsVideo()
|
||||
sprintf (options.value[3], "%s",
|
||||
GCSettings.currpal ? palettes[GCSettings.currpal-1].name : "Default");
|
||||
|
||||
sprintf (options.value[4], "%s", GCSettings.timing == true ? "PAL" : "NTSC");
|
||||
sprintf (options.value[4], "%s", GCSettings.timing == 1 ? "PAL" : "NTSC");
|
||||
sprintf (options.value[5], "%.2f%%", GCSettings.ZoomLevel*100);
|
||||
sprintf (options.value[6], "%d, %d", GCSettings.xshift, GCSettings.yshift);
|
||||
sprintf (options.value[7], "%s", GCSettings.crosshair == 1 ? "On" : "Off");
|
||||
sprintf (options.value[8], "%s", GCSettings.spritelimit == 1 ? "On" : "Off");
|
||||
|
||||
ret = optionBrowser.GetClickedOption();
|
||||
|
||||
@ -2857,6 +2863,14 @@ static int MenuSettingsVideo()
|
||||
case 6:
|
||||
ScreenPositionWindow();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
GCSettings.crosshair ^= 1;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
GCSettings.spritelimit ^= 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if(backBtn.GetState() == STATE_CLICKED)
|
||||
|
@ -139,6 +139,7 @@ preparePrefsData (int method)
|
||||
|
||||
createXMLSetting("currpal", "Palette", toStr(GCSettings.currpal));
|
||||
createXMLSetting("timing", "Timing", toStr(GCSettings.timing));
|
||||
createXMLSetting("spritelimit", "Sprite Limit", toStr(GCSettings.spritelimit));
|
||||
createXMLSetting("ZoomLevel", "Zoom Level", FtoStr(GCSettings.ZoomLevel));
|
||||
createXMLSetting("render", "Video Filtering", toStr(GCSettings.render));
|
||||
createXMLSetting("widescreen", "Aspect Ratio Correction", toStr(GCSettings.widescreen));
|
||||
@ -291,6 +292,7 @@ decodePrefsData (int method)
|
||||
|
||||
loadXMLSetting(&GCSettings.currpal, "currpal");
|
||||
loadXMLSetting(&GCSettings.timing, "timing");
|
||||
loadXMLSetting(&GCSettings.spritelimit, "spritelimit");
|
||||
loadXMLSetting(&GCSettings.ZoomLevel, "ZoomLevel");
|
||||
loadXMLSetting(&GCSettings.render, "render");
|
||||
loadXMLSetting(&GCSettings.widescreen, "widescreen");
|
||||
|
Loading…
Reference in New Issue
Block a user