mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -06:00
quick hack: Tab toggles framerate limit.
misc little fix.
This commit is contained in:
@ -451,7 +451,7 @@ void Reset()
|
|||||||
|
|
||||||
SPI_Firmware::Reset();
|
SPI_Firmware::Reset();
|
||||||
SPI_Powerman::Reset();
|
SPI_Powerman::Reset();
|
||||||
SPI_TSC::Init();
|
SPI_TSC::Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -326,6 +326,8 @@ wxThread::ExitCode EmuThread::Entry()
|
|||||||
emustatus = 3;
|
emustatus = 3;
|
||||||
emupaused = false;
|
emupaused = false;
|
||||||
|
|
||||||
|
limitfps = true;
|
||||||
|
|
||||||
sdlwin = SDL_CreateWindow("melonDS " MELONDS_VERSION,
|
sdlwin = SDL_CreateWindow("melonDS " MELONDS_VERSION,
|
||||||
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||||
Config::WindowWidth, Config::WindowHeight,
|
Config::WindowWidth, Config::WindowHeight,
|
||||||
@ -422,7 +424,7 @@ wxThread::ExitCode EmuThread::Entry()
|
|||||||
lasttick = curtick;
|
lasttick = curtick;
|
||||||
|
|
||||||
u32 wantedtick = starttick + (u32)((float)fpslimitcount * framerate);
|
u32 wantedtick = starttick + (u32)((float)fpslimitcount * framerate);
|
||||||
if (curtick < wantedtick)
|
if (curtick < wantedtick && limitfps)
|
||||||
{
|
{
|
||||||
Sleep(wantedtick - curtick);
|
Sleep(wantedtick - curtick);
|
||||||
}
|
}
|
||||||
@ -571,6 +573,7 @@ void EmuThread::ProcessEvents()
|
|||||||
if (evt.key.keysym.scancode == Config::KeyMapping[10]) NDS::PressKey(16);
|
if (evt.key.keysym.scancode == Config::KeyMapping[10]) NDS::PressKey(16);
|
||||||
if (evt.key.keysym.scancode == Config::KeyMapping[11]) NDS::PressKey(17);
|
if (evt.key.keysym.scancode == Config::KeyMapping[11]) NDS::PressKey(17);
|
||||||
if (evt.key.keysym.scancode == SDL_SCANCODE_F12) NDS::debug(0);
|
if (evt.key.keysym.scancode == SDL_SCANCODE_F12) NDS::debug(0);
|
||||||
|
if (evt.key.keysym.scancode == SDL_SCANCODE_TAB) limitfps = !limitfps;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
@ -579,6 +582,7 @@ void EmuThread::ProcessEvents()
|
|||||||
if (evt.key.keysym.scancode == Config::KeyMapping[i]) NDS::ReleaseKey(i);
|
if (evt.key.keysym.scancode == Config::KeyMapping[i]) NDS::ReleaseKey(i);
|
||||||
if (evt.key.keysym.scancode == Config::KeyMapping[10]) NDS::ReleaseKey(16);
|
if (evt.key.keysym.scancode == Config::KeyMapping[10]) NDS::ReleaseKey(16);
|
||||||
if (evt.key.keysym.scancode == Config::KeyMapping[11]) NDS::ReleaseKey(17);
|
if (evt.key.keysym.scancode == Config::KeyMapping[11]) NDS::ReleaseKey(17);
|
||||||
|
//if (evt.key.keysym.scancode == SDL_SCANCODE_TAB) limitfps = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_JOYBUTTONDOWN:
|
case SDL_JOYBUTTONDOWN:
|
||||||
|
@ -117,6 +117,7 @@ protected:
|
|||||||
|
|
||||||
int emustatus;
|
int emustatus;
|
||||||
volatile bool emupaused;
|
volatile bool emupaused;
|
||||||
|
bool limitfps;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WX_MAIN_H
|
#endif // WX_MAIN_H
|
||||||
|
Reference in New Issue
Block a user