Make GB_serial_set_data_bit a bit more thread safe

This commit is contained in:
Lior Halphon
2024-11-24 20:58:12 +02:00
parent b4fc2ff7ba
commit 27a064caff

View File

@@ -1365,8 +1365,8 @@ void GB_serial_set_data_bit(GB_gameboy_t *gb, bool data)
gb->io_registers[GB_IO_SB] |= data;
gb->serial_count++;
if (gb->serial_count == 8) {
gb->io_registers[GB_IO_IF] |= 8;
gb->io_registers[GB_IO_SC] &= ~0x80;
gb->io_registers[GB_IO_IF] |= 8;
gb->serial_count = 0;
}
}