From 320aff1d1e5cdf4ab26a56b4114cf7b66a6c0375 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 4 Feb 2022 13:58:44 +0200 Subject: [PATCH] DMA doesn't block GDMA --- Core/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/memory.c b/Core/memory.c index 566b12b..7eab9ca 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -251,7 +251,7 @@ void GB_trigger_oam_bug_read(GB_gameboy_t *gb, uint16_t address) static bool is_addr_in_dma_use(GB_gameboy_t *gb, uint16_t addr) { - if (!GB_is_dma_active(gb) || addr >= 0xfe00) return false; + if (!GB_is_dma_active(gb) || addr >= 0xfe00 || gb->hdma_in_progress) return false; if (gb->dma_current_dest == 0xFF || gb->dma_current_dest == 0x0) return false; // Warm up if (addr >= 0xfe00) return false; if (gb->dma_current_src == addr) return false; // Shortcut for DMA access flow