X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=9a739870df9083a596593f11d30c84204fd3db4f;hb=5c28b6dbf7aa20441c8a51f484f4f64b1966f7e3;hp=ec3961cf84dd5ac0f262a3be14561a309cb9880f;hpb=26044acf8a4fe70772bd6e69afb8b8d20b5a6af5;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index ec3961c..9a73987 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -35,16 +35,19 @@ #include "SDL.h" #include "app.h" -#include "glwidget.h" #include "about.h" -#include "help.h" -#include "settings.h" -#include "filepicker.h" #include "configdialog.h" +#include "filepicker.h" +#include "gamepad.h" #include "generaltab.h" +#include "glwidget.h" +#include "help.h" +#include "settings.h" #include "version.h" -#include "debug/memorybrowser.h" #include "debug/cpubrowser.h" +#include "debug/m68kdasmbrowser.h" +#include "debug/memorybrowser.h" +#include "debug/opbrowser.h" #include "dac.h" #include "jaguar.h" @@ -100,6 +103,8 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), filePickWin = new FilePickerWindow(this); memBrowseWin = new MemoryBrowserWindow(this); cpuBrowseWin = new CPUBrowserWindow(this); + opBrowseWin = new OPBrowserWindow(this); + m68kDasmBrowseWin = new M68KDasmBrowserWindow(this); videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -216,6 +221,16 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), // memBrowseAct->setCheckable(true); connect(cpuBrowseAct, SIGNAL(triggered()), this, SLOT(ShowCPUBrowserWin())); + opBrowseAct = new QAction(QIcon(":/res/generic.png"), tr("OP Browser"), this); + opBrowseAct->setStatusTip(tr("Shows the Jaguar OP browser window")); +// memBrowseAct->setCheckable(true); + connect(opBrowseAct, SIGNAL(triggered()), this, SLOT(ShowOPBrowserWin())); + + m68kDasmBrowseAct = new QAction(QIcon(":/res/generic.png"), tr("68K Listing Browser"), this); + m68kDasmBrowseAct->setStatusTip(tr("Shows the 68K disassembly browser window")); +// memBrowseAct->setCheckable(true); + connect(m68kDasmBrowseAct, SIGNAL(triggered()), this, SLOT(ShowM68KDasmBrowserWin())); + // Misc. connections... connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString))); connect(filePickWin, SIGNAL(FilePickerHiding()), this, SLOT(Unpause())); @@ -236,6 +251,8 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugMenu = menuBar()->addMenu(tr("&Debug")); debugMenu->addAction(memBrowseAct); debugMenu->addAction(cpuBrowseAct); + debugMenu->addAction(opBrowseAct); + debugMenu->addAction(m68kDasmBrowseAct); } helpMenu = menuBar()->addMenu(tr("&Help")); @@ -263,6 +280,8 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugbar = addToolBar(tr("&Debug")); debugbar->addAction(memBrowseAct); debugbar->addAction(cpuBrowseAct); + debugbar->addAction(opBrowseAct); + debugbar->addAction(m68kDasmBrowseAct); } // Create status bar @@ -485,6 +504,21 @@ void MainWin::HandleKeys(QKeyEvent * e, bool state) } +void MainWin::HandleGamepads(void) +{ + Gamepad::Update(); + + for(int i=BUTTON_FIRST; i<=BUTTON_LAST; i++) + { + if (vjs.p1KeyBindings[i] & (JOY_BUTTON | JOY_HAT)) + joypad_0_buttons[i] = (Gamepad::GetState(0, vjs.p1KeyBindings[i]) ? 0x01 : 0x00); + + if (vjs.p2KeyBindings[i] & (JOY_BUTTON | JOY_HAT)) + joypad_1_buttons[i] = (Gamepad::GetState(1, vjs.p2KeyBindings[i]) ? 0x01 : 0x00); + } +} + + void MainWin::Open(void) { } @@ -588,6 +622,7 @@ void MainWin::Timer(void) else { // Otherwise, run the Jaguar simulation + HandleGamepads(); JaguarExecuteNew(); } @@ -809,14 +844,6 @@ void MainWin::FrameAdvance(void) void MainWin::SetFullScreen(bool state/*= true*/) { -#if 0 - QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); - QSize size = settings.value("size", QSize(400, 400)).toSize(); - resize(size); - move(pos); - settings.setValue("pos", pos()); - settings.setValue("size", size()); -#endif if (state) { mainWinPosition = pos(); @@ -872,6 +899,20 @@ void MainWin::ShowCPUBrowserWin(void) } +void MainWin::ShowOPBrowserWin(void) +{ + opBrowseWin->show(); + opBrowseWin->RefreshContents(); +} + + +void MainWin::ShowM68KDasmBrowserWin(void) +{ + m68kDasmBrowseWin->show(); + m68kDasmBrowseWin->RefreshContents(); +} + + void MainWin::ResizeMainWindow(void) { // videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256));