mirror of https://github.com/mgba-emu/mgba.git
DS Video: Fix crash in extmode 1.x with memory unmapped
This commit is contained in:
parent
dcf7a80e88
commit
db16620861
|
@ -752,7 +752,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt1(struct GBAVideoSoftwareRenderer*
|
||||||
|
|
||||||
if (!mosaicWait) {
|
if (!mosaicWait) {
|
||||||
uint32_t address = (localX >> 8) + (localY >> 8) * width;
|
uint32_t address = (localX >> 8) + (localY >> 8) * width;
|
||||||
color = ((uint8_t*)renderer->d.vramBG[address >> 17])[address];
|
uint8_t* vram = (uint8_t*) renderer->d.vramBG[address >> 17];
|
||||||
|
if (UNLIKELY(!vram)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
color = vram[address];
|
||||||
mosaicWait = mosaicH;
|
mosaicWait = mosaicH;
|
||||||
} else {
|
} else {
|
||||||
--mosaicWait;
|
--mosaicWait;
|
||||||
|
@ -804,7 +808,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt2(struct GBAVideoSoftwareRenderer*
|
||||||
|
|
||||||
if (!mosaicWait) {
|
if (!mosaicWait) {
|
||||||
uint32_t address = ((localX >> 8) + (localY >> 8) * width) << 1;
|
uint32_t address = ((localX >> 8) + (localY >> 8) * width) << 1;
|
||||||
LOAD_16(color, address & 0x1FFFE, renderer->d.vramBG[address >> 17]);
|
uint16_t* vram = renderer->d.vramBG[address >> 17];
|
||||||
|
if (UNLIKELY(!vram)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LOAD_16(color, address & 0x1FFFE, vram);
|
||||||
#ifndef COLOR_16_BIT
|
#ifndef COLOR_16_BIT
|
||||||
unsigned color32;
|
unsigned color32;
|
||||||
color32 = 0;
|
color32 = 0;
|
||||||
|
|
Loading…
Reference in New Issue