Added draw input aid configuration option to Qt GUI.

This commit is contained in:
mjbudd77 2021-05-23 21:06:34 -04:00
parent 5c4f402a1f
commit 7bd1d6c2e8
7 changed files with 58 additions and 28 deletions

View File

@ -164,12 +164,16 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
// Force Aspect Ratio
aspectCbx = new QCheckBox( tr("Force Aspect Ratio") );
// Draw Input Aids
drawInputAidsCbx = new QCheckBox( tr("Draw Input Aids") );
setCheckBoxFromProperty( autoRegion , "SDL.AutoDetectPAL");
setCheckBoxFromProperty( new_PPU_ena , "SDL.NewPPU");
setCheckBoxFromProperty( frmskipcbx , "SDL.Frameskip");
setCheckBoxFromProperty( sprtLimCbx , "SDL.DisableSpriteLimit");
setCheckBoxFromProperty( clipSidesCbx , "SDL.ClipSides");
setCheckBoxFromProperty( showFPS_cbx , "SDL.ShowFPS");
setCheckBoxFromProperty( drawInputAidsCbx, "SDL.DrawInputAids" );
if ( consoleWindow )
{
@ -189,16 +193,18 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
connect(new_PPU_ena , SIGNAL(stateChanged(int)), this, SLOT(use_new_PPU_changed(int)) );
connect(frmskipcbx , SIGNAL(stateChanged(int)), this, SLOT(frameskip_changed(int)) );
connect(sprtLimCbx , SIGNAL(stateChanged(int)), this, SLOT(useSpriteLimitChanged(int)) );
connect(clipSidesCbx, SIGNAL(stateChanged(int)), this, SLOT(clipSidesChanged(int)) );
connect(clipSidesCbx , SIGNAL(stateChanged(int)), this, SLOT(clipSidesChanged(int)) );
connect(showFPS_cbx , SIGNAL(stateChanged(int)), this, SLOT(showFPSChanged(int)) );
connect(aspectCbx , SIGNAL(stateChanged(int)), this, SLOT(aspectEnableChanged(int)) );
connect(autoScaleCbx, SIGNAL(stateChanged(int)), this, SLOT(autoScaleChanged(int)) );
connect(autoScaleCbx , SIGNAL(stateChanged(int)), this, SLOT(autoScaleChanged(int)) );
connect(drawInputAidsCbx, SIGNAL(stateChanged(int)), this, SLOT(drawInputAidsChanged(int)) );
vbox1->addWidget( autoRegion );
vbox1->addWidget( new_PPU_ena );
vbox1->addWidget( frmskipcbx );
vbox1->addWidget( sprtLimCbx );
//vbox1->addWidget( clipSidesCbx);
vbox1->addWidget( drawInputAidsCbx );
vbox1->addWidget( showFPS_cbx );
vbox1->addWidget( autoScaleCbx);
vbox1->addWidget( aspectCbx );
@ -412,7 +418,9 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
setCheckBoxFromProperty( cursorVisCbx, "SDL.CursorVis" );
grid->addWidget( cursorVisCbx, 1, 0, 2, 1, Qt::AlignLeft);
connect(cursorVisCbx, SIGNAL(stateChanged(int)), this, SLOT(cursorVisChanged(int)) );
//grid->addWidget( drawInputAidsCbx, 2, 0, 2, 1, Qt::AlignLeft);
connect(cursorVisCbx , SIGNAL(stateChanged(int)), this, SLOT(cursorVisChanged(int)) );
vbox2->addStretch( 5 );
@ -825,6 +833,19 @@ void ConsoleVideoConfDialog_t::cursorVisChanged( int value )
consoleWindow->loadCursor();
}
//----------------------------------------------------
void ConsoleVideoConfDialog_t::drawInputAidsChanged( int value )
{
int draw;
draw = (value != Qt::Unchecked);
//printf("Value:%i \n", value );
g_config->setOption("SDL.DrawInputAids", draw );
g_config->save ();
drawInputAidsEnable = draw;
}
//----------------------------------------------------
QSize ConsoleVideoConfDialog_t::calcNewScreenSize(void)
{
QSize out( GL_NES_WIDTH, GL_NES_HEIGHT );

View File

@ -45,6 +45,7 @@ class ConsoleVideoConfDialog_t : public QDialog
QCheckBox *autoScaleCbx;
QCheckBox *aspectCbx;
QCheckBox *cursorVisCbx;
QCheckBox *drawInputAidsCbx;
QDoubleSpinBox *xScaleBox;
QDoubleSpinBox *yScaleBox;
QLabel *aspectSelectLabel;
@ -85,6 +86,7 @@ class ConsoleVideoConfDialog_t : public QDialog
void scalerChanged(int index);
void cursorShapeChanged(int index);
void cursorVisChanged(int value);
void drawInputAidsChanged(int value);
void applyChanges( void );
void ntscStartScanLineChanged(const QString &);
void ntscEndScanLineChanged(const QString &);

View File

@ -504,6 +504,7 @@ InitConfig()
config->addOption("togglemenu", "SDL.ToggleMenu", 0);
config->addOption("cursorType", "SDL.CursorType", 0);
config->addOption("cursorVis" , "SDL.CursorVis", 1);
config->addOption("SDL.DrawInputAids", 1);
// OpenGL options
config->addOption("opengl", "SDL.OpenGL", 1);

View File

@ -84,6 +84,7 @@ bool turbo = false;
bool pauseAfterPlayback = false;
bool suggestReadOnlyReplay = true;
bool showStatusIconOpt = true;
bool drawInputAidsEnable = true;
unsigned int gui_draw_area_width = 256;
unsigned int gui_draw_area_height = 256;
@ -736,6 +737,8 @@ int fceuWrapperInit( int argc, char *argv[] )
AutoResumePlay = false;
}
g_config->getOption ("SDL.DrawInputAids", &drawInputAidsEnable);
// check to see if recording HUD to AVI is enabled
int rh;
g_config->getOption("SDL.RecordHUD", &rh);
@ -1549,6 +1552,11 @@ void FCEUD_ToggleStatusIcon(void)
showStatusIconOpt = !showStatusIconOpt;
}
bool FCEUD_ShouldDrawInputAids(void)
{
return drawInputAidsEnable;
}
void FCEUD_TurboOn (void) { /* TODO */ };
void FCEUD_TurboOff (void) { /* TODO */ };
void FCEUD_TurboToggle(void) { /* TODO */ };

