Welcome
Welcome to <strong>psphacks</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

&lt;!--Begin GameSites200 Vote-->&lt;p><a href="http://www.gamesites200.com/psp/in.php?id=2187">&lt;img src="http://www.gamesites200.com/psp/vote.gif" alt="Vote on the PSP Top 200" border="0"></a>&lt;br><a href="http://www.gamesites200.com/psp/">&lt;img src="http://www.gamesites200.com/track.gif" alt="PSP Top 200 - Games, Videos, Wallpapers, Files, Hacks, Homebrew" border="0"></a>&lt;p>&lt;!--End Game Sites 200 Code-->

[tuturial] how to become a psp homebrew developer

Learn how to program homebrew for the PSP!

[tuturial] how to become a psp homebrew developer

Postby plyrjohn404 on Sat Mar 15, 2008 11:58 am

So you you check out the front page of PSP-Hacks everyday and see a lot of new games and applications created for the PSP... And, you're thinking, "Man! I wish I could do that!" But then you say to yourself, "There is no way I'm going to go through all the hassle of downloading and setting up cygwin and compiling toolchains and all that." Well now you don't need to do all that and you can become a PSP dev in only a few. steps.


Setting up the PSP Dev Environment

First download this: http://xorloser.com/PSPDevWin32.zip (20.5MB)

FYI: It's a precompiled PSPDev environnment for the PC. There is no need for cygwin which emulates Linux on your Windows PC. The PSPSDK and toolchain are already compiled and transfered to your Windows machine with this package.

Once you install it, it will ask you what directory you would like to install into. Just let it install in the default directory of PSPDEV.
Then it will ask how you want to set up your environmental variables. Just click on the all users options and click next. Now it is installed on your computer.

Next goto where the package was installed on your computer which is
C:\pspdev.
This is presuming that your hard drive is the C: drive. If it is not, then change C: to whatever your hard drive letter is.

In that folder you should see a batch file called pspdev.bat
Right click that file and select Edit It should open the file with some commands inside.
Erase everything that is inside the file and copy and paste this into the file.

set path=%path%;C:\pspdev\bin
set PSPSDK=C:\pspdev\psp\sdk
cmd

Again, this is presuming that your hard drive is the C: drive. If not, change it to the letter of your drive.

Then click on File then Save at the top of the file and close it.

Now you have the basics of your PSP dev environment set up.



Testing the PSP Dev Environment

Now you can test your setup by trying to compile a couple of samples that are included in your installation.

Your test samples are located in your C:\pspdev\psp\sdk\samples directory. Take a look at them and lets try to compile one of them. Goto your C:\pspdev folder and double click on the pspdev.bat file we edited earlier. Now a command prompt should appear. Type this into your dos screen

cd psp\sdk\samples\audio\wavegen

and hit enter. You can now type

dir

and hit the enter key to see the files you have listed in that folder. You should see a makefile and a main.c file.

Now type Make and hit the enter key to compile that sample in that directory. When you type Make, it does all the commands that are in the makefile to compile your program. Every PSP program needs to have a makefile. More about that later.
IF you did it correctly, you should see an EBOOT.PBP in your wavegen folder. Now you can transfer that eboot to your PSP and see the program that you just compiled.

*NOTE to 1.50 users* (2.71 SE / 3.0x OE not affected)

That EBOOT that you just compiled is for a 1.0 PSP. If you would like to create an EBOOT with the Wavegen and Wavegen% folders for your 1.5 PSP, you have to do another step. Normally, instead of or after typing make in the command line, you would then type make kxploit to create the 2 folders for the 1.5 PSP. However, there is a bug in this release in the build.mak file which prevents it from working correctly. It will create the 2 folders but one folder will be missing an EBOOT. But do not worry however because I corrected the bug and have uploaded a new build.mak file for everyone to install if they want to make 1.5 EBOOTs. You can download it here:
http://www.mediafire.com/?bzgfq2ftnkf (906KB)

Don't worry about the other folders yet that are in there. We are going to compile those programs later.
Just copy the build.mak file and paste it into this folder C:\pspdev\psp\sdk\lib. It will ask if you would like to overwrite the file. Select Yes and you're done.

Now test it out. Double click your pspdev.bat file again in your C:\pspdev folder and type

cd psp\sdk\samples\audio\wavegen

and hit enter. Then
type

make kxploit

and hit enter. You should now see the 2 folders wavegen and wavegen% for your 1.5 PSP.

Adding Libraries

