Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gba: fix timing of initial DMA wait cycles (ares-emulator#1461)
DMAs on the GBA wait for two cycles before taking control of the bus. While ares implements this behaviour, ticking these cycles before running DMAs causes the DMA to run early in ares when the current call to `CPU::step()` runs for a number of cycles equal to or greater than the number of DMA wait cycles left. This PR addresses the issue by ticking DMA wait cycles after running all DMAs that are currently ready, fixing several timing test cases in the mGBA test suite, and improving timings in the [Hades DMA start delay tests](https://github.com/hades-emu/Hades-Tests/blob/master/source/dma-start-delay.c).
- Loading branch information