mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Make the running thread wait if we are too fast. Jit is so fast in QT
compared to SDL, it's not playable.
This commit is contained in:
parent
1b4394ac5e
commit
806dd5ff3d
1 changed files with 13 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "EmuThread.h"
|
||||
|
||||
#include <QThread>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
#include "Core/HLE/sceCtrl.h"
|
||||
#include "Core/Config.h"
|
||||
|
@ -97,8 +98,12 @@ void EmuThread::run()
|
|||
#endif
|
||||
host->BootDone();
|
||||
|
||||
QElapsedTimer timer;
|
||||
|
||||
while(running) {
|
||||
//UpdateGamepad(*input_state);
|
||||
timer.start();
|
||||
|
||||
UpdateInputState(input_state);
|
||||
|
||||
static const int mapping[12][2] = {
|
||||
|
@ -144,7 +149,15 @@ void EmuThread::run()
|
|||
if (coreState == CORE_NEXTFRAME) {
|
||||
// set back to running for the next frame
|
||||
coreState = CORE_RUNNING;
|
||||
|
||||
qint64 time = timer.elapsed();
|
||||
const int frameTime = (1.0f/60.0f) * 1000;
|
||||
if(time < frameTime)
|
||||
{
|
||||
msleep(frameTime-time);
|
||||
}
|
||||
}
|
||||
timer.start();
|
||||
|
||||
fbo_unbind();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue