From de95e6f6fc3e748d4b27f543bf9899bd32320452 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 9 Apr 2016 15:00:29 +0300 Subject: [PATCH] Fixed incorrect DMA validity check, fixing The Smurfs 3 --- Core/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/memory.c b/Core/memory.c index 981bf7e..1904d30 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -396,11 +396,12 @@ static void write_high_memory(GB_gameboy_t *gb, unsigned short addr, unsigned ch return; case GB_IO_DMA: - if (value <= 0xD0) { + if (value <= 0xF1) { /* According to Pan Docs */ for (unsigned char i = 0xA0; i--;) { gb->oam[i] = read_memory(gb, (value << 8) + i); } } + /* else { what? } */ /* Todo: measure this value */ gb->dma_cycles = 640; return;