all repos — mgba @ e0ee881e5f50770d603324ae6510996a437496f0

mGBA Game Boy Advance Emulator

GBA BIOS: Fix incorrect exit condition in LZ77
Vicki Pfau vi@endrift.com
Thu, 04 Jan 2018 21:42:44 -0800
commit

e0ee881e5f50770d603324ae6510996a437496f0

parent

212d4f5cf3fb04851575f8033c7c12fc319655a0

2 files changed, 5 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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) {