//hm. :-/
// This is stuff we pass into the mainWindow...
bool noUntunedTankPlease = false;
+bool loadAndGo = false;
+QString filename;
// Here's the main application loop--short and simple...
int main(int argc, char * argv[])
{
noUntunedTankPlease = true;
}
+
+ // Check for filename
+ if (argv[1][0] != '-')
+ {
+ loadAndGo = true;
+ filename = argv[1];
+ }
}
Q_INIT_RESOURCE(virtualjaguar); // This must the same name as the exe filename
App::App(int argc, char * argv[]): QApplication(argc, argv)
{
- mainWindow = new MainWin();
+ mainWindow = new MainWin(filename);
mainWindow->plzDontKillMyComputer = noUntunedTankPlease;
mainWindow->show();
}
//
// app.h: Header file
//
-// by James L. Hammons
+// by James Hammons
// (C) 2009 Underground Software
//
// Globally accessible stuff goes here...
// Although... Globally accessible stuff should go into settings.cpp...
+ // Unless it's stuff related to the GUI, then it should go here. :-P
+ // And we make these class variables so we don't have to muck around with
+ // chasing down instances of the object...
// public:
+// static QString filenameToRun;
};
#endif // __APP_H__
#include "mainwin.h"
#include "SDL.h"
+#include "app.h"
#include "glwidget.h"
#include "about.h"
#include "help.h"
// 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);
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)
// 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)
powerButtonOn = false;
TogglePowerState();
- if (!vjs.hardwareTypeAlpine)
+ if (!vjs.hardwareTypeAlpine && !loadAndGo)
{
QString newTitle = QString("Virtual Jaguar " VJ_RELEASE_VERSION " - Now playing: %1")
.arg(filePickWin->GetSelectedPrettyName());