I decided to fix IOP rebooting when working on the new init code. Now, each EE-side RPC library as well as EE-side IOP related libraries can reset themselves if the IOP is reset and I think I've fixed any resource leaks that may have occurred. I haven't added support for IOPRP images as of yet since I haven't really had a need to use them. And I still need to test the poweroff code for IOP reboots.
It simplifies IOP rebooting down to 3 different methods.
Code:
SifIopReset("rom0:UDNL rom0:EELOADCNF",0);
while(!SifIopSync());
SifInitRpc(0);
FlushCache(0);
FlushCache(2);
Code:
// Same as first two lines above
SifResetIop();
SifInitRpc(0);
FlushCache(0);
FlushCache(2);
Code:
// Same as the first two examples
SifIopReboot("rom0:EELOADCNF");
My code worked after a thousand IOP reboots, so I think it's fine. This should allow me to swap modules pretty easily in the case that I want to make custom modules for offloading work to the IOP, in the future.
Current status:
The init code is almost done. Need to work on the gameplay loop, and finish up the rest of the menu code.