diff --git a/src/platform/sdl/gl-main.c b/src/platform/sdl/gl-main.c index 5bd8b7828..cd048eb9e 100644 --- a/src/platform/sdl/gl-main.c +++ b/src/platform/sdl/gl-main.c @@ -74,7 +74,7 @@ int main(int argc, char** argv) { context.useDebugger = 1; context.renderer = &renderer.d.d; context.frameskip = 0; - context.sync.videoFrameWait = 0; + context.sync.videoFrameWait = 1; context.sync.audioWait = 1; context.startCallback = _GBASDLStart; 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); #endif glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - glFlush(); + if (context->sync.videoFrameWait) { + glFlush(); + } } GBASyncWaitFrameEnd(&context->sync); SDL_GL_SwapBuffers(); diff --git a/src/platform/sdl/sdl-events.c b/src/platform/sdl/sdl-events.c index 5525d0c1f..a5e73e429 100644 --- a/src/platform/sdl/sdl-events.c +++ b/src/platform/sdl/sdl-events.c @@ -66,7 +66,8 @@ static void _GBASDLHandleKeypress(struct GBAThread* context, const struct SDL_Ke break; #endif case SDLK_TAB: - context->sync.audioWait = !context->sync.audioWait; + context->sync.audioWait = event->type != SDL_KEYDOWN; + context->sync.videoFrameWait = event->type != SDL_KEYDOWN; return; default: if (event->type == SDL_KEYDOWN) {