diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-05-25 22:46:01 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-05-25 22:46:01 +0200 |
commit | 0c31a7ab01f0810c2d1ac2b285c93d406e48ae0b (patch) | |
tree | 162943feba111f10545f863465efa29b3656608a | |
parent | 4b3caedbe7191ca1dc25304b3dc1c8b2e466730d (diff) |
quick hack: Tab toggles framerate limit.
misc little fix.
-rw-r--r-- | src/SPI.cpp | 2 | ||||
-rw-r--r-- | src/wx/main.cpp | 6 | ||||
-rw-r--r-- | src/wx/main.h | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/SPI.cpp b/src/SPI.cpp index 0e7ac6d..c74c2be 100644 --- a/src/SPI.cpp +++ b/src/SPI.cpp @@ -451,7 +451,7 @@ void Reset() SPI_Firmware::Reset(); SPI_Powerman::Reset(); - SPI_TSC::Init(); + SPI_TSC::Reset(); } diff --git a/src/wx/main.cpp b/src/wx/main.cpp index 576a81d..1b245e8 100644 --- a/src/wx/main.cpp +++ b/src/wx/main.cpp @@ -326,6 +326,8 @@ wxThread::ExitCode EmuThread::Entry() emustatus = 3; emupaused = false; + limitfps = true; + sdlwin = SDL_CreateWindow("melonDS " MELONDS_VERSION, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Config::WindowWidth, Config::WindowHeight, @@ -422,7 +424,7 @@ wxThread::ExitCode EmuThread::Entry() lasttick = curtick; u32 wantedtick = starttick + (u32)((float)fpslimitcount * framerate); - if (curtick < wantedtick) + if (curtick < wantedtick && limitfps) { 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[11]) NDS::PressKey(17); if (evt.key.keysym.scancode == SDL_SCANCODE_F12) NDS::debug(0); + if (evt.key.keysym.scancode == SDL_SCANCODE_TAB) limitfps = !limitfps; break; 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[10]) NDS::ReleaseKey(16); if (evt.key.keysym.scancode == Config::KeyMapping[11]) NDS::ReleaseKey(17); + //if (evt.key.keysym.scancode == SDL_SCANCODE_TAB) limitfps = true; break; case SDL_JOYBUTTONDOWN: diff --git a/src/wx/main.h b/src/wx/main.h index 0219ff7..34ac43f 100644 --- a/src/wx/main.h +++ b/src/wx/main.h @@ -117,6 +117,7 @@ protected: int emustatus; volatile bool emupaused; + bool limitfps; }; #endif // WX_MAIN_H |