From 71b616a9c2cf921037636b3181deef0c28f39ec6 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 9 Nov 2021 15:51:31 -0800 Subject: [PATCH] GBA: Fix maximum tile ID in caching for 256-color modes --- CHANGES | 1 + src/gba/renderers/cache-set.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index b1a976ebe..613ba9937 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ Other fixes: - FFmpeg: Don't attempt to use YUV 4:2:0 for lossless videos (fixes mgba.io/i/2084) - 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 maximum tile ID in caching for 256-color modes - Libretro: Fix crash when using Game Boy codes (fixes mgba.io/i/2281) - Qt: Fix corrupted savestate and fatal error text Misc: diff --git a/src/gba/renderers/cache-set.c b/src/gba/renderers/cache-set.c index bc84deadd..95093ae9a 100644 --- a/src/gba/renderers/cache-set.c +++ b/src/gba/renderers/cache-set.c @@ -25,10 +25,10 @@ void GBAVideoCacheInit(struct mCacheSet* cache) { sysconfig = mTileCacheSystemInfoSetPaletteBPP(sysconfig, 3); // 2^(2^3) = 256 entries sysconfig = mTileCacheSystemInfoSetPaletteCount(sysconfig, 0); // 1 palettes - sysconfig = mTileCacheSystemInfoSetMaxTiles(sysconfig, 2048); + sysconfig = mTileCacheSystemInfoSetMaxTiles(sysconfig, 1024); mTileCacheConfigureSystem(mTileCacheSetGetPointer(&cache->tiles, 1), sysconfig, 0, 0); mTileCacheConfigure(mTileCacheSetGetPointer(&cache->tiles, 1), config); - sysconfig = mTileCacheSystemInfoSetMaxTiles(sysconfig, 1024); + sysconfig = mTileCacheSystemInfoSetMaxTiles(sysconfig, 512); mTileCacheConfigureSystem(mTileCacheSetGetPointer(&cache->tiles, 3), sysconfig, 0x10000, 0x100); mTileCacheConfigure(mTileCacheSetGetPointer(&cache->tiles, 3), config);