[Updated Tutorial]The Quick + Easy Way To Start Developing in C/C++!!
*NOTE: Since this text is automatically formatted, there may be some spaces where they don't need to be or some other stuff. So if you see spacing like "controlle r", understand that i didn't do that on purpose and that it should be "controller".
###Changes on July 04, 2006##
-Added Installing PSP Libs part.
-Changed the .bat file code to improve performance, and fix some bugs.
###INTRODUCTION###
For some months now, I have been wanting to start/try developing for the PSP in C/C++. I read some of the tutorials explaining how to set up and use mingw or cygwin. Most of the tutorials were complex, and required a lot of downloading of huge files. I have dial-up, so I couldn’t really sit there all day and watch these files download. I am sure some others feel this way also. Anyways, I think that this may be one of the easiest and quickest(because of the small download sizes)ways to set up the PSPSDK, and the toolchain/compiler on a windows machine. So here we go:
###INSTALLATION###
1.) Go download the precompiled windows toolchain/compiler + PSPSDK from:
http://xorloser.com/PSPDevWin32.zip
2.) Extract the .zip file somewhere on your hard-drive.
3.) Launch the .exe file and go through the installation. You should install the package to X:\pspdev\ where X is the letter of your hard-drive. This directory is the default setting on the installer anyways.
4.) Find your way to your x:\pspdev\ folder using the Windows Explorer. Create a new .bat file in that folder and name it whatever you want. I named mine start.bat. Next, make sure your .bat file includes the following code:
Code:
set PSPDEV=X:/pspdev
set PATH=%PATH%;%PSPDEV%/bin
set PSPSDK=X:/pspdev/psp/sdk
cmd
5.) Delete the pspdev.bat file from your x:\pspdev\ folder. The file that we created in step 4 configures the settings for your environment. You don’t need the other pspdev.bat file that came with the package. Or you may keep it if you want. That’s up to you. :icon_wink
6.) Use the Windows search engine to search for a file called cygwin1.dll. Look at the file properties for all of the results and keep the newest one in x:\pspdev\bin\. Delete the other older files. I use the cygwin1.dll file with the build date of 2006-01-20 13:28 and it works great. If you don’t delete the other files the compiler will get an error.
7.) Now, you are done! Congrats, you have a working psptoolchain and PSPSDK along with the compilers installed on your computer.
###COMPILING AN EXAMPLE FILE###
a.) Double-click your .bat file that you created in step 4 of the installation. It should start with the command prompt saying something like this:
Code:
C:\pspdev>set path=C:\Python24\.;C:\WINDOWS\SYSTEM32;C:\WINDOWS;C:\WINDOWS\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WSG32\;C:/pspdev/bin;C:/pspdev2/bin;c:\pspdev\bin
C:\pspdev>set PSPSDK=C:\pspdev\psp\sdk
C:\pspdev>cmd
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\pspdev>
Of course, instead of C it will show the letter of your drive.
b.) Type cd psp\sdk\samples\controller\basic and hit enter to go to the x:\pspdev\psp\sdk\samples\controller\basic directory.
You should get something like this:
Code:
C:\pspdev\psp\sdk\samples\controller\basic>
c.) Type make and hit enter.
You should get something like this in the command prompt and and eboot in the x:\pspdev\psp\sdk\samples\controller\basic folder:
Code:
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o main.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -LC:/pspdev/psp/sdk/l
ib main.o -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lp
spnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -
o controller_basic.elf
psp-fixup-imports controller_basic.elf
mksfo 'Basic controller sample' PARAM.SFO
psp-strip controller_basic.elf -o controller_basic_strip.elf
pack-pbp EBOOT.PBP PARAM.SFO NULL \
NULL NULL NULL \
NULL controller_basic_strip.elf NULL
rm -f controller_basic_strip.elf
C:\pspdev\psp\sdk\samples\controller\basic>
d.) Congratulations, you just compiled a working controller sample eboot. I’ve tested this on my 2.01 PSP through the GTA exploit and it worked fine.
###Installing PSP Libs###
Now this is the very easy part. Go download my & Whazilla's PSP Development Library Installer. Get it Here. And the rest is pretty much self-explanatory. Make sure to read the readme in the package to get a detailed list of tested/untested libs, installation instructions, etc...
###Conclusion###
So did you like this tutorial? This is my first tutorial. Any feedback/suggestions/problems is welcome. [email protected] or [email protected]. Or PM me on the forums.
Enjoy,
Nick/dalejrrocks