PDA

View Full Version : [Tutorial]The Quick + Easy Way To Start Developing in C/C++!!



dalejrrocks
May 26th, 2006, 04:22
*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:



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:



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:



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:



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 (http://dl.qj.net/dl.php?fid=8603). 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

shadowprophet
May 26th, 2006, 16:06
Many people should be interested in this:D
Good job bro

Cooe14
May 26th, 2006, 20:08
Nice new sig shadowprophet (and is that really you in your avatar?), and nice tutorial dalejrrocks.

shadowprophet
May 26th, 2006, 20:27
Thanx I love my new sig, and yes thats really me in my avatar lol
Why would I sport somones elses image as my own avatar :confused:
lol

Kaiser
May 26th, 2006, 22:07
Nice Work

Stickied

dalejrrocks
May 26th, 2006, 23:50
Sweet. Have you guys tried this? It works fine for me and everyone else as far as I know, except for two people on PSPUpdates. They keep getting some error. I think they typed the paths wrong.

EDIT: They had some bad installs. They got it to work eventually, so the tutorial works. yay! :) lol

Matt2323
May 27th, 2006, 12:05
Whenever i open up my .bat files the cmd thing will pop but go away really fast. you know what the problem is?:confused: it even happens with the pspdev.bat that the package came with.

dalejrrocks
May 28th, 2006, 02:02
make sure that your .bat file has cmd at the end. the file that it came with doesn't. that's why the tutorial says to create your own .bat file.
it should look like this if your drive letter is c:
set path=%path%;C:\pspdev\bin
set PSPSDK=C:\pspdev\psp\sdk
cmd

\/oid
May 28th, 2006, 19:00
thanks man!!it works gr8te.this is my start at writing homebrew.Sony be war3!:)

Matt2323
May 31st, 2006, 10:06
make sure that your .bat file has cmd at the end. the file that it came with doesn't. that's why the tutorial says to create your own .bat file.
it should look like this if your drive letter is c:
set path=%path%;C:\pspdev\bin
set PSPSDK=C:\pspdev\psp\sdk
cmd

O thanks that worked:D Rep+

Matt2323
June 2nd, 2006, 11:59
Ok i got to the part where u type make in and now i get this error:
make.exe - Unable To Locate Component

This application has failed to start because cygiconv-2.dll was not found. Re-installing the application may fix this problem.

Know wut the problem is?

.:Edit:. Nevermind i fixed it.:D

GamerSJD
June 13th, 2006, 01:33
I get the error:

Couldn't reserve space for cygwin's heap, Win32 error 6

Any help would be great thanks ^^

P.S. I'm using the devkit pro from www.devkitpro.org

dalejrrocks
June 17th, 2006, 02:07
Sounds like a problem with your computer?? Maybe not enough free RAM left? But idk, you are the first one to get this error. Anyone else have an idea?

distrex
June 18th, 2006, 22:07
I don't know if i have done something wrong or what but i keep gettting this error when i type in make:
Makefile:16: /cygdrive/d/pspdev/psp/sdk/lib/build.make no such file or directory

make: *** No Rule to make target '/cygdrive/d/psp/dev/psp/sdk/lib/build.mak'. stop

dalejrrocks
June 19th, 2006, 21:09
I think that your makefile or your paths are messed up. Check them and try reading several previous posts.
Good luck

ronbot3p0
June 21st, 2006, 03:33
And how excatly do you make a new bat file, help please

distrex
June 21st, 2006, 03:56
To make the bat file just use notepad and type in what he said and save it as "start.bat" with the quotes. I also got mine to work. During the install it asks about how the settings will be set, i just put it to set them for all users. If anyone is having the same problem i was give that a shot.

ronbot3p0
June 21st, 2006, 04:03
I did all the steps now, but it closes after I open it, any ideas

I think I got it to work

dalejrrocks
June 21st, 2006, 20:32
put cmd at the end of your .bat file

ronbot3p0
June 22nd, 2006, 02:46
I fixed it, but how do you install stuff, like libmad and other stuff you can use to make a program.

