forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GU library?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sat Oct 08, 2005 11:42 pm    Post subject: GU library? Reply with quote

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:
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
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Oct 09, 2005 3:53 am    Post subject: Reply with quote

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/pspsvn/2005-July/000062.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 :'-(
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sun Oct 09, 2005 3:59 am    Post subject: Reply with quote

You probably checked out the wrong branch from SVN. Use the versions in trunk/.
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Oct 09, 2005 4:04 am    Post subject: Reply with quote

I checked out:
svn://svn.ps2dev.org/psp/trunk/pspsdk/sdk/gu
It seems to be correct, isn't it?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sun Oct 09, 2005 4:32 am    Post subject: Reply with quote

Yes. Looks like those defines you were looking for were changed in revision 661.
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Oct 09, 2005 4:50 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sun Oct 09, 2005 5:00 am    Post subject: Reply with quote

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?)
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Oct 09, 2005 5:15 am    Post subject: Reply with quote

Okay thank you. So I have the latest version. But there are still a lot of errors.
Code:
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/pspsvn/2005-July/000076.html
How can I do "svn blame"? I'm under Windows and I use Tortoise, it doesn't seem to have such a command.
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sun Oct 09, 2005 5:28 am    Post subject: Reply with quote

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:
cd /usr/local/pspdev/psp/sdk/samples/gu/cube/
make
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Oct 09, 2005 10:08 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sun Oct 09, 2005 4:25 pm    Post subject: Reply with quote

Code:
info gcc
Back to top
View user's profile Send private message
holger



Joined: 18 Aug 2005
Posts: 204

PostPosted: Sun Oct 09, 2005 8:48 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Mon Oct 10, 2005 5:36 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group