Properly sync to frame only when not in turbo
Jeffrey Pfau jeffrey@endrift.com
Wed, 22 Jan 2014 03:25:09 -0800
2 files changed,
6 insertions(+),
3 deletions(-)
M
src/platform/sdl/gl-main.c
→
src/platform/sdl/gl-main.c
@@ -74,7 +74,7 @@ context.fname = fname;
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 @@ #else
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();
M
src/platform/sdl/sdl-events.c
→
src/platform/sdl/sdl-events.c
@@ -66,7 +66,8 @@ }
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) {