From a20117ec1434c54a8cda6efaa488b60f0e43b9f2 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 13 Oct 2013 12:14:16 -0700 Subject: [PATCH] Fix Huffman destinations --- src/gba/gba-bios.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gba/gba-bios.c b/src/gba/gba-bios.c index 55eedd2a7..ecff719a5 100644 --- a/src/gba/gba-bios.c +++ b/src/gba/gba-bios.c @@ -263,13 +263,13 @@ void GBASwi16(struct ARMBoard* board, int immediate) { case 0x13: switch (gba->cpu.gprs[1] >> BASE_OFFSET) { case REGION_WORKING_RAM: - _unHuffman(&gba->memory, gba->cpu.gprs[0], &((uint32_t*) gba->memory.wram)[(gba->cpu.gprs[1] & (SIZE_WORKING_RAM - 3))]); + _unHuffman(&gba->memory, gba->cpu.gprs[0], &((uint32_t*) gba->memory.wram)[(gba->cpu.gprs[1] & (SIZE_WORKING_RAM - 3)) >> 2]); break; case REGION_WORKING_IRAM: - _unHuffman(&gba->memory, gba->cpu.gprs[0], &((uint32_t*) gba->memory.iwram)[(gba->cpu.gprs[1] & (SIZE_WORKING_IRAM - 3))]); + _unHuffman(&gba->memory, gba->cpu.gprs[0], &((uint32_t*) gba->memory.iwram)[(gba->cpu.gprs[1] & (SIZE_WORKING_IRAM - 3)) >> 2]); break; case REGION_VRAM: - _unHuffman(&gba->memory, gba->cpu.gprs[0], &((uint32_t*) gba->video.renderer->vram)[(gba->cpu.gprs[1] & 0x0001FFFC)]); + _unHuffman(&gba->memory, gba->cpu.gprs[0], &((uint32_t*) gba->video.renderer->vram)[(gba->cpu.gprs[1] & 0x0001FFFC) >> 2]); break; default: GBALog(gba, GBA_LOG_WARN, "Bad Huffman destination");