From 91dd493f954ea2c109e18fc0eb647f5cd7d9217f 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-GS/baseline_0000.png | Bin 0 -> 528 bytes .../acceptance/oam_dma/sources-GS/config.ini | 2 -- src/gb/io.c | 2 +- src/gb/memory.c | 4 ++-- 5 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 cinema/gb/mooneye-gb/acceptance/oam_dma/sources-GS/baseline_0000.png delete mode 100644 cinema/gb/mooneye-gb/acceptance/oam_dma/sources-GS/config.ini diff --git a/CHANGES b/CHANGES index 86ea3ef60..006db1256 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ Emulation fixes: - ARM: Fix ALU reading PC after shifting - ARM: Fix STR storing PC after address calculation - GB: Partially fix timing for skipped BIOS + - GB Memory: Fix OAM DMA from top 8 kB - GB MBC: Fix MBC1 mode changing behavior - 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-GS/baseline_0000.png b/cinema/gb/mooneye-gb/acceptance/oam_dma/sources-GS/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 36d083df0..b070ff601 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);