From 114e22c48ff0c96b989d3d259a079a8551e0a675 Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Wed, 26 Aug 2020 22:44:11 -0400 Subject: [PATCH 1/5] Added hex editor bookmark functionality. Still TODO save bookmarks to file based on ROM name. --- src/drivers/Qt/HexEditor.cpp | 188 +++++++++++++++++++++++++++++++++-- src/drivers/Qt/HexEditor.h | 61 +++++++++++- 2 files changed, 240 insertions(+), 9 deletions(-) diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index aefea213..18aaa3df 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "../../types.h" #include "../../fceu.h" @@ -35,6 +36,7 @@ #include "Qt/HexEditor.h" #include "Qt/ConsoleUtilities.h" +static HexBookMarkManager_t hbm; //---------------------------------------------------------------------------- static int getRAM( unsigned int i ) { @@ -279,6 +281,114 @@ void memBlock_t::init(void) } } //---------------------------------------------------------------------------- +HexBookMark::HexBookMark(void) +{ + addr = 0; + mode = 0; + desc[0] = 0; +} +//---------------------------------------------------------------------------- +HexBookMark::~HexBookMark(void) +{ + +} +//---------------------------------------------------------------------------- +HexBookMarkManager_t::HexBookMarkManager_t(void) +{ + +} +//---------------------------------------------------------------------------- +HexBookMarkManager_t::~HexBookMarkManager_t(void) +{ + removeAll(); +} +//---------------------------------------------------------------------------- +void HexBookMarkManager_t::removeAll(void) +{ + HexBookMark *b; + + while ( !ls.empty() ) + { + b = ls.front(); + + delete b; + + ls.pop_front(); + } +} +//---------------------------------------------------------------------------- +int HexBookMarkManager_t::addBookMark( int addr, int mode, const char *desc ) +{ + HexBookMark *b; + + b = new HexBookMark(); + b->addr = addr; + b->mode = mode; + + if ( desc ) + { + strncpy( b->desc, desc, 63 ); + } + + b->desc[63] = 0; + + ls.push_back(b); + + updateVector(); + + return 0; +} +//---------------------------------------------------------------------------- +void HexBookMarkManager_t::updateVector(void) +{ + std::list ::iterator it; + + v.clear(); + + for (it=ls.begin(); it!=ls.end(); it++) + { + v.push_back( *it ); + } + + return; +} +//---------------------------------------------------------------------------- +int HexBookMarkManager_t::size(void) +{ + return ls.size(); +} +//---------------------------------------------------------------------------- +HexBookMark *HexBookMarkManager_t::getBookMark( int index ) +{ + if ( index < 0 ) + { + return NULL; + } + else if ( index >= (int)v.size() ) + { + return NULL; + } + return v[index]; +} +//---------------------------------------------------------------------------- +HexBookMarkMenuAction::HexBookMarkMenuAction(QString desc, QWidget *parent) + : QAction( desc, parent ) +{ + bm = NULL; qedit = NULL; +} +//---------------------------------------------------------------------------- +HexBookMarkMenuAction::~HexBookMarkMenuAction(void) +{ + +} +//---------------------------------------------------------------------------- +void HexBookMarkMenuAction::activateCB(void) +{ + //printf("Activate Bookmark: %p \n", bm ); + qedit->setMode( bm->mode ); + qedit->setAddr( bm->addr ); +} +//---------------------------------------------------------------------------- HexEditorDialog_t::HexEditorDialog_t(QWidget *parent) : QDialog( parent ) { @@ -472,9 +582,17 @@ HexEditorDialog_t::~HexEditorDialog_t(void) periodicTimer->stop(); } //---------------------------------------------------------------------------- +void HexEditorDialog_t::removeAllBookmarks(void) +{ + hbm.removeAll(); + + populateBookmarkMenu(); +} +//---------------------------------------------------------------------------- void HexEditorDialog_t::populateBookmarkMenu(void) { QAction *act; + HexBookMarkMenuAction *hAct; bookmarkMenu->clear(); @@ -482,10 +600,23 @@ void HexEditorDialog_t::populateBookmarkMenu(void) act = new QAction(tr("Remove All Bookmarks"), this); //act->setShortcuts(QKeySequence::Open); act->setStatusTip(tr("Remove All Bookmarks")); - //connect(act, SIGNAL(triggered(void)), this, SLOT(pickBackGroundColor(void)) ); + connect(act, SIGNAL(triggered(void)), this, SLOT(removeAllBookmarks(void)) ); bookmarkMenu->addAction(act); bookmarkMenu->addSeparator(); + + for (int i=0; idesc), this); + bookmarkMenu->addAction(hAct); + hAct->bm = b; hAct->qedit = editor; + connect(hAct, SIGNAL(triggered(void)), hAct, SLOT(activateCB(void)) ); + } + } } //---------------------------------------------------------------------------- void HexEditorDialog_t::closeEvent(QCloseEvent *event) @@ -654,6 +785,7 @@ QHexEdit::QHexEdit(QWidget *parent) { QPalette pal; + this->parent = (HexEditorDialog_t*)parent; this->setFocusPolicy(Qt::StrongFocus); font.setFamily("Courier New"); @@ -821,6 +953,8 @@ void QHexEdit::setAddr( int newAddr ) cursorPosX = 2*((newAddr - addr)%16); cursorPosY = (newAddr - addr)/16; + + vbar->setValue( lineOffset ); } //---------------------------------------------------------------------------- void QHexEdit::setHorzScroll( int value ) @@ -1205,7 +1339,7 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event) int addr; char stmp[128]; - addr = convPixToAddr( event->pos() ); + ctxAddr = addr = convPixToAddr( event->pos() ); //printf("contextMenuEvent\n"); switch ( viewMode ) @@ -1241,26 +1375,30 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event) } } - act = new QAction(tr("TODO Add Bookmark"), this); + act = new QAction(tr("Add Bookmark"), this); menu.addAction(act); + connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); } break; case MODE_NES_PPU: { - act = new QAction(tr("TODO Add Bookmark"), this); + act = new QAction(tr("Add Bookmark"), this); menu.addAction(act); + connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); } break; case MODE_NES_OAM: { - act = new QAction(tr("TODO Add Bookmark"), this); + act = new QAction(tr("Add Bookmark"), this); menu.addAction(act); + connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); } break; case MODE_NES_ROM: { - act = new QAction(tr("TODO Add Bookmark"), this); + act = new QAction(tr("Add Bookmark"), this); menu.addAction(act); + connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); } break; } @@ -1269,6 +1407,44 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event) } //---------------------------------------------------------------------------- +void QHexEdit::addBookMarkCB(void) +{ + int ret; + char stmp[64]; + QInputDialog dialog(this); + + switch ( viewMode ) + { + default: + case MODE_NES_RAM: + sprintf( stmp, "RAM %04X", ctxAddr ); + break; + case MODE_NES_PPU: + sprintf( stmp, "PPU %04X", ctxAddr ); + break; + case MODE_NES_OAM: + sprintf( stmp, "OAM %04X", ctxAddr ); + break; + case MODE_NES_ROM: + sprintf( stmp, "ROM %04X", ctxAddr ); + break; + } + + dialog.setWindowTitle( tr("Add Bookmark") ); + dialog.setLabelText( tr("Specify New Bookmark Description") ); + dialog.setOkButtonText( tr("Add") ); + dialog.setTextValue( tr(stmp) ); + + dialog.show(); + ret = dialog.exec(); + + if ( QDialog::Accepted == ret ) + { + hbm.addBookMark( ctxAddr, viewMode, dialog.textValue().toStdString().c_str() ); + parent->populateBookmarkMenu(); + } +} +//---------------------------------------------------------------------------- void QHexEdit::jumpToROM(void) { setMode( MODE_NES_ROM ); diff --git a/src/drivers/Qt/HexEditor.h b/src/drivers/Qt/HexEditor.h index a2f7079a..de3a714c 100644 --- a/src/drivers/Qt/HexEditor.h +++ b/src/drivers/Qt/HexEditor.h @@ -3,9 +3,13 @@ #pragma once +#include +#include + #include #include #include +#include #include #include #include @@ -42,6 +46,52 @@ struct memBlock_t int (*memAccessFunc)( unsigned int offset); }; +class HexBookMark +{ + public: + HexBookMark(void); + ~HexBookMark(void); + + int addr; + int mode; + char desc[64]; +}; + +class HexBookMarkManager_t +{ + public: + HexBookMarkManager_t(void); + ~HexBookMarkManager_t(void); + + void removeAll(void); + int addBookMark( int addr, int mode, const char *desc ); + int size(void); + HexBookMark *getBookMark( int index ); + private: + void updateVector(void); + std::list ls; + std::vector v; +}; + +class QHexEdit; + +class HexBookMarkMenuAction : public QAction +{ + Q_OBJECT + + public: + HexBookMarkMenuAction( QString desc, QWidget *parent = 0); + ~HexBookMarkMenuAction(void); + + QHexEdit *qedit; + HexBookMark *bm; + public slots: + void activateCB(void); + +}; + +class HexEditorDialog_t; + class QHexEdit : public QWidget { Q_OBJECT @@ -93,6 +143,8 @@ class QHexEdit : public QWidget QColor highLightColor[ HIGHLIGHT_ACTIVITY_NUM_COLORS ]; QColor rvActvTextColor[ HIGHLIGHT_ACTIVITY_NUM_COLORS ]; + HexEditorDialog_t *parent; + uint64_t total_instructions_lp; int viewMode; @@ -119,6 +171,7 @@ class QHexEdit : public QWidget int editValue; int editMask; int jumpToRomValue; + int ctxAddr; bool cursorBlink; bool reverseVideo; @@ -126,6 +179,7 @@ class QHexEdit : public QWidget private slots: void jumpToROM(void); + void addBookMarkCB(void); }; @@ -137,11 +191,11 @@ class HexEditorDialog_t : public QDialog HexEditorDialog_t(QWidget *parent = 0); ~HexEditorDialog_t(void); - protected: - void closeEvent(QCloseEvent *bar); - void gotoAddress(int newAddr); void populateBookmarkMenu(void); + protected: + + void closeEvent(QCloseEvent *bar); QScrollBar *vbar; QScrollBar *hbar; @@ -168,4 +222,5 @@ class HexEditorDialog_t : public QDialog void actvHighlightRVCB(bool value); void pickForeGroundColor(void); void pickBackGroundColor(void); + void removeAllBookmarks(void); }; From 1032e6f443803bcfb5721a6088e4809cb57417c3 Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Wed, 26 Aug 2020 22:53:39 -0400 Subject: [PATCH 2/5] Bookmark menu action memory management fix. QMenu will only delete QActions if it has ownership of the widget. --- src/drivers/Qt/HexEditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index 18aaa3df..5bf6644b 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -379,7 +379,7 @@ HexBookMarkMenuAction::HexBookMarkMenuAction(QString desc, QWidget *parent) //---------------------------------------------------------------------------- HexBookMarkMenuAction::~HexBookMarkMenuAction(void) { - + //printf("Hex Bookmark Menu Action Deleted\n"); } //---------------------------------------------------------------------------- void HexBookMarkMenuAction::activateCB(void) @@ -597,7 +597,7 @@ void HexEditorDialog_t::populateBookmarkMenu(void) bookmarkMenu->clear(); // Bookmarks -> Remove All Bookmarks - act = new QAction(tr("Remove All Bookmarks"), this); + act = new QAction(tr("Remove All Bookmarks"), bookmarkMenu); //act->setShortcuts(QKeySequence::Open); act->setStatusTip(tr("Remove All Bookmarks")); connect(act, SIGNAL(triggered(void)), this, SLOT(removeAllBookmarks(void)) ); @@ -611,7 +611,7 @@ void HexEditorDialog_t::populateBookmarkMenu(void) if ( b ) { - hAct = new HexBookMarkMenuAction(tr(b->desc), this); + hAct = new HexBookMarkMenuAction(tr(b->desc), bookmarkMenu); bookmarkMenu->addAction(hAct); hAct->bm = b; hAct->qedit = editor; connect(hAct, SIGNAL(triggered(void)), hAct, SLOT(activateCB(void)) ); From ca59812e97293a6d8d3a7113ad9052d191a3264b Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Thu, 27 Aug 2020 22:43:13 -0400 Subject: [PATCH 3/5] Added hex editor bookmark auto load/save functionality. --- src/drivers/Qt/ConsoleUtilities.cpp | 2 +- src/drivers/Qt/HexEditor.cpp | 186 +++++++++++++++++++++++++++- src/drivers/Qt/HexEditor.h | 5 + src/drivers/Qt/fceuWrapper.cpp | 4 + 4 files changed, 194 insertions(+), 3 deletions(-) diff --git a/src/drivers/Qt/ConsoleUtilities.cpp b/src/drivers/Qt/ConsoleUtilities.cpp index fcb9a23c..d118dd7d 100644 --- a/src/drivers/Qt/ConsoleUtilities.cpp +++ b/src/drivers/Qt/ConsoleUtilities.cpp @@ -59,7 +59,7 @@ int getFileBaseName( const char *filepath, char *base ) { if ( (filepath[i] == '/') || (filepath[i] == '\\') ) { - j = i; + j = i+1; } i++; } diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index 5bf6644b..a80fdc13 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -37,6 +37,8 @@ #include "Qt/ConsoleUtilities.h" static HexBookMarkManager_t hbm; +static std::list winList; +static const char *memViewNames[] = { "RAM", "PPU", "OAM", "ROM", NULL }; //---------------------------------------------------------------------------- static int getRAM( unsigned int i ) { @@ -315,6 +317,7 @@ void HexBookMarkManager_t::removeAll(void) ls.pop_front(); } + v.clear(); } //---------------------------------------------------------------------------- int HexBookMarkManager_t::addBookMark( int addr, int mode, const char *desc ) @@ -371,6 +374,142 @@ HexBookMark *HexBookMarkManager_t::getBookMark( int index ) return v[index]; } //---------------------------------------------------------------------------- +int HexBookMarkManager_t::loadFromFile(void) +{ + int i,j,mode,addr; + FILE *fp; + QDir dir; + char line[256], fd[256], baseFile[512]; + const char *romFile = getRomFile(); + const char *baseDir = FCEUI_GetBaseDirectory(); + std::string path; + + if ( romFile == NULL ) + { + return -1; + } + path = std::string(baseDir) + "/bookmarks/"; + + dir.mkpath( QString::fromStdString(path) ); + + getFileBaseName( romFile, baseFile ); + + path += std::string(baseFile) + ".txt"; + + fp = ::fopen( path.c_str(), "r"); + + if ( fp == NULL ) + { + return -1; + } + + while ( ::fgets( line, sizeof(line), fp ) != NULL ) + { + i=0; j=0; + //printf("%s\n", line ); + // + while ( isspace(line[i]) ) i++; + + while ( isalpha(line[i]) ) + { + fd[j] = line[i]; i++; j++; + } + fd[j] = 0; + + mode = -1; + + for (j=0; j<4; j++) + { + if ( strcmp( fd, memViewNames[j] ) == 0 ) + { + mode = j; break; + } + } + if ( mode < 0 ) continue; + + while ( isspace(line[i]) ) i++; + if ( line[i] == ':' ) i++; + while ( isspace(line[i]) ) i++; + + j=0; + while ( isxdigit(line[i]) ) + { + fd[j] = line[i]; i++; j++; + } + fd[j] = 0; + + addr = strtol( fd, NULL, 16 ); + + while ( isspace(line[i]) ) i++; + if ( line[i] == ':' ) i++; + while ( isspace(line[i]) ) i++; + + j=0; + while ( line[i] ) + { + fd[j] = line[i]; i++; j++; + } + fd[j] = 0; + j--; + + while ( j >= 0 ) + { + if ( isspace( fd[j] ) ) + { + fd[j] = 0; + } + else + { + break; + } + j--; + } + + addBookMark( addr, mode, fd ); + } + ::fclose(fp); + + return 0; +} +//---------------------------------------------------------------------------- +int HexBookMarkManager_t::saveToFile(void) +{ + FILE *fp; + QDir dir; + char baseFile[512]; + const char *romFile = getRomFile(); + const char *baseDir = FCEUI_GetBaseDirectory(); + std::string path; + + if ( romFile == NULL ) + { + return -1; + } + path = std::string(baseDir) + "/bookmarks/"; + + dir.mkpath( QString::fromStdString(path) ); + + getFileBaseName( romFile, baseFile ); + + path += std::string(baseFile) + ".txt"; + + fp = ::fopen( path.c_str(), "w"); + + if ( fp == NULL ) + { + return -1; + } + + for (int i=0; imode ], v[i]->addr, v[i]->desc ); + } + ::fclose(fp); + + return 0; +} +//---------------------------------------------------------------------------- HexBookMarkMenuAction::HexBookMarkMenuAction(QString desc, QWidget *parent) : QAction( desc, parent ) { @@ -535,8 +674,6 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent) // Bookmarks Menu bookmarkMenu = menuBar->addMenu(tr("Bookmarks")); - populateBookmarkMenu(); - //----------------------------------------------------------------------- // Menu End //----------------------------------------------------------------------- @@ -574,12 +711,29 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent) connect( periodicTimer, &QTimer::timeout, this, &HexEditorDialog_t::updatePeriodic ); periodicTimer->start( 100 ); // 10hz + + winList.push_back(this); + + populateBookmarkMenu(); + } //---------------------------------------------------------------------------- HexEditorDialog_t::~HexEditorDialog_t(void) { + std::list ::iterator it; + printf("Hex Editor Deleted\n"); periodicTimer->stop(); + + for (it = winList.begin(); it != winList.end(); it++) + { + if ( (*it) == this ) + { + winList.erase(it); + //printf("Removing Hex Edit Window\n"); + break; + } + } } //---------------------------------------------------------------------------- void HexEditorDialog_t::removeAllBookmarks(void) @@ -611,6 +765,7 @@ void HexEditorDialog_t::populateBookmarkMenu(void) if ( b ) { + //printf("%p %p \n", b, editor ); hAct = new HexBookMarkMenuAction(tr(b->desc), bookmarkMenu); bookmarkMenu->addAction(hAct); hAct->bm = b; hAct->qedit = editor; @@ -1707,3 +1862,30 @@ void QHexEdit::paintEvent(QPaintEvent *event) } //---------------------------------------------------------------------------- +void hexEditorLoadBookmarks(void) +{ + std::list ::iterator it; + + hbm.removeAll(); + hbm.loadFromFile(); + + for (it = winList.begin(); it != winList.end(); it++) + { + (*it)->populateBookmarkMenu(); + } +} +//---------------------------------------------------------------------------- +void hexEditorSaveBookmarks(void) +{ + std::list ::iterator it; + + printf("Save Bookmarks\n"); + hbm.saveToFile(); + hbm.removeAll(); + + for (it = winList.begin(); it != winList.end(); it++) + { + (*it)->populateBookmarkMenu(); + } +} +//---------------------------------------------------------------------------- diff --git a/src/drivers/Qt/HexEditor.h b/src/drivers/Qt/HexEditor.h index de3a714c..6c2623a0 100644 --- a/src/drivers/Qt/HexEditor.h +++ b/src/drivers/Qt/HexEditor.h @@ -67,6 +67,8 @@ class HexBookMarkManager_t int addBookMark( int addr, int mode, const char *desc ); int size(void); HexBookMark *getBookMark( int index ); + int saveToFile(void); + int loadFromFile(void); private: void updateVector(void); std::list ls; @@ -224,3 +226,6 @@ class HexEditorDialog_t : public QDialog void pickBackGroundColor(void); void removeAllBookmarks(void); }; + +void hexEditorLoadBookmarks(void); +void hexEditorSaveBookmarks(void); diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index a8dcad5f..9fe90965 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -14,6 +14,7 @@ #include "Qt/sdl-video.h" #include "Qt/nes_shm.h" #include "Qt/unix-netplay.h" +#include "Qt/HexEditor.h" #include "Qt/ConsoleWindow.h" #include "Qt/fceux_git_info.h" @@ -231,6 +232,8 @@ int LoadGame(const char *path) return 0; } + hexEditorLoadBookmarks(); + int state_to_load; g_config->getOption("SDL.AutoLoadState", &state_to_load); if (state_to_load >= 0 && state_to_load < 10){ @@ -277,6 +280,7 @@ CloseGame(void) if(!isloaded) { return(0); } + hexEditorSaveBookmarks(); int state_to_save; g_config->getOption("SDL.AutoSaveState", &state_to_save); From e711b21ee40f358e47e139daa2255c36cc59793a Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Fri, 28 Aug 2020 20:23:20 -0400 Subject: [PATCH 4/5] Added hex editor remove all bookmarks question acknowledgement box. --- src/drivers/Qt/HexEditor.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index a80fdc13..3cfab1dc 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include "../../types.h" #include "../../fceu.h" @@ -738,9 +739,23 @@ HexEditorDialog_t::~HexEditorDialog_t(void) //---------------------------------------------------------------------------- void HexEditorDialog_t::removeAllBookmarks(void) { - hbm.removeAll(); + int ret; + QMessageBox mbox(this); - populateBookmarkMenu(); + mbox.setWindowTitle( tr("Bookmarks") ); + mbox.setText( tr("Remove All Bookmarks?") ); + mbox.setIcon( QMessageBox::Question ); + mbox.setStandardButtons( QMessageBox::Cancel | QMessageBox::Ok ); + + ret = mbox.exec(); + + //printf("Ret: %i \n", ret ); + if ( ret == QMessageBox::Ok ) + { + hbm.removeAll(); + + populateBookmarkMenu(); + } } //---------------------------------------------------------------------------- void HexEditorDialog_t::populateBookmarkMenu(void) From e6369e142eab09bf200d093d28f4fd1eeb75f73e Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Fri, 28 Aug 2020 21:40:51 -0400 Subject: [PATCH 5/5] Updated Mac OSX build web page. Provided instructions on how to install the necessary dependencies to run the appveyor pipeline autobuild. --- web/osx.html | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/web/osx.html b/web/osx.html index 9459aa6c..cb6670c6 100644 --- a/web/osx.html +++ b/web/osx.html @@ -59,37 +59,23 @@
- To compile FCEUX in osx, you must have fink or macports. The FCEUX developers recommend fink, since that's what they use, but then again, the only time they compile software on osx is when folks come nagging.

