mirror of https://github.com/mgba-emu/mgba.git
DS Video: Fix extended modes 1.x VRAM access
This commit is contained in:
parent
3439eada8c
commit
f97983d498
|
@ -774,11 +774,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt1(struct GBAVideoSoftwareRenderer*
|
||||||
|
|
||||||
if (!mosaicWait) {
|
if (!mosaicWait) {
|
||||||
uint32_t address = (localX >> 8) + (localY >> 8) * width + screenBase;
|
uint32_t address = (localX >> 8) + (localY >> 8) * width + screenBase;
|
||||||
uint8_t* vram = (uint8_t*) renderer->d.vramBG[address >> 17];
|
uint8_t* vram = (uint8_t*) renderer->d.vramBG[address >> VRAM_BLOCK_OFFSET];
|
||||||
if (UNLIKELY(!vram)) {
|
if (UNLIKELY(!vram)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
color = vram[address];
|
color = vram[address & VRAM_BLOCK_MASK];
|
||||||
mosaicWait = mosaicH;
|
mosaicWait = mosaicH;
|
||||||
} else {
|
} else {
|
||||||
--mosaicWait;
|
--mosaicWait;
|
||||||
|
@ -831,11 +831,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt2(struct GBAVideoSoftwareRenderer*
|
||||||
|
|
||||||
if (!mosaicWait) {
|
if (!mosaicWait) {
|
||||||
uint32_t address = ((localX >> 8) + (localY >> 8) * width + screenBase) << 1;
|
uint32_t address = ((localX >> 8) + (localY >> 8) * width + screenBase) << 1;
|
||||||
uint16_t* vram = renderer->d.vramBG[address >> 17];
|
uint16_t* vram = renderer->d.vramBG[address >> VRAM_BLOCK_OFFSET];
|
||||||
if (UNLIKELY(!vram)) {
|
if (UNLIKELY(!vram)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LOAD_16(color, address & 0x1FFFE, vram);
|
LOAD_16(color, address & VRAM_BLOCK_MASK, vram);
|
||||||
#ifndef COLOR_16_BIT
|
#ifndef COLOR_16_BIT
|
||||||
unsigned color32;
|
unsigned color32;
|
||||||
color32 = 0;
|
color32 = 0;
|
||||||
|
|
Loading…
Reference in New Issue