Contributing to PKGi PS3
We welcome pull requests for bug fixes, architectural improvements, new features, and localizations! This document outlines how to set up your environment, debug the application, and submit contributions.
Setting up the Build Environment
To compile the PlayStation 3 executable (.self) and package (.pkg) locally, you must utilize the PS3 homebrew toolchain.
Required Dependencies
You must have the following installed and exported in your environment:
- PS3 toolchain (ps3dev)
- PSL1GHT SDK
- Libraries: Tiny3D, YA2D, PolarSSL (v1.3.9), libcurl (v7.64.1), MikMod, Mini18n, dbglogger.
Building Locally
If your host machine is fully configured (with $PSL1GHT and $PS3DEV paths exported):
- Run
maketo compile the source code intopkgi-ps3.elfand subsequently wrap it intopkgi-ps3.self. - Run
make pkgto package the executable,sfo.xml, and assets into an installablepkgi-ps3.pkgfile. - Run
make runto immediately push the executable to the console via PS3LoadX (requiresPS3LOAD=tcp:x.x.x.xenvironment variable).
Building with Docker (Recommended)
Configuring the PSL1GHT toolchain natively can be prone to dependency conflicts. The easiest and most reproducible way to build the project is via the included Dockerfile.
- Ensure you have Docker installed and running on your system.
- Execute the following command from the root of the repository:
make -f Makefile.docker docker-pkg
What this does:
- Builds an Ubuntu 22.04 base image.
- Injects the pre-compiled PSL1GHT SDK via
curl. - Clones and compiles the required
ya2d_ps3andmini18ndependencies. - Mounts your current working directory and executes the
make pkgcommand. - Outputs the resulting
pkgi-ps3.pkgdirectly into your host directory.
Debugging
Standard printf statements do not output to a visible console on the PS3. To debug the application, you must utilize network logging.
-
Build the application with the debug flag appended:
make DEBUGLOG=1 -
This enables the
dbgloggerlibrary, converting allLOG()macros in the C code to network packets. - Run the resulting debug
.pkgon your PS3. - On your PC (connected to the same local network), use
socatto listen to the UDP multicast address:
socat udp4-recv:30000,ip-add-membership=239.255.0.100:0.0.0.0 -
You will see a live stream of extensive internal state logs, memory allocations, and network trace errors.
Translating (Localization)
PKGi PS3 utilizes the standard gettext .po (Portable Object) format for dynamic localization via the mini18n library.
To add a new language or fix an existing translation:
- Navigate to
pkgfiles/USRDIR/LANG/. - Copy the
translate.potemplate and rename it to your target language code (e.g.,sv.pofor Swedish). - Open the file in a tool like Poedit, or any standard text editor.
-
Edit the
msgstrfields to correspond with themsgidstrings. Example:#: pkgi.c:82 msgid "Installing" msgstr "Instalando" -
Submit a Pull Request with your
.pofile. The application (pkgi_ps3.c) usessysUtilGetSystemParamIntto automatically map the system language to these files.