mirror of https://github.com/mgba-emu/mgba.git
Properly sync to frame only when not in turbo
This commit is contained in:
parent
1e0f400091
commit
968dbe55db
|
@ -74,7 +74,7 @@ int main(int argc, char** argv) {
|
||||||
context.useDebugger = 1;
|
context.useDebugger = 1;
|
||||||
context.renderer = &renderer.d.d;
|
context.renderer = &renderer.d.d;
|
||||||
context.frameskip = 0;
|
context.frameskip = 0;
|
||||||
context.sync.videoFrameWait = 0;
|
context.sync.videoFrameWait = 1;
|
||||||
context.sync.audioWait = 1;
|
context.sync.audioWait = 1;
|
||||||
context.startCallback = _GBASDLStart;
|
context.startCallback = _GBASDLStart;
|
||||||
context.cleanCallback = _GBASDLClean;
|
context.cleanCallback = _GBASDLClean;
|
||||||
|
@ -148,7 +148,9 @@ static void _GBASDLRunloop(struct GBAThread* context, struct GLSoftwareRenderer*
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, renderer->d.outputBuffer);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, renderer->d.outputBuffer);
|
||||||
#endif
|
#endif
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||||
glFlush();
|
if (context->sync.videoFrameWait) {
|
||||||
|
glFlush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GBASyncWaitFrameEnd(&context->sync);
|
GBASyncWaitFrameEnd(&context->sync);
|
||||||
SDL_GL_SwapBuffers();
|
SDL_GL_SwapBuffers();
|
||||||
|
|
|
@ -66,7 +66,8 @@ static void _GBASDLHandleKeypress(struct GBAThread* context, const struct SDL_Ke
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case SDLK_TAB:
|
case SDLK_TAB:
|
||||||
context->sync.audioWait = !context->sync.audioWait;
|
context->sync.audioWait = event->type != SDL_KEYDOWN;
|
||||||
|
context->sync.videoFrameWait = event->type != SDL_KEYDOWN;
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
if (event->type == SDL_KEYDOWN) {
|
if (event->type == SDL_KEYDOWN) {
|
||||||
|
|
Loading…
Reference in New Issue