diff --git a/src/drivers/Qt/ConsoleDebugger.cpp b/src/drivers/Qt/ConsoleDebugger.cpp index 7d1dca0b..d2b190d7 100644 --- a/src/drivers/Qt/ConsoleDebugger.cpp +++ b/src/drivers/Qt/ConsoleDebugger.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "../../types.h" @@ -2986,7 +2987,7 @@ QAsmView::QAsmView(QWidget *parent) //c = pal.color(QPalette::Base); //printf("Base: R:%i G:%i B:%i \n", c.red(), c.green(), c.blue() ); - //c = pal.color(QPalette::Background); + //c = pal.color(QPalette::Window); //printf("BackGround: R:%i G:%i B:%i \n", c.red(), c.green(), c.blue() ); // Figure out if we are using a light or dark theme by checking the @@ -3003,13 +3004,13 @@ QAsmView::QAsmView(QWidget *parent) if ( useDarkTheme ) { pal.setColor(QPalette::Base , fg ); - pal.setColor(QPalette::Background, fg ); + pal.setColor(QPalette::Window , fg ); pal.setColor(QPalette::WindowText, bg ); } else { pal.setColor(QPalette::Base , bg ); - pal.setColor(QPalette::Background, bg ); + pal.setColor(QPalette::Window , bg ); pal.setColor(QPalette::WindowText, fg ); } @@ -3877,7 +3878,7 @@ void QAsmView::paintEvent(QPaintEvent *event) } selAddr = parent->getBookmarkSelectedAddress(); - painter.fillRect( 0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Background) ); + painter.fillRect( 0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Window) ); y = pxLineSpacing; diff --git a/src/drivers/Qt/ConsoleWindow.cpp b/src/drivers/Qt/ConsoleWindow.cpp index 3e6480f7..3d9f7024 100644 --- a/src/drivers/Qt/ConsoleWindow.cpp +++ b/src/drivers/Qt/ConsoleWindow.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -133,7 +134,11 @@ consoleWin_t::consoleWin_t(QWidget *parent) setWindowIcon(QIcon(":fceux1.png")); gameTimer = new QTimer( this ); +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) + mutex = new QRecursiveMutex(); +#else mutex = new QMutex( QMutex::Recursive ); +#endif emulatorThread = new emulatorThread_t(); connect(emulatorThread, &QThread::finished, emulatorThread, &QObject::deleteLater); diff --git a/src/drivers/Qt/ConsoleWindow.h b/src/drivers/Qt/ConsoleWindow.h index 215f57d4..1df682d3 100644 --- a/src/drivers/Qt/ConsoleWindow.h +++ b/src/drivers/Qt/ConsoleWindow.h @@ -18,8 +18,11 @@ #include #include #include -#include #include +#include +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) +#include +#endif #include "Qt/ConsoleViewerGL.h" #include "Qt/ConsoleViewerSDL.h" @@ -96,7 +99,11 @@ class consoleWin_t : public QMainWindow void setCyclePeriodms( int ms ); +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) + QRecursiveMutex *mutex; +#else QMutex *mutex; +#endif void requestClose(void); diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index eadd0e52..d7482ace 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "../../types.h" #include "../../fceu.h" @@ -1847,7 +1848,7 @@ QHexEdit::QHexEdit(QWidget *parent) pal = this->palette(); pal.setColor(QPalette::Base , bg ); - pal.setColor(QPalette::Background, bg ); + pal.setColor(QPalette::Window , bg ); pal.setColor(QPalette::WindowText, fg ); //editor->setAutoFillBackground(true); @@ -1980,7 +1981,7 @@ void QHexEdit::setForeGroundColor( QColor fg ) pal = this->palette(); //pal.setColor(QPalette::Base , Qt::black); - //pal.setColor(QPalette::Background, Qt::black); + //pal.setColor(QPalette::Window , Qt::black); pal.setColor(QPalette::WindowText, fg ); this->setPalette(pal); @@ -1992,7 +1993,7 @@ void QHexEdit::setBackGroundColor( QColor bg ) pal = this->palette(); //pal.setColor(QPalette::Base , Qt::black); - pal.setColor(QPalette::Background, bg ); + pal.setColor(QPalette::Window , bg ); //pal.setColor(QPalette::WindowText, fg ); this->setPalette(pal); @@ -3325,17 +3326,17 @@ int QHexEdit::getRomAddrColor( int addr, QColor &fg, QColor &bg ) QColor color, oppColor; fg = this->palette().color(QPalette::WindowText); - bg = this->palette().color(QPalette::Background); + bg = this->palette().color(QPalette::Window ); if ( reverseVideo ) { - color = this->palette().color(QPalette::Background); + color = this->palette().color(QPalette::Window ); oppColor = this->palette().color(QPalette::WindowText); } else { color = this->palette().color(QPalette::WindowText); - oppColor = this->palette().color(QPalette::Background); + oppColor = this->palette().color(QPalette::Window ); } if ( viewMode != MODE_NES_ROM ) @@ -3543,7 +3544,7 @@ void QHexEdit::paintEvent(QPaintEvent *event) lineOffset = maxLineOffset; } - painter.fillRect( 0, 0, w, h, this->palette().color(QPalette::Background) ); + painter.fillRect( 0, 0, w, h, this->palette().color(QPalette::Window) ); if ( cursorBlinkCount >= 5 ) { diff --git a/src/drivers/Qt/NameTableViewer.cpp b/src/drivers/Qt/NameTableViewer.cpp index 6c2c7c0b..190c54d5 100644 --- a/src/drivers/Qt/NameTableViewer.cpp +++ b/src/drivers/Qt/NameTableViewer.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/drivers/Qt/RamSearch.cpp b/src/drivers/Qt/RamSearch.cpp index bab1ad2c..85e0694e 100644 --- a/src/drivers/Qt/RamSearch.cpp +++ b/src/drivers/Qt/RamSearch.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1583,13 +1584,13 @@ QRamSearchView::QRamSearchView(QWidget *parent) if (useDarkTheme) { pal.setColor(QPalette::Base, fg); - pal.setColor(QPalette::Background, fg); + pal.setColor(QPalette::Window, fg); pal.setColor(QPalette::WindowText, bg); } else { pal.setColor(QPalette::Base, bg); - pal.setColor(QPalette::Background, bg); + pal.setColor(QPalette::Window, bg); pal.setColor(QPalette::WindowText, fg); } this->setPalette(pal); @@ -1869,7 +1870,7 @@ void QRamSearchView::paintEvent(QPaintEvent *event) it++; } - painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Background)); + painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Window)); painter.setPen(this->palette().color(QPalette::WindowText)); diff --git a/src/drivers/Qt/TraceLogger.cpp b/src/drivers/Qt/TraceLogger.cpp index 847b598d..886bb540 100644 --- a/src/drivers/Qt/TraceLogger.cpp +++ b/src/drivers/Qt/TraceLogger.cpp @@ -1186,13 +1186,13 @@ QTraceLogView::QTraceLogView(QWidget *parent) if (useDarkTheme) { pal.setColor(QPalette::Base, fg); - pal.setColor(QPalette::Background, fg); + pal.setColor(QPalette::Window, fg); pal.setColor(QPalette::WindowText, bg); } else { pal.setColor(QPalette::Base, bg); - pal.setColor(QPalette::Background, bg); + pal.setColor(QPalette::Window, bg); pal.setColor(QPalette::WindowText, fg); } @@ -1977,7 +1977,7 @@ void QTraceLogView::paintEvent(QPaintEvent *event) viewLines = nrow; - painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Background)); + painter.fillRect(0, 0, viewWidth, viewHeight, this->palette().color(QPalette::Window)); painter.setPen(this->palette().color(QPalette::WindowText)); diff --git a/src/drivers/Qt/ppuViewer.cpp b/src/drivers/Qt/ppuViewer.cpp index 67ef80a9..b3ccbc51 100644 --- a/src/drivers/Qt/ppuViewer.cpp +++ b/src/drivers/Qt/ppuViewer.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include "../../types.h" #include "../../fceu.h" diff --git a/src/ppu.cpp b/src/ppu.cpp index 0d7451dc..01a03a79 100644 --- a/src/ppu.cpp +++ b/src/ppu.cpp @@ -1088,7 +1088,7 @@ static void RefreshLine(int lastpixel) { uint32 vofs; int X1; - register uint8 *P = Pline; + uint8 *P = Pline; int lasttile = lastpixel >> 3; int numtiles; static int norecurse = 0; // Yeah, recursion would be bad. diff --git a/src/pputile.inc b/src/pputile.inc index 86fea166..ce4a6d0e 100644 --- a/src/pputile.inc +++ b/src/pputile.inc @@ -1,12 +1,12 @@ uint8 *C; -register uint8 cc; +uint8 cc; uint32 vadr; #ifdef PPU_VRC5FETCH uint8 tmpd; #endif #ifndef PPUT_MMC5SP - register uint8 zz; + uint8 zz; #else uint8 xs, ys; xs = X1;