DVDInterface: Chunking and various timing accuracy improvements #4829
This is a rebased and cleaned up version of PR #3701.
This PR has two primary improvements: Copying disc data to the emulated RAM in chunks instead of all in one go at the end (fixes various games, including Sonic Riders) and using more accurate timing models that take chunking and seek timing into account (makes loading times closer to consoles but doesn't fix any bugs as far as I know).
All comments on the old PR should be fixed
Bringing two old Reviewable discussions from @JosJuice here:
The drive didn't appear to be smart about optimizing for this. In fact, it was quite dumb in a lot of cases (it would throw away buffers when seeking backward, even if they overlapped). From my experimental data I never saw any evidence that it would wait for a streaming read if it was faster. I think it's safe to assume that this is not the case.
That's correct. I wasn't able to formulate an experiment to determine the seek time separate from the read time, so I just baked that read of one block into this number. We should add a short comment to that effect.
I've added that information to the comment above the definition of CalculateSeekTime.
Splits DVD reads up into smaller chunks so that data is available before the final interrupt is triggered. This better simulates the DMA that happens on a real device, which some games will take advantage of - by either playing back data as it is loading or by using data that is going to be overwritten shortly by an outstanding read.