hrydgard/ppsspp — pull request #211 by unknownbrackets (2012-12-21 08:46:08+00:00)
Title: Basic alarm functionality and related fixes

Alarms aren't quite buttoned up, but they work generally well, and this includes a few related fixes which are worth knowing about:

* `hleAfterSyscall` now has a flag for running interrupts (so the HLE call returns the correct value.)
* Vblank interrupts are now called only while interrupts are enabled (verified by test.)
* I wasn't sure whether the sceGe / display list interrupts should run while suspended so added TODOs.
* `CoreTiming::ScheduleEvent()` now considers `downcount`, which seems to make the time it fires more accurate.
* The interrupt class was made more public some alarms can subclass and handle the args and return value right.

Also updates tests, so please accept hrydgard/pspautotests#28 first.

I learned some interesting things while testing this:

* Both my PSP-2000 and PSP-3000, while running psplink, fire some interrupt pretty frequently (more frequently than vblank, so maybe usb or something?), which made testing this more confusing at first.
* Even while interrupts are suspended, rescheduling sometimes happens - e.g. using `sceKernelDelayThread()` (I suspect it just doesn't reschedule unless the current thread goes into a waiting state...)
* A simple spin loop seems to take MUCH longer on hardware than PPSSPP, but I think this is because of that weird interrupt that keeps running.

-[Unknown]