GBA BIOS: Fix incorrect exit condition in LZ77

This commit is contained in:
Vicki Pfau 2018-01-04 21:42:44 -08:00
parent 212d4f5cf3
commit e0ee881e5f
2 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,7 @@ Bugfixes:
- Qt: Fix locale being set to English on settings save (fixes mgba.io/i/906) - Qt: Fix locale being set to English on settings save (fixes mgba.io/i/906)
- LR35902: Fix watchpoints not reporting new value - LR35902: Fix watchpoints not reporting new value
- GBA Audio: Increase PSG volume (fixes mgba.io/i/932) - GBA Audio: Increase PSG volume (fixes mgba.io/i/932)
- GBA BIOS: Fix incorrect exit condition in LZ77
Misc: Misc:
- GBA: Improve multiboot image detection - GBA: Improve multiboot image detection
- GB MBC: Remove erroneous bank 0 wrapping - GB MBC: Remove erroneous bank 0 wrapping

View File

@ -529,8 +529,10 @@ static void _unLz77(struct GBA* gba, int width) {
source += 2; source += 2;
disp = dest - (block & 0x0FFF) - 1; disp = dest - (block & 0x0FFF) - 1;
bytes = (block >> 12) + 3; bytes = (block >> 12) + 3;
while (bytes-- && remaining) { while (bytes--) {
--remaining; if (remaining) {
--remaining;
}
if (width == 2) { if (width == 2) {
byte = (int16_t) cpu->memory.load16(cpu, disp & ~1, 0); byte = (int16_t) cpu->memory.load16(cpu, disp & ~1, 0);
if (dest & 1) { if (dest & 1) {