Windows PSPSDK Help

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

webjeff
Posts: 66
Joined: Thu May 05, 2005 2:51 am

Windows PSPSDK Help

Post by webjeff »

OK,

I've read the information regarding how to set this up. I have been running code on my 1.0 psp and would like to test some stuff on my 1.5 american psp. But none of the information provided makes any sense for a windows guy like me.

Can someone please post a win32 setup (seems someone already did this, I've got it). But I really need and I think alot of us out here really need a simple tutorial on how to get a hello world in C++ working. This will really help us along. I'm using VS.NET 2003 and would like to use that for the IDE.

Does anyone know anything that could help not only me but the community. I've seen a lot of posts regarding peices of this, but lets just finalize one way of doing it.

Thanks guys
Jeff.
cable16
Posts: 22
Joined: Tue Mar 22, 2005 9:43 am
Contact:

Post by cable16 »

I had a little trouble too, but got it set up eventually. Try this:

INSTALLATION ----------
1: download TommyKat's PSPSDK 1.0+Beta Win32 installer ( http://forums.ps2dev.org/viewtopic.php?t=2371 )
2: download KaL's Win32 compiled PSP toolchain ( http://ipdred.free.fr/pspdev_wo.zip )
3. install PSPSDK 1.0+Beta to the default directory of c:\PSPdev
4. copy all the DLLs in pspdev_wo.zip's pspdev\bin folder to C:\PSPDev\bin
5. *NEW* copy make.exe in pspdev_wo.zip's pspdev\bin folder to C:\PSPDev\bin
6. edit start.bat so it contains:
- set path=%path%;c:\pspdev\bin
- set PSPSDK=C:\PSPDev\psp\sdk
- cmd

Compiling the sdktest example ----------
1. open C:\PSPDev\psp\sdk\samples\sdktest\Makefile, and remove the " PSPSDK=$(shell psp-config --pspsdk-path) " line.
2. run start.bat inside c:\PSPDev
3. inside the newly-opened CMD navigate to C:\PSPDev\psp\sdk\samples\sdktest
4. type make, and you should get a EBOOT.PBP inside C:\PSPDev\psp\sdk\samples\sdktest

Compiling Nem's Hello World ----------
1. download the Hello World src at http://sec.pn.to/pub/hellopsp_src_Rel1.zip, and extract somewhere
2. you can go ahead and delete mk.bat, outpatch.exe, and outpatch.cpp b/c you won't need them
3. edit hellopsp.c, and :
- add these above the "pg.h" and "bitmap.c" includes:
#include <pspkernel.h>
#include <pspdebug.h>
#include <stdlib.h>
#include <string.h>
- change the xmain function to main
- insert
PSP_MODULE_INFO("HELLOPSP", 0, 1, 1);
right before int main(void)
4. edit pg.c and replace all the pspXXX functions to sceXXX (e.g. pspDisplayWaitVblankStart becomes sceDisplayWaitVblankStart)
5. copy the Makefile (make sure it's had the 'PSPSDK=$(shell psp-config --pspsdk-path)' line removed) from the sdktest to helloworld's folder.
6. edit the Makefile, change OBJS = main.o to OBJS = hellopsp.o pg.o
7. change the eboot title if you want
8. run start.bat inside c:\PSPDev, and navigate to helloworld's folder
9. type/run make
10. should get an EBOOT.PBP inside your helloworld folder

NOTES:
I don't use Visual Studio, so I have no idea how to set it up

the reason you have to change helloworld so much is because it originally uses it's own startup asm code, which isn't needed now b/c of PSPSDK (and PSPSDK's way of doing things is a little different/newer).

to add an icon (ICON0.PNG) to the EBOOTs make gives you, use PBP unpacker ( http://www.pdc.me.uk/pbp/ ).

Hope this helps :)
Last edited by cable16 on Tue Jul 05, 2005 1:12 am, edited 1 time in total.
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

cable16 I've done all you have said, but when i have to type "make" for get the EBOOT.PBP of sdktest, it doesn't works.

It says me (i'm spanish and i don't know how can I translate that, I'm going to try) "make" isn't recognized like a internal or external comand, program or other thing [archivo por lotes ejecutable].

I think the problem is something related to the path. I've seen the Enviorement Variables (in My Computer) and exist another variable called path of the MS Visual Studio .NET, but i don't know if it's that or another thing.

Could you help me?

Thank you!
Byezz

[Sorry, my english is very poor]
cable16
Posts: 22
Joined: Tue Mar 22, 2005 9:43 am
Contact:

Post by cable16 »

my mistake, I already had make installed on my system with dev-cpp, so I didn't think to say where to get it.

open up the pspdev_wo.zip you downloaded, go to pspdev\bin and extract make.exe to c:\pspdev\bin.

try running make again, and it should work.
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

I've done that, but continuos without work.

If you prefer, tell me how can I install Dev-Cpp with make for it works.

Thanks.

kecC

EDIT: A get it! I have put the Variables in Enviorement Variable (on My computer), and I write the line " PSPSDK=$(shell psp-config --pspsdk-path) " in the Makefile, and it works me!

Thanks for all!
User avatar
sq377
Posts: 87
Joined: Mon Apr 11, 2005 3:30 am

Post by sq377 »

I made a tutorial for this with pics. (from installing cygwin to putting the compiled sample on the psp.

http://psplinuxdev.com/ click on the side psp-sdk.
Blackwidow
Posts: 27
Joined: Sun Jun 26, 2005 5:43 am

Post by Blackwidow »

so how do you open up the cygwin console window? cause i can`t figure it out
User avatar
sq377
Posts: 87
Joined: Mon Apr 11, 2005 3:30 am

Post by sq377 »

you should have a shortcut to it.
Blackwidow
Posts: 27
Joined: Sun Jun 26, 2005 5:43 am

Post by Blackwidow »

i guess cygwin is not installing right. i tried a bunch of times. any ideas
cable16
Posts: 22
Joined: Tue Mar 22, 2005 9:43 am
Contact:

Post by cable16 »

if it was installed right, run C:\cygwin\cygwin.bat. Change c:\cygwin to wherever you installed it.
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

hey cable16, would you mind sharing how you setup Dev-cpp (I'm guessing your reffering to Bloodshed) and the config file you used I also use Bloodshed's ide and seems to be giving me some trouble. I would appreciate a little walkthrough similar to your above post for setting up the PSPSDK and toolchain. Thanks in advanced.
cable16
Posts: 22
Joined: Tue Mar 22, 2005 9:43 am
Contact:

Post by cable16 »

actually I haven't set up pspsdk to work with dev-cpp. I had a copy of make.exe (needed by PSPSDK) already on my PC, that had been installed with a totally unrelated install of dev-c++.

Agoln recently made a tutorial ( http://forums.ps2dev.org/viewtopic.php? ... light=devc ) for setting dev-c++ with the sdk, but it won't work for me. I'll try to figure it out, and post as soon as I can.
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

cable16 wrote:Agoln recently made a tutorial ( http://forums.ps2dev.org/viewtopic.php? ... light=devc ) for setting dev-c++ with the sdk, but it won't work for me. I'll try to figure it out, and post as soon as I can.
What doesn't work about it? I know that I have an error or two with the pic's, I kinda threw the tutorial together in about 30 minutes on my lunch break at work, today at lunch I will be fixing the couple of pictures (mainly I said that there was a psp-gdb and MAKEFILE.bat instead of build.mak.
Lego of my Ago!
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

my error occurs in compiling, it doesn't recognize a single header, causing many of the functions to no longer work.
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

do you use the standard build.mak (or w/e it's called in the samples) or do you use your own makefile?

If you use your own Makefile, make sure you do a -L"[path to sdk include directory]".
Lego of my Ago!
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

alright here is my error i get when compiling with dev-c++:

Code: Select all

Compiler&#58; PSP SDK Complier
Executing  make...
make.exe -f "Makefile" all
psp-gcc -I. -Ipsp-config -I--pspsdk-F&#58;/PSPDEV/sdk/include -O2 -G0 -Wall   -c -o main.o main.c
main.c&#58;14&#58;23&#58; error&#58; pspkernel.h&#58; No such file or directory
main.c&#58;15&#58;22&#58; error&#58; pspdebug.h&#58; No such file or directory
main.c&#58;16&#58;20&#58; error&#58; stdlib.h&#58; No such file or directory
main.c&#58;17&#58;20&#58; error&#58; string.h&#58; No such file or directory
main.c&#58;20&#58; error&#58; parse error before string constant
main.c&#58;20&#58; warning&#58; type defaults to 'int' in declaration of 'PSP_MODULE_INFO'
main.c&#58;20&#58; warning&#58; data definition has no type or storage class
main.c&#58;23&#58; error&#58; parse error before '|' token
main.c&#58;23&#58; warning&#58; type defaults to 'int' in declaration of 'PSP_MAIN_THREAD_ATTR'
main.c&#58;23&#58; warning&#58; data definition has no type or storage class
main.c&#58; In function 'exit_callback'&#58;
main.c&#58;33&#58; warning&#58; implicit declaration of function 'sceKernelExitGame'
main.c&#58; In function 'CallbackThread'&#58;
main.c&#58;43&#58; warning&#58; implicit declaration of function 'pspDebugScreenPrintf'
main.c&#58;45&#58; warning&#58; implicit declaration of function 'sceKernelCreateCallback'
main.c&#58;45&#58; error&#58; 'NULL' undeclared &#40;first use in this function&#41;
main.c&#58;45&#58; error&#58; &#40;Each undeclared identifier is reported only once
main.c&#58;45&#58; error&#58; for each function it appears in.&#41;
main.c&#58;46&#58; warning&#58; implicit declaration of function 'sceKernelRegisterExitCallback'
main.c&#58;48&#58; warning&#58; implicit declaration of function 'sceKernelSleepThreadCB'
main.c&#58; In function 'dump_threadstatus'&#58;
main.c&#58;55&#58; error&#58; 'ThreadStatus' undeclared &#40;first use in this function&#41;
main.c&#58;55&#58; error&#58; parse error before 'status'
main.c&#58;58&#58; warning&#58; implicit declaration of function 'sceKernelGetThreadId'
main.c&#58;59&#58; warning&#58; implicit declaration of function 'memset'
main.c&#58;59&#58; warning&#58; incompatible implicit declaration of built-in function 'memset'
main.c&#58;59&#58; error&#58; 'status' undeclared &#40;first use in this function&#41;
main.c&#58;62&#58; warning&#58; implicit declaration of function 'sceKernelReferThreadStatus'
main.c&#58; In function 'SetupCallbacks'&#58;
main.c&#58;81&#58; warning&#58; implicit declaration of function 'sceKernelCreateThread'
main.c&#58;84&#58; warning&#58; implicit declaration of function 'sceKernelStartThread'
main.c&#58; In function 'main'&#58;
main.c&#58;92&#58; warning&#58; implicit declaration of function 'pspDebugScreenInit'
main.c&#58;93&#58; error&#58; 'g_elf_name' undeclared &#40;first use in this function&#41;
main.c&#58;97&#58; warning&#58; implicit declaration of function 'sceKernelSleepThread'
make&#58; *** &#91;main.o&#93; Error 1
Execution terminated
Here is my makefile:

Code: Select all

TARGET = sdktest
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SDK Test v1.0

PSPSDK &#58;= psp-config --pspsdk-F&#58;/PSPDEV/sdk
include F&#58;/PSPDEV/lib/build.mak
Where would i put the
-L"[path to sdk include directory]".
on the "PSPSDK" line in the makefile
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

One quick question... in your code, do you do includes like "stdio.h" or <stdio.h>

If you use ""s, then use <>'s for standard headers, while ""s for headers you make yourself.

<>'s say to look for the headers in the standard header location, while ""s are usually for relative path's.

Mangus wrote: Where would i put the
-L"[path to sdk include directory]".
on the "PSPSDK" line in the makefile

Code: Select all

CFLAGS = -O2 -G0 -Wall -L"&#91;path to sdk include directory&#93;"
Lego of my Ago!
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

i'm using the standard <> style, the source i'm attempting to compile is actually the sdktest source.

I guess i should explain, I have the directories in the Dev-C++ set to folders that I made that contain many of the files from the sdk folders and the PSPDev's folders as well (in other words I took the includes from PSPdev/include, PSPDev/psp/include, and PSPDev/psp/sdk/include and stuck them in the PSPDEV/include folder on another HDD, i did this for bin, include, lib, and i copied the folder sdk for PSPDev/psp and placed it in my HDD that has the new PSPDEV folder on it.)
i'm trying to see if i can compile on the Dev-C++ with out creating my own makefile (let Dev-C++ auto-generate one for me, but it always creates one improperly) i want to use the new PSPDEV folder mentioned above to keep the number of directory paths to a min in the Dev-C++>Tools>Compiler Options>Directories, which now point to my new folders for the include and other things
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

should i delete the PSPSDK line or keep the current one, because after adding what you told me to to CFLAGS i get this and i don't think it is right.

Code: Select all

psp-gcc -I. -Ipsp-config -I--pspsdk-F&#58;/PSPDEV/sdk/include -O2 -G0 -Wall -L"F&#58;/PSPDEV/sdk/include"   -c -o main.o main.c
it is part of an error i recieve now and the rest is the same as before.
I'm aslo concerned with the "

Code: Select all

-c -o main.o main.c
" part it appears to be placing the .c source file after the .o object file, but the -c command is already stated before the -o is, i don't know why it is doing this perhaps you do?
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

I think I may have messed up when telling you to do a -L for includes, -L is used for libraries, while -I is used for includes.

While I am unsure of this or not... I believe that if you specify that you wish to use your own Makefile in Dev-C++, then adding directories to the Compiler Options->directories setting woudln't do anything. I believe that a bulk of those options are for if you are having Dev-C++ make the Makefile for you.

As for moving files around, I would just modify the make file so that it has a -I[path to sdk include] and -L[path to libraries] in the cflags.
Lego of my Ago!
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

Mangus wrote: it appears to be placing the .c source file after the .o object file, but the -c command is already stated before the -o is, i don't know why it is doing this perhaps you do?
That is fine.

What gcc is doing is that you specify that you wish to only compile it, but don't build an executble (-c). Then you specify that you wish to name the output file main.o (-o main.o). At the end, you are just telling it what file you wish to compile, (main.c).
Lego of my Ago!
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

ok, well do you recommend deleting the PSPSDK line or maybe after looking into it i should place

Code: Select all

-I &#91;dir of sdk&#93;
, and remove the

Code: Select all

psp-config --pspsdk-F&#58;/PSPDEV/sdk
that currently is there, i don't think that psp-config is neccesary because i would be telling where the SDK is and then i wouldn't even need to put

Code: Select all

-I &#91;dir of sdk's include&#93;
in the CFLAGS, because the make file calls build.mak, which puts the value stored in PSPSDK and adds /include to the end of it on the list of options following the psp-gcc command
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

do you have a PSPSDK variable set?

If not, then do set PSPSDK=[some path], and then delete the one in the build.mak

But remember to use /'s instead of \'s in the PSPSDK path.
Lego of my Ago!
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

yeah but its not helping any, i've given up on running the original make file. have you successfully made a eboot.pbp using the dev-c++ and if so just explain how. I recommend that a new, more compatible makefile be written for Dev-C++ and some one figure out a proper way to group the folders of the include, lib, etc. I'm lost because this seems like the makefiles and locations of the include, lib, etc. folders aren't compatible with Dev-C++.
cable16
Posts: 22
Joined: Tue Mar 22, 2005 9:43 am
Contact:

Post by cable16 »

What doesn't work about it? I know that I have an error or two with the pic's, I kinda threw the tutorial together in about 30 minutes on my lunch break at work, today at lunch I will be fixing the couple of pictures (mainly I said that there was a psp-gdb and MAKEFILE.bat instead of build.mak.
Well, I got it working now, I wasn't slamming your tutorial or anything, the problem was with my makefiles. I added

Code: Select all

PSPSDK = $&#40;shell psp-config --pspsdk-path&#41;
and

Code: Select all

include C&#58;\PSPDev\psp\sdk\lib\build.mak
to them and it started working.[/quote]
Sporff
Posts: 2
Joined: Mon Jul 11, 2005 11:49 am

Post by Sporff »

this works fine and dandy for me. I can compile C programs just fine.

Is there a way of getting this to work with C++ though? From what i've read, everyone who gets the same errors has been told to just install the latest sdk but i can't seem to get how to do it when using the win32 versions of things posted by cable16
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

The win32 installers don't install the latest SDK. To be sure you have the latest, you have to run ooPo's toolchain.sh from psptoolchain.

Yeah, I know I promised a beta last week, but we'll get a new one out soon enough, and most of these problems will disappear.
Sporff
Posts: 2
Joined: Mon Jul 11, 2005 11:49 am

Post by Sporff »

Nevermind, I figured it out. It actually does work with those win32 versions.
quetz67
Posts: 5
Joined: Wed Jul 20, 2005 9:45 pm

Post by quetz67 »

I cant get it to work, make gives me:

psp-gcc -I. -IC:\PSPDev\psp\sdk\/include -O2 -G0 -Wall -c -o hellopsp.o hellop
sp.c
make: psp-gcc: Command not found
make: *** [hellopsp.o] Error 127

Dont understand why, there is a psp-gcc.exe in PSPDev\bin (and he finds the make there)

And ideas?
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

quetz67 wrote:I cant get it to work, make gives me:

psp-gcc -I. -IC:\PSPDev\psp\sdk\/include -O2 -G0 -Wall -c -o hellopsp.o hellop
sp.c
make: psp-gcc: Command not found
make: *** [hellopsp.o] Error 127

Dont understand why, there is a psp-gcc.exe in PSPDev\bin (and he finds the make there)

And ideas?
Your path is wrong. Check out wiki.pspdev.org/psp:programming_faq
Lego of my Ago!
Post Reply