• Steam recently changed the default privacy settings for all users. This may impact tracking. Ensure your profile has the correct settings by following the guide on our forums.

PSP Programming ?

flofrucht

PSP Enthusiast
Hi,i can code in lua.
but now i want learn an other script languane.
so i have some questions:

1.What is better for the PSP:
C/C#/C++ ?
(I won't code homebrew games)

2.when i have my c/c#/c++ code:
how can i make the c code in a eboot.pbp?

3.where there tutorials for psp programming ?

thx
 

Hellcat

Contributor
For the PSP plain C is better above C++.

With C you're "more close to device", C++ adds some more abstraction, like all the objects with their methods and properties, which results in some overhead when the code is executed since all that crap needs to be resolved and stuff, hence costing you valuable CPU cycles - and they ARE valuable on the PSP.

Then again if you don't need every cycle you can get, i.e. you don't really care about timing and FPS, you can use either....
 

MenaceInc

Staff Member
PSP Tutorials

you can use pspsdk or cygwin to compile eboots

The latest version of cygwin 1.7.1 breaks the toolchain so it's really not advisable to use it however I do have a custom installer with the psptoolchain already compiled and cleaned. I also made it portable so that it doesn't rely on registry entries. I really should upload it to Megaupload. :\


There were problems with the cygwin tutorial anyways since libmpfr0 had been moved to the _obsolete folder and the latest version of perl broke the toolchain too and you had to revert to 5.8.8-4 as well. I did ask some of the admin over at psp-programming.com to change the details of the tutorial but it was never done. Ah well.


You could still try the cygwin way if you use the legacy cygwin installer that uses 1.5.25 maybe but I can't guarantee it will work. Here's the legacy installer.
Here's the revised instructions that I gave to the admin over at psp-programming.com

We need a mod to edit the original post, the psptoolchain works perfectly but there's two edits that need done.



[quote author=nathan42100 link=topic=62.msg386#msg386 date=1146972581]
Hey, so it seems a lot of you are having trouble setting up cygwin, most of the time, it isn't even your fault. So I am making a tutorail to standardize the directions so that everyone starts out with the same thing :wink: I'm also making this because Lesson one is a little out of date and doesn't include all necessary info (I'm not admin on script scribbler). This also cuts out all the info stuff that is not necessary for completing Lesson one as well as puts it into step by step form.

NOTES:
- If you are on a Linux machine, directly jump to step 5 and type everything into your terminal/shell instead of 'cygwin'. You probably also need to install a few libraries, which can easily be achieved by the following:
DEBIAN based distributions:
sudo apt-get install autoconf autogen automake1.9 libtool build-essential flex bison subversion libncurses5-dev libgmp3-dev libmpfr-dev libreadline5-dev texinfo libusb-dev
- If your windows user name contains whitespaces, you're gonna get problems after installing cygwin (step 4).
In that case, rename the folder "/cygwin/home/[your username]" to not contain any spaces and edit the file /cygwin/etc/passwd to match the new folder name. Afterwards restart cygwin and proceed with step 5.

Step One:
Download CYGWIN's setup.exe to the directory of your choice from here:
http://www.cygwin.com/setup.exe

Step Two:
Run CYGWIN's setup.exe. When you reach a screen similar to this:
untitled2copy2ty.gif

proceed to step three.

Step Three:
After reaching the above screen, click into the text entry box titled "User URL:". In the text box, enter this (you can copy and paste):
Code:
http://mirrors.kernel.org
Then click add and next.

Step Four:
Click on next. Now it will download the package list, this could take a few minutes, depending on your connection speed.
You can now choose to install the default (more download, easier to setup) or the minimum cygwin environment required:
Option 1 (default/easy): Untick "Hide obsolete packages" in the bottom left. Scroll down to "devel" and click on where it says "default" so that it becomes "install. Scroll down to "_obsolete" and click the "+" next to it, scroll down and ensure that "libmpfr0" is set to "install." If not then set it. Then scroll down to "Perl," click the "+" next to it, scroll down and set "Perl" to "5.8.8-4." Finally, scroll down to "web," click the "+" next to it, scroll down and set "wget" to "install."
Option 2 (minimum/complex): Make sure that "All" is set to "Default". Click on "View" once so it lists all packages by name. Untick "Hide obsolete packages" in the bottom left (needed for libmpfr0). Scroll down and select the following packages to "install":
Code:
autoconf
automake
binutils
bison
flex
gcc
gcc-core
gcc-g++
[b]libgmp-devel
libgmp3
libmpfr-devel
libmpfr0
libmpfr1
libtool
libusb[/b]
make
ncurses
patch
patchutils
[b]perl (set to 5.8.8-4)[/b]
readline
subversion
texinfo
wget
Press Next. A screen with a message about "missing dependencies" might follow - just click Next again.
Now wait until everything has been downloaded. The minimal setup downloads ~50MB.

Step Five:
Start cygwin and type this:
Code:
echo "export PSPDEV=/usr/local/pspdev" >> ~/.bashrc
echo "export PATH=\$PATH:\$PSPDEV/bin" >> ~/.bashrc
Close cygwin.

Step Six(long step):
Now run cygwin again and type this exactly:
Code:
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain
Once the above step is done, type the following exactly in to the CYGWIN console:
Code:
cd ./psptoolchain
./toolchain.sh
This might take up to several hours. Take the time and do something useful with it.
At the end, an error message that ../scripts/003-psplinkusb.sh has failed may occur. Ignore that and
just type the following (if you want to use PSPLINK - see below):
Code:
cd build/psplinkusb/
make && make release
Now read up psplink_manual.pdf (Acrobat) or psplink_manual.sxw (OpenOffice) to learn how to setup psplink in case you want to use it for easier development. This is just an optional step though.

Step Seven:
Have fun coding- Thats an order soldier!

Hope this helped you. I have tested this server and guarantee it to have all needed packages.
[/quote]

I've bolded all changes I've made to the post that is necessary for it to work, please feel free to unbold the changes when updating the first post.
 

Hellcat

Contributor
The latest version of cygwin 1.7.1 breaks the toolchain so it's really not advisable to use it
How exactely does it get broken and is there a way to "unbreak" it?
'cause I gotta reinstall the ps2dev toolchain too....
 

MenaceInc

Staff Member
and is there any programm to compile for psp for ubuntu ?

you can try installing the toolchain but you'll need to install some dev packages first.

Type in terminal
Code:
sudo apt-get install autoconf automake binutils bison flex gcc gcc-core gcc-g++ libgmp-devel libgmp3 libmpfr-devel libmpfr0 libmpfr1 libtool libusb make ncurses patch patchutils perl readline subversion texinfo wget

It may come up that you have some packages already installed, I'm not 100% sure. After that, type this into terminal.
Code:
echo "export PSPDEV=/usr/local/pspdev" >> ~/.bashrc
echo "export PATH=\$PATH:\$PSPDEV/bin" >> ~/.bashrc

Restart your terminal then type this.
Code:
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain

Go into the psptoolchain folder when it's done and run the toolchain-sudo.sh script.



After that you can compile a basic psp program into an EBOOT, however if you were serious about developing for the PSP then you'll need some additional libraries. You can get this by typing this into console.
Code:
svn checkout svn://svn.ps2dev.org/psp/trunk/psplibraries

You then go into the folder and execute the install script. The psplibraries script will build and install a variety of libraries for the PSP, including: zlib, bzip2, freetype, libjpeg, libbulletml, libmad, libmikmod, libogg, libpng, libpspvram, libTremor, libvorbis, lua, pspgl, pspirkeyb, sqlite, SDL, SDL_gfx, SDL_image, SDL_mixer, SDL_ttf, smpeg, zziplib .

---------- Post added at 11:57 AM ---------- Previous post was at 11:55 AM ----------

How exactely does it get broken and is there a way to "unbreak" it?
'cause I gotta reinstall the ps2dev toolchain too....

well, when I tried using 1.7.1, the main gcc package was 1kb and didn't contain the binary. Can't make a new one either since I need gcc.... :sneaky2:

I'll throw the custom installer I have up on Megaupload now. May take a while on my 0.5Mb/s upload connection.
 

MenaceInc

Staff Member
OK,and thankz MenaceInc
that you upload now your installer.

but my last question:
what are the differences between PSPToolchain,PSPSDK,CYGWIN?

The installer I'm uploading is for Windows, sorry. If you are using a linux distro, you should be able to follow the instructions I wrote up in the thread.

Cygwin is a installation that allows you to run a UNIX-like setup on windows and that many people use to compile the PSPtoolchain.

The PSPtoolchain contains all the tools necessary to compile programs for the PSP into EBOOTS.

The PSPSDK contains examples and helpful files in regards to programming for the PSP as well as the tools.



EDIT: Hellcat, I can't get onto megaupload.com at all here. Tried on a different computer, tried reseting the router, flushing my DNS cache and even changing my DNS settings but still not working, sorry. I'll try another time but I think that you'd be better following the instructions up there maybe. Would probally be quicker.
 

wafakation

New Member
can i ask hope u dont get angry

do i need all of that to program a home brew in my psp?
coz i want to learn i install pspdev in my windows computer when i compile its not running on my psp i think i have much to learn in setting up that compiler
 

Hellcat

Contributor
Cygwin is a kinda "Unix emulating" environment for Windows, so you can use/compile Linux/Unix apps on Windows.

The PSPSDK is the whole deal, includes, samples and (as part of it) the toolchain consisting of the compiler, linker, e.t.c.
 
Top