all repos — mgba @ 2dc8f76294779e8d8b1f3c240ea62e978b563a58

mGBA Game Boy Advance Emulator

DS Video: Fix VRAM mapping for invalid states
Vicki Pfau vi@endrift.com
Thu, 16 Feb 2017 02:35:39 -0800
commit

2dc8f76294779e8d8b1f3c240ea62e978b563a58

parent

522b4c129802e8d6d296680ffc91f1667e7b85ed

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/ds/video.csrc/ds/video.c

@@ -259,7 +259,7 @@ void DSVideoConfigureVRAM(struct DSMemory* memory, int index, uint8_t value) {

struct DSVRAMBankInfo info = _vramInfo[index][value & 0x7]; memset(&memory->vramMirror[index], 0, sizeof(memory->vramMirror[index])); memset(&memory->vramMode[index], 0, sizeof(memory->vramMode[index])); - if (!(value & 0x80)) { + if (!(value & 0x80) || !info.mirrorSize) { return; } uint32_t size = _vramSize[index] >> DS_VRAM_OFFSET;