Win32 native Toolchain for PSPSDK

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

Moderators: cheriff, TyRaNiD

Post Reply
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

Ohhhh looking [BoratVoice]nice![/BoratVoice]

Thank goodness a quick installer! Thanks a million Heimdall!

As for the PSPIRKeyB. That's now been submitted to the svn.

Anyway... it's only me and ZX81 on the IRDA dev corner, and we share libs often.

Thanks!

Angelo
Exophase
Posts: 2
Joined: Mon Nov 06, 2006 3:54 pm

Post by Exophase »

Cool, but I see that the SDL you included is linked against pspgl (presumably for SDL's OpenGL support), is that necessary? ie:

x:\workspace\minpspw\devpaks\017_SDL\SDL\src\video\psp/SDL_pspgl.c:109: undefined reference to `eglGetDisplay'

I tried to build the SDL from svn.pspdev.org, but couldn't make it past configure because the test compile requires libpspuser. Maybe there's a newer SDL that doesn't require it, or can it be made available for your toolchain?

Anyway, for those wondering (probably everyone knew but me...), you need to link -lGL, -lGLU, and -lpspvfpu to get it. Too bad that's not part of sdl-config --libs.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

SDL is build against pspgl in order to support GL rendering, it is not a thing i added it is part of the default code on SVN. However you're right, i should also add the missing libs to sdl-config.exe it is my bad!
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

I installed 0.8.10 (which includes all libs)...

I can't find libpng or png.h ANYWHERE...
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

if you installed the libs, it should be there. The header file under:

C:\pspsdk\psp\include\png.h

and the lib file:

C:\pspsdk\psp\lib\libpng.a

I've installed the 0.8.10 to C:\pspsdk and i get those files.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Heimdall wrote:if you installed the libs, it should be there. The header file under:

C:\pspsdk\psp\include\png.h

and the lib file:

C:\pspsdk\psp\lib\libpng.a

I've installed the 0.8.10 to C:\pspsdk and i get those files.
Yes it works if I install the Devpaks. But doesn't 0.8.10 come preinstalled with all those libs that are mentioned?
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Using only the 0.8.10 full installer it works.

You must use the full installer, not the lite (without docs, libs). And by default they are selected to install unless you de-select them.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Heimdall wrote:Using only the 0.8.10 full installer it works.

You must use the full installer, not the lite (without docs, libs). And by default they are selected to install unless you de-select them.
Oh... That is the reason why.

Can you create a new type next time "PSP SDK - No Docs + All Libs".

I check the header files and dont use the Doxygen at all.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

I'd look into that for a next release.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

MinPSPW has been updated to GCC 4.3.3 and it's internal libGMP to the latest release. Get it from:

Full SDK (SDK + Docs + Libs): https://sourceforge.net/project/showfil ... _id=656864

Lite (only the SDK): https://sourceforge.net/project/showfil ... _id=656869

No SDK + Libs yet but for the ones using Eclipse I've started to write a small eBook (still in very very very alpha stage) on to use MinPSPW + Eclipse as a full development Environment: (Code, Compile, Link, Deploy and Debug) using the visual IDE. Read it here: http://minpspw.sourceforge.net/files/pspeclipse.pdf
longjoel
Posts: 14
Joined: Thu Jan 29, 2009 4:06 am

Post by longjoel »

Hi, I just got the SDK and have been playing around with it. I can get the examples to compile just fine with Make, but I'm still having problems integrating with code::blocks.

Here are my settings.

Compiler:
-I. -IC:/pspsdk/psp/sdk/include
-IC:/pspsdk/psp/include
-O2 -G0 -Wall -D_PSP_FW_VERSION=150

Linker:
-I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150
-L.
-LC:/pspsdk/psp/sdk/lib
-LC:/pspsdk/psp/lib
-LC:/pspsdk/lib
-lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel

Command line macro: $proj_name is defined elsewhere
$compiler $options $includes -c $file -o $object
psp-fixup-imports $exe_output
mksfo $proj_name PARAM.SFO
psp-strip $exe_output tmp.elf
pack-pbp EBOOT.PBP PARAM.SFO NULL NULL NULL NULL NULL tmp.elf NULL

It compiles just fine but I get the following linking errors when I try the control test sample.

Code: Select all

Linking console executable: bin\Debug\psphi.exe
C:\pspsdk\psp\lib\libc.a(_exit.o): In function `_exit':
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:890: undefined reference to `sceKernelSelfStopUnloadModule'
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:897: undefined reference to `sceKernelExitThread'
C:\pspsdk\psp\lib\libc.a(_sbrk.o): In function `__psp_free_heap':
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:576: undefined reference to `sceKernelFreePartitionMemory'
C:\pspsdk\psp\lib\libc.a(_sbrk.o): In function `_sbrk':
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:549: undefined reference to `sceKernelMaxFreeMemSize'
...and so on down the line.
Does anybody have any advice?
longjoel
Posts: 14
Joined: Thu Jan 29, 2009 4:06 am

Post by longjoel »

longjoel wrote:Hi, I just got the SDK and have been playing around with it. I can get the examples to compile just fine with Make, but I'm still having problems integrating with code::blocks.

Here are my settings.

Compiler:
-I. -IC:/pspsdk/psp/sdk/include
-IC:/pspsdk/psp/include
-O2 -G0 -Wall -D_PSP_FW_VERSION=150

Linker:
-I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150
-L.
-LC:/pspsdk/psp/sdk/lib
-LC:/pspsdk/psp/lib
-LC:/pspsdk/lib
-lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel

Command line macro: $proj_name is defined elsewhere
$compiler $options $includes -c $file -o $object
psp-fixup-imports $exe_output
mksfo $proj_name PARAM.SFO
psp-strip $exe_output tmp.elf
pack-pbp EBOOT.PBP PARAM.SFO NULL NULL NULL NULL NULL tmp.elf NULL

It compiles just fine but I get the following linking errors when I try the control test sample.

Code: Select all

Linking console executable: bin\Debug\psphi.exe
C:\pspsdk\psp\lib\libc.a(_exit.o): In function `_exit':
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:890: undefined reference to `sceKernelSelfStopUnloadModule'
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:897: undefined reference to `sceKernelExitThread'
C:\pspsdk\psp\lib\libc.a(_sbrk.o): In function `__psp_free_heap':
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:576: undefined reference to `sceKernelFreePartitionMemory'
C:\pspsdk\psp\lib\libc.a(_sbrk.o): In function `_sbrk':
../../../../../../../newlib-1.16.0/newlib/libc/sys/psp/libcglue.c:549: undefined reference to `sceKernelMaxFreeMemSize'
...and so on down the line.
Does anybody have any advice?
NM figured it out on my own, just needed to link to libc as well.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Hi longloel, maybe you could explain how to setup code::blocks in a mini tutorial? I usually use Eclipse and visual studio but have no experience on Code::Blocks, is there any special trick to get it working or does it work out of the box?
longjoel
Posts: 14
Joined: Thu Jan 29, 2009 4:06 am

Post by longjoel »

Heimdall wrote:Hi longloel, maybe you could explain how to setup code::blocks in a mini tutorial? I usually use Eclipse and visual studio but have no experience on Code::Blocks, is there any special trick to get it working or does it work out of the box?
Well, I thought I had it working, but it wasn't producing the elfs right, so i switched to theslightly annoying eclipse platform. but I can post the steps I used, and maybe somebody could pickup from there.

First thing I did was autodetect the compiler settings. This is simple with the pspsdk, you just follow code::blocks instructions and it will pick the right compiler for you. Just set the base directory to c:\pspsdk and you are golden.

Second thing I did was build the elf_template from the command line, but piping the output to a file, so i could grab everything it built and feed it back into the compiler settings in code::blocks.

compiler settings were:
-I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150

linker settings were:
-IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L.
-LC:/pspsdk/psp/sdk/lib -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet
-lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel

I think it's a bug, but no matter what i set the extension of the compiled file, it always returns to .EXE, but that doesn't matter, it should still be an .ELF at heart

I then created a batch file I could use to deal with the rest of the process to convert the file to an eboot.

c:\pspsdk\bin\make_eboot.bat
psp-fixup-imports %1
mksfo %2 PARAM.SFO
psp-strip %1 -o tmp
pack-pbp EBOOT.PBP PARAM.SFO NULL NULL NULL NULL NULL tmp NULL
where %1 is the elf/exe file name, %2 is the title of the eboot i think?

Then from codeblocks I add this in as a new tool, using
Name: Eboot maker
Executable: C:\pspsdk\bin\make_eboot.bat
Parameters: ${TARGET_OUTPUT_FILE} ${PROJECT_NAME}

for me this builds just fine, and the tool runs just fine, but the PSP won't load up the eboot file. It gives me the kernel mode error, the one that starts with 8001 something.

So for now i'm using eclipse. If anybody want's to help me keep working on this, with me, just message me here or hit me up on AIM.

Years ago i got code::blocks working with the SEGA Dreamcast doing something similar. I think it would be cool to have a self-contained deployable SDK. [The PSP is far less frusturating than the DC was. Better community too.]
ITDemo
Posts: 20
Joined: Sat Nov 17, 2007 8:08 am

Post by ITDemo »

Edit: I fixed it sorry.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Can you make a minor update with this fix:
http://forums.ps2dev.org/viewtopic.php?t=11006
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

I love the native toolchain, it works nice. Thanks Heimdall :)

I have a question: is there no boost::weak_ptr support in the sdk at this moment? I tried porting a game to the psp and the only problem I have is that there is no implementation of the weak_ptr template. I tried to add the weak_ptr.hpp file manually but obviously that didn't work.
Setting up pspsdk on ubuntu and upcoming tutorials: http://www.guztech.nl
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

jojojoris wrote:Can you make a minor update with this fix:
http://forums.ps2dev.org/viewtopic.php?t=11006
Already started on it :) patching patching patching, i'll make an announcement soon with the build. Now the thing is, should it go on the 0.8.x or 0.9.x series, meaning newlib 1.16 and newlib 1.17...
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Oguz286 wrote:I love the native toolchain, it works nice. Thanks Heimdall :)

I have a question: is there no boost::weak_ptr support in the sdk at this moment? I tried porting a game to the psp and the only problem I have is that there is no implementation of the weak_ptr template. I tried to add the weak_ptr.hpp file manually but obviously that didn't work.
For using boost you need to look into this site:

http://boost4psp.wiki.sourceforge.net/

I never tried it on the psp myself.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Heimdall wrote:
jojojoris wrote:Can you make a minor update with this fix:
http://forums.ps2dev.org/viewtopic.php?t=11006
Already started on it :) patching patching patching, i'll make an announcement soon with the build. Now the thing is, should it go on the 0.8.x or 0.9.x series, meaning newlib 1.16 and newlib 1.17...
latest build includes the patch:

https://sourceforge.net/project/showfil ... _id=661742
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Just released the 0.9.2 build:

this includes:

* newlib 1.17
* psplink fix for the slim
* C++ exceptions working sample
* installer size reduced by not including NLS messages (only english) because of some issues with japanese users

get it here: http://downloads.sourceforge.net/minpsp ... -0.9.2.exe
DanielC
Posts: 40
Joined: Fri Jul 11, 2008 8:10 pm
Location: Australia

Post by DanielC »

Wow I'm downloading the latest SVN of toolchain in cygwin right now, but am definately gonna check this out... being in a native Windows/NTVDM environment will be much more newbie friendly...! Thanks heaps :)
Regards,
Daniel C
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Heimdall, I'm trying to use Eclipse but I have a problem.

I installed your last toolchain.
I have Eclipse with Qt Integration that I launched
I follow your instructions in your .PDF file about Eclipse.

When I try to build I get this :

Code: Select all

**** Build of configuration Default for project Spinning Cube ****


(Cannot run program "make": Launching failed)
Did I miss something ?
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Ok found, I just need to have a start.bat (to launch Eclipse for PSPSDK) which setup the environment the right way :

Code: Select all

@echo off
echo Setting up environment for PSPSDK...

set PATH=C:\pspsdk\bin
set PATH=%PATH%;%SystemRoot%\System32

echo Starting eclipse...
call "M:\dev\eclipse\eclipse.exe" -clean
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

I don't understand...

I was able to debug cube.prx as stated in your eclipse.pdf yesterday or yesterday but one.

but now, when I run pspsh through Eclipse, I have a void console, no message at all. I can type and be sure that they are executed but i cannot see anything except from what I type.

I also tried through cmd.exe. I got the same thing.

SO I tried to type "debug cube.prx" and run Cube Spinning Debug. Eclipse fails to connect.

It drives me crazy.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

The latest Eclipse CDT (5.0.2) is really bad, I've filled a couple of bugs and I see more people complaining about debugging not working properly... I'm trying to get those issue fixed ASAP
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Some progress but just some. I need to close FireFox so PSPSH can run properly (displaying a prompt like "host0:>") .

And yes debugging is not working properly. When I tried cube.prx (-g -O0), it seemed to work. But with my source (-g O2), I have kind of erratic behavior in the source windows.

In fact, I need to debug per instruction to be sure to follow the execution flow. And the normal "step in", "step over" and "step out" don't seem to work as I used to with visual studio, making them mostly unusable.

There is also an issue with stepping over sce-like functions : it breaks in the stub function (jr $ra; syscal ...) and trying to step out is like resuming execution. Quite an annoyance.

Is that normal ?
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

The firefox thing is weird, maybe some cygwin crap, because i build pspsh with cygwin due to some posix stuff I didn't had time to investigate how to migrate to win32 api.
theHobbit
Posts: 65
Joined: Sat Sep 30, 2006 5:26 am

Post by theHobbit »

Hi, i´m trying to use minpspw with eclipse, i'm reading the pspeclipse document, but i got stuck in the Makefile Discovery Options -> Discovery Options part because the Discovery profile list is empty so i can't set the Compiler Invocation Command to psp-gcc. I've just installed the c/c++ Developers version of eclipse as the tutorial suggested but maybe i'm missing something. Hope someone can help.

Thanks in advance.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

That is a eclipse CDT 5.0.2 bug. You can only set it up with 5.0.1 or the up coming 6.0 where it has been fixed. For now you can hack it by copying your psp-gcc.exe and psp-g++.exe to respectively gcc.exe and g++.exe
Post Reply