X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=72869fb7515723f7751715621b0c400c4137ac61;hb=cdc64706c10d3fe005fecff5d000fe60b3980a3b;hp=22c211b17d8f6173ff7025fb8730b99f0331368a;hpb=09b508a759ca512da810722a0d4786dd1695d47c;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 22c211b..72869fb 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -45,6 +45,7 @@ #include "version.h" #include "debug/memorybrowser.h" #include "debug/cpubrowser.h" +#include "debug/opbrowser.h" #include "dac.h" #include "jaguar.h" @@ -100,6 +101,7 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), filePickWin = new FilePickerWindow(this); memBrowseWin = new MemoryBrowserWindow(this); cpuBrowseWin = new CPUBrowserWindow(this); + opBrowseWin = new OPBrowserWindow(this); videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -216,6 +218,11 @@ 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())); + // Misc. connections... connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString))); connect(filePickWin, SIGNAL(FilePickerHiding()), this, SLOT(Unpause())); @@ -236,6 +243,7 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugMenu = menuBar()->addMenu(tr("&Debug")); debugMenu->addAction(memBrowseAct); debugMenu->addAction(cpuBrowseAct); + debugMenu->addAction(opBrowseAct); } helpMenu = menuBar()->addMenu(tr("&Help")); @@ -263,6 +271,7 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugbar = addToolBar(tr("&Debug")); debugbar->addAction(memBrowseAct); debugbar->addAction(cpuBrowseAct); + debugbar->addAction(opBrowseAct); } // Create status bar @@ -809,13 +818,25 @@ 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(); +// mainWinSize = size(); menuBar()->hide(); statusBar()->hide(); showFullScreen(); QRect r = QApplication::desktop()->availableGeometry(); - double targetWidth = 320.0, targetHeight = (vjs.hardwareTypeNTSC ? 240.0 : 256.0); +// double targetWidth = 320.0, targetHeight = (vjs.hardwareTypeNTSC ? 240.0 : 256.0); + double targetWidth = (double)VIRTUAL_SCREEN_WIDTH, + targetHeight = (double)(vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL); double aspectRatio = targetWidth / targetHeight; // NOTE: Really should check here to see which dimension constrains the other. // Right now, we assume that height is the constraint. @@ -830,6 +851,7 @@ void MainWin::SetFullScreen(bool state/*= true*/) statusBar()->show(); showNormal(); ResizeMainWindow(); + move(mainWinPosition); } // For some reason, this doesn't work: If the emu is paused, toggling from @@ -859,9 +881,18 @@ void MainWin::ShowCPUBrowserWin(void) } +void MainWin::ShowOPBrowserWin(void) +{ + opBrowseWin->show(); + opBrowseWin->RefreshContents(); +} + + void MainWin::ResizeMainWindow(void) { - videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256)); +// videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256)); + videoWidget->setFixedSize(zoomLevel * VIRTUAL_SCREEN_WIDTH, + zoomLevel * (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL)); show(); for(int i=0; i<2; i++) @@ -878,11 +909,11 @@ void MainWin::ResizeMainWindow(void) void MainWin::ReadSettings(void) { QSettings settings("Underground Software", "Virtual Jaguar"); - QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); + mainWinPosition = settings.value("pos", QPoint(200, 200)).toPoint(); QSize size = settings.value("size", QSize(400, 400)).toSize(); resize(size); - move(pos); - pos = settings.value("cartLoadPos", QPoint(200, 200)).toPoint(); + move(mainWinPosition); + QPoint pos = settings.value("cartLoadPos", QPoint(200, 200)).toPoint(); filePickWin->move(pos); zoomLevel = settings.value("zoom", 2).toInt();