dalejrrocks
June 22nd, 2006, 03:00
you can install libmad, libpng, and zlib, by make, make install
P.S. I've got a surprise thing coming for this setup that will greatly help everyone. As soon as I can get some help. I posted about it.

ronbot3p0
June 22nd, 2006, 03:30
Yea but where do I download it and in wich folder do I put it in, explain please?

dalejrrocks
June 22nd, 2006, 12:25
DL it from svn.pspdev.org. Put it somewhere, then cd to it, and type make, make install. You need to install Subversion. Google the windows client.

ronbot3p0
June 22nd, 2006, 14:40
It dosent install, is saids it not a command

dalejrrocks
June 22nd, 2006, 20:57
http://subversion.tigris.org/files/documents/15/31465/svn-1.3.1-setup.exe

Then you can launch cmd and type

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

to check out libpng. You can browse the svn by going to svn.pspdev.org in your browser.
Hope that helps

ronbot3p0
June 22nd, 2006, 21:08
when I checkout the toolchain or libpng, I type make and works but when I type MAKE INSTALL it saids (ERROR the syntax of the command is incorrect)

I always seem to have a problem, please help

dalejrrocks
June 23rd, 2006, 12:54
what do you mean it says error? Place the lib folder into your pspdev folder. Then go open your .bat file. then cd to your lib folder. type make. after it finishes type make install.

ronbot3p0
June 23rd, 2006, 16:00
Yea thats extacly what I do and works but when I type MAKE INSTALL it saids

(installing lib/ into C:/pspdev/psp, THE SYNTAX OF THE COMMNAD IS INCORRECT MAKE: *** [INSTALL] ERROR 1)

OK now it does not say this, but where do the libmad and libpng files install to? cause i dont see them anywhere

dalejrrocks
June 24th, 2006, 01:27
I think they go to C:/pspdev/psp/lib, and C:/pspdev/psp/include.
I don't remember now, I will have to look it up. But you don't have to see them, I have tested this setup with those libs and it works. I was able to compile lesson 4 of yeldarbs tuts that uses both libpng, and zlib.

ronbot3p0
June 24th, 2006, 02:02
yea me too but I was trying lesson 6 and cant get libmad to install, can you look into it and see if its possible to install it. Please

johnston829x
June 24th, 2006, 18:45
how did you test the file that was created.....and how did you put it on your psp....sorry for the noob question

ronbot3p0
June 24th, 2006, 19:24
you cant with that fw

KunoNoOni
June 25th, 2006, 22:29
When I run make on the sample file I get a .elf file. Whats this for?

EDIT: OK I googled .elf file and found out about the elf2pbp converter. I tried it and got a .pbp file. but I don't get the folders. I'm using a 1.5 fw psp, which was downgraded if that makes a difference.

EDIT2: ok, the converter worked and I got a .pbp file from the .elf file. I tried putting the new .pbp file in a folder called controller_basic and the eboot.pbp file that I got from running make in a folder called controller_basic%. oh the new .php is called eboot.pbp . now I tried to run the program but get an error.

EDIT3: I think I figured it out. having fw 1.5 I KXploit tool and created the correct folders and it worked! :D

ronbot3p0
June 26th, 2006, 00:08
Lol, I Still Need Help With Libmad, I Cant Install It

KunoNoOni
June 26th, 2006, 03:21
what is Libmad used for?

yaustar
June 26th, 2006, 04:02
http://www.underbit.com/products/mad/
Audio decoder.

ronbot3p0
June 26th, 2006, 05:07
Yea I tryed those, but they never install, anyone have an idea how, when I type make it dont work

KunoNoOni
June 26th, 2006, 10:33
Yea I tryed those, but they never install, anyone have an idea how, when I type make it dont work

When I was trying to install zlib and libpng, I got the same error you did about the syntax being wrong. all I did was open my Makefile and remove the line @mkdir, because the folders already exist. once I did that the make install worked. see if that helps you...;)

ronbot3p0
June 26th, 2006, 14:23
yea those work, but libmad dosent, need help with that one.

KunoNoOni
June 26th, 2006, 15:43
what was the error you were getting again?


EDIT: ok here is what I did to install libmad.

1. download libmad to pspdev folder
2. go into the libmad\src folder
3. open Makefile
4. delete the @mkdir line
5. in the command prompt type make -C src
6. then type make -C src install

this should install it for you successfully! if you check x:\pspdev\pspsdk\psp\include folder there should be a mad.h file

hope this help :)

ronbot3p0
June 26th, 2006, 16:13
it just saids, no target to do this, or something like that, when I type make, any ideas anyone?

KunoNoOni
June 26th, 2006, 16:45
I edited my post before yours explaining how I installed it. see if that help you.

ronbot3p0
June 26th, 2006, 17:18
I tryed it and it said it installed but I went to psp/sdk/include, and its not there.

I noticed that when I typed make -C src install, it saids its installing to libmad and not to psp/sdk

KunoNoOni
June 26th, 2006, 19:37
I tryed it and it said it installed but I went to psp/sdk/include, and its not there.



hehe, thats the wrong include folder... its just /psp/include ;)

ronbot3p0
June 26th, 2006, 20:00
Yea its not there either,I dont think I did anything wrong. why is it not installing? where are you getting libmad from, because the only think that is doing right now is compling the the src folder like if im making a program.

KunoNoOni
June 26th, 2006, 20:23
I'm getting mine from svn.pspdev.org.

try this, delete your download of libmad then follow these instructions again and see if it works.

1. download libmad to pspdev folder

svn checkout svn://svn.pspdev.org/psp/trunk/libmad
2. go into the libmad\src folder
3. open Makefile
4. delete the @mkdir line
5. in the command prompt type make -C src
6. then type make -C src install

ronbot3p0
June 26th, 2006, 20:27
This is where im getting it from also, its complying the files in the src folder and nothing else

yaustar
June 27th, 2006, 01:17
KunoNoOni: Why dont you send him/her your compiled version?

ronbot3p0
June 27th, 2006, 01:46
Yes Please Lol, Im Going Crazy Over This

dalejrrocks
June 27th, 2006, 01:58
Libmad files go into your C:/pspdev/psp/include and
C:/pspdev/psp/lib folders.. the mad.h goes into include. the libwhatever.a file goes into lib. you can just make libmad and copy/paste the files yourself.

BTW: Like I said there's an awesome surprise coming for this setup that in my opinion makes it equal to cygwin. ;)

ronbot3p0
June 27th, 2006, 02:11
What if i put one file where it dosent belong?

When is this surprise gonna come out? Hopefully it can help me.

edit: I tryed and guess what It dosent work, it gives me the, MAKE ***[EBOOT.PSP]ERROR 1.when i try lesson6 of that one guys turorials.

KunoNoOni
June 27th, 2006, 02:26
KunoNoOni: Why dont you send him/her your compiled version?

sometimes the easiest solutions elude us :cool: .

hmmm... I keep getting a 403 forbidden error when I try to upload the files.

:mad: ok I tried again and now its not giving me the 403 error but the upload just fails

ronbot3p0, pm me your email and I'll send it that way

ronbot3p0
June 27th, 2006, 02:39
I sent it, tell me if you got it. If you didnt is the same as my user name @yahoo.


edit, thats all I need,2 files?

dalejrrocks
June 28th, 2006, 03:16
rename the target = mp3 to target = blah or something like that and lesson 6 will compile(in the makefile)! I just tested it. The surprise is coming out either tomorrow or the next day!

ronbot3p0
June 28th, 2006, 04:03
ok ill try this, what is the suprise about?


Edit: it does compile but I think theres something wrong in the code because it dosent work on the psp well I get an error of a framebuffer, but im just going to FORGET ABOUT IT lol.

now can someone help (with codes and all of that) me to make a program im thinking about.

dalejrrocks
June 29th, 2006, 21:43
I accidentally deleted most of the thing I was gonna release. And it was done. So I gotta go write the code back.

Zion
June 30th, 2006, 17:13
im having a problem. Im trying to port over a project and keep getting this error when i type make. :

make: *** audio/polyphonic: No such files or directory. stop.

Make: *** [_dir_ausio/polyphonic] Error 2

Please help!

dalejrrocks
June 30th, 2006, 21:08
it can't find that dir that's referenced to somewhere. check your makefile and paths and stuff, you may need to help it find it. ;)

Davidov
July 4th, 2006, 11:52
Ok this works for me but I was wondering if anyone managed to use the make kxploit command when compiling for firmware 1.5. Cygwin does this but whenever I try it with PSPDEV win32 it creates the correct Eboot in the 'without %' symbol "APP NAME" folder but then also makes a -P folder and an empty %"APP NAME" symbol folder where "APP NAME" is the program's folder title.

In the command prompt the error reads:

mkdir -p "vertex"
psp-strip vertex.elf -o vertex/EBOOT.pbp
mkdir -p "vertex%"
a subdirectory or file -p already exists.
Error occured while proccessing: -p.
make *** [kxploit] error1

its the vertex sample in the psp/sdk/samples dir im trying to test.

I can easily make 1.5 eboots via the Kxploit program then PSPBrew to customise them accordingly, but this would be useful if it could compile as 1.5 first off for quickly testing on my psp.

Thanks

dalejrrocks
July 4th, 2006, 23:56
yeah, it worked fine for me.
first, type make and let it compile. then after it finishes type make kxploit. and it will make the appropriate kxploit eboot.

Davidov
July 7th, 2006, 12:30
yeah, it worked fine for me.
first, type make and let it compile. then after it finishes type make kxploit. and it will make the appropriate kxploit eboot.

I still get the same error occured while processing -p

Perhaps there was a problem when I installed the kit, I'll try reinstalling it.

EDIT: also the URL on the first post for downloading the library installer is incorrect, currently its: http://http//dl.qj.net/dl.php?fid=8603

Should be http://dl.qj.net/dl.php?fid=8603

mibi someone already noticed.
but BIG thanks anyways to Dalejrrocks and Whazilla

dalejrrocks
July 7th, 2006, 12:55
Thanks for pointing the broken link out, I changed it.
I just tried the vertex sample, here's my output so you can see exactly what I did, it worked perfectly:


C:\pspdev>set PSPDEV=C:/pspdev

C:\pspdev>set PATH=C:\Python24\.;C:\WINDOWS\SYSTEM32;C:\WINDOWS; C:\WINDOWS\SYSTE
M32\WBEM;C:\WINDOWS\SYSTEM32\WSG32\;C:\Program Files\Subversion\bin;C:/pspdev/bi
n;C:/pspdev/bin;C:/pspdev2/bin;C:/pspdev/bin;C:/pspdev/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>cd psp

C:\pspdev\psp>cd sdk

C:\pspdev\psp\sdk>cd samples

C:\pspdev\psp\sdk\samples>cd vertex
The system cannot find the path specified.

C:\pspdev\psp\sdk\samples>cd gu

C:\pspdev\psp\sdk\samples\gu>cd vertex

C:\pspdev\psp\sdk\samples\gu\vertex>make
psp-gcc -I. -IC:/pspdev/psp/sdk/include -G0 -Wall -c -o vertex.o vertex.c
vertex.c : In function 'generateVertexBuffer':
vertex.c(125) : warning: unused variable 'batchScale'
vertex.c(124) : warning: unused variable 'vertexOffset'
vertex.c(122) : warning: unused variable 'colorOffset'
vertex.c : In function 'main':
vertex.c(602) : warning: too many arguments for format
psp-gcc -I. -IC:/pspdev/psp/sdk/include -G0 -Wall -c -o ../common/callbacks.o
../common/callbacks.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -G0 -Wall -c -o ../common/vram.o ../co
mmon/vram.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -G0 -Wall -c -o ../common/menu.o ../co
mmon/menu.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -G0 -Wall -L. -LC:/pspdev/psp/sdk/lib
vertex.o ../common/callbacks.o ../common/vram.o ../common/menu.o -lpspgum -lpsp
gu -lm -lpsprtc -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet
-lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkerne
l -o vertex.elf
psp-fixup-imports vertex.elf
mksfo 'Vertex Speed Sample' PARAM.SFO
psp-strip vertex.elf -o vertex_strip.elf
pack-pbp EBOOT.PBP PARAM.SFO NULL \
NULL NULL NULL \
NULL vertex_strip.elf NULL
rm -f vertex_strip.elf

C:\pspdev\psp\sdk\samples\gu\vertex>make kxploit
mkdir -p "vertex"
psp-strip vertex.elf -o vertex/EBOOT.PBP
mkdir -p "vertex%"
pack-pbp "vertex%/EBOOT.PBP" PARAM.SFO NULL \
NULL NULL NULL \
NULL NULL NULL

C:\pspdev\psp\sdk\samples\gu\vertex>

lmtlmt
July 8th, 2006, 09:24
how do you create a .bat file?
what the hell is a .bat file is it text document

yaustar
July 8th, 2006, 15:28
Create a new text file and change the extension.
a .bat file is a batch script and was commonly used in the old DOS days to run a certain sequence of commands automatically.

ronbot3p0
July 9th, 2006, 14:36
wheres the suprise?

yaustar
July 9th, 2006, 16:11
On the news section. A one click install PSP development environment for Windows.

ronbot3p0
July 9th, 2006, 16:57
whats the name of it because I cant find it

lmtlmt
July 10th, 2006, 01:51
when i go to launch it in the eloader it starts then it exits strait away is it supposed to . or what is it supposed to do

dalejrrocks
July 10th, 2006, 01:58
whats the name of it because I cant find it

Here you go: http://dl.qj.net/PSP-Development-Library-Installer-PSP-Tools-Utilities-(on-PC)/pg/12/fid/8603/catid/193


when i go to launch it in the eloader it starts then it exits strait away is it supposed to . or what is it supposed to do

why are you using eloader???

lmtlmt
July 10th, 2006, 02:08
to launch it on my psp

dalejrrocks
July 10th, 2006, 02:21
it's for the pc. so you can make stuff to launch on your psp. ;)

lmtlmt
July 10th, 2006, 03:11
yeah i know iam trying to luanch the demo one that you told me to create with the program

lmtlmt
July 10th, 2006, 03:15
you now the start.bat one

Davidov
July 10th, 2006, 12:22
hey dalejrrocks I managed to get the make kxploit thing to work, got a newer version of cygwin1.dll and it work.
Might just be me but it seemed to compile faster too.

Lmtlmt.... im not sure if you've followed what this is, or perhaps your just a bit lost.

Once u have followed the intructions for compliing an sample, go to the directory where the sample you compiled is and copy the eboot.pbp file onto a new folder (name it something) in the PSP/GAME dir on your memory stick. then try loading it with eloader.

But some programs wont work yet until we have the code to get into kernal mode on 2.01, 2.5, 2.6.

roberto_h25
July 10th, 2006, 18:27
hey dalejrrocks I managed to get the make kxploit thing to work, got a newer version of cygwin1.dll and it work.
Might just be me but it seemed to compile faster too.

I get the same error. could you tell me were you got the new version of cygwin1.dll? thanx...

Nevermind... I found how to fix:

http://forums.ps2dev.org/viewtopic.php?t=6046

