PSP SCUMMVM port for PSPonPS4

@Devildwarf thanks to your suggestion above I can now build 2.2.0+, much obliged!
I'll update here when I found the version that broke the filesystem navigation.
Nice thats great news, i just built 2.5.0 on it too, had a small issue with libm.a linking on it and with ultima and titanic engines giving me a error but managed to get it compiled eventually. so hopefully you can compile all versions now, and yeah i hope you can find the issue, it would be great if you can compile all versions. (Would be even better if there was a proper scummvm port for ps4 though, the only one that seems to exist is the retroarch core for ps4).
Good luck and if there is anything i can do it help let me know

And the errors on the previous post, the 4 env seems like a libpng issue, but the top one does look like a gcc issue, but i guess it no longer matters since you can compile now :)
 
I
Nice thats great news, i just built 2.5.0 on it too, had a small issue with libm.a linking on it and with ultima and titanic engines giving me a error but managed to get it compiled eventually. so hopefully you can compile all versions now, and yeah i hope you can find the issue, it would be great if you can compile all versions. (Would be even better if there was a proper scummvm port for ps4 though, the only one that seems to exist is the retroarch core for ps4).
Good luck and if there is anything i can do it help let me know

And the errors on the previous post, the 4 env seems like a libpng issue, but the top one does look like a gcc issue, but i guess it no longer matters since you can compile now :)
I'm building 2.5.0 right now, if it fails in the same way as yours I might have some questions, thank you!
 
@Devildwarf I stopped on:
Code:
psp-ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
C:/msys/1.0/home/developer/pspdev/psp/lib\libm.a(lib_a-sf_logarithm.o): In function `logarithmf':
(.text+0x58): undefined reference to `isfinitef'
make: *** [scummvm.elf] Error 1

did you set -std=c99 in the makefile to solve this?
 
@Devildwarf I stopped on:
Code:
psp-ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
C:/msys/1.0/home/developer/pspdev/psp/lib\libm.a(lib_a-sf_logarithm.o): In function `logarithmf':
(.text+0x58): undefined reference to `isfinitef'
make: *** [scummvm.elf] Error 1

did you set -std=c99 in the makefile to solve this?
No i kinda did it a hacky way and changed the function itself (since isfinitef and finitef are the same function i changed the function used to the correct one for this toolchain), but if that works thats also good news, but if you need my edited lib file just say and i can post it. the real way to fix it would be to rebuild the whole thing from source but that would take way too long. Im guessing the guy who made this toolchain rebuild the libs at some point but didnt update the includes (or vise versa)

EDIT:- Here is the modified lib, just replace your libm.a with this one (backup the old one incase)
https://drive.google.com/file/d/1hnpXQK5rFjmiHPadeB6ikjcdS5FP15Lm/view?usp=sharing
 
Last edited:
No i kinda did it a hacky way and changed the function itself (since isfinitef and finitef are the same function i changed the function used to the correct one for this toolchain), but if that works thats also good news, but if you need my edited lib file just say and i can post it. the real way to fix it would be to rebuild the whole thing from source but that would take way too long. Im guessing the guy who made this toolchain rebuild the libs at some point but didnt update the includes (or vise versa)

EDIT:- Here is the modified lib, just replace your libm.a with this one (backup the old one incase)
https://drive.google.com/file/d/1hnpXQK5rFjmiHPadeB6ikjcdS5FP15Lm/view?usp=sharing

I love to have the your modified lib file If you don't mind, that would save us time, the goal is to get us to 2.8.0 anyways :)
 
ah, shoot. I just built 2.5, I think. I used branch 2.5. no issues or errors, built in linux:

GPVirs4
which psp toolchain did you use to compile it ? it could be useful to know, we could maybe setup a VM with the correct toolchain for future use.

EDIT:- Just installed a linux VM and tested the latest Dev build from 2 days ago and it works fine, lets me compile 2.5.0 and does it a lot faster then windows too, so i guess the linux build works better then the mac build (or the docker is outdated ?)
EDIT2:- Also builds titanic and ultima (had issues with these on windows)
 
