* win32: fixed command line support for "-pal" (#547)
* added "(Europe)" and "(PAL)" strings to region detection
This commit is contained in:
parent
cb579fa216
commit
f346020de2
|
@ -110,24 +110,22 @@ int checkCondition(const char* condition, int num)
|
|||
++b;
|
||||
}
|
||||
|
||||
// Remove the old breakpoint condition before
|
||||
// adding a new condition.
|
||||
|
||||
if (watchpoint[num].cond)
|
||||
{
|
||||
freeTree(watchpoint[num].cond);
|
||||
free(watchpoint[num].condText);
|
||||
|
||||
watchpoint[num].cond = 0;
|
||||
watchpoint[num].condText = 0;
|
||||
}
|
||||
|
||||
// If there's an actual condition create the BP condition object now
|
||||
|
||||
if (*condition && !onlySpaces)
|
||||
{
|
||||
Condition* c = generateCondition(condition);
|
||||
|
||||
|
||||
// Remove the old breakpoint condition before adding a new condition.
|
||||
if (watchpoint[num].cond)
|
||||
{
|
||||
freeTree(watchpoint[num].cond);
|
||||
free(watchpoint[num].condText);
|
||||
watchpoint[num].cond = 0;
|
||||
watchpoint[num].condText = 0;
|
||||
}
|
||||
|
||||
// If the creation of the BP condition object was succesful
|
||||
// the condition is apparently valid. It can be added to the
|
||||
// breakpoint now.
|
||||
|
@ -149,6 +147,14 @@ int checkCondition(const char* condition, int num)
|
|||
}
|
||||
else
|
||||
{
|
||||
// Remove the old breakpoint condition
|
||||
if (watchpoint[num].cond)
|
||||
{
|
||||
freeTree(watchpoint[num].cond);
|
||||
free(watchpoint[num].condText);
|
||||
watchpoint[num].cond = 0;
|
||||
watchpoint[num].condText = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ extern bool turbo;
|
|||
char *ParseArgies(int argc, char *argv[])
|
||||
{
|
||||
static ARGPSTRUCT FCEUArgs[]={
|
||||
{"-pal",0,&pal_emulation,0},
|
||||
{"-pal",&pal_setting_specified,&pal_emulation,0},
|
||||
{"-noicon",0,&status_icon,0},
|
||||
{"-gg",0,&genie,0},
|
||||
{"-no8lim",0,&eoptions,0x8000|EO_NOSPRLIM},
|
||||
|
|
|
@ -144,6 +144,7 @@ double saspectw = 1, saspecth = 1;
|
|||
double winsizemulx = 1, winsizemuly = 1;
|
||||
int genie = 0;
|
||||
int pal_emulation = 0;
|
||||
int pal_setting_specified = 0;
|
||||
int ntsccol = 0, ntsctint, ntschue;
|
||||
std::string BaseDirectory;
|
||||
int PauseAfterLoad;
|
||||
|
@ -643,19 +644,19 @@ int main(int argc,char *argv[])
|
|||
// Parse the commandline arguments
|
||||
t = ParseArgies(argc, argv);
|
||||
|
||||
if (ConfigToLoad) cfgFile.assign(ConfigToLoad);
|
||||
int saved_pal_setting = !!pal_emulation;
|
||||
|
||||
//initDirectories();
|
||||
|
||||
// Load the config information
|
||||
sprintf(TempArray,"%s\\%s",BaseDirectory.c_str(),cfgFile.c_str());
|
||||
LoadConfig(TempArray);
|
||||
if (ConfigToLoad)
|
||||
{
|
||||
cfgFile.assign(ConfigToLoad);
|
||||
//initDirectories();
|
||||
// Load the config information
|
||||
sprintf(TempArray,"%s\\%s",BaseDirectory.c_str(),cfgFile.c_str());
|
||||
LoadConfig(TempArray);
|
||||
}
|
||||
|
||||
//Bleh, need to find a better place for this.
|
||||
{
|
||||
pal_emulation = !!pal_emulation;
|
||||
FCEUI_SetVidSystem(pal_emulation);
|
||||
|
||||
FCEUI_SetGameGenie(genie!=0);
|
||||
|
||||
fullscreen = !!fullscreen;
|
||||
|
@ -678,6 +679,12 @@ int main(int argc,char *argv[])
|
|||
FCEUI_SetPCMVolume(soundPCMvol);
|
||||
}
|
||||
|
||||
if (!ConfigToLoad)
|
||||
{
|
||||
sprintf(TempArray,"%s\\%s",BaseDirectory.c_str(),cfgFile.c_str());
|
||||
LoadConfig(TempArray);
|
||||
}
|
||||
|
||||
//Since a game doesn't have to be loaded before the GUI can be used, make
|
||||
//sure the temporary input type variables are set.
|
||||
ParseGIInput(NULL);
|
||||
|
@ -751,6 +758,13 @@ int main(int argc,char *argv[])
|
|||
LoadNewGamey(hAppWnd, 0);
|
||||
}
|
||||
|
||||
if (pal_setting_specified)
|
||||
{
|
||||
// Force the PAL setting specified in the command line
|
||||
pal_emulation = saved_pal_setting;
|
||||
FCEUI_SetVidSystem(pal_emulation);
|
||||
}
|
||||
|
||||
if(PaletteToLoad)
|
||||
{
|
||||
SetPalette(PaletteToLoad);
|
||||
|
|
|
@ -41,6 +41,7 @@ extern int genie;
|
|||
|
||||
// Flag that indicates whether PAL Emulation is enabled or not.
|
||||
extern int pal_emulation;
|
||||
extern int pal_setting_specified;
|
||||
extern int status_icon;
|
||||
extern int frame_display;
|
||||
extern int rerecord_display;
|
||||
|
|
|
@ -281,7 +281,7 @@ int loadDebuggerPreferences(FILE* f)
|
|||
// Read the flags of the BP
|
||||
if (fread(&flags, sizeof(flags), 1, f) != 1) return 1;
|
||||
|
||||
// Read the length of the BP description
|
||||
// Read the length of the BP condition
|
||||
if (fread(&len, sizeof(len), 1, f) != 1) return 1;
|
||||
|
||||
// Delete eventual older conditions
|
||||
|
@ -294,7 +294,6 @@ int loadDebuggerPreferences(FILE* f)
|
|||
{
|
||||
// Read the breakpoint condition
|
||||
if (fread(watchpoint[myNumWPs].condText, 1, len, f) != len) return 1;
|
||||
|
||||
// TODO: Check return value
|
||||
checkCondition(watchpoint[myNumWPs].condText, myNumWPs);
|
||||
}
|
||||
|
|
|
@ -867,6 +867,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode)
|
|||
if(OverwriteVidMode)
|
||||
{
|
||||
if(strstr(name,"(E)") || strstr(name,"(e)")
|
||||
|| strstr(name,"(Europe)") || strstr(name,"(PAL)")
|
||||
|| strstr(name,"(F)") || strstr(name,"(f)")
|
||||
|| strstr(name,"(G)") || strstr(name,"(g)")
|
||||
|| strstr(name,"(I)") || strstr(name,"(i)"))
|
||||
|
|
Loading…
Reference in New Issue