Render
July 14th, 2006, 04:39
whenever I compile i get:
make: psp-config: Command not found
makefile:20: /lib/build.mak: No such file or directory
make: *** No rule to make target `/lib/build.mak'. Stop.

I used the exe package and this is the result, follwed the tutorial and such as well

dalejrrocks
July 14th, 2006, 12:44
Put this in your .bat file and delete everything else:

set PSPDEV=C:/pspdev
set PATH=%PATH%;%PSPDEV%/bin
set PSPSDK=C:/pspdev/psp/sdk
cmd

and try putting this in the beginning of your makefile:

PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(shell psp-config --psp-prefix)/bin

and this at the end:


include $(PSPSDK)/lib/build.mak

Render
July 14th, 2006, 22:04
did not work. :(

dalejrrocks
July 17th, 2006, 12:43
what are you trying to compile? i think that the problem is with your makefile.

bronxbomber92
August 7th, 2006, 17:25
Hey, I posted this tutorial at other sites like psp-programming and evilmana so more people kno about this ;)

Rest asure, I gave all credit to you ;)

dalejrrocks
August 9th, 2006, 02:42
thanks man. that's great.

bronxbomber92
August 9th, 2006, 23:06
What the disadvantage of this old toolchain compared to the newer toolchain(s)? And is it possible to install this using the new toolchain?

watupgroupie
August 10th, 2006, 18:52
could someone please take a couple of minutes just to make detailed instructions on how to make the 1.5 eboot's i typed make kxploit after i made the first eboot but i get the same error someone mentions before do i just need a newer cygwin1.dll file. thanx in advance :)

lale05
August 29th, 2006, 07:16
Hello,

I'm a newbie in C Coding. I wrote my programs on PC using Delphi, so its hard now to study C.

Can someone help me with a little question:

fd = sceIoOpen("ms0:/PSP/GAME/myapp/myfile.dat", PSP_O_RDONLY, 0777);
if (fd<0)
{
printf("Failed to open file.");
delay_loop(1000);
sceKernelExitGame();
}

When myfile.dat exists - everything is OK, but
when myfile.dat does not exist, my psp just crashes. No debug info displayed.
What am I doing wrong? plz help!!

I have some other problems with coding. If this is the right theme for such questions then i'd like to ask more.

Thanks,

P.S. Sorry for my English.

ryutoki
September 4th, 2006, 05:30
could someone please take a couple of minutes just to make detailed instructions on how to make the 1.5 eboot's i typed make kxploit after i made the first eboot but i get the same error someone mentions before do i just need a newer cygwin1.dll file. thanx in advance :)

Yeah, I'd like that, too. My PSP is also running on Firmware 1.50, and so the eboot doesn't work for me.

I followed the directions exactly and created the eboot, but I can't get it to work.

jman420
September 4th, 2006, 06:11
you could always just be intellegent, and learn how to split your eboots properly....

you just need a program called "pbp unpacker" for which you open up a 1.00 formatted eboot, and export the DATA.PSP file as "EBOOT.PBP" and place it in the non-% folder.. then you take the icon and the PARAM.SFO file, save to new, and save that EBOOT.PBP in the -% folder, then you have the 2 folders, and they are properly exploited...

again!

the % folder contains an eboot with the PARAM.SFO, aswell as any ICON.PNG's or background PNG's (as well as music) This will show up as the visible program in a 1.5 psp

and the non % folder contains the DATA.PSP file renamed to EBOOT.PBP (as well as all files that go with it) this is the reason that it is shown as corrupt, is because its just the data file renamed EBOOT.PBP

hope this helps... you will need to find pbp-unpacker yourself, but its out there on google somewhere

ryutoki
September 4th, 2006, 16:27
you could always just be intellegent, and learn how to split your eboots properly....

It's not a matter of intelligence, it's a matter of not knowing what the crap I'm supposed to do. If no one's ever told you how to do something, then you won't be able to do it no matter how smart you are. Intelligence is irrelevant.

I'm still very, very new to all this stuff, and there is absolutely no way I could possibly have known I needed another program, or that I needed to do all that other stuff you said. So please, don't go around saying people are unintelligent just because they haven't been doing this stuff as long as you have.

jman420
September 4th, 2006, 19:14
well, now I told ya how

ryutoki
September 4th, 2006, 19:48
Yeah, thanks.

gunntims0103
December 16th, 2006, 16:00
mines just isnt working i think its my command promt and even when i click on the start.bat the commands promp shows on the screen for a sec then goes away.

Il just have to wait for malkster to get online, he said he'll help me

yaustar
December 16th, 2006, 18:06
Add

cmd

At the end of the batch file.

gunntims0103
December 16th, 2006, 18:18
Add

cmd

At the end of the batch file.

you mean rename the file

start.batcmd

??

or open the code of the start.bat file and put cmd at the end

???

yaustar
December 16th, 2006, 19:49
y
or open the code of the start.bat file and put cmd at the end

Latter.

gunntims0103
December 16th, 2006, 20:08
i already have that and i keep getting the same error, it would give me a illegal error of some sort....

yaustar
December 16th, 2006, 20:19
Well, post the error message up along with the contents of your batch file.

gunntims0103
December 17th, 2006, 03:03
this is the contents of my start.bat


set PSPDEV=C:/pspdev set PATH=%PATH%;%PSPDEV%/bin set PSPSDK=C:/pspdev/psp/sdk cmd
cmd

i dont get a illegal error any more the when i run the start.bat file it blits to the screen for a sec then goes away. I have cmd in the code but it doesnt work...

yaustar
December 17th, 2006, 03:17
It should be:

set path=%path%;C:\pspdev\bin
set PSPSDK=C:\pspdev\psp\sdk
cmd
That should leave the Window open.

Edit: Although saying that, yours should still leave the command prompt window open.

gunntims0103
December 17th, 2006, 03:25
the window stays open

but a error box appears it says

16 bit MS-DOS Subsystem

C:/WINNT/System32/cmd.exe
The NTVDM CPU has encountered an illegal instruction.
CS:0552 IP:fff0 OP:fe 1d 09 30 Choose 'Close' to terminate the application.

yaustar
December 17th, 2006, 03:34
Oh.. that kind of error. That sounds more like a problem with your PC more then anything.

Go to Start -> Run
Type in
cmd
And press enter. Do you get the same error?

gunntims0103
December 17th, 2006, 03:45
i went to start then went in run, typed in cmd and i didnt get a error.

regarding my last post do you think i get a error because of this step that i might have done incorrectly because i didnt even bother doing this part.


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.

yaustar
December 17th, 2006, 03:54
No, that only refers to the point where you use the compile. At the moment you are only setting up the Windows path.

Did a quick search on the Net and everything either points to Windows Corruption, Spyware or Virus.

Ref: http://www.computing.net/windowsxp/wwwboard/forum/133675.html

Try a virus scan and see what comes up.

gunntims0103
December 17th, 2006, 04:01
im having norton antivirus scan my computer right now. Il post back with the results

gunntims0103
December 17th, 2006, 15:46
o yea!!!!!!!

i finally got my compiler to work....

the problem was that i have to put all the instructions that i would give to my command prompt, i have to put it in the code of the start.bat

problem solved

carpy
January 2nd, 2007, 23:05
IS there an easy way to take an already written C++ program (written for Windows API with Direct X) and convert it to PSPSDK?

I don't know jack about coding, but I'd like to take this Atari 7800 Emulator source code (C++) and compile it for the PSP and see if it runs any good...

https://home.comcast.net/%7egscottstanton/source/ProSystem.zip

yaustar
January 3rd, 2007, 06:28
Easy, no. Possible, yes.

-=me=-
January 6th, 2007, 01:07
I cant get this to work, it says "make" isn't a command


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:
:confused:

yaustar
January 6th, 2007, 17:04
Is your batch file correct? Are the paths in the batch file correct? Post up the contents in your batch file and the installation pat to the SDK.

froggie22
February 3rd, 2007, 12:46
wow after reading all that i still dont know how to make anything :| the end instruction said that after that its self explanitory but i wouldnt have a clue what to do after that

yaustar
February 3rd, 2007, 16:43
wow after reading all that i still dont know how to make anything :| the end instruction said that after that its self explanitory but i wouldnt have a clue what to do after that
You start coding. This isn't a tutorial on how to develop on the PSP but how to setup a toolchain.

froggie22
February 4th, 2007, 04:14
ohh ok then. is there a tutorial on how to start coding? i havent coded b4 but would like to have a try..

yaustar
February 4th, 2007, 17:41
ohh ok then. is there a tutorial on how to start coding? i havent coded b4 but would like to have a try..
Then in honesty, don't start developing for the PSP. Learning how to program is hard enough without having to deal with any platform specific material. Do you honestly want to persue programming? If so, I recommend learning Python. It is a nice easy to learn language which allows you to see immediate results and can be used on various platforms.

froggie22
February 11th, 2007, 09:27
if its that hard ill give it a miss then and just wait for other to program things. i have heaps of school atm so maybe ill wait for a bit b4 i try learning. thanks anyway bro

CanisLupus
March 20th, 2007, 00:57
I need help, I've deleted all the cygwin1.dlls and I still get the same error(I'm using the one that came with the install. Do I need to reboot after deleteing them, or what?

BoiAzure
April 5th, 2007, 03:54
I'll be honest, I'm not sure how to correct the issue, but for anyone who's having a problem using kxploit with this version of the toolkit, I believe what's happening is that when the compiler creates the directories, it's passing "mkdir -p folder_name" to the windows command line, which doesn't see "-p" as a flag, and makes the directories "folder_name", and "-p". It then causes an error when it incorrectly tries to make another "-p" directory, and quits without making the 2nd directory or the 2nd EBOOT.PBP file.

*EDIT*
I found the answer in this forum on page 8.
... for anyone not interested in searching for it, here's the link reposted with how to correct it: http://forums.ps2dev.org/viewtopic.php?t=6046

jools
July 17th, 2007, 21:30
when I type make it gives me:

'make' is not recognized as an internal or external command, operable program or batch file.

yaustar
July 18th, 2007, 09:57
Step 4 and/or 7a wasn't done correctly.

JPJunkie
August 3rd, 2007, 21:02
Good Tutorial! I have learnt something:)

jools
August 22nd, 2007, 21:59
thanks yaustar I used the code in the .bat that you posted back a bit and it worked :)

thehumanidiot
September 13th, 2007, 22:42
i am just starting to learn C++(i already know flash actionscript if that helps) i have a c file and i wanted to know how to make the makefile

EDIT: ok nvr mind that was a dumb question i started to read some tutorials and now i know what it is,
Nice tutorial, i tried to set up cygwin but it didn't work, then i did this and it took about 10min, thanks a lot.

EDIT: I finished the first two tutorials, but when i went to compile the third i get an error, i installed zlib and libpng but it wont compile. here is a picture of the errors, plz help

Squall333
December 1st, 2007, 21:59
when I type make it gives me:

'make' is not recognized as an internal or external command, operable program or batch file.

I have the same problem, Im 99% certain i have dont all the steps correctly. Can someone post their make file so i can compare? Is there anything else i need to install that isnt listed in this tutorial?

Addy771
January 17th, 2008, 05:57
Thank you very much for putting together this guide; I was having a lot of trouble with PSPtoolchain, endless install errors.

I'm having a problem with this though, and I've done a bunch of things to try and solve it. The error I get now is "/lib/build.mak:24: *** missing separator. Stop.".

This is my makefile


PSPSDK = $(shell psp-config --pspsdk-path)
TARGET = controller_basic
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Basic controller sample

include $(PSPSDK)/lib/build.mak


And this is my start.bat


cd C:\pspdev\psp\sdk\samples\controller\basic
make
cmd


I've added the PATH variables manually already, they weren't working before. It kept adding a space before '/bin' in one of the paths, and that messed it up.


Any and all help is greatly appreciated.

CT_Bolt
April 11th, 2008, 06:15
WOW! Thank you! Thank you! Thank you! :thumbup:

You saved my PSP C/C++ Coding life. :D

Braveboat
October 31st, 2008, 02:19
I have the same problem, Im 99% certain i have dont all the steps correctly. Can someone post their make file so i can compare? Is there anything else i need to install that isnt listed in this tutorial?

I encountered the same problem as well. after so many times tries. I found that you typed "set path=C:\pspdev\bin" (my pspdev is installed in C:)in cmd, then everything go smoothly.

gmlxdm09
December 27th, 2008, 06:26
my .bat file in vista does not work no matter how I do. what I did was I manually created environment variables (PSPDEV, PSPSDK and PATH) and hora! it worked.

this is very interesting, thanks for this info bro! Y_Y

MaNaXeD
December 27th, 2008, 09:53
8107200581072005