From 824bdda083c113ac6a478bfd59d032169d3eaf6e Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Sun, 5 Jul 2020 16:37:26 -0400 Subject: [PATCH] Renamed a few of the files and class objects to be more appropriate to what the actually are. --- fceux.pro | 8 ++--- ...GameSoundConf.cpp => ConsoleSoundConf.cpp} | 36 +++++++++---------- .../{GameSoundConf.h => ConsoleSoundConf.h} | 6 ++-- .../Qt/{GameApp.cpp => ConsoleWindow.cpp} | 8 ++--- src/drivers/Qt/{GameApp.h => ConsoleWindow.h} | 0 src/drivers/Qt/fceuWrapper.cpp | 2 +- src/drivers/Qt/main.cpp | 2 +- src/drivers/Qt/sdl-throttle.cpp | 6 ---- 8 files changed, 31 insertions(+), 37 deletions(-) rename src/drivers/Qt/{GameSoundConf.cpp => ConsoleSoundConf.cpp} (89%) rename src/drivers/Qt/{GameSoundConf.h => ConsoleSoundConf.h} (91%) rename src/drivers/Qt/{GameApp.cpp => ConsoleWindow.cpp} (97%) rename src/drivers/Qt/{GameApp.h => ConsoleWindow.h} (100%) diff --git a/fceux.pro b/fceux.pro index 37eb3f9c..cb3d246f 100644 --- a/fceux.pro +++ b/fceux.pro @@ -294,17 +294,17 @@ SOURCES += src/drivers/common/scalebit.cpp SOURCES += src/drivers/common/vidblit.cpp SOURCES += src/drivers/common/nes_ntsc.c -HEADERS += src/drivers/Qt/GameApp.h +HEADERS += src/drivers/Qt/ConsoleWindow.h HEADERS += src/drivers/Qt/GameViewerGL.h HEADERS += src/drivers/Qt/GameViewerSDL.h HEADERS += src/drivers/Qt/GamePadConf.h -HEADERS += src/drivers/Qt/GameSoundConf.h +HEADERS += src/drivers/Qt/ConsoleSoundConf.h SOURCES += src/drivers/Qt/main.cpp -SOURCES += src/drivers/Qt/GameApp.cpp +SOURCES += src/drivers/Qt/ConsoleWindow.cpp SOURCES += src/drivers/Qt/GameViewerGL.cpp SOURCES += src/drivers/Qt/GameViewerSDL.cpp SOURCES += src/drivers/Qt/GamePadConf.cpp -SOURCES += src/drivers/Qt/GameSoundConf.cpp +SOURCES += src/drivers/Qt/ConsoleSoundConf.cpp SOURCES += src/drivers/Qt/fceuWrapper.cpp SOURCES += src/drivers/Qt/config.cpp SOURCES += src/drivers/Qt/input.cpp diff --git a/src/drivers/Qt/GameSoundConf.cpp b/src/drivers/Qt/ConsoleSoundConf.cpp similarity index 89% rename from src/drivers/Qt/GameSoundConf.cpp rename to src/drivers/Qt/ConsoleSoundConf.cpp index 8ead488f..f5b34727 100644 --- a/src/drivers/Qt/GameSoundConf.cpp +++ b/src/drivers/Qt/ConsoleSoundConf.cpp @@ -2,14 +2,14 @@ // #include "../../fceu.h" #include "../../driver.h" -#include "Qt/GameSoundConf.h" +#include "Qt/ConsoleSoundConf.h" #include "Qt/main.h" #include "Qt/dface.h" #include "Qt/config.h" #include "Qt/fceuWrapper.h" //---------------------------------------------------- -GameSndConfDialog_t::GameSndConfDialog_t(QWidget *parent) +ConsoleSndConfDialog_t::ConsoleSndConfDialog_t(QWidget *parent) : QDialog( parent ) { int buf; @@ -215,12 +215,12 @@ GameSndConfDialog_t::GameSndConfDialog_t(QWidget *parent) setLayout( hbox1 ); } //---------------------------------------------------- -GameSndConfDialog_t::~GameSndConfDialog_t(void) +ConsoleSndConfDialog_t::~ConsoleSndConfDialog_t(void) { } //---------------------------------------------------- -void GameSndConfDialog_t::setCheckBoxFromProperty( QCheckBox *cbx, const char *property ) +void ConsoleSndConfDialog_t::setCheckBoxFromProperty( QCheckBox *cbx, const char *property ) { int pval; g_config->getOption (property, &pval); @@ -228,7 +228,7 @@ void GameSndConfDialog_t::setCheckBoxFromProperty( QCheckBox *cbx, const char * cbx->setCheckState( pval ? Qt::Checked : Qt::Unchecked ); } //---------------------------------------------------- -void GameSndConfDialog_t::setComboBoxFromProperty( QComboBox *cbx, const char *property ) +void ConsoleSndConfDialog_t::setComboBoxFromProperty( QComboBox *cbx, const char *property ) { int i, pval; g_config->getOption (property, &pval); @@ -242,7 +242,7 @@ void GameSndConfDialog_t::setComboBoxFromProperty( QComboBox *cbx, const char * } } //---------------------------------------------------- -void GameSndConfDialog_t::setSliderFromProperty( QSlider *slider, QLabel *lbl, const char *property ) +void ConsoleSndConfDialog_t::setSliderFromProperty( QSlider *slider, QLabel *lbl, const char *property ) { int pval; char stmp[32]; @@ -252,7 +252,7 @@ void GameSndConfDialog_t::setSliderFromProperty( QSlider *slider, QLabel *lbl, lbl->setText( stmp ); } //---------------------------------------------------- -void GameSndConfDialog_t::bufSizeChanged(int value) +void ConsoleSndConfDialog_t::bufSizeChanged(int value) { char stmp[32]; @@ -266,7 +266,7 @@ void GameSndConfDialog_t::bufSizeChanged(int value) InitSound (); } //---------------------------------------------------- -void GameSndConfDialog_t::volumeChanged(int value) +void ConsoleSndConfDialog_t::volumeChanged(int value) { char stmp[32]; @@ -278,7 +278,7 @@ void GameSndConfDialog_t::volumeChanged(int value) FCEUI_SetSoundVolume (value); } //---------------------------------------------------- -void GameSndConfDialog_t::triangleChanged(int value) +void ConsoleSndConfDialog_t::triangleChanged(int value) { char stmp[32]; @@ -290,7 +290,7 @@ void GameSndConfDialog_t::triangleChanged(int value) FCEUI_SetTriangleVolume (value); } //---------------------------------------------------- -void GameSndConfDialog_t::square1Changed(int value) +void ConsoleSndConfDialog_t::square1Changed(int value) { char stmp[32]; @@ -302,7 +302,7 @@ void GameSndConfDialog_t::square1Changed(int value) FCEUI_SetSquare1Volume (value); } //---------------------------------------------------- -void GameSndConfDialog_t::square2Changed(int value) +void ConsoleSndConfDialog_t::square2Changed(int value) { char stmp[32]; @@ -314,7 +314,7 @@ void GameSndConfDialog_t::square2Changed(int value) FCEUI_SetSquare2Volume (value); } //---------------------------------------------------- -void GameSndConfDialog_t::noiseChanged(int value) +void ConsoleSndConfDialog_t::noiseChanged(int value) { char stmp[32]; @@ -326,7 +326,7 @@ void GameSndConfDialog_t::noiseChanged(int value) FCEUI_SetNoiseVolume (value); } //---------------------------------------------------- -void GameSndConfDialog_t::pcmChanged(int value) +void ConsoleSndConfDialog_t::pcmChanged(int value) { char stmp[32]; @@ -338,7 +338,7 @@ void GameSndConfDialog_t::pcmChanged(int value) FCEUI_SetPCMVolume (value); } //---------------------------------------------------- -void GameSndConfDialog_t::enaSoundStateChange(int value) +void ConsoleSndConfDialog_t::enaSoundStateChange(int value) { if ( value ) { @@ -357,7 +357,7 @@ void GameSndConfDialog_t::enaSoundStateChange(int value) } } //---------------------------------------------------- -void GameSndConfDialog_t::enaSoundLowPassChange(int value) +void ConsoleSndConfDialog_t::enaSoundLowPassChange(int value) { if (value) { @@ -372,7 +372,7 @@ void GameSndConfDialog_t::enaSoundLowPassChange(int value) g_config->save (); } //---------------------------------------------------- -void GameSndConfDialog_t::swapDutyCallback(int value) +void ConsoleSndConfDialog_t::swapDutyCallback(int value) { if (value) { @@ -387,7 +387,7 @@ void GameSndConfDialog_t::swapDutyCallback(int value) g_config->save (); } //---------------------------------------------------- -void GameSndConfDialog_t::soundQualityChanged(int index) +void ConsoleSndConfDialog_t::soundQualityChanged(int index) { //printf("Sound Quality: %i : %i \n", index, qualitySelect->itemData(index).toInt() ); @@ -399,7 +399,7 @@ void GameSndConfDialog_t::soundQualityChanged(int index) g_config->save (); } //---------------------------------------------------- -void GameSndConfDialog_t::soundRateChanged(int index) +void ConsoleSndConfDialog_t::soundRateChanged(int index) { //printf("Sound Rate: %i : %i \n", index, rateSelect->itemData(index).toInt() ); diff --git a/src/drivers/Qt/GameSoundConf.h b/src/drivers/Qt/ConsoleSoundConf.h similarity index 91% rename from src/drivers/Qt/GameSoundConf.h rename to src/drivers/Qt/ConsoleSoundConf.h index ebc97649..40e86d2a 100644 --- a/src/drivers/Qt/GameSoundConf.h +++ b/src/drivers/Qt/ConsoleSoundConf.h @@ -16,13 +16,13 @@ #include #include -class GameSndConfDialog_t : public QDialog +class ConsoleSndConfDialog_t : public QDialog { Q_OBJECT public: - GameSndConfDialog_t(QWidget *parent = 0); - ~GameSndConfDialog_t(void); + ConsoleSndConfDialog_t(QWidget *parent = 0); + ~ConsoleSndConfDialog_t(void); protected: QCheckBox *enaChkbox; diff --git a/src/drivers/Qt/GameApp.cpp b/src/drivers/Qt/ConsoleWindow.cpp similarity index 97% rename from src/drivers/Qt/GameApp.cpp rename to src/drivers/Qt/ConsoleWindow.cpp index 6d149bae..b17e4e9f 100644 --- a/src/drivers/Qt/GameApp.cpp +++ b/src/drivers/Qt/ConsoleWindow.cpp @@ -2,9 +2,9 @@ // #include -#include "Qt/GameApp.h" +#include "Qt/ConsoleWindow.h" #include "Qt/GamePadConf.h" -#include "Qt/GameSoundConf.h" +#include "Qt/ConsoleSoundConf.h" #include "Qt/fceuWrapper.h" #include "Qt/keyscan.h" #include "Qt/nes_shm.h" @@ -253,11 +253,11 @@ void consoleWin_t::openGamePadConfWin(void) void consoleWin_t::openGameSndConfWin(void) { - GameSndConfDialog_t *sndConfWin; + ConsoleSndConfDialog_t *sndConfWin; printf("Open Sound Config Window\n"); - sndConfWin = new GameSndConfDialog_t(this); + sndConfWin = new ConsoleSndConfDialog_t(this); sndConfWin->show(); sndConfWin->exec(); diff --git a/src/drivers/Qt/GameApp.h b/src/drivers/Qt/ConsoleWindow.h similarity index 100% rename from src/drivers/Qt/GameApp.h rename to src/drivers/Qt/ConsoleWindow.h diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index c9b0c153..6599d819 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -14,7 +14,7 @@ #include "Qt/sdl-video.h" #include "Qt/nes_shm.h" #include "Qt/unix-netplay.h" -#include "Qt/GameApp.h" +#include "Qt/ConsoleWindow.h" #include "common/cheat.h" #include "../../fceu.h" diff --git a/src/drivers/Qt/main.cpp b/src/drivers/Qt/main.cpp index 153cb60f..0dc688c0 100644 --- a/src/drivers/Qt/main.cpp +++ b/src/drivers/Qt/main.cpp @@ -1,6 +1,6 @@ #include -#include "Qt/GameApp.h" +#include "Qt/ConsoleWindow.h" #include "Qt/fceuWrapper.h" consoleWin_t *consoleWindow = NULL; diff --git a/src/drivers/Qt/sdl-throttle.cpp b/src/drivers/Qt/sdl-throttle.cpp index cafaad5c..1fba8173 100644 --- a/src/drivers/Qt/sdl-throttle.cpp +++ b/src/drivers/Qt/sdl-throttle.cpp @@ -3,8 +3,6 @@ #include "Qt/sdl.h" #include "Qt/throttle.h" -#include "Qt/GameApp.h" -#include "Qt/fceuWrapper.h" static const double Slowest = 0.015625; // 1/64x speed (around 1 fps on NTSC) static const double Fastest = 32; // 32x speed (around 1920 fps on NTSC) @@ -46,8 +44,6 @@ RefreshThrottleFPS() //printf("FrameTime: %llu %llu %f %lf \n", fps, fps >> 24, hz, desired_frametime ); - //gameWindow->setCyclePeriodms( T ); - Lasttime=0; Nexttime=0; InFrame=0; @@ -99,9 +95,7 @@ SpeedThrottle() if ( time_left > 0 ) { - //fceuWrapperUnLock(); SDL_Delay(time_left); - //fceuWrapperLock(); } if (!InFrame)