Bug fix for Qt PPU viewer CDL masking options.

This commit is contained in:
mjbudd77 2021-07-18 20:43:58 -04:00
parent 37f66eb7f4
commit 4301b96b4a
3 changed files with 24 additions and 0 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);