X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=b8a7de0f610526534ee267d54edfc146133238ac;hb=576a7bd6373a53d9cff6a7bb88334429469e0751;hp=ba0b21ebe09bc94f7e5db84ba6cc2a1ebe760a3b;hpb=d9abe1a157bbd35e8b282927489b687f56048ce6;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index ba0b21e..b8a7de0 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -34,6 +34,7 @@ #include "mainwin.h" #include "SDL.h" +#include "app.h" #include "glwidget.h" #include "about.h" #include "help.h" @@ -70,9 +71,10 @@ // We'll make the VJ core modular so that it doesn't matter what GUI is in // use, we can drop it in anywhere and use it as-is. -MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit(true), - cartridgeLoaded(false), CDActive(false),//, alpineLoadSuccessful(false), - pauseForFileSelector(false), plzDontKillMyComputer(false) +MainWin::MainWin(QString filenameToRun): running(true), powerButtonOn(false), + showUntunedTankCircuit(true), cartridgeLoaded(false), CDActive(false), + //, alpineLoadSuccessful(false), + pauseForFileSelector(false), loadAndGo(false), plzDontKillMyComputer(false) { videoWidget = new GLWidget(this); setCentralWidget(videoWidget); @@ -258,8 +260,18 @@ MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit( WriteLog("Virtual Jaguar %s (Last full build was on %s %s)\n", VJ_RELEASE_VERSION, __DATE__, __TIME__); WriteLog("VJ: Initializing jaguar subsystem...\n"); JaguarInit(); + memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Use the stock BIOS - filePickWin->ScanSoftwareFolder(allowUnknownSoftware); + // Check for filename passed in on the command line... + if (!filenameToRun.isEmpty()) + { + loadAndGo = true; + // Attempt to load/run the file the user passed in... + LoadSoftware(filenameToRun); +// memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Use the stock BIOS + // Prevent the scanner from running... + return; + } // Load up the default ROM if in Alpine mode: if (vjs.hardwareTypeAlpine) @@ -279,9 +291,15 @@ MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit( // Attempt to load/run the ABS file... LoadSoftware(vjs.absROMPath); memcpy(jagMemSpace + 0xE00000, jaguarDevBootROM2, 0x20000); // Use the stub BIOS + // Prevent the scanner from running... + return; } - else - memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Otherwise, use the stock BIOS +// else +// memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Otherwise, use the stock BIOS + + // Run the scanner if nothing passed in and *not* Alpine mode... + // NB: Really need to look into caching the info scanned in here... + filePickWin->ScanSoftwareFolder(allowUnknownSoftware); } void MainWin::closeEvent(QCloseEvent * event) @@ -622,7 +640,7 @@ void MainWin::LoadSoftware(QString file) powerButtonOn = false; TogglePowerState(); - if (!vjs.hardwareTypeAlpine) + if (!vjs.hardwareTypeAlpine && !loadAndGo) { QString newTitle = QString("Virtual Jaguar " VJ_RELEASE_VERSION " - Now playing: %1") .arg(filePickWin->GetSelectedPrettyName());