X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=ea4f8d46156b273f93cc936f04562bcfa36ffdb8;hb=19cb30261693d5c56c79d87030cfe8e1dc9ca033;hp=56299f3a5d13d58a25459a5d7bc7a22542b663b2;hpb=f30bf746981a99079e766b0d4e9de5391a4175ff;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 56299f3..ea4f8d4 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) +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); @@ -259,7 +261,15 @@ MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit( WriteLog("VJ: Initializing jaguar subsystem...\n"); JaguarInit(); - filePickWin->ScanSoftwareFolder(allowUnknownSoftware); + 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 +289,13 @@ 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 + + filePickWin->ScanSoftwareFolder(allowUnknownSoftware); } void MainWin::closeEvent(QCloseEvent * event) @@ -442,6 +456,9 @@ void MainWin::Timer(void) if (showUntunedTankCircuit) { + // Some machines can't handle this, so we give them the option to disable it. :-) + if (!plzDontKillMyComputer) + { // Random hash & trash // We try to simulate an untuned tank circuit here... :-) for(uint32_t x=0; xrasterWidth; x++) @@ -452,6 +469,7 @@ void MainWin::Timer(void) = (rand() & 0xFF) << 8 | (rand() & 0xFF) << 16 | (rand() & 0xFF) << 24; } } + } } else { @@ -618,7 +636,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());