View File

@ -17,6 +17,7 @@ extern bool pauseAfterPlayback;
extern bool suggestReadOnlyReplay;
extern bool emulatorCycleToggle;
extern bool showStatusIconOpt;
extern bool drawInputAidsEnable;
extern unsigned int gui_draw_area_width;
extern unsigned int gui_draw_area_height;
extern unsigned int emulatorCycleCount;

View File

@ -77,15 +77,8 @@ extern bool MaxSpeed;
* Attempts to destroy the graphical video display. Returns 0 on
* success, -1 on failure.
*/
//draw input aids if we are fullscreen
bool FCEUD_ShouldDrawInputAids()
{
return s_fullscreen!=0;
}
int
KillVideo()
KillVideo(void)
{
//printf("Killing Video\n");

View File

@ -180,13 +180,17 @@ static void UpdateZapper(int w, void *data, int arg)
ZD[w].lastInput = ptr[2]&3;
//woah.. this looks like broken bit logic.
if(newclicked && !oldclicked)
if (newclicked && !oldclicked)
{
ZD[w].bogo=5;
ZD[w].mzb=ptr[2];
ZD[w].mzx=ptr[0];
ZD[w].mzy=ptr[1];
}
// Always update X,Y so that gunsight draw function
// is always following the cursor.
ZD[w].mzx=ptr[0];
ZD[w].mzy=ptr[1];
}