commit
36c39aa0e9
|
@ -431,6 +431,7 @@ set(SRC_DRIVERS_SDL
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/GuiConf.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/LuaControl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/CheatsConf.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/HexEditor.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleUtilities.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleVideoConf.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drivers/Qt/ConsoleSoundConf.cpp
|
||||
|
|
|
@ -50,7 +50,8 @@ GuiCheatsDialog_t::GuiCheatsDialog_t(QWidget *parent)
|
|||
|
||||
QFontMetrics fm(font);
|
||||
|
||||
fontCharWidth = fm.boundingRect('X').width() * devPixRatio;
|
||||
//fontCharWidth = fm.boundingRect('X').width() * devPixRatio;
|
||||
fontCharWidth = 2.00 * fm.averageCharWidth() * devPixRatio;
|
||||
|
||||
setWindowTitle("Cheat Search");
|
||||
|
||||
|
@ -415,12 +416,22 @@ GuiCheatsDialog_t::~GuiCheatsDialog_t(void)
|
|||
}
|
||||
wasPausedByCheats = false;
|
||||
|
||||
printf("Destroy Cheat Window Event\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void GuiCheatsDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Cheat Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void GuiCheatsDialog_t::closeWindow(void)
|
||||
{
|
||||
//printf("Close Window\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
int GuiCheatsDialog_t::addSearchResult (uint32_t a, uint8_t last, uint8_t current)
|
||||
|
@ -742,25 +753,10 @@ void GuiCheatsDialog_t::saveCheatFile(void)
|
|||
|
||||
if ( GameInfo )
|
||||
{
|
||||
char *_filename;
|
||||
if ((_filename = strrchr(GameInfo->filename, '\\')) || (_filename = strrchr(GameInfo->filename, '/')))
|
||||
{
|
||||
strcpy( dir, _filename + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( dir, GameInfo->filename);
|
||||
}
|
||||
getFileBaseName( GameInfo->filename, dir );
|
||||
|
||||
strcat( dir, ".cht");
|
||||
|
||||
_filename = strrchr( dir, '.');
|
||||
if (_filename)
|
||||
{
|
||||
strcpy(_filename, ".cht");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat( dir, ".cht");
|
||||
}
|
||||
dialog.selectFile( dir );
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ class GuiCheatsDialog_t : public QDialog
|
|||
int activeCheatListCB (char *name, uint32 a, uint8 v, int c, int s, int type, void *data);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
QGroupBox *actCheatFrame;
|
||||
QGroupBox *cheatSearchFrame;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// ConsoleSoundConf.cpp
|
||||
//
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "../../fceu.h"
|
||||
#include "../../driver.h"
|
||||
#include "Qt/ConsoleSoundConf.h"
|
||||
|
@ -217,7 +219,22 @@ ConsoleSndConfDialog_t::ConsoleSndConfDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------
|
||||
ConsoleSndConfDialog_t::~ConsoleSndConfDialog_t(void)
|
||||
{
|
||||
|
||||
printf("Destroy Sound Config Window\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void ConsoleSndConfDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Sound Config Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void ConsoleSndConfDialog_t::closeWindow(void)
|
||||
{
|
||||
//printf("Sound Close Window\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ConsoleSndConfDialog_t::setCheckBoxFromProperty( QCheckBox *cbx, const char *property )
|
||||
|
|
|
@ -25,6 +25,8 @@ class ConsoleSndConfDialog_t : public QDialog
|
|||
~ConsoleSndConfDialog_t(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
QCheckBox *enaChkbox;
|
||||
QCheckBox *enaLowPass;
|
||||
QCheckBox *swapDutyChkbox;
|
||||
|
@ -44,6 +46,7 @@ class ConsoleSndConfDialog_t : public QDialog
|
|||
void setSliderFromProperty( QSlider *slider, QLabel *lbl, const char *property );
|
||||
|
||||
private slots:
|
||||
void closeWindow(void);
|
||||
void bufSizeChanged(int value);
|
||||
void volumeChanged(int value);
|
||||
void triangleChanged(int value);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../fceu.h"
|
||||
#include "Qt/ConsoleUtilities.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -35,3 +36,50 @@ int getDirFromFile( const char *path, char *dir )
|
|||
return 0;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
const char *getRomFile( void )
|
||||
{
|
||||
if ( GameInfo )
|
||||
{
|
||||
return GameInfo->filename;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// Return file base name stripping out preceding path and trailing suffix.
|
||||
int getFileBaseName( const char *filepath, char *base )
|
||||
{
|
||||
int i=0,j=0,end=0;
|
||||
if ( filepath == NULL )
|
||||
{
|
||||
base[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
i=0; j=0;
|
||||
while ( filepath[i] != 0 )
|
||||
{
|
||||
if ( (filepath[i] == '/') || (filepath[i] == '\\') )
|
||||
{
|
||||
j = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
i = j;
|
||||
|
||||
j=0;
|
||||
while ( filepath[i] != 0 )
|
||||
{
|
||||
base[j] = filepath[i]; i++; j++;
|
||||
}
|
||||
base[j] = 0; end=j;
|
||||
|
||||
while ( j > 1 )
|
||||
{
|
||||
j--;
|
||||
if ( base[j] == '.' )
|
||||
{
|
||||
end=j; base[j] = 0; break;
|
||||
}
|
||||
}
|
||||
return end;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// ConsoleUtilities.h
|
||||
|
||||
int getDirFromFile( const char *path, char *dir );
|
||||
|
||||
const char *getRomFile( void );
|
||||
|
||||
int getFileBaseName( const char *filepath, char *base );
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// ConsoleVideoConf.cpp
|
||||
//
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "../../fceu.h"
|
||||
#include "Qt/main.h"
|
||||
#include "Qt/dface.h"
|
||||
|
@ -105,7 +107,7 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
|||
|
||||
button = new QPushButton( tr("Close") );
|
||||
hbox1->addWidget( button );
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(closewindow(void)) );
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(closeWindow(void)) );
|
||||
|
||||
main_vbox->addLayout( hbox1 );
|
||||
|
||||
|
@ -115,8 +117,24 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------
|
||||
ConsoleVideoConfDialog_t::~ConsoleVideoConfDialog_t(void)
|
||||
{
|
||||
printf("Destroy Video Config Window\n");
|
||||
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Video Config Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::closeWindow(void)
|
||||
{
|
||||
//printf("Video Config Close Window\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::resetVideo(void)
|
||||
{
|
||||
|
@ -237,8 +255,3 @@ void ConsoleVideoConfDialog_t::applyChanges( void )
|
|||
resetVideo();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::closewindow( void )
|
||||
{
|
||||
done(0);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
|
|
|
@ -25,6 +25,8 @@ class ConsoleVideoConfDialog_t : public QDialog
|
|||
~ConsoleVideoConfDialog_t(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *bar);
|
||||
|
||||
QComboBox *driverSelect;
|
||||
QComboBox *regionSelect;
|
||||
QCheckBox *gl_LF_chkBox;
|
||||
|
@ -40,6 +42,9 @@ class ConsoleVideoConfDialog_t : public QDialog
|
|||
|
||||
void resetVideo(void);
|
||||
|
||||
public slots:
|
||||
void closeWindow(void);
|
||||
|
||||
private slots:
|
||||
void use_new_PPU_changed( int value );
|
||||
void frameskip_changed( int value );
|
||||
|
@ -49,7 +54,6 @@ class ConsoleVideoConfDialog_t : public QDialog
|
|||
void regionChanged(int index);
|
||||
void driverChanged(int index);
|
||||
void applyChanges( void );
|
||||
void closewindow( void );
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "Qt/GuiConf.h"
|
||||
#include "Qt/LuaControl.h"
|
||||
#include "Qt/CheatsConf.h"
|
||||
#include "Qt/HexEditor.h"
|
||||
#include "Qt/ConsoleUtilities.h"
|
||||
#include "Qt/ConsoleSoundConf.h"
|
||||
#include "Qt/ConsoleVideoConf.h"
|
||||
|
@ -74,8 +75,6 @@ consoleWin_t::consoleWin_t(QWidget *parent)
|
|||
|
||||
emulatorThread->start();
|
||||
|
||||
gamePadConfWin = NULL;
|
||||
|
||||
}
|
||||
|
||||
consoleWin_t::~consoleWin_t(void)
|
||||
|
@ -84,10 +83,8 @@ consoleWin_t::~consoleWin_t(void)
|
|||
|
||||
gameTimer->stop();
|
||||
|
||||
if ( gamePadConfWin != NULL )
|
||||
{
|
||||
gamePadConfWin->closeWindow();
|
||||
}
|
||||
closeGamePadConfWindow();
|
||||
|
||||
fceuWrapperLock();
|
||||
fceuWrapperClose();
|
||||
fceuWrapperUnLock();
|
||||
|
@ -143,11 +140,8 @@ void consoleWin_t::QueueErrorMsgWindow( const char *msg )
|
|||
void consoleWin_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
//printf("Main Window Close Event\n");
|
||||
if ( gamePadConfWin != NULL )
|
||||
{
|
||||
//printf("Command Game Pad Close\n");
|
||||
gamePadConfWin->closeWindow();
|
||||
}
|
||||
closeGamePadConfWindow();
|
||||
|
||||
event->accept();
|
||||
|
||||
closeApp();
|
||||
|
@ -484,6 +478,18 @@ void consoleWin_t::createMainMenu(void)
|
|||
|
||||
toolsMenu->addAction(cheatsAct);
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Debug
|
||||
debugMenu = menuBar()->addMenu(tr("Debug"));
|
||||
|
||||
// Debug -> Hex Editor
|
||||
hexEditAct = new QAction(tr("Hex Editor..."), this);
|
||||
//hexEditAct->setShortcut( QKeySequence(tr("Shift+F7")));
|
||||
hexEditAct->setStatusTip(tr("Open Memory Hex Editor"));
|
||||
connect(hexEditAct, SIGNAL(triggered()), this, SLOT(openHexEditor(void)) );
|
||||
|
||||
debugMenu->addAction(hexEditAct);
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Movie
|
||||
movieMenu = menuBar()->addMenu(tr("Movie"));
|
||||
|
@ -888,30 +894,14 @@ void consoleWin_t::loadLua(void)
|
|||
luaCtrlWin = new LuaControlDialog_t(this);
|
||||
|
||||
luaCtrlWin->show();
|
||||
luaCtrlWin->exec();
|
||||
|
||||
delete luaCtrlWin;
|
||||
|
||||
//printf("Lua Control Window Destroyed\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void consoleWin_t::openGamePadConfWin(void)
|
||||
{
|
||||
if ( gamePadConfWin != NULL )
|
||||
{
|
||||
printf("GamePad Config Window Already Open\n");
|
||||
return;
|
||||
}
|
||||
//printf("Open GamePad Config Window\n");
|
||||
gamePadConfWin = new GamePadConfDialog_t(this);
|
||||
|
||||
gamePadConfWin->show();
|
||||
gamePadConfWin->exec();
|
||||
|
||||
delete gamePadConfWin;
|
||||
gamePadConfWin = NULL;
|
||||
//printf("GamePad Config Window Destroyed\n");
|
||||
openGamePadConfWindow(this);
|
||||
}
|
||||
|
||||
void consoleWin_t::openGameSndConfWin(void)
|
||||
|
@ -923,11 +913,6 @@ void consoleWin_t::openGameSndConfWin(void)
|
|||
sndConfWin = new ConsoleSndConfDialog_t(this);
|
||||
|
||||
sndConfWin->show();
|
||||
sndConfWin->exec();
|
||||
|
||||
delete sndConfWin;
|
||||
|
||||
//printf("Sound Config Window Destroyed\n");
|
||||
}
|
||||
|
||||
void consoleWin_t::openGameVideoConfWin(void)
|
||||
|
@ -939,11 +924,6 @@ void consoleWin_t::openGameVideoConfWin(void)
|
|||
vidConfWin = new ConsoleVideoConfDialog_t(this);
|
||||
|
||||
vidConfWin->show();
|
||||
vidConfWin->exec();
|
||||
|
||||
delete vidConfWin;
|
||||
|
||||
//printf("Video Config Window Destroyed\n");
|
||||
}
|
||||
|
||||
void consoleWin_t::openHotkeyConfWin(void)
|
||||
|
@ -955,11 +935,6 @@ void consoleWin_t::openHotkeyConfWin(void)
|
|||
hkConfWin = new HotKeyConfDialog_t(this);
|
||||
|
||||
hkConfWin->show();
|
||||
hkConfWin->exec();
|
||||
|
||||
delete hkConfWin;
|
||||
|
||||
//printf("Hotkey Config Window Destroyed\n");
|
||||
}
|
||||
|
||||
void consoleWin_t::openPaletteConfWin(void)
|
||||
|
@ -971,11 +946,6 @@ void consoleWin_t::openPaletteConfWin(void)
|
|||
paletteConfWin = new PaletteConfDialog_t(this);
|
||||
|
||||
paletteConfWin->show();
|
||||
paletteConfWin->exec();
|
||||
|
||||
delete paletteConfWin;
|
||||
|
||||
//printf("Palette Config Window Destroyed\n");
|
||||
}
|
||||
|
||||
void consoleWin_t::openGuiConfWin(void)
|
||||
|
@ -987,11 +957,6 @@ void consoleWin_t::openGuiConfWin(void)
|
|||
guiConfWin = new GuiConfDialog_t(this);
|
||||
|
||||
guiConfWin->show();
|
||||
guiConfWin->exec();
|
||||
|
||||
delete guiConfWin;
|
||||
|
||||
//printf("GUI Config Window Destroyed\n");
|
||||
}
|
||||
|
||||
void consoleWin_t::openCheats(void)
|
||||
|
@ -1003,11 +968,17 @@ void consoleWin_t::openCheats(void)
|
|||
cheatWin = new GuiCheatsDialog_t(this);
|
||||
|
||||
cheatWin->show();
|
||||
cheatWin->exec();
|
||||
}
|
||||
|
||||
delete cheatWin;
|
||||
void consoleWin_t::openHexEditor(void)
|
||||
{
|
||||
HexEditorDialog_t *hexEditWin;
|
||||
|
||||
//printf("GUI Cheat Window Destroyed\n");
|
||||
//printf("Open GUI Hex Editor Window\n");
|
||||
|
||||
hexEditWin = new HexEditorDialog_t(this);
|
||||
|
||||
hexEditWin->show();
|
||||
}
|
||||
|
||||
void consoleWin_t::toggleAutoResume(void)
|
||||
|
@ -1383,11 +1354,6 @@ void consoleWin_t::aboutFCEUX(void)
|
|||
aboutWin = new AboutWindow(this);
|
||||
|
||||
aboutWin->show();
|
||||
aboutWin->exec();
|
||||
|
||||
delete aboutWin;
|
||||
|
||||
//printf("About Window Destroyed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ class consoleWin_t : public QMainWindow
|
|||
QMenu *optMenu;
|
||||
QMenu *emuMenu;
|
||||
QMenu *toolsMenu;
|
||||
QMenu *debugMenu;
|
||||
QMenu *movieMenu;
|
||||
QMenu *helpMenu;
|
||||
|
||||
|
@ -88,6 +89,7 @@ class consoleWin_t : public QMainWindow
|
|||
QAction *fdsEjectAct;
|
||||
QAction *fdsLoadBiosAct;
|
||||
QAction *cheatsAct;
|
||||
QAction *hexEditAct;
|
||||
QAction *openMovAct;
|
||||
QAction *stopMovAct;
|
||||
QAction *recMovAct;
|
||||
|
@ -97,8 +99,6 @@ class consoleWin_t : public QMainWindow
|
|||
|
||||
emulatorThread_t *emulatorThread;
|
||||
|
||||
GamePadConfDialog_t *gamePadConfWin;
|
||||
|
||||
std::string errorMsg;
|
||||
bool errorMsgValid;
|
||||
|
||||
|
@ -155,6 +155,7 @@ class consoleWin_t : public QMainWindow
|
|||
void fdsEjectDisk(void);
|
||||
void fdsLoadBiosFile(void);
|
||||
void openCheats(void);
|
||||
void openHexEditor(void);
|
||||
void openMovie(void);
|
||||
void stopMovie(void);
|
||||
void recordMovie(void);
|
||||
|
|
|
@ -36,6 +36,30 @@ struct GamePadConfigLocalData_t
|
|||
|
||||
static GamePadConfigLocalData_t lcl[GAMEPAD_NUM_DEVICES];
|
||||
|
||||
static GamePadConfDialog_t *gamePadConfWin = NULL;
|
||||
|
||||
//----------------------------------------------------
|
||||
int openGamePadConfWindow( QWidget *parent )
|
||||
{
|
||||
if ( gamePadConfWin != NULL )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
gamePadConfWin = new GamePadConfDialog_t(parent);
|
||||
|
||||
gamePadConfWin->show();
|
||||
|
||||
return 0;
|
||||
}
|
||||
//----------------------------------------------------
|
||||
int closeGamePadConfWindow(void)
|
||||
{
|
||||
if ( gamePadConfWin != NULL )
|
||||
{
|
||||
gamePadConfWin->closeWindow();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//----------------------------------------------------
|
||||
GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
|
||||
: QDialog( parent )
|
||||
|
@ -56,6 +80,8 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
|
|||
std::string prefix;
|
||||
char stmp[256];
|
||||
|
||||
gamePadConfWin = this;
|
||||
|
||||
// Ensure that joysticks are enabled, no harm calling init again.
|
||||
InitJoysticks();
|
||||
|
||||
|
@ -279,6 +305,9 @@ GamePadConfDialog_t::~GamePadConfDialog_t(void)
|
|||
{
|
||||
inputTimer->stop();
|
||||
buttonConfigStatus = 0;
|
||||
gamePadConfWin = NULL;
|
||||
|
||||
printf("GamePad Window Deleted\n");
|
||||
}
|
||||
void GamePadConfDialog_t::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
|
@ -500,6 +529,7 @@ void GamePadConfDialog_t::closeEvent(QCloseEvent *event)
|
|||
printf("GamePad Close Window Event\n");
|
||||
buttonConfigStatus = 0;
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
|
@ -510,6 +540,7 @@ void GamePadConfDialog_t::closeWindow(void)
|
|||
printf("Close Window\n");
|
||||
buttonConfigStatus = 0;
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void GamePadConfDialog_t::changeButton0(void)
|
||||
|
|
|
@ -99,3 +99,7 @@ class GamePadConfDialog_t : public QDialog
|
|||
void updatePeriodic(void);
|
||||
|
||||
};
|
||||
|
||||
int openGamePadConfWindow( QWidget *parent );
|
||||
|
||||
int closeGamePadConfWindow(void);
|
||||
|
|
|
@ -46,13 +46,22 @@ GuiConfDialog_t::GuiConfDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------
|
||||
GuiConfDialog_t::~GuiConfDialog_t(void)
|
||||
{
|
||||
|
||||
printf("Destroy GUI Config Close Window\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void GuiConfDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("GUI Config Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void GuiConfDialog_t::closeWindow(void)
|
||||
{
|
||||
//printf("Close Window\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void GuiConfDialog_t::useNativeFileDialogChanged(int state)
|
||||
|
|
|
@ -26,6 +26,8 @@ class GuiConfDialog_t : public QDialog
|
|||
~GuiConfDialog_t(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
QCheckBox *useNativeFileDialog;
|
||||
QCheckBox *useNativeMenuBar;
|
||||
private:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,171 @@
|
|||
// GamePadConf.h
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QFrame>
|
||||
#include <QGroupBox>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QKeyEvent>
|
||||
|
||||
struct memByte_t
|
||||
{
|
||||
unsigned char data;
|
||||
unsigned char color;
|
||||
unsigned char actv;
|
||||
};
|
||||
|
||||
struct memBlock_t
|
||||
{
|
||||
memBlock_t(void);
|
||||
~memBlock_t(void);
|
||||
|
||||
void init(void);
|
||||
int size(void){ return _size; }
|
||||
int numLines(void){ return _maxLines; }
|
||||
int reAlloc( int newSize );
|
||||
void setAccessFunc( int (*newMemAccessFunc)( unsigned int offset) );
|
||||
|
||||
struct memByte_t *buf;
|
||||
int _size;
|
||||
int _maxLines;
|
||||
int (*memAccessFunc)( unsigned int offset);
|
||||
};
|
||||
|
||||
class QHexEdit : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QHexEdit(QWidget *parent = 0);
|
||||
~QHexEdit(void);
|
||||
|
||||
int getMode(void){ return viewMode; };
|
||||
void setMode( int mode );
|
||||
void setLine( int newLineOffset );
|
||||
void setAddr( int newAddrOffset );
|
||||
void setScrollBars( QScrollBar *h, QScrollBar *v );
|
||||
void setHorzScroll( int value );
|
||||
void setHighlightActivity( int enable );
|
||||
void setHighlightReverseVideo( int enable );
|
||||
void setForeGroundColor( QColor fg );
|
||||
void setBackGroundColor( QColor bg );
|
||||
void memModeUpdate(void);
|
||||
int checkMemActivity(void);
|
||||
|
||||
enum {
|
||||
MODE_NES_RAM = 0,
|
||||
MODE_NES_PPU,
|
||||
MODE_NES_OAM,
|
||||
MODE_NES_ROM
|
||||
};
|
||||
static const int HIGHLIGHT_ACTIVITY_NUM_COLORS = 16;
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void keyReleaseEvent(QKeyEvent *event);
|
||||
void mousePressEvent(QMouseEvent * event);
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
|
||||
void calcFontData(void);
|
||||
void resetCursor(void);
|
||||
QPoint convPixToCursor( QPoint p );
|
||||
int convPixToAddr( QPoint p );
|
||||
|
||||
QFont font;
|
||||
|
||||
memBlock_t mb;
|
||||
int (*memAccessFunc)( unsigned int offset);
|
||||
|
||||
QScrollBar *vbar;
|
||||
QScrollBar *hbar;
|
||||
QColor highLightColor[ HIGHLIGHT_ACTIVITY_NUM_COLORS ];
|
||||
QColor rvActvTextColor[ HIGHLIGHT_ACTIVITY_NUM_COLORS ];
|
||||
|
||||
uint64_t total_instructions_lp;
|
||||
|
||||
int viewMode;
|
||||
int lineOffset;
|
||||
int pxCharWidth;
|
||||
int pxCharHeight;
|
||||
int pxCursorHeight;
|
||||
int pxLineSpacing;
|
||||
int pxLineLead;
|
||||
int pxLineWidth;
|
||||
int pxLineXScroll;
|
||||
int pxXoffset;
|
||||
int pxYoffset;
|
||||
int pxHexOffset;
|
||||
int pxHexAscii;
|
||||
int cursorPosX;
|
||||
int cursorPosY;
|
||||
int cursorBlinkCount;
|
||||
int viewLines;
|
||||
int viewWidth;
|
||||
int viewHeight;
|
||||
int maxLineOffset;
|
||||
int editAddr;
|
||||
int editValue;
|
||||
int editMask;
|
||||
int jumpToRomValue;
|
||||
|
||||
bool cursorBlink;
|
||||
bool reverseVideo;
|
||||
bool actvHighlightEnable;
|
||||
|
||||
private slots:
|
||||
void jumpToROM(void);
|
||||
|
||||
};
|
||||
|
||||
class HexEditorDialog_t : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HexEditorDialog_t(QWidget *parent = 0);
|
||||
~HexEditorDialog_t(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *bar);
|
||||
|
||||
void gotoAddress(int newAddr);
|
||||
void populateBookmarkMenu(void);
|
||||
|
||||
QScrollBar *vbar;
|
||||
QScrollBar *hbar;
|
||||
QHexEdit *editor;
|
||||
QTimer *periodicTimer;
|
||||
QMenu *bookmarkMenu;
|
||||
|
||||
private:
|
||||
|
||||
public slots:
|
||||
void closeWindow(void);
|
||||
private slots:
|
||||
void updatePeriodic(void);
|
||||
void vbarMoved(int value);
|
||||
void vbarChanged(int value);
|
||||
void hbarChanged(int value);
|
||||
void saveRomFile(void);
|
||||
void saveRomFileAs(void);
|
||||
void setViewRAM(void);
|
||||
void setViewPPU(void);
|
||||
void setViewOAM(void);
|
||||
void setViewROM(void);
|
||||
void actvHighlightCB(bool value);
|
||||
void actvHighlightRVCB(bool value);
|
||||
void pickForeGroundColor(void);
|
||||
void pickBackGroundColor(void);
|
||||
};
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <SDL.h>
|
||||
#include <QHeaderView>
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "Qt/main.h"
|
||||
#include "Qt/dface.h"
|
||||
|
@ -68,13 +69,22 @@ HotKeyConfDialog_t::HotKeyConfDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------------------------------
|
||||
HotKeyConfDialog_t::~HotKeyConfDialog_t(void)
|
||||
{
|
||||
|
||||
printf("Destroy Hot Key Config Window\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void HotKeyConfDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Hot Key Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void HotKeyConfDialog_t::closeWindow(void)
|
||||
{
|
||||
//printf("Close Window\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void HotKeyConfDialog_t::assignHotkey(QKeyEvent *event)
|
||||
|
|
|
@ -27,6 +27,7 @@ class HotKeyConfDialog_t : public QDialog
|
|||
~HotKeyConfDialog_t(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void keyReleaseEvent(QKeyEvent *event);
|
||||
void assignHotkey(QKeyEvent *event);
|
||||
|
|
|
@ -102,6 +102,8 @@ LuaControlDialog_t::~LuaControlDialog_t(void)
|
|||
{
|
||||
std::list <LuaControlDialog_t*>::iterator it;
|
||||
|
||||
printf("Destroy Lua Control Window\n");
|
||||
|
||||
for (it = winList.begin(); it != winList.end(); it++)
|
||||
{
|
||||
if ( (*it) == this )
|
||||
|
@ -113,10 +115,19 @@ LuaControlDialog_t::~LuaControlDialog_t(void)
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void LuaControlDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Lua Control Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void LuaControlDialog_t::closeWindow(void)
|
||||
{
|
||||
//printf("Close Window\n");
|
||||
//printf("Lua Control Close Window\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void LuaControlDialog_t::openLuaScriptFile(void)
|
||||
|
|
|
@ -29,6 +29,8 @@ class LuaControlDialog_t : public QDialog
|
|||
void refreshState(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *bar);
|
||||
|
||||
QLineEdit *scriptPath;
|
||||
QLineEdit *scriptArgs;
|
||||
QPushButton *browseButton;
|
||||
|
|
|
@ -148,13 +148,22 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------
|
||||
PaletteConfDialog_t::~PaletteConfDialog_t(void)
|
||||
{
|
||||
|
||||
printf("Destroy Palette Config Window\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void PaletteConfDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Palette Config Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void PaletteConfDialog_t::closeWindow(void)
|
||||
{
|
||||
//printf("Close Window\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void PaletteConfDialog_t::hueChanged(int v)
|
||||
|
|
|
@ -26,6 +26,8 @@ class PaletteConfDialog_t : public QDialog
|
|||
~PaletteConfDialog_t(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
QLineEdit *custom_palette_path;
|
||||
QCheckBox *useCustom;
|
||||
QCheckBox *GrayScale;
|
||||
|
|
|
@ -104,7 +104,8 @@ void FCEUD_PrintError(const char *errormsg)
|
|||
*/
|
||||
FILE *FCEUD_UTF8fopen(const char *fn, const char *mode)
|
||||
{
|
||||
return(fopen(fn,mode));
|
||||
FILE *fp = ::fopen(fn,mode);
|
||||
return(fp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1570,6 +1570,7 @@ const char * ButtonName (const ButtConfig * bc)
|
|||
{
|
||||
int joyNum, inputNum;
|
||||
const char *inputType, *inputDirection;
|
||||
char direction[128] = "";
|
||||
|
||||
joyNum = bc->DeviceNum;
|
||||
|
||||
|
@ -1582,7 +1583,6 @@ const char * ButtonName (const ButtConfig * bc)
|
|||
else if (bc->ButtonNum & 0x2000)
|
||||
{
|
||||
int inputValue;
|
||||
char direction[128] = "";
|
||||
|
||||
inputType = "Hat";
|
||||
inputNum = (bc->ButtonNum >> 8) & 0x1F;
|
||||
|
|
|
@ -956,7 +956,7 @@ init_ok:
|
|||
}
|
||||
|
||||
// bbit edited: the whole function below was added
|
||||
int iNesSave() {
|
||||
int iNesSave(void) {
|
||||
char name[2048];
|
||||
|
||||
strcpy(name, LoadedRomFName);
|
||||
|
@ -967,7 +967,7 @@ int iNesSave() {
|
|||
return iNesSaveAs(name);
|
||||
}
|
||||
|
||||
int iNesSaveAs(char* name)
|
||||
int iNesSaveAs(const char* name)
|
||||
{
|
||||
//adelikat: TODO: iNesSave() and this have pretty much the same code, outsource the common code to a single function
|
||||
//caitsith2: done. iNesSave() now gets filename and calls iNesSaveAs with that filename.
|
||||
|
|
|
@ -43,8 +43,8 @@ extern uint8 *VROM;
|
|||
extern uint32 VROM_size;
|
||||
extern uint32 ROM_size;
|
||||
extern uint8 *ExtraNTARAM;
|
||||
extern int iNesSave(); //bbit Edited: line added
|
||||
extern int iNesSaveAs(char* name);
|
||||
extern int iNesSave(void); //bbit Edited: line added
|
||||
extern int iNesSaveAs(const char* name);
|
||||
extern char LoadedRomFName[2048]; //bbit Edited: line added
|
||||
extern const TMasterRomInfo* MasterRomInfo;
|
||||
extern TMasterRomInfoParams MasterRomInfoParams;
|
||||
|
|
Loading…
Reference in New Issue