bucanero / apollo-ps2

Apollo Save Tool (PS2)
http://www.bucanero.com.ar
GNU General Public License v3.0
55 stars 2 forks source link

Reboot IOP on startup if not debugging #8

Open israpps opened 1 year ago

israpps commented 1 year ago

This cleanups the IOP (aka: PS1 CPU) memory of all the resident modules loaded when apollo ELF was launched.

Allowing apollo to load its own IRX modules without conflicts Example:

previous program loaded MCMAN, but apollo loads XMCMAN, this results in an error because XMCMAN will unload from IOP when it finds out another MCMAN is already running and the RPC server will halt when binding to an incompatible MCMAN

israpps commented 1 year ago

I also wanted to make a PR to replace the usage of rom0:XSIO2MAN and others for homebrew ones. ensuring apollo works on all PS2s and it doest corrupts any mc

But I've never used CMake for such a large thing. not even sure how to embed the IRXes yet lol.

Also, i'm concerned for the lack of references to PADMAN. maybe SDL is providing it?

bucanero commented 1 year ago

hi @israpps , thanks for the PR 👍

I'm out of town so I'll check it when I'm back, but meanwhile I can share some comments about your questions

apollo-ps2 release is actually loading rom0:SIO2MAN but I forgot to commit the change. I also removed loading XMCMAN and XMCSERV code because it seems with the SDL2 library a lot of drivers are loaded automatically with ps2_drivers library. So actually MCMAN and MCSERV from ps2_drivers are already loaded when apollo main(...) code starts.

My intention was to stick with MCMAN because from some docs and references, they say with MCMAN you can have raw access to memcard data blocks, but you can't do that with the XMC version. (in a future release I'd like to support full raw memory card backups) But again, I couldn't test that raw access because for some reason when I try to do mcInit(MC_TYPE_MC) the system halts, so for now that needs to wait.

About PADMAN and others, a bunch of IRX drivers are auto-loaded by SDL2 library port. Check the ps2_drivers repository if you want to get a better idea of what they're doing.

About CMake and IRX, check out my code and see how I'm adding and loading the ahx.irx module to handle the background music player. The CMakeLists.txt adds the binary object and then I load it with SifExecModuleBuffer()