A summary of my work so far on ScummVM:
- After a bit more hassle than expected (which involved things like changing some toolchain installation scripts to use older svn revisions), I got the necessary toolchains/libraries to successfully cross-compile ScummVM for the PS2, DS, and GP2x-Wiz.
- I copied the psp-provider, elf32.h, and psploader code into the ps2 backend and began tweaking them for the PS2.
- The simplest of these “tweaks” was just changing references to “PSP” to “PS2” 🙂
- Tweaks so far also included removing psp-specific things from the ps2 loader (like code that I believe was there to ensure the psp didn’t suspend during a load) and in some cases replacing calls to code in the psp toolchain with calls to code in the ps2 toolchain (also being sure to replace “includes” that reference psp toolchain files with “includes” that reference ps2 toolchain files).
- I got the default ps2 cross-compiler ld linker script using ee-ld –verbose and tweaked it in a similar fashion to the way the default psp linker was tweaked for the psp plugins (Yotam provided the default psp linker) to generate plugin.ld (for linking together game engine plugins) and main_prog.ld (for linking together the main engine).
- I tested main_prog.ld with static plugins and found that ScummVM didn’t launch on the PS2 using the modified default ps2 linker. I saw in the PS2 Makefile that the default linker was switched out using -T with a “linkfile” in the PS2 toolchain. I remade main_prog.ld and plugin.ld by modifying this instead and it successfully launched again.
- I modified the main (in systemps2.cpp) to check if Dynamic Modules are enabled and, if so, to call PluginManager::instance().addPluginProvider(new PS2PluginProvider()).
- I have spent much of my time making tweaks to Makefile.ps2 (i.e. learning how different compiler flags/Defines affect the building, adding plugin variables, directing that the linker use my linker scripts, ensuring that the ps2loader is compiled and linked, etc.)
- I was getting linker errors concerning the GP-relative data section being over-filled when I enabled Dynamic Modules. I don’t see a good reason why this is the case but for now I have used -G0 flags in the Makefile to direct the cross-compiler not to put anything in the GP-relative section.
At this point, compiling with Dynamic Modules turned off works as well as always, so at least my modifications haven’t broken anything! :-). With Dynamic Modules turned on, yesterday morning ScummVM booted and let you specify a “Plugins Path” in the options, but failed to find engines for any of the games even though the plugins for those engines were linked. After making some modifications to the makefile and fixing some typos in the loader yesterday, ScummVM won’t even boot anymore with Dynamic Modules turned on (might be a simple typo or something more sinister). In light of this, I’m planning to modify my schedule a bit after discussing it with my mentor, but progress is being made!
Note: I’ve made a number of modifications since my last commit but am holding off on committing code until ScummVM is at least launching again on the PS2.