mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Fix cache updating with proxy and GL renderers
This commit is contained in:
parent
4b4eef373f
commit
fdd03e505e
1
CHANGES
1
CHANGES
|
@ -29,6 +29,7 @@ Other fixes:
|
||||||
- GB Video: Fix memory leak when reseting SGB games
|
- GB Video: Fix memory leak when reseting SGB games
|
||||||
- GBA: Fix out of bounds ROM accesses on patched ROMs smaller than 32 MiB
|
- GBA: Fix out of bounds ROM accesses on patched ROMs smaller than 32 MiB
|
||||||
- GBA: Fix maximum tile ID in caching for 256-color modes
|
- GBA: Fix maximum tile ID in caching for 256-color modes
|
||||||
|
- GBA Video: Fix cache updating with proxy and GL renderers
|
||||||
- Libretro: Fix crash when using Game Boy codes (fixes mgba.io/i/2281)
|
- Libretro: Fix crash when using Game Boy codes (fixes mgba.io/i/2281)
|
||||||
- Qt: Fix corrupted savestate and fatal error text
|
- Qt: Fix corrupted savestate and fatal error text
|
||||||
- Qt: Fix sprite compositing when sprite tiles go out of bounds (fixes mgba.io/i/2348)
|
- Qt: Fix sprite compositing when sprite tiles go out of bounds (fixes mgba.io/i/2348)
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <mgba/core/cache-set.h>
|
#include <mgba/core/cache-set.h>
|
||||||
#include <mgba/internal/gba/gba.h>
|
#include <mgba/internal/gba/gba.h>
|
||||||
#include <mgba/internal/gba/io.h>
|
#include <mgba/internal/gba/io.h>
|
||||||
|
#include <mgba/internal/gba/renderers/cache-set.h>
|
||||||
|
|
||||||
static void GBAVideoProxyRendererInit(struct GBAVideoRenderer* renderer);
|
static void GBAVideoProxyRendererInit(struct GBAVideoRenderer* renderer);
|
||||||
static void GBAVideoProxyRendererReset(struct GBAVideoRenderer* renderer);
|
static void GBAVideoProxyRendererReset(struct GBAVideoRenderer* renderer);
|
||||||
|
@ -267,6 +268,9 @@ uint16_t GBAVideoProxyRendererWriteVideoRegister(struct GBAVideoRenderer* render
|
||||||
if (address > REG_BLDY) {
|
if (address > REG_BLDY) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
if (renderer->cache) {
|
||||||
|
GBAVideoCacheWriteVideoRegister(renderer->cache, address, value);
|
||||||
|
}
|
||||||
|
|
||||||
mVideoLoggerRendererWriteVideoRegister(proxyRenderer->logger, address, value);
|
mVideoLoggerRendererWriteVideoRegister(proxyRenderer->logger, address, value);
|
||||||
if (!proxyRenderer->logger->block) {
|
if (!proxyRenderer->logger->block) {
|
||||||
|
|
|
@ -948,6 +948,9 @@ void GBAVideoGLRendererReset(struct GBAVideoRenderer* renderer) {
|
||||||
|
|
||||||
void GBAVideoGLRendererWriteVRAM(struct GBAVideoRenderer* renderer, uint32_t address) {
|
void GBAVideoGLRendererWriteVRAM(struct GBAVideoRenderer* renderer, uint32_t address) {
|
||||||
struct GBAVideoGLRenderer* glRenderer = (struct GBAVideoGLRenderer*) renderer;
|
struct GBAVideoGLRenderer* glRenderer = (struct GBAVideoGLRenderer*) renderer;
|
||||||
|
if (renderer->cache) {
|
||||||
|
mCacheSetWriteVRAM(renderer->cache, address);
|
||||||
|
}
|
||||||
glRenderer->vramDirty |= 1 << (address >> 12);
|
glRenderer->vramDirty |= 1 << (address >> 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -959,8 +962,9 @@ void GBAVideoGLRendererWriteOAM(struct GBAVideoRenderer* renderer, uint32_t oam)
|
||||||
|
|
||||||
void GBAVideoGLRendererWritePalette(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value) {
|
void GBAVideoGLRendererWritePalette(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value) {
|
||||||
struct GBAVideoGLRenderer* glRenderer = (struct GBAVideoGLRenderer*) renderer;
|
struct GBAVideoGLRenderer* glRenderer = (struct GBAVideoGLRenderer*) renderer;
|
||||||
UNUSED(address);
|
if (renderer->cache) {
|
||||||
UNUSED(value);
|
mCacheSetWritePalette(renderer->cache, address >> 1, mColorFrom555(value));
|
||||||
|
}
|
||||||
glRenderer->paletteDirty = true;
|
glRenderer->paletteDirty = true;
|
||||||
int r = M_R5(value);
|
int r = M_R5(value);
|
||||||
int g = M_G5(value) << 1;
|
int g = M_G5(value) << 1;
|
||||||
|
|
Loading…
Reference in New Issue