mirror of https://github.com/mgba-emu/mgba.git
Core: Return null for out of bounds cached tile VRAM querying
This commit is contained in:
parent
f4c657c537
commit
1002dfd0db
1
CHANGES
1
CHANGES
|
@ -95,6 +95,7 @@ Emulation fixes:
|
|||
Other fixes:
|
||||
- 3DS: Fix screen darkening (fixes mgba.io/i/1562)
|
||||
- Core: Fix uninitialized memory issues with graphics caches
|
||||
- Core: Return null for out of bounds cached tile VRAM querying
|
||||
- Vita: Fix analog controls (fixes mgba.io/i/1554)
|
||||
- Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574)
|
||||
- Qt: Fix scrollbar arrows in memory view (fixes mgba.io/i/1558)
|
||||
|
|
|
@ -281,5 +281,9 @@ const color_t* mTileCacheGetPalette(struct mTileCache* cache, unsigned paletteId
|
|||
}
|
||||
|
||||
const uint16_t* mTileCacheGetVRAM(struct mTileCache* cache, unsigned tileId) {
|
||||
unsigned tiles = mTileCacheSystemInfoGetMaxTiles(cache->sysConfig);
|
||||
if (tileId >= tiles) {
|
||||
return NULL;
|
||||
}
|
||||
return &cache->vram[tileId << (cache->bpp + 2)];
|
||||
}
|
||||
|
|
|
@ -66,6 +66,9 @@ void AssetView::showEvent(QShowEvent*) {
|
|||
}
|
||||
|
||||
void AssetView::compositeTile(const void* tBuffer, void* buffer, size_t stride, size_t x, size_t y, int depth) {
|
||||
if (!tBuffer) {
|
||||
return;
|
||||
}
|
||||
const uint8_t* tile = static_cast<const uint8_t*>(tBuffer);
|
||||
uint8_t* pixels = static_cast<uint8_t*>(buffer);
|
||||
size_t base = stride * y + x;
|
||||
|
|
Loading…
Reference in New Issue