Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/fceux.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerge Bot <bot@example.com>2022-10-11 03:37:28 +0300
committerAutomerge Bot <bot@example.com>2022-10-11 03:37:28 +0300
commit481ebfcc4f85f1a6a5218a18198e5fff251855fa (patch)
tree2dffe5d6a64560e8a2252a1ca75b39ff7fe20f88
parent53d6ae60d95bf79213bb057cca1412507af0015a (diff)
parent83c529efb68161b431b9e3aa2bf6ad2764b30cb8 (diff)
Merge branch 'master' of https://github.com/TASVideos/fceux into coolgirl
-rw-r--r--pipelines/qwin64_build.bat3
-rw-r--r--src/drivers/Qt/ConsoleWindow.cpp40
-rw-r--r--src/drivers/Qt/ConsoleWindow.h3
-rw-r--r--src/drivers/Qt/config.cpp1
-rw-r--r--src/drivers/Qt/fceuWrapper.cpp1
-rw-r--r--src/drivers/Qt/fceuWrapper.h1
-rw-r--r--src/drivers/Qt/sdl-video.cpp15
7 files changed, 59 insertions, 5 deletions
diff --git a/pipelines/qwin64_build.bat b/pipelines/qwin64_build.bat
index 443a4610..606d5daa 100644
--- a/pipelines/qwin64_build.bat
+++ b/pipelines/qwin64_build.bat
@@ -49,6 +49,9 @@ msbuild /m fceux.sln /p:Configuration=Release
@if ERRORLEVEL 1 goto end
copy src\Release\fceux.exe bin\qfceux.exe
+copy %PROJECT_ROOT%\src\auxlib.lua bin\.
+copy %PROJECT_ROOT%\src\drivers\win\lua\x64\lua51.dll bin\.
+copy %PROJECT_ROOT%\src\drivers\win\lua\x64\lua5.1.dll bin\.
copy %SDL_INSTALL_PREFIX%\SDL2\lib\x64\SDL2.dll bin\.
copy %FFMPEG_INSTALL_PREFIX%\ffmpeg\bin\*.dll bin\.
diff --git a/src/drivers/Qt/ConsoleWindow.cpp b/src/drivers/Qt/ConsoleWindow.cpp
index fd5119c4..58cd2eb4 100644
--- a/src/drivers/Qt/ConsoleWindow.cpp
+++ b/src/drivers/Qt/ConsoleWindow.cpp
@@ -894,7 +894,6 @@ void consoleWin_t::createMainMenu(void)
QActionGroup *group;
int useNativeMenuBar;
int customAutofireOnFrames, customAutofireOffFrames;
- ColorMenuItem *bgColorItem;
//QShortcut *shortcut;
menubar = new consoleMenuBar(this);
@@ -1254,15 +1253,32 @@ void consoleWin_t::createMainMenu(void)
optMenu->addAction(act);
+ optMenu->addSeparator();
+
// Options -> Video BG Color
fceuLoadConfigColor( "SDL.VideoBgColor", &videoBgColor );
- bgColorItem = new ColorMenuItem( tr("BG Side Panel Color"), "SDL.VideoBgColor", this );
- bgColorItem->connectColor( &videoBgColor );
+ bgColorMenuItem = new ColorMenuItem( tr("BG Side Panel Color"), "SDL.VideoBgColor", this );
+ bgColorMenuItem->connectColor( &videoBgColor );
+
+ optMenu->addAction(bgColorMenuItem);
+
+ connect( bgColorMenuItem, SIGNAL(colorChanged(QColor&)), this, SLOT(videoBgColorChanged(QColor&)) );
+
+ // Options -> Use BG Palette for Video BG Color
+ g_config->getOption( "SDL.UseBgPaletteForVideo", &usePaletteForVideoBg );
+
+ act = new QAction(tr("Use BG Palette for Video BG Color"), this);
+ //act->setShortcut( QKeySequence(tr("Alt+/")));
+ act->setCheckable(true);
+ act->setChecked( usePaletteForVideoBg );
+ act->setStatusTip(tr("Use BG Palette for Video BG Color"));
+ //act->setIcon( style()->standardIcon( QStyle::SP_TitleBarMaxButton ) );
+ connect(act, SIGNAL(triggered(bool)), this, SLOT(toggleUseBgPaletteForVideo(bool)) );
- optMenu->addAction(bgColorItem);
+ optMenu->addAction(act);
- connect( bgColorItem, SIGNAL(colorChanged(QColor&)), this, SLOT(videoBgColorChanged(QColor&)) );
+ bgColorMenuItem->setEnabled( !usePaletteForVideoBg );
//-----------------------------------------------------------------------
// Emulation
@@ -2152,6 +2168,20 @@ void consoleWin_t::toggleMenuAutoHide(bool checked)
g_config->save();
}
//---------------------------------------------------------------------------
+void consoleWin_t::toggleUseBgPaletteForVideo(bool checked)
+{
+ usePaletteForVideoBg = checked;
+
+ g_config->setOption( "SDL.UseBgPaletteForVideo", usePaletteForVideoBg );
+ g_config->save();
+
+ if ( !usePaletteForVideoBg )
+ {
+ fceuLoadConfigColor( "SDL.VideoBgColor", &videoBgColor );
+ }
+ bgColorMenuItem->setEnabled( !usePaletteForVideoBg );
+}
+//---------------------------------------------------------------------------
void consoleWin_t::closeApp(void)
{
nes_shm->runEmulator = 0;
diff --git a/src/drivers/Qt/ConsoleWindow.h b/src/drivers/Qt/ConsoleWindow.h
index d4451965..20460591 100644
--- a/src/drivers/Qt/ConsoleWindow.h
+++ b/src/drivers/Qt/ConsoleWindow.h
@@ -27,6 +27,7 @@
#include <QRecursiveMutex>
#endif
+#include "Qt/ColorMenu.h"
#include "Qt/ConsoleViewerGL.h"
#include "Qt/ConsoleViewerSDL.h"
#include "Qt/GamePadConf.h"
@@ -259,6 +260,7 @@ class consoleWin_t : public QMainWindow
QTimer *gameTimer;
QColor videoBgColor;
+ ColorMenuItem *bgColorMenuItem;
std::string errorMsg;
bool errorMsgValid;
@@ -453,6 +455,7 @@ class consoleWin_t : public QMainWindow
void winActiveChanged(void);
void emuFrameFinish(void);
void toggleMenuAutoHide(bool);
+ void toggleUseBgPaletteForVideo(bool);
void videoBgColorChanged( QColor &c );
void loadRomRequestCB( QString s );
diff --git a/src/drivers/Qt/config.cpp b/src/drivers/Qt/config.cpp
index fff49ff4..3f5490cf 100644
--- a/src/drivers/Qt/config.cpp
+++ b/src/drivers/Qt/config.cpp
@@ -535,6 +535,7 @@ InitConfig()
config->addOption('f', "fullscreen", "SDL.Fullscreen", 0);
config->addOption("videoDriver", "SDL.VideoDriver", 0);
config->addOption("SDL.VideoBgColor", "#000000");
+ config->addOption("SDL.UseBgPaletteForVideo", false);
config->addOption("SDL.VideoVsync", 1);
// set x/y res to 0 for automatic fullscreen resolution detection (no change)
diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp
index 12790b69..888d5b2e 100644
--- a/src/drivers/Qt/fceuWrapper.cpp
+++ b/src/drivers/Qt/fceuWrapper.cpp
@@ -89,6 +89,7 @@ bool pauseAfterPlayback = false;
bool suggestReadOnlyReplay = true;
bool showStatusIconOpt = true;
bool drawInputAidsEnable = true;
+bool usePaletteForVideoBg = false;
unsigned int gui_draw_area_width = 256;
unsigned int gui_draw_area_height = 256;
diff --git a/src/drivers/Qt/fceuWrapper.h b/src/drivers/Qt/fceuWrapper.h
index 65534ae0..350480a3 100644
--- a/src/drivers/Qt/fceuWrapper.h
+++ b/src/drivers/Qt/fceuWrapper.h
@@ -18,6 +18,7 @@ extern bool suggestReadOnlyReplay;
extern bool emulatorCycleToggle;
extern bool showStatusIconOpt;
extern bool drawInputAidsEnable;
+extern bool usePaletteForVideoBg;
extern unsigned int gui_draw_area_width;
extern unsigned int gui_draw_area_height;
extern unsigned int emulatorCycleCount;
diff --git a/src/drivers/Qt/sdl-video.cpp b/src/drivers/Qt/sdl-video.cpp
index b3c46434..73bbd8bc 100644
--- a/src/drivers/Qt/sdl-video.cpp
+++ b/src/drivers/Qt/sdl-video.cpp
@@ -37,6 +37,7 @@
#include "Qt/sdl-video.h"
#include "Qt/AviRecord.h"
#include "Qt/fceuWrapper.h"
+#include "Qt/ConsoleWindow.h"
#ifdef CREATE_AVI
#include "../videolog/nesvideos-piece.h"
@@ -74,6 +75,7 @@ extern bool MaxSpeed;
extern int input_display;
extern int frame_display;
extern int rerecord_display;
+extern uint8 PALRAM[0x20];
/**
* Attempts to destroy the graphical video display. Returns 0 on
@@ -498,6 +500,19 @@ BlitScreen(uint8 *XBuf)
{
int i = nes_shm->pixBufIdx;
+ if (usePaletteForVideoBg)
+ {
+ unsigned char r, g, b;
+ FCEUD_GetPalette(0x80 | PALRAM[0], &r, &g, &b);
+
+ if (consoleWindow)
+ {
+ QColor *bgColor = consoleWindow->getVideoBgColorPtr();
+
+ *bgColor = QColor::fromRgb(r,g,b);
+ }
+ }
+
doBlitScreen(XBuf, (uint8_t*)nes_shm->pixbuf[i]);
nes_shm->pixBufIdx = (i+1) % NES_VIDEO_BUFLEN;