GU library?

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

Moderators: cheriff, TyRaNiD

Post Reply
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

GU library?

Post by Brunni »

Hello all! :)
I'm new here, my english is not very good, sorry for my errors. I'm new in PSP development, I mainly programmed on PC, GBA, TI89 before, which are sensibly different from PSP ;)
I just installed the PSP toolchain, which took 5 hours for the script to complete. I tried to recompile a simple sample but I realized that a LOT of functions were missing, pretty all beginning with "sceGu" and related defines.
I searched a lot to get the gu library, I downloaded the latest PSPSDK, hopping it would fix this, but not. If I google I see that gu should be included with PSPSDK (/sdk/gu/...), but there's NOTHING in the one I downloaded (from the sticky topic in this section)... I found a link to the GU library but it was broken...
I also tried to recompile another SIMPLE program, which gives me:

Code: Select all

Florian@FLORIAN ~/docs/me
$ ./build
me_mem_dump.c: In function 'main':
me_mem_dump.c:15: warning: passing argument 1 of '_sw' makes integer from pointe
r without a cast
/usr/local/pspdev/bin/../psp/lib/libc.a(sbrkr.o): In function `_sbrk_r':
../../../../../newlib/libc/reent/sbrkr.c:60: undefined reference to `sbrk'
../../../../../newlib/libc/reent/sbrkr.c:60: relocation truncated to fit: R_MIPS
_26 against `sbrk'
main.c: In function 'test':
main.c:25: warning: passing argument 2 of 'sceIoWrite' makes pointer from intege
r without a cast
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -lpspdis
play
collect2: ld returned 1 exit status
Altrough I can compile my hello world with pspDebugScreenPrintf and a lot of other functions...
Can you help me please? What should I download to use GU and other functions not found?
Thank you in advance
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

I downloaded the latest PSPSDK version through the svn.ps2dev.org, but it's still missing a lot of things, like GE_PSM_8888, GU_DISPLAY_ON, and also functions like sceKernelDcacheWriteBackAll.
When I search with google, I get something about files that has been modified, usually in July (might those have been removed since?):
http://lists.ps2dev.org/pipermail/pspsv ... 00062.html
I get the files from SVN (with Tortoise), but they don't contain anything described here, it seems just to be an old version... :(
I tried ANYTHING I saw on Internet, it took me the entire day, I'm really despaired... Pleeeeeeeaaaaaaaaaaaaase help me :'-(
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

You probably checked out the wrong branch from SVN. Use the versions in trunk/.
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

I checked out:
svn://svn.ps2dev.org/psp/trunk/pspsdk/sdk/gu
It seems to be correct, isn't it?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Yes. Looks like those defines you were looking for were changed in revision 661.
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thank you :)
Last thing, I want to install it, I have the old version of PSPSDK (1.0+bêta), along with the latest psptoolchain I downloaded and installed yesterday.
I downloaded anything from svn://svn.ps2dev.org/psp/trunk/pspsdk to C:\cygwin\home\user\psp. I ran ./bootstrap, ./configure, make, make install (like written in the readme), it took a bit less than an hour, without any error. But now I don't know where it was installed, what must I do to use it?
Sorry, I'm a total newbie, and didn't find anything over Internet.
Thanks in advance
(BTW, where did you read these defines were removed? I would like to know by what I should replace them)
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

When you install the toolchain, it automatically checks out the latest pspsdk from subversion and builds it, so you probably didn't even need to rebuild it, but it should install to /usr/local/pspdev by default.

I found GU_PSM_8888 and used "svn blame" to see when it was added. In general, keeping up with the commits via the mailing list is a good way to keep track of changes; the pspsdk is still new and some areas change often.

(The mailing lists are actually not delivering mail at the moment, but hopefully they'll be back soon? John?)
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Okay thank you. So I have the latest version. But there are still a lot of errors.

Code: Select all

Florian@FLORIAN ~/docs/me
$ ./build
me_mem_dump.c: In function 'main':
me_mem_dump.c:15: warning: passing argument 1 of '_sw' makes integer from pointe
r without a cast
/usr/local/pspdev/bin/../psp/lib/libc.a(_sbrk.o): In function `_sbrk':
../../../../../../newlib/libc/sys/psp/libcglue.c:406: undefined reference to `sc
eKernelAllocPartitionMemory'
../../../../../../newlib/libc/sys/psp/libcglue.c:406: relocation truncated to fi
t: R_MIPS_26 against `sceKernelAllocPartitionMemory'
../../../../../../newlib/libc/sys/psp/libcglue.c:408: undefined reference to `sc
eKernelGetBlockHeadAddr'
../../../../../../newlib/libc/sys/psp/libcglue.c:408: relocation truncated to fi
t: R_MIPS_26 against `sceKernelGetBlockHeadAddr'
../../../../../../newlib/libc/sys/psp/libcglue.c:402: undefined reference to `sc
eKernelMaxFreeMemSize'
../../../../../../newlib/libc/sys/psp/libcglue.c:402: relocation truncated to fi
t: R_MIPS_26 against `sceKernelMaxFreeMemSize'
/usr/local/pspdev/bin/../psp/lib/libc.a(_sbrk.o): In function `__psp_free_heap':

../../../../../../newlib/libc/sys/psp/libcglue.c:428: undefined reference to `sc
eKernelFreePartitionMemory'
../../../../../../newlib/libc/sys/psp/libcglue.c:428: relocation truncated to fi
t: R_MIPS_26 against `sceKernelFreePartitionMemory'
main.c: In function 'test':
main.c:25: warning: passing argument 2 of 'sceIoWrite' makes pointer from intege
r without a cast
I'm becoming insane with this. No way to compile this simple sample. If I search for example for sceKernelFreePartitionMemory, and IT'S in pspsdk, but why did it not find it? I don't see any reason for which kernel functions would be removed...
http://lists.ps2dev.org/pipermail/pspsv ... 00076.html
How can I do "svn blame"? I'm under Windows and I use Tortoise, it doesn't seem to have such a command.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

I have no idea what your code or build process looks like, but it appears you're not linking against the right libraries. You need -lpsuser and -lpsputility at least. See the build.mak in pspsdk.

Or just start with samples that actually work:

Code: Select all

cd /usr/local/pspdev/psp/sdk/samples/gu/cube/
make
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thank you very much for your replies, it works now :)
Now I have another problem, I don't know how to generate assembly files at compilation (maybe they're deleted manually, but I can't find where).
I want to see what code GCC generates for some routines... Do you have an idea?
Thank you in advance
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Code: Select all

info gcc
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Post by holger »

Brunni wrote:Thank you very much for your replies, it works now :)
Now I have another problem, I don't know how to generate assembly files at compilation (maybe they're deleted manually, but I can't find where).
I want to see what code GCC generates for some routines... Do you have an idea?
Thank you in advance
try "gcc -S" (write intermediate asm code, cluttered with gcc-specifics) and "psp-objdump -d" (to view plain disassembly). The latter is part of the binutils.
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

In fact, I would like to generate ASM files automatically trough my makefile, so I put:
CFLAGS = -O2 -G0 -Wall -lpspuser -lpsputility -s
In my makefile, but it doesn't work (neither with -S), not any assembly file is generated.
One time, it was okay, I don't know why, but I had run psp-gcc manually and hard-coded options, which is dirty. Do you have a method to do this from the makefile?
Post Reply