Docker image for PlayStation 1 (PSX) development based on psn00bsdk.
Pre-built & pre-installed:
- Compiler: mipsel-unknown-elf-gcc
- Toolchain: libpsn00b and tools
- Extras:
# clone this repo
git clone https://github.com/liangchunn/psn00b-docker.git
# build the image
docker build -t psn00b .
# run and mount your dev folder
docker run -it -v <your_dev_folder_here>:/psx-dev psn00b
Type | Path |
---|---|
libpsn00b include | /psn00bsdk/libpsn00b/include |
libpsn00b library | /psn00bsdk/libpsn00b |
- Build the image
docker build -t psn00b .
- Create a dev folder, and clone PSn00bSDK into it
mkdir ~/psx-dev
cd ~/psx-dev
git clone https://github.com/Lameguy64/PSn00bSDK.git
- Now we edit
PSn00bSDK/examples/sdk-common.mk
so that it points to the correct include folders
# Include directories
- INCLUDE = -I../../libpsn00b/include
+ INCLUDE = -I/psn00bsdk/libpsn00b/include
# Library directories, last entry must point toolchain libraries
- LIBDIRS = -L../../libpsn00b
+ LIBDIRS = -L/psn00bsdk/libpsn00b
- We will use
n00bdemo
as an example. But first, we need to changePSn00bSDK/examples/n00bdemo/makefile
to point tolzp
's correct include folders
- INCLUDE += -I../../libpsn00b/lzp
+ INCLUDE += -I/psn00bsdk/libpsn00b/lzp
- LIBDIRS += -L../../libpsn00b/lzp
+ LIBDIRS += -L/psn00bsdk/libpsn00b/lzp
- Now we run the built image with Docker, and mount our dev folder onto the container.
docker run -it -v ~/psx-dev:/psx-dev psn00b
If you're already inside your dev folder, you can also do:
docker run -it -v $(pwd):/psx-dev psn00b
Note: Mounting a folder in this way makes it possible to work on the project on your host machine. This essentially shares the folder between the host and the VM.
- A console should show up, it should look something like this:
root@696090beec68:/#
- Now, we go into the folder that we've mounted and build the project.
cd /psx-dev/PSn00bSDK/examples/n00bdemo
make
- Verify that there's a
demo.exe
, you're done!
Here are some extras which continue from above
- Create
system.cnf
inside/psx-dev/PSn00bSDK/examples/n00bdemo
with the contents:
BOOT=cdrom:\demo.exe;1
TCB=4
EVENT=10
STACK=801FFFF0
- Create
iso.xml
inside/psx-dev/PSn00bSDK/examples/n00bdemo
with the contents:
<?xml version="1.0" encoding="UTF-8"?>
<iso_project image_name="n00bdemo.bin" cue_sheet="n00bdemo.cue">
<track type="data">
<identifiers
system ="PLAYSTATION"
application ="PLAYSTATION"
volume ="N00BDEMO"
volume_set ="N00BDEMO"
publisher ="MEIDOTEK"
/>
<!-- To 'sign' the ISO, we would need to use LICENSEA.DAT from PS\CDGEN\LCNSFILE which comes with the Psy-Q SDK (see documentation of mkpsxiso) -->
<!--<license file="LICENSEA.DAT"/>-->
<directory_tree>
<file name="system.cnf" type="data" source="system.cnf"/>
<file name="demo.exe" type="data" source="demo.exe"/>
<dummy sectors="1024"/>
</directory_tree>
</track>
</iso_project>
- Run the command inside the directory
/psx-dev/PSn00bSDK/examples/n00bdemo
, a BIN/CUE file should be created.
mkpsxiso iso.xml