all repos — mgba @ b28030c98ced576def581f2f3ead551fc890890b

mGBA Game Boy Advance Emulator

GBA Video: More threaded renderer fixes
Jeffrey Pfau jeffrey@endrift.com
Tue, 09 Aug 2016 23:34:36 -0700
commit

b28030c98ced576def581f2f3ead551fc890890b

parent

295b8210dfd3e1f00dfa3e1a8a7cc6de3b189b80

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

jump to
M src/gba/renderers/thread-proxy.csrc/gba/renderers/thread-proxy.c

@@ -75,6 +75,7 @@ proxyRenderer->vramProxy = anonymousMemoryMap(SIZE_VRAM);

proxyRenderer->backend->palette = proxyRenderer->paletteProxy; proxyRenderer->backend->vram = proxyRenderer->vramProxy; proxyRenderer->backend->oam = &proxyRenderer->oamProxy; + proxyRenderer->backend->cache = NULL; proxyRenderer->backend->init(proxyRenderer->backend);

@@ -87,6 +88,7 @@ void GBAVideoThreadProxyRendererReset(struct GBAVideoRenderer* renderer) {

struct GBAVideoThreadProxyRenderer* proxyRenderer = (struct GBAVideoThreadProxyRenderer*) renderer; MutexLock(&proxyRenderer->mutex); while (proxyRenderer->threadState == PROXY_THREAD_BUSY) { + ConditionWake(&proxyRenderer->toThreadCond); ConditionWait(&proxyRenderer->fromThreadCond, &proxyRenderer->mutex); } memcpy(&proxyRenderer->oamProxy.raw, &renderer->oam->raw, SIZE_OAM);

@@ -173,6 +175,9 @@ value,

0xDEADBEEF, }; RingFIFOWrite(&proxyRenderer->dirtyQueue, &dirty, sizeof(dirty)); + if (renderer->cache) { + GBAVideoTileCacheWritePalette(renderer->cache, address); + } } void GBAVideoThreadProxyRendererWriteOAM(struct GBAVideoRenderer* renderer, uint32_t oam) {