devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

PSP port

Open stefanmielke opened this issue 3 years ago • 2 comments

Draft PR for PSP support.

Got so far as to build and create the EBOOT. But it generates a corrupted file that can't be executed (crashes on real PSP, works fine on PPSSPP).

Also tested Linux build to see if any changes would affect it. Would be nice to review those, as I had to remove "std::to_string" support for it to build.

  • [ ] Fix crash on real PSP (see https://github.com/diasurgical/devilutionX/pull/1918#issuecomment-840744702)
  • [ ] Fix audio support (halts when loading into town)
  • [x] https://github.com/pspdev/newlib/issues/1, https://github.com/pspdev/newlib/issues/2, and https://github.com/pspdev/psptoolchain/issues/108 solved ?
  • [x] Changes to PSP.cmake merged (https://github.com/pspdev/psplibraries/pull/78)
  • [ ] Needs a fix for https://github.com/pspdev/psplibraries/issues/37 if we want video support

stefanmielke avatar May 09 '21 17:05 stefanmielke

@AJenbo @glebm still haven't gotten any more progress than being able to run on PPSSPP.

On real hardware it crashes on StormLib/SBaseCommon.h:459 on method DecryptMpqBlock when it tries to access DataBlock[i] after the first time it goes in the method (when pvDataBlock has been 'added' with the first move on the method that calls this one). Everything seems to work if I force fail this method (the menu loads without any assets, but I'm able to go ingame and it generates the save file as expected, or exit the game).

We still have the issues @glebm linked on PSPSDK end (https://github.com/pspdev/newlib/issues/1 and https://github.com/pspdev/newlib/issues/2). For now I redirected snprintf to sprintf and vsnprintf to vsprintf without major issues, but even copying the whole code for those 2 methods didn't change anything.

Also tried to use the PSPSDK sceIo* methods on Stormlib, but unfortunately sceIoRead is not returning the correct bytes read (and probably reading more than it should).

I'm adding a list of things missing from this port as a checklist on the original PR comment to keep track.

stefanmielke avatar May 13 '21 18:05 stefanmielke

@stefanmielke both StormLib, snprintf, and vsnprintf have been removed as dependencies so this should probably workout much better if rebased :)

AJenbo avatar Jul 02 '22 02:07 AJenbo

Things are now in a much better state so I did a fresh draft for this :) https://github.com/diasurgical/devilutionX/pull/5869

I have tested the game in the PPSSPP emulator but it still need to be test it on hardware.

AJenbo avatar Mar 10 '23 01:03 AJenbo