Skip to content
Snippets Groups Projects
Verified Commit 7a7d16b4 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

fix: issue with the DMA transfer on DMG

parent 36585648
No related branches found
No related tags found
1 merge request!31System state save
Pipeline #3224 failed
......@@ -244,8 +244,14 @@ impl Mmu {
}
// @TODO: Implement DMA transfer in a better way
let data = self.read_many(self.dma.source(), self.dma.length());
self.write_many(self.dma.destination(), &data);
// only runs the DMA transfer if the system is in CGB mode
// this avoid issues when writing to DMG unmapped registers
// that would otherwise cause the system to crash
if self.mode == GameBoyMode::Cgb {
let data = self.read_many(self.dma.source(), self.dma.length());
self.write_many(self.dma.destination(), &data);
}
self.dma.set_active(false);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment