diff --git a/BootROMs/dmg_boot.asm b/BootROMs/dmg_boot.asm index d4176a87..46b389a9 100644 --- a/BootROMs/dmg_boot.asm +++ b/BootROMs/dmg_boot.asm @@ -125,7 +125,7 @@ DoubleBitsAndWriteRow: WaitFrame: push hl ld hl, $FF0F - res 0, [hl] + res 0, [hl] .wait bit 0, [hl] jr z, .wait diff --git a/Core/z80_cpu.c b/Core/z80_cpu.c index 2b319abc..b8b5f639 100644 --- a/Core/z80_cpu.c +++ b/Core/z80_cpu.c @@ -1272,7 +1272,7 @@ static void bit_r(GB_gameboy_t *gb, uint8_t opcode) uint8_t value; uint8_t bit; GB_advance_cycles(gb, 4); - value = get_src_value(gb, opcode, 3); + value = get_src_value(gb, opcode, (opcode & 0xC0) == 0x40? 4 : 3); bit = 1 << ((opcode >> 3) & 7); if ((opcode & 0xC0) == 0x40) { /* Bit */ gb->registers[GB_REGISTER_AF] &= 0xFF00 | GB_CARRY_FLAG;