diff options
author | Automerge Bot <bot@example.com> | 2022-08-19 03:30:35 +0300 |
---|---|---|
committer | Automerge Bot <bot@example.com> | 2022-08-19 03:30:35 +0300 |
commit | a4abc8a649543fa119cf5452d87f1ed1fed18913 (patch) | |
tree | 6f2154953fb71645347d9ca5cc70dabacd50fe07 | |
parent | 1e0f3150a0aeb5ee2c40750ef94f95d3bb83a9b9 (diff) | |
parent | 3eddaf80525ca1a7b156179bf87e09c55386aee6 (diff) |
Merge branch 'master' of https://github.com/TASVideos/fceux into coolgirl
-rw-r--r-- | src/drivers/Qt/fceuWrapper.cpp | 24 | ||||
-rw-r--r-- | src/drivers/Qt/fceuWrapper.h | 1 | ||||
-rw-r--r-- | src/drivers/Qt/main.cpp | 5 |
3 files changed, 25 insertions, 5 deletions
diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index d701fcfb..8c5ef9e7 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -642,6 +642,7 @@ static const char *DriverUsage = static void ShowUsage(const char *prog) { int i,j; + FCEUD_Message("Starting " FCEU_NAME_AND_VERSION "...\n"); printf("\nUsage is as follows:\n%s <options> filename\n\n",prog); puts(DriverUsage); #ifdef _S9XLUA_H @@ -681,11 +682,9 @@ static void ShowUsage(const char *prog) } -int fceuWrapperInit( int argc, char *argv[] ) +// Pre-GUI initialization. +int fceuWrapperPreInit( int argc, char *argv[] ) { - int opt, error; - std::string s; - for (int i=0; i<argc; i++) { if ( (strcmp(argv[i], "--help") == 0) || (strcmp(argv[i],"-h") == 0) ) @@ -693,7 +692,24 @@ int fceuWrapperInit( int argc, char *argv[] ) ShowUsage(argv[0]); exit(0); } + else if ( strcmp(argv[i], "--no-gui") == 0) + { + printf("Error: Qt/SDL version does not support --no-gui option.\n"); + exit(1); + } + else if ( strcmp(argv[i], "--version") == 0) + { + printf("%i.%i.%i\n", FCEU_VERSION_MAJOR, FCEU_VERSION_MINOR, FCEU_VERSION_PATCH); + exit(0); + } } + return 0; +} + +int fceuWrapperInit( int argc, char *argv[] ) +{ + int opt, error; + std::string s; FCEUD_Message("Starting " FCEU_NAME_AND_VERSION "...\n"); diff --git a/src/drivers/Qt/fceuWrapper.h b/src/drivers/Qt/fceuWrapper.h index b5106201..65534ae0 100644 --- a/src/drivers/Qt/fceuWrapper.h +++ b/src/drivers/Qt/fceuWrapper.h @@ -30,6 +30,7 @@ int CloseGame(void); int reloadLastGame(void); int LoadGameFromLua( const char *path ); +int fceuWrapperPreInit( int argc, char *argv[] ); int fceuWrapperInit( int argc, char *argv[] ); int fceuWrapperMemoryCleanup( void ); int fceuWrapperClose( void ); diff --git a/src/drivers/Qt/main.cpp b/src/drivers/Qt/main.cpp index 0c2f1f69..1974ac29 100644 --- a/src/drivers/Qt/main.cpp +++ b/src/drivers/Qt/main.cpp @@ -95,7 +95,10 @@ static bool showSplashScreen(void) int main( int argc, char *argv[] ) { - int retval; + int retval = 0; + + fceuWrapperPreInit(argc, argv); + qInstallMessageHandler(MessageOutput); QApplication app(argc, argv); |