DS Video: Fix extended modes 1.x VRAM access

This commit is contained in:
Vicki Pfau 2017-04-07 16:26:26 -07:00
parent 3439eada8c
commit f97983d498
1 changed files with 4 additions and 4 deletions

View File

@ -774,11 +774,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt1(struct GBAVideoSoftwareRenderer*
if (!mosaicWait) {
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)) {
continue;
}
color = vram[address];
color = vram[address & VRAM_BLOCK_MASK];
mosaicWait = mosaicH;
} else {
--mosaicWait;
@ -831,11 +831,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt2(struct GBAVideoSoftwareRenderer*
if (!mosaicWait) {
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)) {
continue;
}
LOAD_16(color, address & 0x1FFFE, vram);
LOAD_16(color, address & VRAM_BLOCK_MASK, vram);
#ifndef COLOR_16_BIT
unsigned color32;
color32 = 0;