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 000000000..f9e5e47b5 Binary files /dev/null and b/cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/baseline_0000.png differ diff --git a/cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/manifest.yml b/cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/manifest.yml deleted file mode 100644 index a697ada66..000000000 --- a/cinema/gb/mooneye-gb/acceptance/oam_dma/sources-dmgABCmgbS/manifest.yml +++ /dev/null @@ -1 +0,0 @@ -fail: true diff --git a/src/gb/io.c b/src/gb/io.c index ecfa648a1..32d15c470 100644 --- a/src/gb/io.c +++ b/src/gb/io.c @@ -191,7 +191,7 @@ void GBIOReset(struct GB* gb) { GBIOWrite(gb, REG_SCY, 0x00); GBIOWrite(gb, REG_SCX, 0x00); GBIOWrite(gb, REG_LYC, 0x00); - GBIOWrite(gb, REG_DMA, 0xFF); + gb->memory.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);