Corrected read of HDMA5, fixing A Bug's Life

This commit is contained in:
Lior Halphon 2016-04-15 01:26:48 +03:00
parent 4a05c4243d
commit b8bc84db4e

View File

@ -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;