GB Memory: Fix OAM DMA from top 8 kB

This commit is contained in:
Vicki Pfau 2020-06-16 23:06:32 -07:00
parent d2f84e625b
commit 0234cb07b8
5 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,6 @@
0.8.3: (Future) 0.8.3: (Future)
Emulation fixes: Emulation fixes:
- GB Memory: Fix OAM DMA from top 8 kB
- GB MBC: Fix MBC1 RAM enable bit selection - GB MBC: Fix MBC1 RAM enable bit selection
- GB MBC: Fix MBC2 bit selection - GB MBC: Fix MBC2 bit selection

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

View File

@ -191,7 +191,7 @@ void GBIOReset(struct GB* gb) {
GBIOWrite(gb, REG_SCY, 0x00); GBIOWrite(gb, REG_SCY, 0x00);
GBIOWrite(gb, REG_SCX, 0x00); GBIOWrite(gb, REG_SCX, 0x00);
GBIOWrite(gb, REG_LYC, 0x00); GBIOWrite(gb, REG_LYC, 0x00);
GBIOWrite(gb, REG_DMA, 0xFF); gb->memory.io[REG_DMA] = 0xFF;
GBIOWrite(gb, REG_BGP, 0xFC); GBIOWrite(gb, REG_BGP, 0xFC);
if (gb->model < GB_MODEL_CGB) { if (gb->model < GB_MODEL_CGB) {
GBIOWrite(gb, REG_OBP0, 0xFF); GBIOWrite(gb, REG_OBP0, 0xFF);

View File

@ -519,8 +519,8 @@ uint8_t GBView8(struct SM83Core* cpu, uint16_t address, int segment) {
} }
void GBMemoryDMA(struct GB* gb, uint16_t base) { void GBMemoryDMA(struct GB* gb, uint16_t base) {
if (base > 0xF100) { if (base >= 0xE000) {
return; base &= 0xDFFF;
} }
mTimingDeschedule(&gb->timing, &gb->memory.dmaEvent); mTimingDeschedule(&gb->timing, &gb->memory.dmaEvent);
mTimingSchedule(&gb->timing, &gb->memory.dmaEvent, 8); mTimingSchedule(&gb->timing, &gb->memory.dmaEvent, 8);