all repos — mgba @ c40217fc8e6a98885a7a272566e892ff1462bdba

mGBA Game Boy Advance Emulator

GBA: Fix hi-res videos
Vicki Pfau vi@endrift.com
Fri, 17 May 2019 14:40:16 -0700
commit

c40217fc8e6a98885a7a272566e892ff1462bdba

parent

8a26a7977c0dea8315ea9b1a6df9df7da27b1fe5

2 files changed, 4 insertions(+), 4 deletions(-)

jump to
M src/gba/core.csrc/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); } }
M src/gba/renderers/gl.csrc/gba/renderers/gl.c

@@ -820,9 +820,6 @@

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 @@ *stride = GBA_VIDEO_HORIZONTAL_PIXELS * glRenderer->scale;

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);