From 6b250448d5cd4f7b2c19cb7901f506e606aa85d4 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 15 Jan 2015 01:35:02 -0800 Subject: [PATCH] GBA BIOS: Fix HuffUnComp boundary conditions Conflicts: CHANGES src/gba/gba-bios.c --- CHANGES | 1 + src/gba/gba-bios.c | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 158a184d8..400b22302 100644 --- a/CHANGES +++ b/CHANGES @@ -32,6 +32,7 @@ Bugfixes: - GBA BIOS: Fix GetBiosChecksum to return the value of a real GBA, regardless of used BIOS - GBA Memory: Properly bounds-check VRAM accesses - GBA Memory: Fix initial DMA state + - GBA BIOS: Fix HuffUnComp boundary conditions Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it diff --git a/src/gba/gba-bios.c b/src/gba/gba-bios.c index 6a9855e04..6cca7b4d1 100644 --- a/src/gba/gba-bios.c +++ b/src/gba/gba-bios.c @@ -322,8 +322,6 @@ static void _unHuffman(struct GBA* gba, uint32_t source, uint32_t dest) { GBALog(gba, GBA_LOG_STUB, "Unimplemented unaligned Huffman"); return; } - int padding = (4 - remaining) & 0x3; - remaining &= 0xFFFFFFFC; // We assume the signature byte (0x20) is correct int treesize = (cpu->memory.loadU8(cpu, source + 4, 0) << 1) + 1; int block = 0; @@ -373,10 +371,6 @@ static void _unHuffman(struct GBA* gba, uint32_t source, uint32_t dest) { block = 0; } } - - } - if (padding) { - cpu->memory.store32(cpu, dPointer, block, 0); } }