Further hot key rework, fixed Qt Turbo hot key function.

This commit is contained in:
mjbudd77 2021-04-05 22:42:59 -04:00
parent 2f2abfdbb2
commit 0419e22179
4 changed files with 32 additions and 24 deletions

View File

@ -563,10 +563,8 @@ void consoleWin_t::initHotKeys(void)
}
// Frame Advance uses key state directly, disable shortcut events
if ( Hotkeys[HK_FRAME_ADVANCE].getShortcut() != nullptr )
{
Hotkeys[HK_FRAME_ADVANCE].getShortcut()->setEnabled(false);
}
Hotkeys[HK_TURBO ].getShortcut()->setEnabled(false);
connect( Hotkeys[ HK_VOLUME_DOWN ].getShortcut(), SIGNAL(activated()), this, SLOT(decrSoundVolume(void)) );
connect( Hotkeys[ HK_VOLUME_UP ].getShortcut(), SIGNAL(activated()), this, SLOT(incrSoundVolume(void)) );
@ -2782,6 +2780,11 @@ void consoleWin_t::toggleInputDisplay(void)
fceuWrapperUnLock();
}
void consoleWin_t::toggleTurboMode(void)
{
NoWaiting ^= 1;
}
void consoleWin_t::openMovie(void)
{
MoviePlayDialog_t *win;

View File

@ -311,6 +311,7 @@ class consoleWin_t : public QMainWindow
void toggleMovieFrameDisplay(void);
void toggleMovieReadWrite(void);
void toggleInputDisplay(void);
void toggleTurboMode(void);
};

View File

@ -955,9 +955,13 @@ static void KeyboardCommands (void)
//}
// Toggle throttling
if ( Hotkeys[HK_TURBO].getRisingEdge() )
if ( Hotkeys[HK_TURBO].getState() )
{
NoWaiting ^= 1;
NoWaiting |= 0x01;
}
else
{
NoWaiting &= 0x02;
//printf("NoWaiting: 0x%04x\n", NoWaiting );
}
@ -989,23 +993,23 @@ static void KeyboardCommands (void)
//{
// FCEUI_PowerNES();
//}
if ( Hotkeys[HK_QUIT].getRisingEdge() )
{
CloseGame();
FCEUI_Kill();
SDL_Quit();
exit(0);
}
else
#ifdef _S9XLUA_H
if ( Hotkeys[HK_LOAD_LUA].getRisingEdge() )
{
std::string fname;
fname = GetFilename ("Open LUA script...", 3, "Lua scripts|*.lua");
if (fname != "")
FCEU_LoadLuaCode (fname.c_str ());
}
#endif
// if ( Hotkeys[HK_QUIT].getRisingEdge() )
// {
// CloseGame();
// FCEUI_Kill();
// SDL_Quit();
// exit(0);
// }
// else
//#ifdef _S9XLUA_H
// if ( Hotkeys[HK_LOAD_LUA].getRisingEdge() )
// {
// std::string fname;
// fname = GetFilename ("Open LUA script...", 3, "Lua scripts|*.lua");
// if (fname != "")
// FCEU_LoadLuaCode (fname.c_str ());
// }
//#endif
//for (int i = 0; i < 10; i++)
//{

View File

@ -250,7 +250,7 @@ int highPrecSleep( double timeSeconds )
int
SpeedThrottle(void)
{
if (g_fpsScale >= 32)
if ( (g_fpsScale >= 32) || (NoWaiting & 0x01) )
{
return 0; /* Done waiting */
}