Last edited:
ah, shoot. I just built 2.5, I think. I used branch 2.5. no issues or errors, built in linux:

GPVirs4


which psp toolchain did you use to compile it ? it could be useful to know, we could maybe setup a VM with the correct toolchain for future use.

I'm not sure exactly. I've had the toolchain on my pc for a while (built ark and infinite with it). btw, are we talking about 2.5 or 2.5.0.0? is there a difference here in the branches?
 
Last edited by a moderator:
@Devildwarf I used the mingw gcc-8.6 you linked earlier and I can now confirm both 2.2.0 and 2.5.0 are booting games on ps4!
I presume my issue is in the diff between 2.5.0 and 2.6.0. Good job!

Some more progress:
* Scummvm-1.3.0: good
* Scummvm-1.9.0: good
* Scummvm-2.0.0: good

* Scummvm-2.2.0: good
* Scummvm-2.5.0: good

* Scummvm-2.6.0: bad (file system locked when browsing files)
* Scummvm-2.7.0: bad (file system locked when browsing files)
* Scummvm-2.8.0: bad (file system locked when browsing files)
 
I'm not sure exactly. I've had the toolchain on my pc for a while (built ark and infinite with it). btw, are we talking about 2.5 or 2.5.0.0? is there a difference here in the branches?

