diff --git a/src/drivers/Qt/ppuViewer.cpp b/src/drivers/Qt/ppuViewer.cpp index 118a4ec1..8ba27639 100644 --- a/src/drivers/Qt/ppuViewer.cpp +++ b/src/drivers/Qt/ppuViewer.cpp @@ -69,6 +69,7 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent) QVBoxLayout *patternVbox[2]; QHBoxLayout *hbox; QGridLayout *grid; + char stmp[64]; ppuViewWindow = this; @@ -150,6 +151,13 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent) patternView[0]->setTileLabel( tileLabel[0] ); patternView[1]->setTileLabel( tileLabel[1] ); + scanLineEdit->setMaxLength( 3 ); + scanLineEdit->setInputMask( ">900;" ); + sprintf( stmp, "%i", PPUViewScanline ); + scanLineEdit->setText( tr(stmp) ); + + connect( scanLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(scanLineChanged(const QString &))); + refreshSlider->setMinimum( 0); refreshSlider->setMaximum(25); refreshSlider->setValue(PPUViewRefresh); @@ -182,6 +190,19 @@ void ppuViewerDialog_t::closeWindow(void) deleteLater(); } //---------------------------------------------------- +void ppuViewerDialog_t::scanLineChanged( const QString &txt ) +{ + std::string s; + + s = txt.toStdString(); + + if ( s.size() > 0 ) + { + PPUViewScanline = strtoul( s.c_str(), NULL, 10 ); + } + //printf("ScanLine: '%s' %i\n", s.c_str(), PPUViewScanline ); +} +//---------------------------------------------------- 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 b9ec9316..f73246bd 100644 --- a/src/drivers/Qt/ppuViewer.h +++ b/src/drivers/Qt/ppuViewer.h @@ -107,7 +107,7 @@ class ppuViewerDialog_t : public QDialog void sprite8x16Changed0(int state); void sprite8x16Changed1(int state); void refreshSliderChanged(int value); - + void scanLineChanged( const QString &s ); }; int openPPUViewWindow( QWidget *parent );