GBA Video: Fix mode 5 frame 1 caching (fixes #2075)

This commit is contained in:
Vicki Pfau 2021-03-30 22:39:10 -07:00
parent 85b4bb1400
commit 4bb8744cd5
2 changed files with 5 additions and 4 deletions

View File

@ -6,6 +6,7 @@ Emulation fixes:
Other fixes:
- GBA: Fix non-USA 1.0 FireRed misdetecting as a ROM hack (fixes mgba.io/i/2100)
- GBA: Fix crash when ROM loading fails
- GBA Video: Fix mode 5 frame 1 caching (fixes mgba.io/i/2075)
Misc:
- GBA: Default-enable VBA bug compat for Ruby and Emerald ROM hacks
- Qt: Add ROM filename and size to bug reporter

View File

@ -139,18 +139,18 @@ void mBitmapCacheCleanRow(struct mBitmapCache* cache, struct mBitmapCacheEntry*
return;
}
size_t offset = cache->bitsStart[cache->buffer] + y * mBitmapCacheSystemInfoGetWidth(cache->sysConfig);
size_t offset = y * mBitmapCacheSystemInfoGetWidth(cache->sysConfig);
void* vram;
int bpe = mBitmapCacheSystemInfoGetEntryBPP(cache->sysConfig);
uint32_t (*lookupEntry)(void*, uint32_t);
switch (bpe) {
case 3:
lookupEntry = _lookupEntry8;
vram = &cache->vram[offset];
vram = &cache->vram[offset + cache->bitsStart[cache->buffer]];
break;
case 4:
lookupEntry = _lookupEntry15;
vram = &cache->vram[offset << 1];
vram = &cache->vram[offset * 2 + cache->bitsStart[cache->buffer]];
break;
default:
abort();