yeah 2.5 and 2.5.0 are the same thing (just sometimes the 0's are not included)

@Devildwarf I used the mingw gcc-8.6 you linked earlier and I can now confirm both 2.2.0 and 2.5.0 are booting games on ps4!
I presume my issue is in the diff between 2.5.0 and 2.6.0. Good job!

Some more progress:
* Scummvm-1.3.0: good
* Scummvm-1.9.0: good
* Scummvm-2.0.0: good

* Scummvm-2.2.0: good
* Scummvm-2.5.0: good

* Scummvm-2.6.0: bad (file system locked when browsing files)
* Scummvm-2.7.0: bad (file system locked when browsing files)
* Scummvm-2.8.0: bad (file system locked when browsing files)

Thats great news, well try compiling 2.6.0 in the same toolchain, it could be a compiler issue so if the 2.6.0 compiled in GCC8 works then its the toolchains fault, if it still system locks then we know its scummvm problem then its time to go through the changes between 2.5.0 and 2.6.0 and see what changed in the psp side.
EDIT:- There is also a 2.5.1 branch so it might be worth compiling that too to see,
 
Last edited:
yeah 2.5 and 2.5.0 are the same thing (just sometimes the 0's are not included)



Thats great news, well try compiling 2.6.0 in the same toolchain, it could be a compiler issue so if the 2.6.0 compiled in GCC8 works then its the toolchains fault, if it still system locks then we know its scummvm problem then its time to go through the changes between 2.5.0 and 2.6.0 and see what changed in the psp side.
EDIT:- There is also a 2.5.1 branch so it might be worth compiling that too to see,

2.5.1 builds OK as well, that's great!
I tried building version 2.6 with the gcc-8 toolchain by bypassing the compiler version check in the config file, unfortunately it then fails on the endianness check. I re-read the release notes for 2.6 and they state it now requires g++11. My newer toolchain is 13+ so maybe if I could find a toolchain with g++-11 or downgrade mine?

EDIT: for now I'm just trying to find commits related to read/write of the filsystem. So far it doesn't seem to be something directly correlated to backend/platform/psp.
 
Last edited:
2.5.1 builds OK as well, that's great!
I tried building version 2.6 with the gcc-8 toolchain by bypassing the compiler version check in the config file, unfortunately it then fails on the endianness check. I re-read the release notes for 2.6 and they state it now requires g++11. My newer toolchain is 13+ so maybe if I could find a toolchain with g++-11 or downgrade mine?

EDIT: for now I'm just trying to find commits related to read/write of the filsystem. So far it doesn't seem to be something directly correlated to backend/platform/psp.
Good well 2.5.1 works is good news, it leaves less code to look through.
You can remove the Endianness check from CONFIGURE file (just delete the full section) then run configure and once configure finishes just add
#define SCUMM_LITTLE_ENDIAN
#undef SCUMM_BIG_ENDIAN
to the config.h where you are building (that is what the check is for, to see which lines to add, and we know already from previous builds we are building in little so do that),
I will have a go at building a GCC9 toolchain in a bit and see if i can make it build, not sure it will but its worth a try to see if i can compile the toolchain, might take a long time on my slow *** PC.

And strange if there was no big changes, that does make me feel it could be the compiler or libaries in the toolchain "could" be the issue.
 
Good well 2.5.1 works is good news, it leaves less code to look through.
You can remove the Endianness check from CONFIGURE file (just delete the full section) then run configure and once configure finishes just add
#define SCUMM_LITTLE_ENDIAN
#undef SCUMM_BIG_ENDIAN
to the config.h where you are building (that is what the check is for, to see which lines to add, and we know already from previous builds we are building in little so do that),
I will have a go at building a GCC9 toolchain in a bit and see if i can make it build, not sure it will but its worth a try to see if i can compile the toolchain, might take a long time on my slow *** PC.

And strange if there was no big changes, that does make me feel it could be the compiler or libaries in the toolchain "could" be the issue.
I think (if I remember correctly) that they incorporated "nullptr" checks instead "0" as a part of the C++11 standard in scummvm-2.6 so that would probably need reverting as well. However, in my "port" mods I've been making changes to the /common/system.cpp (which is not PSP specific) to avoid freezes when writing to the scummvm.ini file, I could be more stuff in there that I should check for.
 
I think (if I remember correctly) that they incorporated "nullptr" checks instead "0" as a part of the C++11 standard in scummvm-2.6 so that would probably need reverting as well. However, in my "port" mods I've been making changes to the /common/system.cpp (which is not PSP specific) to avoid freezes when writing to the scummvm.ini file, I could be more stuff in there that I should check for.
Well if you set
#define NO_CXX11_INITIALIZER_LIST
#define NO_CXX11_NULLPTR_T
into the config.h it should allow it to compile without C++ and fix the nullptr problem (if the configure file doesnt do this for you like it did for me).
But yeah i guess it could be non-psp stuff making it crash, i hadn't considered that, good luck,
Also having trouble building the gcc9 toolkit, giving me error after error, been going all this time and failed over 20 times, each time its a very small issue but still annoying as hell xD but i hope i can fully compile it. (even if its just for archive purposes, its nice to have binary builds of old things)
 
Well if you set
#define NO_CXX11_INITIALIZER_LIST
#define NO_CXX11_NULLPTR_T
into the config.h it should allow it to compile without C++ and fix the nullptr problem (if the configure file doesnt do this for you like it did for me).
But yeah i guess it could be non-psp stuff making it crash, i hadn't considered that, good luck,
Also having trouble building the gcc9 toolkit, giving me error after error, been going all this time and failed over 20 times, each time its a very small issue but still annoying as hell xD but i hope i can fully compile it. (even if its just for archive purposes, its nice to have binary builds of old things)
Awesome, I'm going to test making a build using gcc-8 and your bypass instructions, sometimes I feel you need to have a glutton for punishment :)
 
Do you two need 2.6.0? I just built it on Ubuntu 22.04. I used the latest precompiled psp toolchain, so that I could quickly check if I could build it. It requires glibc 2.34 iirc, so I used 22.04. It built fine. It didn't like the jobs command though, so it took a while. Built, no errors, no needing to change the code. Works fine, but I have no games, only tested if it booted.
 
Awesome, I'm going to test making a build using gcc-8 and your bypass instructions, sometimes I feel you need to have a glutton for punishment :)
i wonder about that too......
on the plus side i finally got it compiled (the gcc9 toolchain), the libraries have compiled but for some reason dont show in the configuration of scummvm causing it to fail massively, i probably messed up somewhere :\ anyway it has the exact same problems as the gcc8 build (fails on C++11 or Endianness check), So i kinda feel i wasted a whole day to compile this steaming pile of poo.... oh well
Good luck on trying to compile on the gcc-8 build, let me know how it goes.
 
Back
Top