+ To run FCEUX in Mac OSX, you must have the following library dependencies installed on your system:

-first, install the prerequisites.

-

-macports requires these prerequisites: scons, libsdl, zenity, lua, gtk2

-fink requires these prerequisites: try all the same ones as macports, but i know at least one of them is named gtk+2 instead. please report your results.

-

-Building instructions for fink:

-

-CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib scons

-if you are getting link errors about 64bitness then your system is compiling fceux as 64bit but fink is providing i386 libraries. you need to force fceux to compile 32 bits:

-CFLAGS="-I/sw/include -arch i386" LDFLAGS="-L/sw/lib -arch i386" scons

-

-None of the modifications listed at the paperkettle URL were necessary in our latest fink test only 18-jul-2010

-

-This URL is a little old, but he got FCEUX compiling via fink

-http://beesbuzz.biz/blog/e/2009/04/14-how_to_build_fceux_for_mac_os_x.php

-

-Building instructions for macports:

-

-CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib scons

-

-This URL is fresh, and he got FCEUX compiling via macports:

-http://www.paperkettle.com/blog/2010/07/17/fceux-2-14a-compiled-on-mac-osx-10-6/

-

----

-

-At any given time while fooling around you may discover that scons begins behaving irrationally. To fix this, try deleting .sconsign.dblite which will clear out its memory of what has come before.

-

-To clean your scons build, issue the main scons build command as discussed above with the -c parameter

- + Qt5, SDL2, minizip, and zlib +

+ If you are attempting to use the appveyor pipeline autobuild of fceux, you must install these + dependencies via the home brew package management tool. The following commands will install + the necessary dependencies to run the autobuild: +

+		 brew install qt5
+		 brew install sdl2
+		 brew install minizip
+		 
+ If you are attempting to compile fceux, you can either install the dependencies via home brew + or you can install the dmg packages available from the Qt and SDL websites. The cmake and make + build tools are required to compile fceux. See the README file in the root directory of the + project for build instructions. You can also look at what is being done in the ./pipelines/macOS_build.sh + script if you wish to build fceux in the same way the autobuild does.