]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/app.cpp
Virtual Jaguar 2.0.0 release.
[virtualjaguar] / src / gui / app.cpp
index b313f66c6eba21bc35b76fd25b5af6151668a565..aad90feb2b128db4e6982916d2356868f7ea6f01 100644 (file)
@@ -19,6 +19,7 @@
 #include <QApplication>
 #include "log.h"
 #include "mainwin.h"
+#include "settings.h"
 #include "types.h"
 
 #ifdef __GCCWIN32__
 // Here's the main application loop--short and simple...
 int main(int argc, char * argv[])
 {
+       // Normally, this would be read in from the settings module... :-P
+       vjs.hardwareTypeAlpine = false;
+
        if (argc > 1)
        {
-               if (strcmp(argv[1], "--help") == 0)
+               if ((strcmp(argv[1], "--help") == 0) || (strcmp(argv[1], "-h") == 0)
+                       || (strcmp(argv[1], "-?") == 0))
                {
                        printf("Virtual Jaguar 2.0.0 help\n");
                        printf("\n");
-                       printf("This is an experimental branch of Virtual Jaguar, how did you get it?\n");
+                       printf("Command line interface is non-functional ATM, but may return if there is\n"
+                               "enough demand for it. :-)\n");
                        return 0;
                }
+               if (strcmp(argv[1], "--yarrr") == 0)
+               {
+                       printf("\n");
+                       printf("Shiver me timbers!\n");
+                       printf("\n");
+                       return 0;
+               }
+               if ((strcmp(argv[1], "--alpine") == 0) || (strcmp(argv[1], "-a") == 0))
+               {
+                       printf("Alpine Mode enabled.\n");
+                       vjs.hardwareTypeAlpine = true;
+               }
        }
 
        Q_INIT_RESOURCE(virtualjaguar); // This must the same name as the exe filename
@@ -58,6 +76,10 @@ int main(int argc, char * argv[])
                WriteLog("VJ: SDL (joystick, audio) successfully initialized.\n");
                App app(argc, argv);                                    // Declare an instance of the application
                retVal = app.exec();                                    // And run it!
+
+               // Free SDL components last...!
+               SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_AUDIO);
+               SDL_Quit();
        }
 
        LogDone();                                                                      // Close logfile