Added video region combo box logic.

This commit is contained in:
Matthew Budd 2020-07-07 21:06:24 -04:00
parent ea1782bfe5
commit 46271dfa61
2 changed files with 20 additions and 0 deletions

View File

@ -51,6 +51,8 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
regionSelect->addItem( tr("PAL") , 1 );
regionSelect->addItem( tr("Dendy"), 2 );
connect(regionSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(regionChanged(int)) );
hbox1 = new QHBoxLayout();
hbox1->addWidget( lbl );
@ -181,6 +183,23 @@ void ConsoleVideoConfDialog_t::showFPSChanged( int value )
fceuWrapperUnLock();
}
//----------------------------------------------------
void ConsoleVideoConfDialog_t::regionChanged(int index)
{
int region;
//printf("Region: %i : %i \n", index, regionSelect->itemData(index).toInt() );
region = regionSelect->itemData(index).toInt();
g_config->setOption ("SDL.PAL", region);
g_config->save ();
// reset sound subsystem for changes to take effect
fceuWrapperLock();
FCEUI_SetRegion (region);
fceuWrapperUnLock();
}
//----------------------------------------------------
void ConsoleVideoConfDialog_t::applyChanges( void )
{
resetVideo();

View File

@ -46,6 +46,7 @@ class ConsoleVideoConfDialog_t : public QDialog
void useSpriteLimitChanged( int value );
void clipSidesChanged( int value );
void showFPSChanged( int value );
void regionChanged(int index);
void applyChanges( void );
void closewindow( void );