GBA BIOS: Fix incorrect exit condition in LZ77
Vicki Pfau vi@endrift.com
Thu, 04 Jan 2018 21:42:44 -0800
2 files changed,
5 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -11,6 +11,7 @@ - GBA Cheats: Fix slide codes not initializing properly
- Qt: Fix locale being set to English on settings save (fixes mgba.io/i/906) - LR35902: Fix watchpoints not reporting new value - GBA Audio: Increase PSG volume (fixes mgba.io/i/932) + - GBA BIOS: Fix incorrect exit condition in LZ77 Misc: - GBA: Improve multiboot image detection - GB MBC: Remove erroneous bank 0 wrapping
M
src/gba/bios.c
→
src/gba/bios.c
@@ -529,8 +529,10 @@ int block = cpu->memory.load8(cpu, source + 1, 0) | (cpu->memory.load8(cpu, source, 0) << 8);
source += 2; disp = dest - (block & 0x0FFF) - 1; bytes = (block >> 12) + 3; - while (bytes-- && remaining) { - --remaining; + while (bytes--) { + if (remaining) { + --remaining; + } if (width == 2) { byte = (int16_t) cpu->memory.load16(cpu, disp & ~1, 0); if (dest & 1) {