[TUTORIAL] Setting up the PSXSDK under Windows and Linux

All other SDK help, questions and information
User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

[TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by Shendo » March 28th, 2012, 4:08 am

Image About PSXSDK:
PSXSDK is an open source software development kit for the
Sony PlayStation 1 console made by NextVolume aka Tails92.

In this tutorial I will explain how to install and use PSXSDK.

Currently this tutorial is for Windows and Ubuntu linux.
Other operating systems will be added in the future.

Windows XP, Vista, 7 and 8:
As PSXSDK requires POSIX environment we will be using Cygwin.
Download x86 version even if you use x64 build of Windows (thanks Xavi92).

After you have downloaded "Setup.exe" run it, choose the Internet instalation and select a source
closest to your location (or any one if you don't mind the slower download rate).

Default packages wil now be shown.
The following packages need to be added to the installation (use the search command):
wget, make, mkisofs, gcc-g++, diffutils, zlib-devel

When the setup is done run the "Cygwin Terminal" shortcut that was placed on your desktop.

Note: Don't use sudo command on Cygwin, just omit it.

Windows 10:
On Windows 10 for our POSIX needs we can use WSL (Windows Subsystem for Linux).
Follow this guide and make sure you have a working Ubuntu WSL setup before proceeding.

If for some reason you can't or won't use WSL follow the guide for older Windows releases
but I really recommend WSL on Windows 10 as it compiles faster in my experience.

Ubuntu:
Just follow the guide, there are no extra steps.

Install prerequisites (Windows 10 and Ubuntu):

Code: Select all

sudo apt-get update
sudo apt-get install wget mkisofs gcc g++ make zlib1g-dev
Download and install toolchain:

Code: Select all

wget http://ftp.gnu.org/gnu/binutils/binutils-2.31.tar.gz
wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz

export BASEDIR=$PWD
mkdir source build

tar -zxf binutils*gz -C source
tar -zxf gcc*gz -C source

cd build
mkdir psxsdk-binutils
mkdir psxsdk-gcc

cd psxsdk-binutils
$BASEDIR/source/binutils*/configure --disable-nls --prefix=/usr/local/psxsdk --target=mipsel-unknown-elf --with-float=soft
make
sudo make install

cd $BASEDIR/source/gcc*
./contrib/download_prerequisites
cd $BASEDIR/build/psxsdk-gcc
$BASEDIR/source/gcc*/configure --disable-nls --disable-libada --disable-libssp --disable-libquadmath --disable-libstdc++-v3 --target=mipsel-unknown-elf --prefix=/usr/local/psxsdk --with-float=soft --enable-languages=c,c++
make
sudo make install
Download and install PSXSDK:

Code: Select all

cd $BASEDIR
wget http://unhaut.x10host.com/psxsdk/psxsdk-20180115.tar.bz2
tar xvjf psxsdk-20180115.tar.bz2 -C source
cd source/psxsdk-20180115

export PATH=$PATH:/usr/local/psxsdk/bin
Open Makefile.cfg inside psxsdk directory and change line "MAKE_COMMAND = gmake" to "MAKE_COMMAND = make".
Save the file and proceed. You can use Vim ( to close it press ESC, then ":" and "x" to save changes).

Code: Select all

vi Makefile.cfg
Then build and install it.

Code: Select all

make
sudo make install
Permanently exporting path:

Code: Select all

vi ~/.bashrc
Add "export PATH=$PATH:/usr/local/psxsdk/bin" without quotes at the end of the file.
Congratulations :clap You have successfully installed PSXSDK on your PC.

To test your newly installed SDK run the example, eg. mandel.

Code: Select all

cd examples/mandel
make
You do not have the required permissions to view the files attached to this post.
Last edited by Shendo on February 3rd, 2019, 8:40 am, edited 15 times in total.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » October 11th, 2012, 8:55 am

Hell YEAH! THANK YOU! I had tried to do this for ages and I hadn't achieved it until I read your tutorial! Seriously, thanks a lot again! :D

Users who need compiling GMP, MPFR and MPC before GCC (as me) should read this how-to:

http://www.acsu.buffalo.edu/~charngda/cc_build.html

PD: BTW, I didn't need to change those lines in Makefile - doing it caused me an error, so I kept them as they were before. I've used Kubuntu 10.10 instead of Windows though.

armorineSKY
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: October 16th, 2012, 9:45 am
Location: Venezuela

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by armorineSKY » October 29th, 2012, 11:56 pm

This also works in windows?

Mdrb
Curious PSXDEV User
Curious PSXDEV User
Posts: 15
Joined: July 18th, 2012, 9:43 pm

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Mdrb » November 1st, 2012, 10:14 pm

Code: Select all

...Cygwin (POSIX environment for Windows)...
@armorineSKY: Yes, this tutorial is made for Windows users ! (so it'll work on this OS ;))

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » November 2nd, 2012, 3:01 am

Although nowadays this procedure isn't needed anymore unless you want to compile PSXSDK under Linux. There is an automatic installer which eases the job:

https://code.google.com/p/psxsdk/downlo ... e&can=2&q=

User avatar
CodeAsm
Active PSXDEV User
Active PSXDEV User
Posts: 64
Joined: January 13th, 2012, 12:41 am
I am a: Programmer, Student
IRC: codeasm
Steam: codeasm
Location: The Netherlands
Contact:

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by CodeAsm » December 6th, 2012, 8:47 pm

Sadly your forum seems offline, but thanx for the automated installer :D
Development Console: SCPH-102, unkown clone Modchip, PAL , FTDI board build into the case (microUSB) for Serial I/O.
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » December 15th, 2012, 5:46 am

CodeAsm wrote:Sadly your forum seems offline
Hey, that's Tails92, not me. I'm just a PSXSDK user. :)

User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Shendo » October 3rd, 2015, 5:05 am

Updated for newest release.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » October 5th, 2015, 3:26 am

Getting this error when configuring binutils-2.25:

Code: Select all

$ ./configure --disable-nls --prefix=/usr/local/psxsdk --target=mipsel-unknown-elf --with-float=soft
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking target system type... mipsel-unknown-elf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking to see if cat works as expected... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... configure: error: in `/home/Xavi/binutils-2.25':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Have you ever encountered this problem before?

EDIT: Solved. I was using Cygwin for x64 systems, instead of Cygwin x86.

User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Shendo » October 7th, 2015, 10:29 pm

I never encountered that error. Glad you solved it. I'll add a note in the tutorial.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

Rooti
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: June 24th, 2017, 7:55 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Rooti » June 24th, 2017, 8:26 am

Hello everyone; first time poster, long time lurker here :D

I was successful in compiling and setting up the tool chain using binutils-2.28, gcc-7.1.0 and psxsdk-20160603 within Msys2.
I compiled the mandelbrot example and tried to master the image according to this guide:
http://www.psxdev.net/help/cdrom_mastering.html

I ran the programs, which wouldn't run in windows 10 64 bit, in DosBox.
I then tried to run the Image in Xebra, which didn't work. I am just stuck at the PlayStation screen.
To test my Xebra setup I loaded a copy of Crash Bandicoot, which worked excellent.

So any guesses what went wrong? Any tips?

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2280
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Shadow » June 24th, 2017, 11:58 pm

Could be anything. Need more info though.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » July 5th, 2017, 3:51 am

Why don't you use the tools PSXSDK already provides to create a valid BIN/CUE image instead of looking at PSXDEV Psy-Q oriented tutorials? I would recommend you taking a look into the Makefile for my video game, specially lines 60-68.

https://github.com/XaviDCR92/Airport/bl ... e/Makefile

Rooti
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: June 24th, 2017, 7:55 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Rooti » July 19th, 2017, 2:33 am

Thank you all for the replies.
I did try the Makefile that came with the psx-sdk but when i tried to load them up in XEBRA, it usually got stuck in one of the First screens.

I Also did try the lines of the Makefile (https://github.com/XaviDCR92/Airport/bl ... e/Makefile) but ended up with the same result.

Has anyone had experience with GCC7 so far?

User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Shendo » July 19th, 2017, 9:57 pm

Make sure you run .bin image. Xebra can't load .cue sheets afaik.

You can also try other emulators. no$psx is another great one with features like disassembler, tty debug window and support for loading executables without the need for a cd image.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » July 20th, 2017, 5:31 am

So far I've tested GCC 5.2.0 with no issues. In any case, I would always recommend PCSX-R for testing, as it also supports TTY printf debug messages. AFAIK, no$psx does not recognize joypad input on games created with PSXSDK.

User avatar
danhans42
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 270
Joined: November 28th, 2012, 11:51 pm
IRC: danhans42
PlayStation Model: SCPH-7502
Want to Find: Inspiration
Location: West Yorkshire, UK
Contact:

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by danhans42 » August 19th, 2017, 4:26 am

Anyone have any tips on this with Linux? Im trying to get setup on Debian 9 but stuck on getting binutils compiled. Make goes without issue, but on 'make install' i get..

Code: Select all

libtool: link: ranlib .libs/libbfd.a
libtool: link: ( cd ".libs" && rm -f "libbfd.la" && ln -s "../libbfd.la" "libbfd.la" )
libtooldir=`/bin/bash ./libtool --config | sed -n -e 's/^objdir=//p'`; if [ -f $libtooldir/libbfd.a ]; then   cp $libtooldir/libbfd.a libbfd.tmp;   ranlib libbfd.tmp;   /bin/bash ./../move-if-change libbfd.tmp libbfd.a; else true; fi
touch stamp-lib
make[5]: Entering directory '/home/dan/binutils-2.25/bfd'
make[5]: Nothing to be done for 'install-exec-am'.
test -z "" || /bin/mkdir -p ""
test -z "" || /bin/mkdir -p ""
make[5]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[4]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[3]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[2]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[2]: Entering directory '/home/dan/binutils-2.25/opcodes'
make[2]: *** No rule to make target 'install'.  Stop.
make[2]: Leaving directory '/home/dan/binutils-2.25/opcodes'
Makefile:3106: recipe for target 'install-opcodes' failed
make[1]: *** [install-opcodes] Error 2
make[1]: Leaving directory '/home/dan/binutils-2.25'
Makefile:2154: recipe for target 'install' failed
make: *** [install] Error 2
root@debian:/home/dan/binutils-2.25#
I have all the dependencies installed (mpc etc..)

Any ideas?


EDIT: Started over but changed to GCC 7.1.0 and Bin Utils 2.28 and seems to be going fine now.
Last edited by danhans42 on August 19th, 2017, 6:12 am, edited 1 time in total.
♥ PSX - http://psx0.wordpress.com

My collection - SCPH-102/SCPH-7502, Yaroze Modded PSone, PocketStation (Clear), 2x Xplorer Carts, 2x Xplorer Pro, 2x AR Carts (1 with Ezoray), GS Pro 3, ISA Comms Link Card. Various USB serial devices, Gameshark Sharklink, Kentai Eddy, iMode Cable & other bits and bobs.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » August 19th, 2017, 6:04 am

Have you tried any other Binutils version?

User avatar
danhans42
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 270
Joined: November 28th, 2012, 11:51 pm
IRC: danhans42
PlayStation Model: SCPH-7502
Want to Find: Inspiration
Location: West Yorkshire, UK
Contact:

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by danhans42 » August 19th, 2017, 6:14 am

Hi Xavi92

Yep, just edited my post above, changed to GCC 7.1.0 and Bin Utils 2.28 and im now building GCC, so got a lot further.

Thanks

EDIT: Works perfect with the above. Only thing I had to do was to install zlib (as I hadn't), and also create a symbolic link for mkisofs, as mkisofs isnt in the debian repo.

All in all its great, I now have a £15 HP Thin Client running Debian 9 with the open source SDK and Catlflap. I can log into it from anywhere. Great guide thanks.
♥ PSX - http://psx0.wordpress.com

My collection - SCPH-102/SCPH-7502, Yaroze Modded PSone, PocketStation (Clear), 2x Xplorer Carts, 2x Xplorer Pro, 2x AR Carts (1 with Ezoray), GS Pro 3, ISA Comms Link Card. Various USB serial devices, Gameshark Sharklink, Kentai Eddy, iMode Cable & other bits and bobs.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » August 20th, 2017, 8:41 pm

I'm glad you finally got it working! If you have any questions regarding PSXSDK, please let me know. )

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest