Merge branch 'TASEmulators:master' into master

This commit is contained in:
Cyneprepou4uk 2022-01-31 16:55:38 +03:00 committed by GitHub
commit a9c69089d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 113 additions and 18 deletions

View File

@ -2,7 +2,7 @@
use strict;
my $VERSION="2.6.1";
my $VERSION="2.6.2";
my $INSTALL_PREFIX="/tmp/fceux";
my $CTL_FILENAME="$INSTALL_PREFIX/DEBIAN/control";
my $ARCH="amd64";

View File

@ -10,7 +10,7 @@ QT_MAJOR=5;
QT_PKGNAME=qt$QT_MAJOR;
FCEUX_VERSION_MAJOR=2
FCEUX_VERSION_MINOR=6
FCEUX_VERSION_PATCH=1
FCEUX_VERSION_PATCH=2
SDL2_VERSION=2.0.14
SCRIPT_DIR=$( cd $(dirname $BASH_SOURCE[0]); pwd );

View File

@ -28,8 +28,8 @@ Interim builds:
* Win32: [fceux.zip](https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux.zip?branch=master&job=Windows%2032)
* Win64: [fceux64.zip](https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux64.zip?branch=master&job=Windows%2064)
* Win64 Qt/SDL: [qfceux64.zip](https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/qfceux64.zip?branch=master&job=Win64%20Qt)
* Ubuntu: [fceux-2.6.1-amd64.deb](https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.1-amd64.deb?branch=master&job=Ubuntu)
* MacOSX: [fceux-2.6.1-Darwin.dmg](https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.1-Darwin.dmg?branch=master&job=MacOS)
* Ubuntu: [fceux-2.6.2-amd64.deb](https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.2-amd64.deb?branch=master&job=Ubuntu)
* MacOSX: [fceux-2.6.2-Darwin.dmg](https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.2-Darwin.dmg?branch=master&job=MacOS)
* Status: [Appveyor](https://ci.appveyor.com/project/zeromus/fceux/)
But you might like mesen more: https://github.com/SourMesen/Mesen

View File

@ -32,6 +32,7 @@
#include <vfw.h>
#endif
#include <QFile>
#include <QDate>
#include <QLocale>
#include <QSysInfo>

View File

@ -492,7 +492,11 @@ void fceuCustomToolTip::mouseMoveEvent(QMouseEvent *event)
if (!w->rect().isNull())
{
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
QPoint pos = event->globalPosition().toPoint();
#else
QPoint pos = event->globalPos();
#endif
pos = mapFromGlobal(pos);
//printf("QEvent::MouseMove: (%i,%i) (%i,%i)\n",

View File

@ -114,19 +114,23 @@ consoleWin_t::consoleWin_t(QWidget *parent)
initHotKeys();
createMainMenu();
firstResize = true;
closeRequested = false;
errorMsgValid = false;
viewport_GL = NULL;
viewport_SDL = NULL;
mainMenuEmuPauseSet = false;
mainMenuEmuWasPaused = false;
mainMenuPauseWhenActv = false;
contextMenuEnable = false;
soundUseGlobalFocus = false;
mainMenuEmuPauseSet = false;
mainMenuEmuWasPaused = false;
mainMenuPauseWhenActv = false;
autoHideMenuFullscreen = false;
createMainMenu();
g_config->getOption( "SDL.PauseOnMainMenuAccess", &mainMenuPauseWhenActv );
g_config->getOption( "SDL.AutoHideMenuFullsreen", &autoHideMenuFullscreen );
g_config->getOption( "SDL.ContextMenuEnable", &contextMenuEnable );
g_config->getOption( "SDL.Sound.UseGlobalFocus", &soundUseGlobalFocus );
g_config->getOption ("SDL.VideoDriver", &use_SDL_video);
@ -225,6 +229,10 @@ consoleWin_t::consoleWin_t(QWidget *parent)
if ( setFullScreen )
{
if ( autoHideMenuFullscreen )
{
menubar->setVisible(false);
}
this->showFullScreen();
}
@ -1221,6 +1229,19 @@ void consoleWin_t::createMainMenu(void)
Hotkeys[ HK_MAIN_MENU_HIDE ].setAction( act );
connect( Hotkeys[ HK_MAIN_MENU_HIDE ].getShortcut(), SIGNAL(activated()), this, SLOT(toggleMenuVis(void)) );
// Options -> Auto Hide Menu on Fullscreen
g_config->getOption( "SDL.AutoHideMenuFullsreen", &autoHideMenuFullscreen );
act = new QAction(tr("&Auto Hide Menu on Fullscreen"), this);
//act->setShortcut( QKeySequence(tr("Alt+/")));
act->setCheckable(true);
act->setChecked( autoHideMenuFullscreen );
act->setStatusTip(tr("Auto Hide Menu on Fullscreen"));
//act->setIcon( style()->standardIcon( QStyle::SP_TitleBarMaxButton ) );
connect(act, SIGNAL(triggered(bool)), this, SLOT(toggleMenuAutoHide(bool)) );
optMenu->addAction(act);
// Options -> Video BG Color
fceuLoadConfigColor( "SDL.VideoBgColor", &videoBgColor );
@ -2098,6 +2119,14 @@ void consoleWin_t::toggleMenuVis(void)
}
}
//---------------------------------------------------------------------------
void consoleWin_t::toggleMenuAutoHide(bool checked)
{
autoHideMenuFullscreen = checked;
g_config->setOption( "SDL.AutoHideMenuFullsreen", autoHideMenuFullscreen );
g_config->save();
}
//---------------------------------------------------------------------------
void consoleWin_t::closeApp(void)
{
nes_shm->runEmulator = 0;
@ -3102,9 +3131,18 @@ void consoleWin_t::toggleFullscreen(void)
if ( isFullScreen() )
{
showNormal();
if ( autoHideMenuFullscreen )
{
menubar->setVisible(true);
}
}
else
{
if ( autoHideMenuFullscreen )
{
menubar->setVisible(false);
}
showFullScreen();
}
}

View File

@ -271,6 +271,7 @@ class consoleWin_t : public QMainWindow
bool scrHandlerConnected;
bool contextMenuEnable;
bool soundUseGlobalFocus;
bool autoHideMenuFullscreen;
std::list <std::string*> romList;
std::vector <autoFireMenuAction*> afActList;
@ -449,6 +450,7 @@ class consoleWin_t : public QMainWindow
void winScreenChanged( QScreen *scr );
void winActiveChanged(void);
void emuFrameFinish(void);
void toggleMenuAutoHide(bool);
void videoBgColorChanged( QColor &c );
void loadRomRequestCB( QString s );

View File

@ -1100,7 +1100,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
QAction *act, *actHlgt, *actHlgtRV;
ColorMenuItem *actColorFG, *actColorBG, *actRowColColor, *actAltColColor;
QActionGroup *group;
int opt, useNativeMenuBar, refreshRateOpt;
int opt, useNativeMenuBar;
QSettings settings;
QDialog::setWindowTitle( tr("Hex Editor") );
@ -1280,6 +1280,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
group->setExclusive(true);
refreshRateOpt = 10;
g_config->getOption("SDL.HexEditRefreshRate", &refreshRateOpt);
// View -> Refresh Rate -> 5 Hz
@ -1318,6 +1319,15 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
group->addAction(act);
subMenu->addAction(act);
// View -> Refresh Rate -> 50 Hz
act = new QAction(tr("50 Hz"), this);
act->setCheckable(true);
act->setChecked( refreshRateOpt == 50 );
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh50Hz(void)) );
group->addAction(act);
subMenu->addAction(act);
// View -> Refresh Rate -> 60 Hz
act = new QAction(tr("60 Hz"), this);
act->setCheckable(true);
@ -1727,6 +1737,7 @@ void HexEditorDialog_t::changeFontRequest(void)
//----------------------------------------------------------------------------
void HexEditorDialog_t::setViewRefresh5Hz(void)
{
refreshRateOpt = 5;
g_config->setOption("SDL.HexEditRefreshRate", 5);
periodicTimer->stop();
periodicTimer->start(200);
@ -1734,6 +1745,7 @@ void HexEditorDialog_t::setViewRefresh5Hz(void)
//----------------------------------------------------------------------------
void HexEditorDialog_t::setViewRefresh10Hz(void)
{
refreshRateOpt = 10;
g_config->setOption("SDL.HexEditRefreshRate", 10);
periodicTimer->stop();
periodicTimer->start(100);
@ -1741,6 +1753,7 @@ void HexEditorDialog_t::setViewRefresh10Hz(void)
//----------------------------------------------------------------------------
void HexEditorDialog_t::setViewRefresh20Hz(void)
{
refreshRateOpt = 20;
g_config->setOption("SDL.HexEditRefreshRate", 20);
periodicTimer->stop();
periodicTimer->start(50);
@ -1748,13 +1761,23 @@ void HexEditorDialog_t::setViewRefresh20Hz(void)
//----------------------------------------------------------------------------
void HexEditorDialog_t::setViewRefresh30Hz(void)
{
refreshRateOpt = 30;
g_config->setOption("SDL.HexEditRefreshRate", 30);
periodicTimer->stop();
periodicTimer->start(33);
}
//----------------------------------------------------------------------------
void HexEditorDialog_t::setViewRefresh50Hz(void)
{
refreshRateOpt = 50;
g_config->setOption("SDL.HexEditRefreshRate", 50);
periodicTimer->stop();
periodicTimer->start(20);
}
//----------------------------------------------------------------------------
void HexEditorDialog_t::setViewRefresh60Hz(void)
{
refreshRateOpt = 60;
g_config->setOption("SDL.HexEditRefreshRate", 60);
periodicTimer->stop();
periodicTimer->start(16);
@ -3804,7 +3827,7 @@ void QHexEdit::paintEvent(QPaintEvent *event)
painter.fillRect( 0, 0, w, h, bgColor );
if ( cursorBlinkCount >= 5 )
if ( cursorBlinkCount >= (parent->getRefreshRate()>>1) )
{
cursorBlink = !cursorBlink;
cursorBlinkCount = 0;
@ -4008,8 +4031,12 @@ void QHexEdit::paintEvent(QPaintEvent *event)
if ( reverseVideo )
{
painter.setPen( romFgColor );
painter.fillRect( x - (0.5*pxCharWidth) , recty, pxCharWidth3, pxLineSpacing, romBgColor );
painter.fillRect( pxHexAscii + (col*pxCharWidth) - pxLineXScroll, recty, pxCharWidth, pxLineSpacing, romBgColor );
if ( bgColor != romBgColor )
{
painter.fillRect( x - (0.5*pxCharWidth) , recty, pxCharWidth3, pxLineSpacing, romBgColor );
painter.fillRect( pxHexAscii + (col*pxCharWidth) - pxLineXScroll, recty, pxCharWidth, pxLineSpacing, romBgColor );
}
}
else
{

View File

@ -297,6 +297,8 @@ class HexEditorDialog_t : public QDialog
void setWindowTitle(void);
void openDebugSymbolEditWindow( int addr );
int getRefreshRate(void){ return refreshRateOpt; }
QHexEdit *editor;
HexEditorFindDialog_t *findDialog;
@ -318,6 +320,8 @@ class HexEditorDialog_t : public QDialog
QAction *rolColHlgtAct;
QAction *altColHlgtAct;
int refreshRateOpt;
private:
public slots:
@ -349,6 +353,7 @@ class HexEditorDialog_t : public QDialog
void setViewRefresh10Hz(void);
void setViewRefresh20Hz(void);
void setViewRefresh30Hz(void);
void setViewRefresh50Hz(void);
void setViewRefresh60Hz(void);
void changeFontRequest(void);
};

View File

@ -39,6 +39,7 @@
#include <QFontDialog>
#include <QInputDialog>
#include <QStandardPaths>
#include <QActionGroup>
#include <QApplication>
#include <QGuiApplication>
#include <QDesktopServices>

View File

@ -858,7 +858,11 @@ void BOOKMARKS::mouseMoveEvent(QMouseEvent * event)
emit imageIndexChanged(item);
}
imageItem = item;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
imagePos = event->globalPosition().toPoint();
#else
imagePos = event->globalPos();
#endif
imageTimer->start();
QToolTip::hideText();
}

View File

@ -152,7 +152,7 @@ void BRANCHES::calcFontData(void)
// printf("Char:'%c' x:%i y:%i w:%i h:%i\n", txt[0], boundingRect.x(), boundingRect.y(), boundingRect.width(), boundingRect.height() );
//}
bs = (metrics.leftBearing(ch) + metrics.rightBearing(ch)) / 2;
bs = (metrics.leftBearing(QChar(ch)) + metrics.rightBearing(QChar(ch))) / 2;
pxCharHeight = metrics.capHeight();
//pxCharHeight = metrics.ascent();
@ -690,7 +690,11 @@ void BRANCHES::mouseMoveEvent(QMouseEvent * event)
emit imageIndexChanged(item);
}
imageItem = item;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
imagePos = event->globalPosition().toPoint();
#else
imagePos = event->globalPos();
#endif
imageTimer->start();
QToolTip::hideText();
}

View File

@ -817,6 +817,7 @@ InitConfig()
config->addOption("_useNativeFileDialog", "SDL.UseNativeFileDialog", false);
config->addOption("_useNativeMenuBar" , "SDL.UseNativeMenuBar", false);
config->addOption("SDL.PauseOnMainMenuAccess", false);
config->addOption("SDL.AutoHideMenuFullsreen", false);
config->addOption("SDL.ContextMenuEnable", true);
config->addOption("SDL.GuiStyle", "");
config->addOption("SDL.QtStyleSheet", "");

View File

@ -265,11 +265,19 @@ void hotkey_t::conv2SDL(void)
if (shortcut == nullptr)
return;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
qkey.value = shortcut->key()[0].key();
qkey.modifier = shortcut->key()[0].keyboardModifiers();
SDL_Keycode k = convQtKey2SDLKeyCode(shortcut->key()[0].key());
SDL_Keymod m = convQtKey2SDLModifier(shortcut->key()[0].keyboardModifiers());
#else
qkey.value = (Qt::Key)(shortcut->key()[0] & 0x01FFFFFF);
qkey.modifier = (Qt::KeyboardModifier)(shortcut->key()[0] & 0xFE000000);
SDL_Keycode k = convQtKey2SDLKeyCode((Qt::Key)(shortcut->key()[0] & 0x01FFFFFF));
SDL_Keymod m = convQtKey2SDLModifier((Qt::KeyboardModifier)(shortcut->key()[0] & 0xFE000000));
#endif
//printf("Key: '%s' 0x%08x\n", shortcut->key().toString().toStdString().c_str(), shortcut->key()[0] );

View File

@ -62,14 +62,14 @@
#define FCEU_VERSION_MAJOR 2
#define FCEU_VERSION_MINOR 6
#define FCEU_VERSION_PATCH 1
#define FCEU_VERSION_PATCH 2
#define FCEU_VERSION_NUMERIC ( (FCEU_VERSION_MAJOR*10000) + (FCEU_VERSION_MINOR*100) + (FCEU_VERSION_PATCH) )
#define FCEU_VERSION_MAJOR_DECODE(x) ( (x / 10000) )
#define FCEU_VERSION_MINOR_DECODE(x) ( (x / 100) % 100 )
#define FCEU_VERSION_PATCH_DECODE(x) (x % 100)
#define FCEU_VERSION_STRING "2.6.1" FCEU_SUBVERSION_STRING FCEU_FEATURE_STRING FCEU_COMPILER
#define FCEU_VERSION_STRING "2.6.2" FCEU_SUBVERSION_STRING FCEU_FEATURE_STRING FCEU_COMPILER
#define FCEU_NAME_AND_VERSION FCEU_NAME " " FCEU_VERSION_STRING
#endif

View File

@ -84,8 +84,8 @@
<li><a href="https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux.zip?branch=master&job=Windows%2032">Windows 32-bit</a></li>
<li><a href="https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux64.zip?branch=master&job=Windows%2064">Windows 64-bit</a></li>
<li><a href="https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/qfceux64.zip?branch=master&job=Win64%20Qt">Win 64 Qt/SDL</a></li>
<li><a href="https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.1-amd64.deb?branch=master&job=Ubuntu">Ubuntu Linux</a></li>
<li><a href="https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.1-Darwin.dmg?branch=master&job=MacOS">Mac OS X</a></li>
<li><a href="https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.2-amd64.deb?branch=master&job=Ubuntu">Ubuntu Linux</a></li>
<li><a href="https://ci.appveyor.com/api/projects/zeromus/fceux/artifacts/fceux-2.6.2-Darwin.dmg?branch=master&job=MacOS">Mac OS X</a></li>
</ul>
<h3>Source Code</h3>