Properly sync to frame only when not in turbo

This commit is contained in:
Jeffrey Pfau 2014-01-22 03:25:09 -08:00
parent 1e0f400091
commit 968dbe55db
2 changed files with 6 additions and 3 deletions

View File

@ -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,8 +148,10 @@ 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);
if (context->sync.videoFrameWait) {
glFlush();
}
}
GBASyncWaitFrameEnd(&context->sync);
SDL_GL_SwapBuffers();

View File

@ -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) {