Fixed another timing regression with the CB opcodes

This commit is contained in:
Lior Halphon 2018-03-29 21:06:53 +03:00
parent 96063fb0da
commit e380a00b67
2 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ DoubleBitsAndWriteRow:
WaitFrame:
push hl
ld hl, $FF0F
res 0, [hl]
res 0, [hl]
.wait
bit 0, [hl]
jr z, .wait

View File

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