From c40217fc8e6a98885a7a272566e892ff1462bdba Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 17 May 2019 14:40:16 -0700 Subject: [PATCH] GBA: Fix hi-res videos --- src/gba/core.c | 4 +++- src/gba/renderers/gl.c | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gba/core.c b/src/gba/core.c index 0fc449972..44d125f73 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -355,7 +355,9 @@ static void _GBACoreSetAVStream(struct mCore* core, struct mAVStream* stream) { struct GBA* gba = core->board; gba->stream = stream; if (stream && stream->videoDimensionsChanged) { - stream->videoDimensionsChanged(stream, GBA_VIDEO_HORIZONTAL_PIXELS, GBA_VIDEO_VERTICAL_PIXELS); + unsigned width, height; + core->desiredVideoDimensions(core, &width, &height); + stream->videoDimensionsChanged(stream, width, height); } } diff --git a/src/gba/renderers/gl.c b/src/gba/renderers/gl.c index c5a069738..81fc5cdb8 100644 --- a/src/gba/renderers/gl.c +++ b/src/gba/renderers/gl.c @@ -820,9 +820,6 @@ void GBAVideoGLRendererDrawScanline(struct GBAVideoRenderer* renderer, int y) { if (y == 0) { glDisable(GL_SCISSOR_TEST); glClearColor(0, 0, 0, 0); - glDrawBuffers(1, (GLenum[]) { GL_COLOR_ATTACHMENT3 }); - glClear(GL_COLOR_BUFFER_BIT); - glBindFramebuffer(GL_FRAMEBUFFER, glRenderer->fbo[GBA_GL_FBO_OBJ]); glDrawBuffers(2, (GLenum[]) { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 }); glClear(GL_COLOR_BUFFER_BIT); @@ -939,6 +936,7 @@ void GBAVideoGLRendererGetPixels(struct GBAVideoRenderer* renderer, size_t* stri if (!glRenderer->temporaryBuffer) { glRenderer->temporaryBuffer = anonymousMemoryMap(GBA_VIDEO_HORIZONTAL_PIXELS * GBA_VIDEO_VERTICAL_PIXELS * glRenderer->scale * glRenderer->scale * BYTES_PER_PIXEL); } + glFinish(); glBindFramebuffer(GL_FRAMEBUFFER, glRenderer->fbo[GBA_GL_FBO_OUTPUT]); glPixelStorei(GL_PACK_ROW_LENGTH, GBA_VIDEO_HORIZONTAL_PIXELS * glRenderer->scale); glPixelStorei(GL_PACK_ALIGNMENT, 1);