hrydgard/ppsspp — pull request #1841 by unknownbrackets (2013-05-19 03:39:44+00:00)
Title: Implement sceKernelExtendThreadStack() + some minor + report unimpl

A lot of the other changes were minor, so I bundled them together.

Please accept hrydgard/pspautotests#74 first.

I'd like feedback on the way I've implemented sceKernelExtendThreadStack(). Basically, instead of using the mipscall stuff, I just pushed things onto the thread's stack itself, and set an RA to one of the kernel FakeSyscalls.

I think this may be a better way, because it makes it much simpler to handle recursion (you can run a func on a new stack from inside a new stack, per tests) and it has almost no chance of incorrectly interacting with waits. It could probably use some helpers, though..

Similarly, async IO seems to run on a thread with priority. I'm thinking of actually allocating code space and writing mips code to call a "continue async IO" function, which I'm planning to have basically manage the *actual* background async queue thread. This way it can have a normal thread priority and should work easily. Using MipsCalls seems actually much harder...

Anyhow, the other things included are:
* A completely unrelated NULL check in scePsmfPlayerGetAudioData(), since I saw a game call it.
* sceKernelRefer{EventFlag,Sema}Status fix to check size properly.
* Don't report unsupported options for sema, mutex, and lwmutex when size == 0.
* Report unimplemented functions. I think it's time, I want to see if anything is calling functions we don't have.

-[Unknown]