Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboot IOP on startup if not debugging #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

israpps
Copy link

@israpps israpps commented Aug 18, 2023

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 israpps requested a review from bucanero as a code owner August 18, 2023 15:16
@israpps
Copy link
Author

israpps commented Aug 18, 2023

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
Copy link
Owner

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants