Monday, May 12, 2008

programming for psp -1 (getting started)

For those who don't know what's a PSP is , it's a handheld gaming device made by sony called as playstation portable and in short PSP. Hacker's around net have cracked the psp and created their own psp toolchain, which is a collection of headerfiles and libraries which are used to create applications programs and even games. So basically psp toolchain is a cross compiler that runs natively on a pc and used to compile programs for PSP.
Here i will be explaining how to get the psp toolchain on a linux box and get started with programming for psp.

First make sure that you have installed all the dependencies needed for compiling the toolchain
sudo apt-get install autoconf automake bison flex gcc make libncurses5-dev libusb-dev patch subversion texinfo wget build-essential
now we need to setup the environment variables; let us edit the .bashrc file in home folder; the commands in this file are executed when a terminal window is opened.
gedit ~/.bashrc
add the following two lines at the end of the .bashrc file.
export PSPDEV=/opt/pspdev
export PATH=$PATH:$PSPDEV/bin

the /opt/pspdev is the folder in which you want to install the psp toolchain. You can change it to any directory you want suppose if u want to install in /usr/local/pspdev change the line "export PSPDEV=/opt/pspdev" to "export PSPDEV=/usr/local/pspdev". We also modifid the PATH variable so as to include the /opt/pspdev/bin directory into the search path when you type a command in the terminal.

Now we need to download the psp toolchain from net and compile it. you can get it from subversion
svn checkout svn://
now change directory into the downloaded toolchain installer
cd psptoolchain
and get root access by foolowing command and entering the password
sudo su
and start the installer by
it downloads the files necessary for toolchain from net and compile. This process takes alot of time so be patient. Once the compilation finishes you have you psp dev environment setup.

Now u may want to install basic psp libraries for advanced programming involving opengl port, mp3 ,ogg , image file support in programming. You can get the psplibraries installer from the subversion same as above.
svn checkout svn://
get root access by this command, if you already have root access dont do the following command
sudo su
start the installer by
This command also takes a long time like above.

Once everything is done, you now have your PSPDEV with the basic libraries. You can get more libraries from the subversion. If you want, just download the whole psp dev trunk from subversion by
svn checkout svn://
For those who dont have a net connection or those who dont want to compile. Iam sharing my compiled toolchain. You can get it from this link Just extract it
and place it anywhere (eg:- /opt/ ) on your pc .

tar -xvjf pspdev.tar.bz2
mv pspdev /opt/
and add the path to .bashrc
export PSPDEV=/opt/pspdev
export PATH=$PATH:$PSPDEV/bin
change /opt/ to location where you want to install, or just leave it as it is.

I have also shared the whole trunk of psp dev, you can get it from here


You can get started with psp-programming now, you can find good tutorials to get started here
i have made a small filebrowser application based on above tutorials, i will be discussing about it later.
You can use any IDE that supports makefile and c language. Iam using eclipse. See how to setup eclipse for c and c++ in this blog.

Hope this helps to get u started programming for psp.

No comments: