GTK: added PAL option

SDL: fixed PAL sf2842769
This commit is contained in:
punkrockguy318 2010-02-20 03:33:26 +00:00
parent 9f9cb9c2fc
commit d1bab4ef09
3 changed files with 51 additions and 3 deletions

View File

@ -157,6 +157,21 @@ void setScaler(GtkWidget* w, gpointer p)
g_config->setOption("SDL.SpecialFilter", x);
}
void setPal(GtkWidget* w, gpointer p)
{
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
{
g_config->setOption("SDL.PAL", 1);
FCEUI_SetVidSystem(1);
}
else
{
g_config->setOption("SDL.PAL", 0);
FCEUI_SetVidSystem(0);
}
return;
}
void setGL(GtkWidget* w, gpointer p)
{
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
@ -174,6 +189,7 @@ void openVideoConfig()
GtkWidget* scalerLbl;
GtkWidget* scalerCombo;
GtkWidget* glChk;
GtkWidget* palChk;
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(win), "Video Prefernces");
@ -212,11 +228,23 @@ void openVideoConfig()
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(glChk), 1);
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(glChk), 0);
// PAL check
palChk = gtk_check_button_new_with_label("Enable PAL mode");
g_signal_connect(GTK_OBJECT(palChk), "clicked", G_CALLBACK(setPal), NULL);
// sync with config
g_config->getOption("SDL.PAL", &buf);
if(buf)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(palChk), 1);
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(palChk), 0);
gtk_box_pack_start(GTK_BOX(vbox), lbl, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(vbox), glChk, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(vbox), palChk, FALSE, FALSE, 2);
gtk_container_add(GTK_CONTAINER(win), vbox);

View File

@ -133,7 +133,15 @@ inline double GetYScale(int yres)
{
return ((double)yres) / s_tlines;
}
void FCEUD_VideoChanged()
{
int buf;
g_config->getOption("SDL.PAL", &buf);
if(buf)
PAL = 1;
else
PAL = 0;
}
/**
* Attempts to initialize the graphical video display. Returns 0 on
* success, -1 on failure.

View File

@ -190,6 +190,15 @@ int LoadGame(const char *path)
if(!DriverInitialize(GameInfo)) {
return(0);
}
// set pal/ntsc
int buf;
g_config->getOption("SDL.PAL", &buf);
if(buf)
FCEUI_SetVidSystem(1);
else
FCEUI_SetVidSystem(0);
g_config->getOption("SDL.SoundRecordFile", &filename);
if(filename.size()) {
@ -519,6 +528,7 @@ SDL_GL_LoadLibrary(0);
// Initialize the configuration system
g_config = InitConfig();
if(!g_config) {
SDL_Quit();
@ -532,7 +542,7 @@ SDL_GL_LoadLibrary(0);
SDL_Quit();
return -1;
}
int romIndex = g_config->parse(argc, argv);
//mbg 8/23/2008 - this is also here so that the inputcfg routines can have a chance to dump the new inputcfg to the fceux.cfg
@ -543,11 +553,14 @@ SDL_GL_LoadLibrary(0);
g_config->getOption("SDL.NoConfig", &noconfig);
if (!noconfig)
g_config->save();
std::string s;
g_config->getOption("SDL.InputCfg", &s);
// update the input devices
UpdateInput(g_config);
// check for a .fcm file to convert to .fm2
g_config->getOption ("SDL.FCMConvert", &s);
@ -831,7 +844,6 @@ DUMMY(FCEUD_MovieReplayFrom)
DUMMY(FCEUD_ToggleStatusIcon)
DUMMY(FCEUD_AviRecordTo)
DUMMY(FCEUD_AviStop)
DUMMY(FCEUD_VideoChanged);
void FCEUI_AviVideoUpdate(const unsigned char* buffer) { }
int FCEUD_ShowStatusIcon(void) {return 0;}
bool FCEUI_AviIsRecording(void) {return false;}