From 46271dfa614fae24ace56bcde167b1ee1ff45303 Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Tue, 7 Jul 2020 21:06:24 -0400 Subject: [PATCH] Added video region combo box logic. --- src/drivers/Qt/ConsoleVideoConf.cpp | 19 +++++++++++++++++++ src/drivers/Qt/ConsoleVideoConf.h | 1 + 2 files changed, 20 insertions(+) diff --git a/src/drivers/Qt/ConsoleVideoConf.cpp b/src/drivers/Qt/ConsoleVideoConf.cpp index 345d9b71..a70bdca2 100644 --- a/src/drivers/Qt/ConsoleVideoConf.cpp +++ b/src/drivers/Qt/ConsoleVideoConf.cpp @@ -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(); diff --git a/src/drivers/Qt/ConsoleVideoConf.h b/src/drivers/Qt/ConsoleVideoConf.h index 0c258fe1..16b5aa5f 100644 --- a/src/drivers/Qt/ConsoleVideoConf.h +++ b/src/drivers/Qt/ConsoleVideoConf.h @@ -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 );