Added logic to initialize the video PAL combo box with proper config value at window creation.
This commit is contained in:
parent
3a6c861326
commit
35b0227809
|
@ -51,6 +51,8 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
||||||
regionSelect->addItem( tr("PAL") , 1 );
|
regionSelect->addItem( tr("PAL") , 1 );
|
||||||
regionSelect->addItem( tr("Dendy"), 2 );
|
regionSelect->addItem( tr("Dendy"), 2 );
|
||||||
|
|
||||||
|
setComboBoxFromProperty( regionSelect, "SDL.PAL");
|
||||||
|
|
||||||
connect(regionSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(regionChanged(int)) );
|
connect(regionSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(regionChanged(int)) );
|
||||||
|
|
||||||
hbox1 = new QHBoxLayout();
|
hbox1 = new QHBoxLayout();
|
||||||
|
@ -128,6 +130,20 @@ void ConsoleVideoConfDialog_t::setCheckBoxFromProperty( QCheckBox *cbx, const c
|
||||||
cbx->setCheckState( pval ? Qt::Checked : Qt::Unchecked );
|
cbx->setCheckState( pval ? Qt::Checked : Qt::Unchecked );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
void ConsoleVideoConfDialog_t::setComboBoxFromProperty( QComboBox *cbx, const char *property )
|
||||||
|
{
|
||||||
|
int i, pval;
|
||||||
|
g_config->getOption (property, &pval);
|
||||||
|
|
||||||
|
for (i=0; i<cbx->count(); i++)
|
||||||
|
{
|
||||||
|
if ( pval == cbx->itemData(i).toInt() )
|
||||||
|
{
|
||||||
|
cbx->setCurrentIndex(i); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------
|
||||||
void ConsoleVideoConfDialog_t::use_new_PPU_changed( int value )
|
void ConsoleVideoConfDialog_t::use_new_PPU_changed( int value )
|
||||||
{
|
{
|
||||||
//printf("Value:%i \n", value );
|
//printf("Value:%i \n", value );
|
||||||
|
@ -196,7 +212,7 @@ void ConsoleVideoConfDialog_t::regionChanged(int index)
|
||||||
|
|
||||||
// reset sound subsystem for changes to take effect
|
// reset sound subsystem for changes to take effect
|
||||||
fceuWrapperLock();
|
fceuWrapperLock();
|
||||||
FCEUI_SetRegion (region);
|
FCEUI_SetRegion (region, true);
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ConsoleVideoConfDialog_t : public QDialog
|
||||||
QCheckBox *showFPS_cbx;
|
QCheckBox *showFPS_cbx;
|
||||||
|
|
||||||
void setCheckBoxFromProperty( QCheckBox *cbx, const char *property );
|
void setCheckBoxFromProperty( QCheckBox *cbx, const char *property );
|
||||||
//void setComboBoxFromProperty( QComboBox *cbx, const char *property );
|
void setComboBoxFromProperty( QComboBox *cbx, const char *property );
|
||||||
//void setSliderFromProperty( QSlider *slider, QLabel *lbl, const char *property );
|
//void setSliderFromProperty( QSlider *slider, QLabel *lbl, const char *property );
|
||||||
|
|
||||||
void resetVideo(void);
|
void resetVideo(void);
|
||||||
|
|
10
src/fceu.cpp
10
src/fceu.cpp
|
@ -1054,38 +1054,34 @@ void FCEUI_SetRegion(int region, int notify) {
|
||||||
normalscanlines = 240;
|
normalscanlines = 240;
|
||||||
pal_emulation = 0;
|
pal_emulation = 0;
|
||||||
dendy = 0;
|
dendy = 0;
|
||||||
// until it's fixed on sdl. see issue #740
|
|
||||||
#ifdef WIN32
|
|
||||||
if (notify)
|
if (notify)
|
||||||
{
|
{
|
||||||
FCEU_DispMessage("NTSC mode set", 0);
|
FCEU_DispMessage("NTSC mode set", 0);
|
||||||
FCEUI_printf("NTSC mode set");
|
FCEUI_printf("NTSC mode set");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 1: // PAL
|
case 1: // PAL
|
||||||
normalscanlines = 240;
|
normalscanlines = 240;
|
||||||
pal_emulation = 1;
|
pal_emulation = 1;
|
||||||
dendy = 0;
|
dendy = 0;
|
||||||
#ifdef WIN32
|
|
||||||
if (notify)
|
if (notify)
|
||||||
{
|
{
|
||||||
FCEU_DispMessage("PAL mode set", 0);
|
FCEU_DispMessage("PAL mode set", 0);
|
||||||
FCEUI_printf("PAL mode set");
|
FCEUI_printf("PAL mode set");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case 2: // Dendy
|
case 2: // Dendy
|
||||||
normalscanlines = 290;
|
normalscanlines = 290;
|
||||||
pal_emulation = 0;
|
pal_emulation = 0;
|
||||||
dendy = 1;
|
dendy = 1;
|
||||||
#ifdef WIN32
|
|
||||||
if (notify)
|
if (notify)
|
||||||
{
|
{
|
||||||
FCEU_DispMessage("Dendy mode set", 0);
|
FCEU_DispMessage("Dendy mode set", 0);
|
||||||
FCEUI_printf("Dendy mode set");
|
FCEUI_printf("Dendy mode set");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
normalscanlines += newppu;
|
normalscanlines += newppu;
|
||||||
|
|
Loading…
Reference in New Issue