crosshair disable option, prevent update notification from interfering with game loading

This commit is contained in:
dborth 2010-03-15 23:18:18 +00:00
parent bc4aff009d
commit ad5c687ce8
7 changed files with 39 additions and 9 deletions

View File

@ -46,6 +46,7 @@ static char szpath[MAXPATHLEN];
static bool inSz = false; static bool inSz = false;
unsigned long SNESROMSize = 0; unsigned long SNESROMSize = 0;
bool loadingFile = false;
/**************************************************************************** /****************************************************************************
* autoLoadMethod() * autoLoadMethod()
@ -460,6 +461,7 @@ int WiiFileLoader()
memset(Memory.NSRTHeader, 0, sizeof(Memory.NSRTHeader)); memset(Memory.NSRTHeader, 0, sizeof(Memory.NSRTHeader));
Memory.HeaderCount = 0; Memory.HeaderCount = 0;
loadingFile = true;
if(!inSz) if(!inSz)
{ {
@ -478,6 +480,7 @@ int WiiFileLoader()
BrowserChangeFolder(); BrowserChangeFolder();
} }
} }
loadingFile = false;
if(size <= 0) if(size <= 0)
return 0; return 0;

View File

@ -53,6 +53,7 @@ enum
}; };
extern unsigned long SNESROMSize; extern unsigned long SNESROMSize;
extern bool loadingFile;
bool MakeFilePath(char filepath[], int type, char * filename = NULL, int filenum = -2); bool MakeFilePath(char filepath[], int type, char * filename = NULL, int filenum = -2);
int UpdateDirName(); int UpdateDirName();

View File

@ -356,7 +356,7 @@ msgid "Settings - Network"
msgstr "Paramètres - Réseau" msgstr "Paramètres - Réseau"
msgid "Settings - Saving & Loading" msgid "Settings - Saving & Loading"
msgstr "Paramètres - Sauvegarde & Chargement" msgstr "Paramètres - Sauv. & Chargement"
msgid "Shift" msgid "Shift"
msgstr "Maj" msgstr "Maj"

View File

@ -297,6 +297,8 @@ UpdateGUI (void *arg)
if(updateFound) if(updateFound)
{ {
updateFound = false; updateFound = false;
if(!loadingFile)
LWP_CreateThread (&updatethread, EmulatorUpdate, NULL, NULL, 0, 70); LWP_CreateThread (&updatethread, EmulatorUpdate, NULL, NULL, 0, 70);
} }
#endif #endif
@ -2996,6 +2998,7 @@ static int MenuSettingsVideo()
sprintf(options.name[i++], "Filtering"); sprintf(options.name[i++], "Filtering");
sprintf(options.name[i++], "Screen Zoom"); sprintf(options.name[i++], "Screen Zoom");
sprintf(options.name[i++], "Screen Position"); sprintf(options.name[i++], "Screen Position");
sprintf(options.name[i++], "Crosshair");
sprintf(options.name[i++], "Video Mode"); sprintf(options.name[i++], "Video Mode");
options.length = i; options.length = i;
@ -3075,7 +3078,12 @@ static int MenuSettingsVideo()
case 4: case 4:
ScreenPositionWindow(); ScreenPositionWindow();
break; break;
case 5: case 5:
GCSettings.crosshair ^= 1;
break;
case 6:
GCSettings.videomode++; GCSettings.videomode++;
if(GCSettings.videomode > 4) if(GCSettings.videomode > 4)
GCSettings.videomode = 0; GCSettings.videomode = 0;
@ -3105,19 +3113,20 @@ static int MenuSettingsVideo()
sprintf (options.value[2], "%s", GetFilterName((RenderFilter)GCSettings.FilterMethod)); sprintf (options.value[2], "%s", GetFilterName((RenderFilter)GCSettings.FilterMethod));
sprintf (options.value[3], "%.2f%%, %.2f%%", GCSettings.zoomHor*100, GCSettings.zoomVert*100); sprintf (options.value[3], "%.2f%%, %.2f%%", GCSettings.zoomHor*100, GCSettings.zoomVert*100);
sprintf (options.value[4], "%d, %d", GCSettings.xshift, GCSettings.yshift); sprintf (options.value[4], "%d, %d", GCSettings.xshift, GCSettings.yshift);
sprintf (options.value[5], "%s", GCSettings.crosshair == 1 ? "On" : "Off");
switch(GCSettings.videomode) switch(GCSettings.videomode)
{ {
case 0: case 0:
sprintf (options.value[5], "Automatic (Recommended)"); break; sprintf (options.value[6], "Automatic (Recommended)"); break;
case 1: case 1:
sprintf (options.value[5], "NTSC (480i)"); break; sprintf (options.value[6], "NTSC (480i)"); break;
case 2: case 2:
sprintf (options.value[5], "Progressive (480p)"); break; sprintf (options.value[6], "Progressive (480p)"); break;
case 3: case 3:
sprintf (options.value[5], "PAL (50Hz)"); break; sprintf (options.value[6], "PAL (50Hz)"); break;
case 4: case 4:
sprintf (options.value[5], "PAL (60Hz)"); break; sprintf (options.value[6], "PAL (60Hz)"); break;
} }
optionBrowser.TriggerUpdate(); optionBrowser.TriggerUpdate();
} }

View File

@ -140,6 +140,7 @@ preparePrefsData ()
createXMLSetting("zoomVert", "Vertical Zoom Level", FtoStr(GCSettings.zoomVert)); createXMLSetting("zoomVert", "Vertical Zoom Level", FtoStr(GCSettings.zoomVert));
createXMLSetting("render", "Video Filtering", toStr(GCSettings.render)); createXMLSetting("render", "Video Filtering", toStr(GCSettings.render));
createXMLSetting("widescreen", "Aspect Ratio Correction", toStr(GCSettings.widescreen)); createXMLSetting("widescreen", "Aspect Ratio Correction", toStr(GCSettings.widescreen));
createXMLSetting("crosshair", "Crosshair", toStr(GCSettings.crosshair));
createXMLSetting("FilterMethod", "Filter Method", toStr(GCSettings.FilterMethod)); createXMLSetting("FilterMethod", "Filter Method", toStr(GCSettings.FilterMethod));
createXMLSetting("xshift", "Horizontal Video Shift", toStr(GCSettings.xshift)); createXMLSetting("xshift", "Horizontal Video Shift", toStr(GCSettings.xshift));
createXMLSetting("yshift", "Vertical Video Shift", toStr(GCSettings.yshift)); createXMLSetting("yshift", "Vertical Video Shift", toStr(GCSettings.yshift));
@ -313,6 +314,7 @@ decodePrefsData ()
loadXMLSetting(&GCSettings.zoomVert, "zoomVert"); loadXMLSetting(&GCSettings.zoomVert, "zoomVert");
loadXMLSetting(&GCSettings.render, "render"); loadXMLSetting(&GCSettings.render, "render");
loadXMLSetting(&GCSettings.widescreen, "widescreen"); loadXMLSetting(&GCSettings.widescreen, "widescreen");
loadXMLSetting(&GCSettings.crosshair, "crosshair");
loadXMLSetting(&GCSettings.FilterMethod, "FilterMethod"); loadXMLSetting(&GCSettings.FilterMethod, "FilterMethod");
loadXMLSetting(&GCSettings.xshift, "xshift"); loadXMLSetting(&GCSettings.xshift, "xshift");
loadXMLSetting(&GCSettings.yshift, "yshift"); loadXMLSetting(&GCSettings.yshift, "yshift");
@ -411,6 +413,7 @@ DefaultSettings ()
GCSettings.zoomVert = 1.0; // vertical zoom level GCSettings.zoomVert = 1.0; // vertical zoom level
GCSettings.xshift = 0; // horizontal video shift GCSettings.xshift = 0; // horizontal video shift
GCSettings.yshift = 0; // vertical video shift GCSettings.yshift = 0; // vertical video shift
GCSettings.crosshair = 1;
GCSettings.WiimoteOrientation = 0; GCSettings.WiimoteOrientation = 0;
GCSettings.ExitAction = 0; GCSettings.ExitAction = 0;

View File

@ -94,6 +94,7 @@ struct SGCSettings{
int render; // 0 - original, 1 - filtered, 2 - unfiltered int render; // 0 - original, 1 - filtered, 2 - unfiltered
int FilterMethod; // convert to RenderFilter int FilterMethod; // convert to RenderFilter
int Controller; int Controller;
int crosshair;
int widescreen; // 0 - 4:3 aspect, 1 - 16:9 aspect int widescreen; // 0 - 4:3 aspect, 1 - 16:9 aspect
int xshift; // video output shift int xshift; // video output shift
int yshift; int yshift;

View File

@ -194,6 +194,10 @@
#include "netplay.h" #include "netplay.h"
#endif #endif
#ifdef GEKKO
#include "../ngc/snes9xGX.h"
#endif
using namespace std; using namespace std;
#define NONE (-2) #define NONE (-2)
@ -3207,6 +3211,9 @@ void S9xControlEOF (void)
DoGunLatch(superscope.x, superscope.y); DoGunLatch(superscope.x, superscope.y);
c = &superscope.crosshair; c = &superscope.crosshair;
#ifdef GEKKO
if(GCSettings.crosshair)
#endif
if (IPPU.RenderThisFrame) if (IPPU.RenderThisFrame)
S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, superscope.x, superscope.y); S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, superscope.x, superscope.y);
} }
@ -3217,6 +3224,9 @@ void S9xControlEOF (void)
if (n == 1 && !justifier.offscreen[1]) if (n == 1 && !justifier.offscreen[1])
{ {
c = &justifier.crosshair[1]; c = &justifier.crosshair[1];
#ifdef GEKKO
if(GCSettings.crosshair)
#endif
if (IPPU.RenderThisFrame) if (IPPU.RenderThisFrame)
S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[1], justifier.y[1]); S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[1], justifier.y[1]);
} }
@ -3236,6 +3246,9 @@ void S9xControlEOF (void)
if (!justifier.offscreen[0]) if (!justifier.offscreen[0])
{ {
c = &justifier.crosshair[0]; c = &justifier.crosshair[0];
#ifdef GEKKO
if(GCSettings.crosshair)
#endif
if (IPPU.RenderThisFrame) if (IPPU.RenderThisFrame)
S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[0], justifier.y[0]); S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[0], justifier.y[0]);
} }