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");
@ -213,10 +229,22 @@ void openVideoConfig()
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

@ -191,6 +191,15 @@ int LoadGame(const char *path)
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()) {
if(!FCEUI_BeginWaveRecord(filename.c_str())) {
@ -520,6 +529,7 @@ SDL_GL_LoadLibrary(0);
// Initialize the configuration system
g_config = InitConfig();
if(!g_config) {
SDL_Quit();
return -1;
@ -543,12 +553,15 @@ 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);
g_config->setOption ("SDL.FCMConvert", "");
@ -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;}