Modular core
Pull Request checklist
Note: these are not necessarily requirements
- [ ] I reformatted the code with clang-format
- [x] I checked to make sure my submission worked
- [x] I am the author of submission or have permission from the original author
- [ ] Requires update of the PS2SDK
- [ ] Requires update of the gsKit
- [ ] Others (please specify below)
Pull Request description
This is my attempt at 'modular core' as discussed here https://github.com/ps2homebrew/Open-PS2-Loader/discussions/553.
I tested cores as zips & dirs, took same amount of time to boot the game so went with zips as suggested.. Using listDir method as suggested.. Defaults to compiled in core (where development will continue).. For BDM & Pademu they are core dependant ie only cores w/ bdm or pademu modules will use said features.. Brought back modes 7 & 8 since older cores used them but they are again core dependant, this was a little more annoying to try handle and I just ended up with the core zip itself needs to have "(EM)" or "(em)" in the name for the modes to become active (mode 8 also requires the module to actually check for the compat flag).. EM meaning "extra modes".. not the best solution but thats what I landed on in the end..
Using this method required small changes to older cores to make them compatible as seen here https://github.com/KrahJohlito/Open-PS2-Loader/commits/093-core
These are the cores I tested with.. 110 bdm I forgot to compile w/o pademu flags and just left the files out to test the method.. these cores are purely for testing/curiosity purposes..
core_110_BDM.zip core_110_BDM_PE.zip core_093(EM).zip
Just opening as Draft in case anyone wants to review/request changes/object/add commits or ignore it entirely is fine also :-)
Are the changes to bdmsupport.c, ethsupport.c, hddsupport.c (and others) intended to load the modules from the selected core? Doesn't this lead to problems when loading usb driver from usb? hdd drivers from hdd? eth drivers from eth?
Yea bdmsupport.c, ethsupport.c, hddsupport.c use the selected core modules for mcemu and cdvdman because the builtins would have different sizes and data.. and the function seems to do "something" via sbprepare() in preparation to launch the game here since this is all happening once the game is selected and then it passes the pointer to module via sysLaunchElfLoader and sendIrxKernelRAM.. tbh I haven't traced the function to see what its actually doing there it just seemed necessary since the files would be different depending on the core.
I tested usb games with cores on usb and eth games with cores over smb and didn't have any problems, I also tested hdd games but cores were on usb cause I didn't bother copying to hdd but I would think it would be fine also.
dropped the two unrelated commits and moved them to a cleanup/refactoring branch
@ps2homebrew Think I’m pretty much done with ps2 so I’ll open this up. If y’all want it take it, if not don’t I’m not fussed.
I don’t have the means to update my fork/resolve conflicts as I have no access to a pc but if someone was able to add me to about page that would be nice since I think I’ve earned a spot there.. but if no one can be bothered that’s fine too I’m not bothered anymore.
Best Regards, Kevin
I'll probably fix this up myself in a few months
I don't know if this PR is still active but I'd like to add a suggestion: Since we already have the LZ4 decompression routine available from the ZSO code, perhaps we should remove libunzip and use LZ4 instead, it's much faster and lighter on memory and we avoid redundancy of libraries that do the same thing.