mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Fix mode 5 frame 1 caching (fixes #2075)
This commit is contained in:
parent
02b814d3bb
commit
7740295a6c
1
CHANGES
1
CHANGES
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
@ -184,4 +184,4 @@ bool mBitmapCacheCheckRow(struct mBitmapCache* cache, const struct mBitmapCacheE
|
|||
const color_t* mBitmapCacheGetRow(struct mBitmapCache* cache, unsigned y) {
|
||||
color_t* row = &cache->cache[(cache->buffer * mBitmapCacheSystemInfoGetHeight(cache->sysConfig) + y) * mBitmapCacheSystemInfoGetWidth(cache->sysConfig)];
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue