Super Bonk triggers an HDMA at the top of the screen on scanline 0 and then the HDMA channel stops. This caused the logic to call SyncStartDma & SyncEndDma on every scanline until vblank, even though no HDMA channel is active for the rest of the frame. The lost CPU time caused Super Bonk's demo to desync even earlier than hardware.
* Code: Add auto-formatting rules for C++ projects (clang-format) and enforce code style via "clang-format" and "dotnet format"
* fix ui format warnings
When transfer is larger than 255 bytes, i wraps back to 0, causing _dmaClockCounter to be incremented by the wrong amount. This could cause minor timing issues because the value of _dmaClockCounter is used in SyncEndDma() to determine how many cycles to stall before the CPU resumes its execution.
This appears to make the result of my old timing_test rom give a value that's closer to hardware for the last row ("WRAM DMA 1K+FR")
The alignment done at the end of DMA appears to ignore master clocks spent in DRAM refresh (which is why a separate counter is needed). Unsure if this has been verified on hardware, but this is also what ares does to fix this issue.