all repos — mgba @ f8362fda6815f28ae1495fb9303beaaf4235f086

mGBA Game Boy Advance Emulator

GBA Video: Improve GL reset
Vicki Pfau vi@endrift.com
Fri, 24 May 2019 10:34:36 -0700
commit

f8362fda6815f28ae1495fb9303beaaf4235f086

parent

e4e2c27789f1c04a5b41b1d8eb8318afde2d3a5b

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M src/gba/renderers/gl.csrc/gba/renderers/gl.c

@@ -848,12 +848,21 @@

void GBAVideoGLRendererReset(struct GBAVideoRenderer* renderer) { struct GBAVideoGLRenderer* glRenderer = (struct GBAVideoGLRenderer*) renderer; +#ifdef BUILD_GLES3 + int i; + for (i = 0; i < 512; ++i) { + renderer->writePalette(renderer, i << 1, renderer->palette[i]); + } +#else glRenderer->paletteDirty = true; +#endif glRenderer->vramDirty = 0xFFFFFF; glRenderer->firstAffine = -1; glRenderer->firstY = -1; glRenderer->dispcnt = 0; glRenderer->mosaic = 0; + memset(glRenderer->shadowRegs, 0, sizeof(glRenderer->shadowRegs)); + glRenderer->regsDirty = 0xFFFFFFFFFFFFULL; } void GBAVideoGLRendererWriteVRAM(struct GBAVideoRenderer* renderer, uint32_t address) {