From 0234cb07b8d64bf0979d17927350db4f07f44d3b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 16 Jun 2020 23:06:32 -0700 Subject: [PATCH] GB Memory: Fix OAM DMA from top 8 kB --- CHANGES | 1 + .../oam_dma/sources-dmgABCmgbS/baseline_0000.png | Bin 0 -> 528 bytes .../oam_dma/sources-dmgABCmgbS/manifest.yml | 1 - src/gb/io.c | 2 +- src/gb/memory.c | 4 ++-- 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/baseline_0000.png delete mode 100644 cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/manifest.yml diff --git a/CHANGES b/CHANGES index 30015cef5..8075b84e7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 0.8.3: (Future) Emulation fixes: + - GB Memory: Fix OAM DMA from top 8 kB - GB MBC: Fix MBC1 RAM enable bit selection - GB MBC: Fix MBC2 bit selection diff --git a/cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/baseline_0000.png b/cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/baseline_0000.png new file mode 100644 index 0000000000000000000000000000000000000000..f9e5e47b50a4d548ddbc988a8e76364d30f505cf GIT binary patch literal 528 zcmeAS@N?(olHy`uVBq!ia0vp^3xIe62NRHFxc>b*0|VoAPZ!6KiaBquU(7mWz~FE( z<;Va1cWgxt&B%VfEU&=!xnok3TT$lH;@jICuivi!&oIyXfkoqEmOfz%KM+GNxySPP z*F*Dd<=5Z6-dB81|M;InsWNlk%!+)xcmemory.io[REG_DMA] = 0xFF; GBIOWrite(gb, REG_BGP, 0xFC); if (gb->model < GB_MODEL_CGB) { GBIOWrite(gb, REG_OBP0, 0xFF); diff --git a/src/gb/memory.c b/src/gb/memory.c index 18ba75a17..a5c047d0f 100644 --- a/src/gb/memory.c +++ b/src/gb/memory.c @@ -519,8 +519,8 @@ uint8_t GBView8(struct SM83Core* cpu, uint16_t address, int segment) { } void GBMemoryDMA(struct GB* gb, uint16_t base) { - if (base > 0xF100) { - return; + if (base >= 0xE000) { + base &= 0xDFFF; } mTimingDeschedule(&gb->timing, &gb->memory.dmaEvent); mTimingSchedule(&gb->timing, &gb->memory.dmaEvent, 8);