Now it's time to add libraries to your setup.
So you are asking, what are libraries? Well as of right now you can compile basic PSP samples and programs for your PSP, however, to take full advantage of creating programs, there have been libraries that have been made for the PSP which do added functions for your programs, such as loading and unloading graphics and playing sound as effects or background music.
For example, there is a library for the PSP called libmad. What it does is loads and plays your MP3 clips and songs. All you would have to do to play an MP3 would be to use the function MP3_Play(); Now if you didn't have that library to use, you could still load and play an MP3 in your program, but it would take like an extra 50 lines of code. Why not save yourself the trouble, and just use one line of code, MP3_Play(); to do the work for you?

Now all the libraries made for the PSP need to be compiled under cygwin and then installed into the right directories. However, none of you need to do this. There is an installer already that has already compiled some libraries for you and it installs them directly into the folders that it needs to be. Download that installer here:
http://www.mediafire.com/?doaimyfqytm (2.51MB)

To be honest with you, this installer is not all that good. It says that it installs these libraries into your pspdev folders:
SDL, SDL_Mixer, PSPGL, LibBulletMl, LibTremor, Jpeg, libpsp2d, libpng, libmad, zlib, and libmikmod.
However, SDL, SDL_Mixer and Jpeg libraries are not correctly installed and have many bugs in them.
I am going to create my own installer soon to correct these bugs and add even more libraries to your setup. It does, however, for the meantime, give you enough libraries to work with to create pretty good programs and go through the entire Programming tutorial that I will post in a minute.

Once you install it, it will ask you what directory you would like to install the files. Just install it in the default directory of pspdev.

Now you are ready to go. To test out your new library setup, go to the folder that you downloaded with the build.mak and the invader folder and daedalus folder. You should now be able to compile the space invader game and also be able to compile the latest Daedalus n64 emulator release R8 XD. Simply place the invader folder and the daedalus folders in your pspdev folder at C:\pspdev.
Then dpuble click the pspdev.bat file to open up your command line and type this to compile the space invader game:

cd invaders

Then hit enter and type:

make OR make kxploit

(use the KXploit line for making EBOOTs 1.50 compliant)
You should then see your EBOOT file in that folder or 2 folders with 2 EBOOTs if you used the make kxploit command.
To compile the daedalus n64 emulator, just type

cd daedalus

and hit enter. Then type

cd daedalus

again (since the makefile is in the other folder) and hit enter.
cd means change directories for those who do not know.
Then type either make or make kxploit to create your daedalus EBOOTs.




___________________________________________________________________________________

Starting to Program

So you want to learn more about libraries? You want to actually see a library and read the files in it? Not a problem.

Download subversion here:
http://subversion.tigris.org/files/docu … -setup.exe (3.4MB)

This program will allow you to download PSP libraries and PSPware that are stored off the internet through your command line.
Now just install it.


Take a look at all the psp libraries here:
http://svn.ps2dev.org/listing.php?repna … 0&sc=0

You can browse through them by clicking on each one. Now say you want to download the library libmad (which allows you to load MP3s into your program).
Once you already installed subversion, double click your pspdev.bat file to open up your command line.
Then type this:

svn checkout svn://svn.ps2dev.org/psp/trunk/libmad

and hit enter. You should now see your library downloading into your pspdev folder.

Open it up, take a look at it, read the documentations, and try to learn what that library does and how it works.
You can do this with all of the libraries. To download a different library, just take out the word libmad and add the library that you wanted to download.
For example, if you wanted to download the library libpng (which allows you to add .png files to your program), type this in your command screen:

svn checkout svn://svn.ps2dev.org/psp/trunk/libpng

and hit enter. Now this and the other libraries do not need to be compiled and installed since we already did that earlier with the library installer. But you can read these libraries to see how they work and how to use them.

*TIP*
You can open all of the makefiles and all of the c files with Notepad to view/edit them. However I recommend downloading this IDE which allows you to view each PSP file the way it was meant to be viewed in the correct format with the correct spacing:
http://prdownloads.sourceforge.net/dev- … _setup.exe (8.9MB)

It will also compile all your C++ programs in my C++ tutorial in my sig.
Install it and open your makefiles and C files with this for better viewing.

Alright so now you are ready to try to tackle your own PSP program. Go though this tutorial which explains how to begin creating your own simple PSP programs.



Start off with lesson 1 as I show you how to print HelloWorld on your PSP)


I will also be going over each of these lessons in detail and making my own games and demos for you to understand and develop your PSP programming. Remember that the more advanced we get, the more you will need to understand C and C++. Try to brush up by reading my C++ tutorial listed in my sig.


So now you all can do the banana dance <insert RaiderX"s banana dance gif> because you are all offical PSP devs XD.
plyrjohn404
Site Admin
 
Posts: 60
Joined: Tue Mar 04, 2008 8:05 pm

Return to Psp Programming

Who is online

Users browsing this forum: No registered users and 0 guests