core: Fix libdwarf and Qt build failure
[clinton/Virtual-Jaguar-Rx.git] / src / gui / app.cpp
index 2ab01c0..bc56752 100644 (file)
 // JLH  01/21/2011  Added SDL initialization\r
 // JLH  06/26/2011  Added fix to keep SDL from hijacking main() on win32\r
 // JLH  05/24/2012  Added option switches\r
-// JLH  03/05/2013  Fixed console redireciton on win32 platform  :-P\r
-// JPM  06/06/2016  Visual Studio support\r
-// JPM  06/19/2016  Soft debugger support (--debugger)\r
+// JLH  03/05/2013  Fixed console redirection on win32 platform  :-P\r
+// JPM  Sept./2016  Visual Studio support, and Soft debugger support (--debugger)\r
 // JPM  09/  /2017  Added option (--dram-max) to support 8MB ram (which doesn't exist)\r
-// JPM  09/06/2017  Added the 'Rx' word to the emulator name and updated the credits line\r
-// JPM  09/08/2017  Added option (--es-all, --es-ui, --es-alpine & --es-debugger) to support the erase settings\r
+// JPM  Sept./2017  Added the 'Rx' word to the emulator name, updated the credits line, added option (--es-all, --es-ui, --es-alpine & --es-debugger) to support the erase settings\r
+// JPM   Oct./2018  Added the Rx version's contact in the help text, added timer initialisation in the SDL_Init\r
+// JPM   Apr./2019  Fixed a command line option duplication\r
 //\r
 \r
 #include "app.h"\r
 \r
 #include <SDL.h>\r
-#include <QApplication>\r
+#include <QtWidgets/QApplication>\r
 #include "gamepad.h"\r
 #include "log.h"\r
 #include "mainwin.h"\r
@@ -61,8 +61,7 @@ int main(int argc, char * argv[])
 #if defined (__GCCWIN32__) || defined (_MSC_VER)\r
        BOOL(WINAPI * AttachConsole)(DWORD dwProcessId);\r
 \r
-       AttachConsole = (BOOL (WINAPI *)(DWORD))\r
-               GetProcAddress(LoadLibraryA("kernel32.dll"), "AttachConsole");\r
+       AttachConsole = (BOOL (WINAPI *)(DWORD))GetProcAddress(LoadLibraryA("kernel32.dll"), "AttachConsole");\r
 \r
        if (AttachConsole != NULL && AttachConsole(((DWORD)-1)))\r
        {\r
@@ -108,7 +107,7 @@ int main(int argc, char * argv[])
        }\r
 \r
        // Set up SDL library\r
-       if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0)\r
+       if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_TIMER) < 0)\r
        {\r
                WriteLog("VJ: Could not initialize the SDL library: %s\n", SDL_GetError());\r
        }\r
@@ -175,11 +174,12 @@ bool ParseCommandLine(int argc, char * argv[])
                if ((strcmp(argv[i], "--help") == 0) || (strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "-?") == 0))\r
                {\r
                        printf(\r
-                               "Virtual Jaguar " VJ_RELEASE_VERSION " (" VJ_RELEASE_SUBVERSION ") Rx\n"\r
+                               "Virtual Jaguar " VJ_RELEASE_VERSION " (" VJ_RELEASE_SUBVERSION ") Rx - " __DATE__ "\n"\r
                                "Based upon Virtual Jaguar core v1.0.0 by David Raingeard.\n"\r
                                "Based upon the work by James Hammons (Linux/WIN32), Niels Wagenaar (Linux/WIN32),\n"\r
                                "Carwin Jones (BeOS), and Adam Green (MacOS)\n"\r
                                "Contact: http://sdlemu.ngemu.com/ | sdlemu@ngemu.com\n"\r
+                               "Contact: https://github.com/djipi/Virtual-Jaguar-Rx | djipi.mari@gmail.com\n"\r
                                "\n"\r
                                "Usage:\n"\r
                                "   virtualjaguar [<filename>] [switches]\n"\r
@@ -188,11 +188,11 @@ bool ParseCommandLine(int argc, char * argv[])
                                "   ----------------  -----------------------------------\n"\r
                                "   <filename>        Name of file to autoload\n"\r
                                "   --alpine      -a  Put Virtual Jaguar into Alpine mode\n"\r
-                               "   --debugger    -d  Put Virtual Jaguar into Debugger mode\n"\r
+                               "   --debugger    -D  Put Virtual Jaguar into Debugger mode\n"\r
                                "   --pal         -p  PAL mode\n"\r
                                "   --ntsc        -n  NTSC mode\n"\r
                                "   --dram-max        Set DRAM size to 8MB\n"\r
-                               "   --bios        -b  Boot using Jagaur BIOS\n"\r
+                               "   --bios        -b  Boot using Jaguar BIOS\n"\r
                                "   --no-bios         Do not use Jaguar BIOS\n"\r
                                "   --gpu         -g  Enable GPU\n"\r
                                "   --no-gpu          Disable GPU\n"\r
@@ -253,7 +253,7 @@ bool ParseCommandLine(int argc, char * argv[])
                }\r
 \r
                // Debugger mode\r
-               if ((strcmp(argv[i], "--debugger") == 0) || (strcmp(argv[i], "-d") == 0))\r
+               if ((strcmp(argv[i], "--debugger") == 0) || (strcmp(argv[i], "-D") == 0))\r
                {\r
                        printf("Debugger mode enabled.\n");\r
                        vjs.softTypeDebugger = true;\r
@@ -282,7 +282,7 @@ bool ParseCommandLine(int argc, char * argv[])
                // DRAM size max\r
                if (strcmp(argv[i], "--dram-max") == 0)\r
                {\r
-                       printf("DRAM size set at 8 Mbytes.\n");\r
+                       printf("DRAM size set at 8 MBytes.\n");\r
                        vjs.DRAM_size = 0x800000;\r
                }\r
 \r