diff --git a/Core/display.c b/Core/display.c index de84999..1b90ddb 100644 --- a/Core/display.c +++ b/Core/display.c @@ -1613,6 +1613,7 @@ void GB_display_run(GB_gameboy_t *gb, unsigned cycles, bool force) if (unlikely(GB_is_dma_active(gb))) { unsigned offset = cycles - gb->display_cycles; // Time passed in 8MHz ticks + cycles = gb->display_cycles; if (offset) { if (!gb->cgb_double_speed) { offset >>= 1; // Convert to T-cycles diff --git a/Core/memory.c b/Core/memory.c index 8409490..572eae3 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -292,7 +292,11 @@ static uint8_t read_mbc_rom(GB_gameboy_t *gb, uint16_t addr) static uint8_t read_vram(GB_gameboy_t *gb, uint16_t addr) { - GB_display_sync(gb); + if (!GB_is_dma_active(gb)) { + /* Prevent syncing from a DMA read. Batching doesn't happen during DMA anyway. */ + GB_display_sync(gb); + } + if (unlikely(gb->vram_read_blocked)) { return 0xFF; }