WidescreenFixesPack icon indicating copy to clipboard operation
WidescreenFixesPack copied to clipboard

[PSP] code improvements

Open xan1242 opened this issue 2 years ago • 3 comments
trafficstars

Since I made PSPModBase recently, I saw a few more areas that could be improved.

Namely, the entire module_start function could be reduced with sceKernelFindModuleByName instead of looping through the currently loaded modules. This way it'd be safer and more robust.

Unfortunately, as it would seem, that function on PPSSPP returns a pointer to SceModule that is 4 bytes off compared to real hardware. I've opened an issue on the PPSSPP repo here: https://github.com/hrydgard/ppsspp/issues/17894

If that gets fixed, then I'll just rewrite that portion as-is. If not, I'll compensate for it by adding 4 bytes and it should work fine.

Also, on a related note, maybe I could get some of this up and running on real PSP hardware. I'll see if I'll have the time to do this. Some of the code relies on userspace code, but the core injection functionality works in kernel mode just fine, so some smaller portions could be made to work hassle-free.

For userspace stuff a bootstrapper would be needed to load on real hardware to work (just like I did in PSPModBase). I could write some sort of an "ASI loader" alternative if I decide to go through with it.

xan1242 avatar Aug 13 '23 06:08 xan1242

Oh, btw, I just remembered that @ermaccer and I couldn't make c++ plugins to load for some reason, is that something you can test/look into? At some point I'd rather have psp code be C++, if that's possible.

ThirteenAG avatar Aug 13 '23 07:08 ThirteenAG

I think it's possible, the toolchain comes with a C++ compiler too.

If not, there's also Rust. Yes, Rust is on PSP as well.

xan1242 avatar Aug 13 '23 07:08 xan1242

I can't remember what the issue was, but I think I tried to use cpp and that didn't go far. If you could check that out and confirm that it's working, I'll try to move existing plugins to cpp some time later.

ThirteenAG avatar Aug 13 '23 07:08 ThirteenAG