Setup initial menu options and window open for Qt GUI PPU Viewer.

This commit is contained in:
Matthew Budd 2020-10-03 11:46:14 -04:00
parent 896a979689
commit c21041e26e
5 changed files with 125 additions and 0 deletions

View File

@ -441,6 +441,7 @@ set(SRC_DRIVERS_SDL
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/TraceLogger.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/TraceLogger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/AboutWindow.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/AboutWindow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/fceuWrapper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/fceuWrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ppuViewer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/config.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/input.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/input.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/nes_shm.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/nes_shm.cpp

View File

@ -33,6 +33,7 @@
#include "Qt/ConsoleVideoConf.h" #include "Qt/ConsoleVideoConf.h"
#include "Qt/AboutWindow.h" #include "Qt/AboutWindow.h"
#include "Qt/fceuWrapper.h" #include "Qt/fceuWrapper.h"
#include "Qt/ppuViewer.h"
#include "Qt/keyscan.h" #include "Qt/keyscan.h"
#include "Qt/nes_shm.h" #include "Qt/nes_shm.h"
@ -501,6 +502,14 @@ void consoleWin_t::createMainMenu(void)
debugMenu->addAction(hexEditAct); debugMenu->addAction(hexEditAct);
// Debug -> PPU Viewer
ppuViewAct = new QAction(tr("PPU Viewer..."), this);
//ppuViewAct->setShortcut( QKeySequence(tr("Shift+F7")));
ppuViewAct->setStatusTip(tr("Open PPU Viewer"));
connect(ppuViewAct, SIGNAL(triggered()), this, SLOT(openPPUViewer(void)) );
debugMenu->addAction(ppuViewAct);
// Debug -> Trace Logger // Debug -> Trace Logger
traceLogAct = new QAction(tr("Trace Logger..."), this); traceLogAct = new QAction(tr("Trace Logger..."), this);
//traceLogAct->setShortcut( QKeySequence(tr("Shift+F7"))); //traceLogAct->setShortcut( QKeySequence(tr("Shift+F7")));
@ -1021,6 +1030,13 @@ void consoleWin_t::openHexEditor(void)
hexEditWin->show(); hexEditWin->show();
} }
void consoleWin_t::openPPUViewer(void)
{
//printf("Open GUI PPU Viewer Window\n");
openPPUViewWindow(this);
}
void consoleWin_t::openCodeDataLogger(void) void consoleWin_t::openCodeDataLogger(void)
{ {
CodeDataLoggerDialog_t *cdlWin; CodeDataLoggerDialog_t *cdlWin;

View File

@ -93,6 +93,7 @@ class consoleWin_t : public QMainWindow
QAction *codeDataLogAct; QAction *codeDataLogAct;
QAction *traceLogAct; QAction *traceLogAct;
QAction *hexEditAct; QAction *hexEditAct;
QAction *ppuViewAct;
QAction *openMovAct; QAction *openMovAct;
QAction *stopMovAct; QAction *stopMovAct;
QAction *recMovAct; QAction *recMovAct;
@ -162,6 +163,7 @@ class consoleWin_t : public QMainWindow
void fdsSwitchDisk(void); void fdsSwitchDisk(void);
void fdsEjectDisk(void); void fdsEjectDisk(void);
void fdsLoadBiosFile(void); void fdsLoadBiosFile(void);
void openPPUViewer(void);
void openCheats(void); void openCheats(void);
void openMovie(void); void openMovie(void);
void stopMovie(void); void stopMovie(void);

View File

@ -0,0 +1,63 @@
// ppuViewer.cpp
//
#include <stdio.h>
#include <QDir>
#include <QInputDialog>
#include <QMessageBox>
#include "Qt/ppuViewer.h"
#include "Qt/main.h"
#include "Qt/dface.h"
#include "Qt/input.h"
#include "Qt/config.h"
#include "Qt/fceuWrapper.h"
static ppuViewerDialog_t *ppuViewWindow = NULL;
//----------------------------------------------------
int openPPUViewWindow( QWidget *parent )
{
if ( ppuViewWindow != NULL )
{
return -1;
}
ppuViewWindow = new ppuViewerDialog_t(parent);
ppuViewWindow->show();
return 0;
}
//----------------------------------------------------
ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent)
: QDialog( parent )
{
ppuViewWindow = this;
setWindowTitle( tr("PPU Viewer") );
//setLayout( mainLayout );
}
//----------------------------------------------------
ppuViewerDialog_t::~ppuViewerDialog_t(void)
{
ppuViewWindow = NULL;
printf("PPU Viewer Window Deleted\n");
}
//----------------------------------------------------
void ppuViewerDialog_t::closeEvent(QCloseEvent *event)
{
printf("PPU Viewer Close Window Event\n");
done(0);
deleteLater();
event->accept();
}
//----------------------------------------------------
void ppuViewerDialog_t::closeWindow(void)
{
printf("Close Window\n");
done(0);
deleteLater();
}
//----------------------------------------------------

View File

@ -0,0 +1,43 @@
// ppuViewer.h
//
#pragma once
#include <QWidget>
#include <QDialog>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QComboBox>
#include <QCheckBox>
#include <QPushButton>
#include <QLabel>
#include <QFrame>
#include <QTimer>
#include <QGroupBox>
#include <QCloseEvent>
#include "Qt/main.h"
class ppuViewerDialog_t : public QDialog
{
Q_OBJECT
public:
ppuViewerDialog_t(QWidget *parent = 0);
~ppuViewerDialog_t(void);
protected:
//QTimer *inputTimer;
void closeEvent(QCloseEvent *bar);
private:
public slots:
void closeWindow(void);
private slots:
//void updatePeriodic(void);
};
int openPPUViewWindow( QWidget *parent );