diff --git a/src/drivers/Qt/config.cpp b/src/drivers/Qt/config.cpp index 2b3a6c95..7341675f 100644 --- a/src/drivers/Qt/config.cpp +++ b/src/drivers/Qt/config.cpp @@ -691,6 +691,8 @@ InitConfig() config->addOption("SDL.NT_TileFocusPolicy", 0); config->addOption("SDL.PPU_TileFocusPolicy", 0); config->addOption("SDL.OAM_TileFocusPolicy", 0); + config->addOption("SDL.PPU_MaskUnused", 0); + config->addOption("SDL.PPU_InvertMask", 0); // quit when a+b+select+start is pressed config->addOption("4buttonexit", "SDL.ABStartSelectExit", 0); diff --git a/src/drivers/Qt/ppuViewer.cpp b/src/drivers/Qt/ppuViewer.cpp index 53635cc0..dd343593 100644 --- a/src/drivers/Qt/ppuViewer.cpp +++ b/src/drivers/Qt/ppuViewer.cpp @@ -54,6 +54,7 @@ #include "Qt/HexEditor.h" #include "Qt/fceuWrapper.h" #include "Qt/ConsoleWindow.h" +#include "Qt/ConsoleUtilities.h" #include "Qt/PaletteEditor.h" #define PATTERNWIDTH 128 @@ -264,9 +265,14 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent) maskUnusedCbox = new QCheckBox( tr("Mask unused Graphics (Code/Data Logger)") ); invertMaskCbox = new QCheckBox( tr("Invert the Mask (Code/Data Logger)") ); + g_config->getOption("SDL.PPU_MaskUnused", &PPUView_maskUnusedGraphics); + g_config->getOption("SDL.PPU_InvertMask", &PPUView_invertTheMask); + maskUnusedCbox->setChecked( PPUView_maskUnusedGraphics ); invertMaskCbox->setChecked( PPUView_invertTheMask ); + connect( maskUnusedCbox , SIGNAL(stateChanged(int)), this, SLOT(maskUnusedGraphicsChanged(int))); + connect( invertMaskCbox , SIGNAL(stateChanged(int)), this, SLOT(invertMaskChanged(int))); connect( sprite8x16Cbox[0], SIGNAL(stateChanged(int)), this, SLOT(sprite8x16Changed0(int))); connect( sprite8x16Cbox[1], SIGNAL(stateChanged(int)), this, SLOT(sprite8x16Changed1(int))); @@ -501,6 +507,20 @@ void ppuViewerDialog_t::scanLineChanged(int value) //printf("ScanLine: %i\n", PPUViewScanline ); } //---------------------------------------------------- +void ppuViewerDialog_t::invertMaskChanged(int state) +{ + PPUView_invertTheMask = (state == Qt::Unchecked) ? 0 : 1; + + g_config->setOption("SDL.PPU_InvertMask", PPUView_invertTheMask); +} +//---------------------------------------------------- +void ppuViewerDialog_t::maskUnusedGraphicsChanged(int state) +{ + PPUView_maskUnusedGraphics = (state == Qt::Unchecked) ? 0 : 1; + + g_config->setOption("SDL.PPU_MaskUnused", PPUView_maskUnusedGraphics); +} +//---------------------------------------------------- void ppuViewerDialog_t::sprite8x16Changed0(int state) { PPUView_sprite16Mode[0] = (state == Qt::Unchecked) ? 0 : 1; diff --git a/src/drivers/Qt/ppuViewer.h b/src/drivers/Qt/ppuViewer.h index ac4faf4a..6464ec8e 100644 --- a/src/drivers/Qt/ppuViewer.h +++ b/src/drivers/Qt/ppuViewer.h @@ -291,6 +291,8 @@ class ppuViewerDialog_t : public QDialog void periodicUpdate(void); void sprite8x16Changed0(int state); void sprite8x16Changed1(int state); + void invertMaskChanged(int state); + void maskUnusedGraphicsChanged(int state); void refreshSliderChanged(int value); void scanLineChanged(int value); void setClickFocus(void);