From 2d7b1099a92a585dbe51026f2df36de00d7144df Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 21 Feb 2017 22:14:36 -0800 Subject: [PATCH] DS Video: Fix palette and OAM boundaries --- src/ds/renderers/software.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ds/renderers/software.c b/src/ds/renderers/software.c index 4e01c64b8..8ffb45315 100644 --- a/src/ds/renderers/software.c +++ b/src/ds/renderers/software.c @@ -120,19 +120,19 @@ static uint16_t DSVideoSoftwareRendererWriteVideoRegister(struct DSVideoRenderer static void DSVideoSoftwareRendererWritePalette(struct DSVideoRenderer* renderer, uint32_t address, uint16_t value) { struct DSVideoSoftwareRenderer* softwareRenderer = (struct DSVideoSoftwareRenderer*) renderer; - if (address < 0x200) { - softwareRenderer->engA.d.writePalette(&softwareRenderer->engA.d, address & 0x1FF, value); + if (address < 0x400) { + softwareRenderer->engA.d.writePalette(&softwareRenderer->engA.d, address & 0x3FF, value); } else { - softwareRenderer->engB.d.writePalette(&softwareRenderer->engB.d, address & 0x1FF, value); + softwareRenderer->engB.d.writePalette(&softwareRenderer->engB.d, address & 0x3FF, value); } } static void DSVideoSoftwareRendererWriteOAM(struct DSVideoRenderer* renderer, uint32_t oam) { struct DSVideoSoftwareRenderer* softwareRenderer = (struct DSVideoSoftwareRenderer*) renderer; - if (oam < 0x100) { - softwareRenderer->engA.d.writeOAM(&softwareRenderer->engA.d, oam & 0xFF); + if (oam < 0x200) { + softwareRenderer->engA.d.writeOAM(&softwareRenderer->engA.d, oam & 0x1FF); } else { - softwareRenderer->engB.d.writeOAM(&softwareRenderer->engB.d, oam & 0xFF); + softwareRenderer->engB.d.writeOAM(&softwareRenderer->engB.d, oam & 0x1FF); } }