plastic
plastic copied to clipboard
Improve emulation accuracy
Currently, the emulation is done like this:
- clock APU (audio)
- clock CPU:
- if its time to execute instruction, execute it and store how many cycles we should wait
- if we are still waiting, don't do anything and decrement the wait counter (this is the issue here, as we are grouping several cycles into one and faking accurate cycle emulation
- clock PPU (picture) 3 times (since its running 3 times cpu speed, it should not run like that and should be executed while cpu is executing
There are some tests to cover accurate emulation.
I have already done that in mizu, it has much more accurate emulation than this and the methods there could be applied here.