This changes the main IOS code (roughly the equivalent of the kernel)
to a class instead of being a set of free functions + tons of static
variables.
The reason for this change is that keeping tons of static variables
like that prevents us from making an IOS instance and reusing IOS
code easily.
Converting the IOS code to a class also allows us to mostly decouple
IOS from the PPC emulation.
The more interesting changes are in Core/IOS/IOS. Everything else is
mostly just boring stuff required by this change...
* Because the devices themselves call back to the main IOS code
for various things (getting the current version, replying to a
request, and other syscall-like functions), just like processes in
IOS call kernel syscalls, we have to pass a reference to the kernel
to anything that uses IOS syscalls.
* Change DoState to save device names instead of device IDs to simplify
AddDevice() and get rid of an ugly static count.
* Change ES_Launch's ack to be sent at IOS boot, now that we can do
this properly.
This removes the need for multiple texture files to store the mipmap
chain for a texture. As many mipmaps will be loaded as are present in
the DDS file, and any remaining mipmaps will fall back to the old
behavior.
This changes the IOS code to handle ES contexts inside of ES, instead
of leaking out implementation details into the IPC request dispatcher.
The intent is to clarify what's shared between every single ES context,
and what is specific to an ES context. (Not much.) This should reduce
the number of static members in the ES class.
The other changes are there just because we now keep track of the
IPC FD inside of ES.
Future plans:
* After the WAD direct launch hack is dropped, the title context
will be made a class member.
* Have proper function prototypes, instead of having every single one
of them take ioctlv requests. This will allow reusing IOS code in
other parts of the Dolphin codebase without having to construct
ioctlv requests.
Use Bitmap.setPixels() instead of Bitmap.copyPixelsFromBuffer() the former
use non pre-multiplied values of the colors which is what we expect to
come from the native code.