Tutorial: Setting up the Psy-Q SDK under modern Linux

General help for the PSY-Q SDK, such as setting the SDK up, compiling correctly, linking and debugging
Post Reply
User avatar
prochazkaml
Curious PSXDEV User
Curious PSXDEV User
Posts: 28
Joined: Jan 22, 2021
I am a: Student & Programmer
PlayStation Model: SCPH-7502
Discord: prochazkaml#4853
Location: Czech Republic
Contact:

Tutorial: Setting up the Psy-Q SDK under modern Linux

Post by prochazkaml » January 22nd, 2021, 1:32 am

I haven't been able to find any good tutorial on how to get the Psy-Q SDK running under Linux, so after a bit of trial and error I got it working well enough that this Hello world example now compiles, gets packaged into a disc image and runs all under modern Linux.

Step 1: Make sure you have Wine installed and all of the required dependencies for this project. On Debian-based systems, run:

Code: Select all

sudo apt-get install wine wget libtinyxml2-dev unzip git make cmake gcc g++
EDIT: wget has been added to the list of dependencies, due to the changes in step 5.

Step 2: Create a 32-bit Wine prefix for the Psy-Q SDK. Let's say you want to put it into ".psyq" in your home directory.

Code: Select all

export WINEPREFIX=$HOME/.psyq
export WINEARCH=win32
wine wineboot
Step 3: Download the Psy-Q SDK and extract it into your new Wine prefix.

Code: Select all

cd ~/.psyq/drive_c
unzip ~/Downloads/PSYQ_SDK.zip
Step 4: Download Orion's CPE2X and extract it to the Psy-Q's "bin" folder. This is necessary, because the original CPE2X is a 16-bit tool, which cannot be run under Wine.

Code: Select all

cd ~/.psyq/drive_c/psyq/bin
unzip ~/Downloads/cpe2x.zip
mv cpe2x/cpe2x.exe CPE2X32.EXE
rm -r cpe2x
Step 5: Install LameGuy64's mkpsxiso. This is necessary, because the original tool used for building CDs (BUILDCD) is a 16-bit tool.

EDIT: The following bit of code has been changed to download an earlier version of mkpsxiso, because its creators have made numerous changes to the project (since the time this post was originally written) which break compatibility with our example project (srcdir seems to be broken in the new version).

Code: Select all

cd ~/Downloads
wget https://github.com/Lameguy64/mkpsxiso/archive/refs/tags/v1.26.zip
unzip v1.26.zip
cd mkpsxiso-1.26
mkdir build
cd build
cmake ..
make
sudo cp bin_nix/mkpsxiso /usr/bin/
To instead pull the latest version of mkpsxiso (not recommended for our purposes) and don't mind messing with the newly introduced quirks, run the following:

Code: Select all

cd ~/Downloads
git clone https://github.com/Lameguy64/mkpsxiso
cd mkpsxiso
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make
sudo cp mkpsxiso /usr/bin/
Step 6: Download my example project, extract it and compile it!

Code: Select all

cd ~/Downloads
unzip example.zip
cd example
./make.sh
If it throws an error, it is probably because it's just trying to launch the Mednafen emulator, which you might not have installed. If you are using something else (such as ePSXe or NO$PSX), just edit the run.sh file to launch that instead.

Well, that's it, now you should have a fully-working Psy-Q building environment! :D
You do not have the required permissions to view the files attached to this post.
Last edited by prochazkaml on February 16th, 2022, 1:22 am, edited 1 time in total.
Development Console: SCPH-7502 with 2MB RAM, some random modchip and a custom 2.54 mm (0.1") pin header for easy access to the serial port using my Propeller Plug.

PlayStation Development PC: Arch Linux, Ryzen 5 3500U at up to 3700MHz, 20GB SDRAM, no dedicated PSX dev hardware, 19" Fujitsu Siemens X19, some cheap composite to VGA adapter, Hitachi GP60NB60 CD/DVD burner and an integrated chiclet keyboard.

elatronion
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Jul 07, 2021

Post by elatronion » July 7th, 2021, 2:41 pm

This is a wonderfully well explained tutorial!
Very helpful indeed, worked first try without any hassle. :)

User avatar
prochazkaml
Curious PSXDEV User
Curious PSXDEV User
Posts: 28
Joined: Jan 22, 2021
I am a: Student & Programmer
PlayStation Model: SCPH-7502
Discord: prochazkaml#4853
Location: Czech Republic
Contact:

Post by prochazkaml » August 23rd, 2021, 5:45 pm

Thank you, I''m glad to hear that! :D
Development Console: SCPH-7502 with 2MB RAM, some random modchip and a custom 2.54 mm (0.1") pin header for easy access to the serial port using my Propeller Plug.

PlayStation Development PC: Arch Linux, Ryzen 5 3500U at up to 3700MHz, 20GB SDRAM, no dedicated PSX dev hardware, 19" Fujitsu Siemens X19, some cheap composite to VGA adapter, Hitachi GP60NB60 CD/DVD burner and an integrated chiclet keyboard.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests