hrydgard/ppsspp — pull request #2701 by unknownbrackets (2013-07-08 04:41:10+00:00)
Title: Intial VTimer fixes

I have more tests to write, but these changes look pretty relevant, and I think they are responsible for the delay in sound for Monster Hunter.

A few notes:
* The "common" parameter is not changed when setting the handler to NULL. Could matter if it does NULL, NULL.
* The return value of the handler is *not* offset by the previous schedule, e.g. if the schedule was 400 and it returns 100, it runs in another 100us, not in 500us.
* There's no good reason to delay by an arbitrary 372us, which is going to depend on a bunch of things. Will have to adjust test (tests that have to do with timing and cycles are annoying since our cycles are not 100% accurate.)
* The handler definitely does run even with a schedule of 0.

-[Unknown]