+
+
+//
+// Here we parse out stuff that needs to be looked at *before* we construct the
+// App object.
+//
+bool ParseCommandLine(int argc, char * argv[])
+{
+ for(int i=1; i<argc; i++)
+ {
+ if ((strcmp(argv[i], "--help") == 0) || (strcmp(argv[i], "-h") == 0)
+ || (strcmp(argv[i], "-?") == 0))
+ {
+ printf(
+ "Virtual Jaguar " VJ_RELEASE_VERSION " (" VJ_RELEASE_SUBVERSION ")\n"
+ "Based upon Virtual Jaguar core v1.0.0 by David Raingeard.\n"
+ "Written by James Hammons (Linux/WIN32), Niels Wagenaar (Linux/WIN32),\n"
+ "Carwin Jones (BeOS), and Adam Green (MacOS)\n"
+ "Contact: http://sdlemu.ngemu.com/ | sdlemu@ngemu.com\n"
+ "\n"
+ "Usage:\n"
+ " virtualjaguar [<filename>] [switches]\n"
+ "\n"
+ " Option Description\n"
+ " ---------------- -----------------------------------\n"
+ " <filename> Name of file to autoload\n"
+ " --alpine -a Put Virtual Jaguar into Alpine mode\n"
+ " --pal -p PAL mode\n"
+ " --ntsc -n NTSC mode\n"
+ " --bios -b Boot using Jagaur BIOS\n"
+ " --no-bios Do not use Jaguar BIOS\n"
+ " --gpu -g Enable GPU\n"
+ " --no-gpu Disable GPU\n"
+ " --dsp -d Enable DSP\n"
+ " --no-dsp Disable DSP\n"
+ " --fullscreen -f Start in full screen mode\n"
+ " --blur -B Enable GL bilinear filter\n"
+ " --no-blur Disable GL bilinear filtering\n"
+ " --log -l Create and use log file\n"
+ " --no-log Do not use log file\n"
+ " --help -h Show this message\n"
+ " --please-dont-kill-my-computer\n"
+ " -z Run Virtual Jaguar without \"snow\"\n"
+ "\n"
+ "Invoking Virtual Jagaur with no filename will cause it to boot up\n"
+ "with the VJ GUI. Using Alpine mode will enable log file.\n"
+ "\n");
+ return false;
+ }
+
+ if (strcmp(argv[i], "--yarrr") == 0)
+ {
+ printf("\n");
+ printf("Shiver me timbers!\n");
+ printf("\n");
+ return false;
+ }
+
+ if ((strcmp(argv[i], "--alpine") == 0) || (strcmp(argv[i], "-a") == 0))
+ {
+ printf("Alpine Mode enabled.\n");
+ vjs.hardwareTypeAlpine = true;
+ // We also enable logging as well :-)
+ useLogfile = true;
+ }
+
+ if ((strcmp(argv[i], "--please-dont-kill-my-computer") == 0) || (strcmp(argv[i], "-z") == 0))
+ {
+ noUntunedTankPlease = true;
+ }
+
+ if ((strcmp(argv[i], "--log") == 0) || (strcmp(argv[i], "-l") == 0))
+ {
+ useLogfile = true;
+ }
+
+ if (strcmp(argv[i], "--no-log") == 0)
+ {
+ useLogfile = false;
+ }
+
+ // Check for filename
+ if (argv[i][0] != '-')
+ {
+ loadAndGo = true;
+ filename = argv[i];
+ }
+ }
+
+ return true;
+}
+
+
+//
+// This is to override settings loaded from the config file.
+// Note that settings set here will become the new defaults!
+// (Not any more: Settings are only saved if the config dialog was OKed, or
+// the toolbar buttons were pressed.)
+//
+void ParseOptions(int argc, char * argv[])
+{
+ for(int i=1; i<argc; i++)
+ {
+ if ((strcmp(argv[i], "--pal") == 0) || (strcmp(argv[i], "-p") == 0))
+ {
+ vjs.hardwareTypeNTSC = false;
+ }
+
+ if ((strcmp(argv[i], "--ntsc") == 0) || (strcmp(argv[i], "-n") == 0))
+ {
+ vjs.hardwareTypeNTSC = true;
+ }
+
+ if ((strcmp(argv[i], "--bios") == 0) || (strcmp(argv[i], "-b") == 0))
+ {
+ vjs.useJaguarBIOS = true;
+ }
+
+ if (strcmp(argv[i], "--no-bios") == 0)
+ {
+ vjs.useJaguarBIOS = false;
+ }
+
+ if ((strcmp(argv[i], "--gpu") == 0) || (strcmp(argv[i], "-g") == 0))
+ {
+ vjs.GPUEnabled = true;
+ }
+
+ if (strcmp(argv[i], "--no-gpu") == 0)
+ {
+ vjs.GPUEnabled = false;
+ }
+
+ if ((strcmp(argv[i], "--dsp") == 0) || (strcmp(argv[i], "-d") == 0))
+ {
+ vjs.DSPEnabled = true;
+ vjs.audioEnabled = true;
+ }
+
+ if (strcmp(argv[i], "--no-dsp") == 0)
+ {
+ vjs.DSPEnabled = false;
+ vjs.audioEnabled = false;
+ }
+
+ if ((strcmp(argv[i], "--fullscreen") == 0) || (strcmp(argv[i], "-f") == 0))
+ {
+ vjs.fullscreen = true;
+ }
+
+ if ((strcmp(argv[i], "--blur") == 0) || (strcmp(argv[i], "-B") == 0))
+ {
+ vjs.glFilter = 1;
+ }
+
+ if (strcmp(argv[i], "--no-blur") == 0)
+ {
+ vjs.glFilter = 0;
+ }
+ }
+}
+
+#if 0
+ bool useJoystick;
+ int32 joyport; // Joystick port
+ bool hardwareTypeNTSC; // Set to false for PAL
+ bool useJaguarBIOS;
+ bool GPUEnabled;
+ bool DSPEnabled;
+ bool usePipelinedDSP;
+ bool fullscreen;
+ bool useOpenGL;
+ uint32 glFilter;
+ bool hardwareTypeAlpine;
+ bool audioEnabled;
+ uint32 frameSkip;
+ uint32 renderType;
+ bool allowWritesToROM;
+
+ // Keybindings in order of U, D, L, R, C, B, A, Op, Pa, 0-9, #, *
+
+ uint32 p1KeyBindings[21];
+ uint32 p2KeyBindings[21];
+
+ // Paths
+
+ char ROMPath[MAX_PATH];
+ char jagBootPath[MAX_PATH];
+ char CDBootPath[MAX_PATH];
+ char EEPROMPath[MAX_PATH];
+ char alpineROMPath[MAX_PATH];
+ char absROMPath[MAX_PATH];
+#endif
+