From b8bc84db4ee05a3873425752c84fb4e8a1ffbf4f Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 15 Apr 2016 01:26:48 +0300 Subject: [PATCH] Corrected read of HDMA5, fixing A Bug's Life --- Core/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/memory.c b/Core/memory.c index 1904d30..57d0568 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -125,7 +125,7 @@ static unsigned char read_high_memory(GB_gameboy_t *gb, unsigned short addr) case GB_IO_SB: return gb->io_registers[addr & 0xFF]; case GB_IO_HDMA5: - return gb->io_registers[GB_IO_HDMA5] | 0x7F; + return (gb->io_registers[GB_IO_HDMA5] & 0x80) | ((gb->hdma_steps_left - 1) & 0x7F); case GB_IO_SVBK: if (!gb->cgb_mode) { return 0xFF;