// use, we can drop it in anywhere and use it as-is.
MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit(true),
- cartridgeLoaded(false), CDActive(false)//, alpineLoadSuccessful(false)
+ cartridgeLoaded(false), CDActive(false),//, alpineLoadSuccessful(false),
+ pauseForFileSelector(false)
{
videoWidget = new GLWidget(this);
setCentralWidget(videoWidget);
filePickAct->setShortcut(QKeySequence(tr("Ctrl+i")));
connect(filePickAct, SIGNAL(triggered()), this, SLOT(InsertCart()));
- configAct = new QAction(QIcon(":/res/generic.png"), tr("&Configure"), this);
+ configAct = new QAction(QIcon(":/res/wrench.png"), tr("&Configure"), this);
configAct->setStatusTip(tr("Configure options for Virtual Jaguar"));
configAct->setShortcut(QKeySequence(tr("Ctrl+c")));
connect(configAct, SIGNAL(triggered()), this, SLOT(Configure()));
// Misc. connections...
connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString)));
+ connect(filePickWin, SIGNAL(FilePickerHiding()), this, SLOT(Unpause()));
// Create menus & toolbars
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(filePickAct);
- fileMenu->addAction(useCDAct);
+ fileMenu = menuBar()->addMenu(tr("&Jaguar"));
fileMenu->addAction(powerAct);
fileMenu->addAction(pauseAct);
+ fileMenu->addAction(filePickAct);
+ fileMenu->addAction(useCDAct);
fileMenu->addAction(configAct);
fileMenu->addAction(quitAppAct);
// Attempt to load/run the ABS file...
LoadSoftware(vjs.absROMPath);
}
+ else
+ memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Otherwise, use the stock BIOS
}
void MainWin::closeEvent(QCloseEvent * event)
joypad_0_buttons[BUTTON_D] = 0;
if (e->key() == (int)vjs.p1KeyBindings[BUTTON_D] && joypad_0_buttons[BUTTON_U])
joypad_0_buttons[BUTTON_U] = 0;
+
+ if (e->key() == (int)vjs.p2KeyBindings[BUTTON_L] && joypad_1_buttons[BUTTON_R])
+ joypad_0_buttons[BUTTON_R] = 0;
+ if (e->key() == (int)vjs.p2KeyBindings[BUTTON_R] && joypad_1_buttons[BUTTON_L])
+ joypad_0_buttons[BUTTON_L] = 0;
+ if (e->key() == (int)vjs.p2KeyBindings[BUTTON_U] && joypad_1_buttons[BUTTON_D])
+ joypad_0_buttons[BUTTON_D] = 0;
+ if (e->key() == (int)vjs.p2KeyBindings[BUTTON_D] && joypad_1_buttons[BUTTON_U])
+ joypad_0_buttons[BUTTON_U] = 0;
#endif
// No bad combos exist, let's stuff the emulator key buffers...!
{
if (e->key() == (int)vjs.p1KeyBindings[i])
joypad_0_buttons[i] = (uint8)state;
+
+ if (e->key() == (int)vjs.p2KeyBindings[i])
+ joypad_1_buttons[i] = (uint8)state;
}
}
// If the "Alpine" ROM is changed, then let's load it...
if (alpineBefore != alpineAfter)
{
- if (!JaguarLoadFile(vjs.alpineROMPath) || !AlpineLoadFile(vjs.alpineROMPath))
+ if (!JaguarLoadFile(vjs.alpineROMPath) && !AlpineLoadFile(vjs.alpineROMPath))
{
// Oh crap, we couldn't get the file! Alert the media!
QMessageBox msg;
void MainWin::InsertCart(void)
{
+ // If the emulator is running, we pause it here and unpause it later
+ // if we dismiss the file selector without choosing anything
+ if (running)
+ {
+ ToggleRunState();
+ pauseForFileSelector = true;
+ }
+
filePickWin->show();
}
+void MainWin::Unpause(void)
+{
+ // Here we unpause the emulator if it was paused when we went into the file selector
+ if (pauseForFileSelector)
+ {
+ pauseForFileSelector = false;
+ ToggleRunState();
+ }
+}
+
void MainWin::LoadSoftware(QString file)
{
- running = false; // Prevent bad things(TM) from happening...
+ running = false; // Prevent bad things(TM) from happening...
+ pauseForFileSelector = false; // Reset the file selector pause flag
SET32(jaguarMainRAM, 0, 0x00200000); // Set top of stack...
- cartridgeLoaded = (JaguarLoadFile(file.toAscii().data()) ? true : false);
+ cartridgeLoaded = JaguarLoadFile(file.toAscii().data());
char * biosPointer = jaguarBootROM;