Back to the PSP, sceGU or pspGL?

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

Moderators: cheriff, TyRaNiD

Post Reply
Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Back to the PSP, sceGU or pspGL?

Post by Bytrix »

It's been over a year since I've done any coding for my PSP, and what I did back then was simple SDL stuff mostly. I've spent the last year working on HL2 mods for the PC and I've got some new ideas that I want to try out on my PSP (hint: Why are there no decent helicopter games for the PSP?????)

I've been looking over the latest version of the SDK, I think I know how to do most things, I'm just not sure what to use for the 3D, I haven't used OpenGL style 3D in about 4 years (Direct X Junkie now).

So what would you recommend? Should I take the time to learn the sceGU commands, or just go with pspGL (got the updates version that came with the nehe tutorials). And does anyone have any real stats from them to say how much slower pspGL is? I would assume it's slower, but guess it would only matter if you had alot of geometry.

Also any links or source code for simple apps using sceGU and pspGL would be apreciated, just so I can see how to set things up, draw, rotate, texture etc...

Thanks for any help, look forward to getting back into this and hope I can make something worth playing in the next few months.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

There are lots of GU samples with the SDK.

Also see here for some NeHe tutorials ported to GU: http://www.psp-programming.com/code/ind ... :tutorials
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Re: Back to the PSP, sceGU or pspGL?

Post by holger »

Bytrix wrote:I've been looking over the latest version of the SDK, I think I know how to do most things, I'm just not sure what to use for the 3D, I haven't used OpenGL style 3D in about 4 years (Direct X Junkie now).
The OpenGL1.1 API has not changed over the last 4 years, so you should be familiar with it. libGU is very similiar, but leaves the command buffer and video memory management up to you.

Bytrix wrote:So what would you recommend? Should I take the time to learn the sceGU commands, or just go with pspGL (got the updates version that came with the nehe tutorials). And does anyone have any real stats from them to say how much slower pspGL is? I would assume it's slower, but guess it would only matter if you had alot of geometry.
libGU and pspGL do about the same: encoding very similiar API calls into very similiar command packets that are then sent using the DMA engine to the graphics unit.

Since you need to handle the command buffer setup and video management somewhere else in your software, you won't gain much in performance or overall code size by prefering either API, it's just a matter of personal taste.

The advantage of OpenGL is portability to other consoles, and, maybe more important, faster development turnaround cycles on the desktop.

Bytrix wrote:Also any links or source code for simple apps using sceGU and pspGL would be apreciated, just so I can see how to set things up, draw, rotate, texture etc...
If you want to compare the two APIs, check out the examples. A few of them are exactly matching counterparts for libGU and pspGL. You find quite a lot of OpenGL examples on the web, tutorials and API documentation on http://www.opengl.org/.
Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Post by Bytrix »

Thanks

I was leaning more towards trying out pspGL as it looks more familiar. I guess I need to start going over all the samples in the SDK.

Are there any other files I should download, any useful libraries that do things not included in the SDK? I have been round a bunch of PSP sites and got a bunch of stuff but for now I'm just gonna try and use the SDK+pspGL.
Tomaz
Posts: 2
Joined: Fri Aug 25, 2006 7:50 am
Contact:

Post by Tomaz »

(hint) There is at least 1 Helicopter game in the makes for the PSP.. I know because im making it ;)
Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Post by Bytrix »

Hehe, well there can never be enough.

I've been working on a helicopter game for ages on the PC using a simple engine I wrote myself. Two of my favourite games were RedZone (HardWired) on the Genesis and Swiv3D on the PC. My little PC game is a sort of hybrid (RedZone had top down chopper action and also top-down shooter style action) (Swiv3D is just a simple 3D flying around blowing everything up).

I spent half an hour lastnight trying to get pspGL to compile using the pspdev downloadable environment for windows but it wouldn't let me because of AWK. So I might try using sceGU anyway.

I'll be looking forward to seeing your game and keep an eye on your progress ;-)
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Post by holger »

Bytrix wrote:I spent half an hour lastnight trying to get pspGL to compile using the pspdev downloadable environment for windows but it wouldn't let me because of AWK. So I might try using sceGU anyway.
You don't need AWK to build PSPGL. These lines are put into the Makefile by Jeremy to avoid PSPGL library programming mistakes, to keep the code namespace safe&clean.

Simply remove lines 178-185 from the Makefile, if you don't have AWK installed.

hope this helps,
Holger
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Post by holger »

correction: The current Make system generates the function pointer table for eglGetProcAddress() on-the-fly. If you don't have the unix-tools installed, just copy this into a file called "pspgl_proctable.h":

Code: Select all

        /* start of file */
        { "glBindBufferARB", (void (*)())glBindBufferARB },
        { "glBufferDataARB", (void (*)())glBufferDataARB },
        { "glBufferSubDataARB", (void (*)())glBufferSubDataARB },
        { "glColorTableEXT", (void (*)())glColorTableEXT },
        { "glDeleteBuffersARB", (void (*)())glDeleteBuffersARB },
        { "glDisableStatsPSP", (void (*)())glDisableStatsPSP },
        { "glDrawBezierArraysPSP", (void (*)())glDrawBezierArraysPSP },
        { "glDrawBezierElementsPSP", (void (*)())glDrawBezierElementsPSP },
        { "glDrawBezierRangeElementsPSP", (void (*)())glDrawBezierRangeElementsPSP },
        { "glDrawSplineArraysPSP", (void (*)())glDrawSplineArraysPSP },
        { "glDrawSplineElementsPSP", (void (*)())glDrawSplineElementsPSP },
        { "glDrawSplineRangeElementsPSP", (void (*)())glDrawSplineRangeElementsPSP },
        { "glEnableStatsPSP", (void (*)())glEnableStatsPSP },
        { "glGenBuffersARB", (void (*)())glGenBuffersARB },
        { "glGetBufferSubDataARB", (void (*)())glGetBufferSubDataARB },
        { "glGetStatisticsuivPSP", (void (*)())glGetStatisticsuivPSP },
        { "glLockArraysEXT", (void (*)())glLockArraysEXT },
        { "glMapBufferARB", (void (*)())glMapBufferARB },
        { "glPatchSubdivisionPSP", (void (*)())glPatchSubdivisionPSP },
        { "glResetStatsPSP", (void (*)())glResetStatsPSP },
        { "glUnlockArraysEXT", (void (*)())glUnlockArraysEXT },
        { "glUnmapBufferARB", (void (*)())glUnmapBufferARB },
        { "glWeightPointerPSP", (void (*)())glWeightPointerPSP },
        /* end of file */

Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Post by Bytrix »

Thanks, I hadn't really looked into the make file. I had already edited alot of files which relied on the SDK files being in /usr/local (and ofcourse they were in d:\pspdev, but that was easy to fix, then I got the awk error and tried sticking the executable in the bin directory but it moaned about the way it was being called, so I was going to give up.

I'll try your suggestions, thanks fo the info.
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Post by holger »

Bytrix wrote:Thanks, I hadn't really looked into the make file. I had already edited alot of files which relied on the SDK files being in /usr/local (and ofcourse they were in d:\pspdev, but that was easy to fix, then I got the awk error and tried sticking the executable in the bin directory but it moaned about the way it was being called, so I was going to give up.
Can you please be a little more specific, where did you found such dependencies -- the library should in fact not rely on any particular installation path prefix...?
Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Post by Bytrix »

in almost every .d file it was looking for the SDK in /usr/local/

eg:

Code: Select all

D:\pspdev\src\pspgl_modified_v0.2\.deps\eglBindTexImage.d(2):  /usr/local/pspdev/lib/gcc/psp/4.0.2/include/stddef.h GLES/egl.h \
D:\pspdev\src\pspgl_modified_v0.2\.deps\eglBindTexImage.d(3):  GLES/gl.h GLES/egltypes.h /usr/local/pspdev/psp/sdk/include/pspvfpu.h \
D:\pspdev\src\pspgl_modified_v0.2\.deps\eglBindTexImage.d(5):  /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/sys/types.h \
D:\pspdev\src\pspgl_modified_v0.2\.deps\eglBindTexImage.d(6):  /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/_ansi.h \
D:\pspdev\src\pspgl_modified_v0.2\.deps\eglBindTexImage.d(7):  /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/newlib.h \
I'm using 'pspGL modified 0.2', is there are a later version or a better version I should be using? Perhaps I should download from the svn.. (http://svn.pspdev.org/listing.php?repna ... rev=0&sc=0)
Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Post by Bytrix »

Thanks Holger, finally got it sorted, downloaded 2092 from SVN, created the pspgl_proctable.h file and removed the references to awk from the Makefile and it all compiles properly now.
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Post by holger »

Bytrix wrote:Thanks Holger, finally got it sorted, downloaded 2092 from SVN, created the pspgl_proctable.h file and removed the references to awk from the Makefile and it all compiles properly now.
yes, please use the SVN source whenever possible.
User avatar
Barts_706
Posts: 38
Joined: Tue Jan 24, 2006 2:21 pm
Contact:

Post by Barts_706 »

Very interesting thread... I actually am trying to get back to PSP coding and was asking myself the same question - going back to what little I know about pspGL or try to learn sceGU. I'm afraid the latter is a little more demanding, but it was interesting to read all the above.

Bytrix : I loved Swiv3D, so if you do that, you'll have my personal grattitude :]
Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Post by Bytrix »

Thanks, it's amazing how many people think Swiv3D sucks. It's true it's a very simplistic game, but I think that only makes it addictive, and for a game like that on handheld is perfect because you're not expected to play it for hours on end. Small missions are better that maybe only take 10 minutes to complete.

I did have more problems after the original make with pspgl, when I ran 'make install' the mkdir command that comes with pspdev for win32 wouldn't work with the -p argument, so I ended up copying all the libraries and headers over manually. But atleast I've got it all set up properly now.

Already run through all the Nehe tutorials for PSP (remember doing those for PC a looooong time ago) and I'm well on the way with the basic framework for the game. Levels are easy enough as they load from a heightmap with another file detailing object placement, and because there isn't really alot of objects in the game it means I can make the models pretty detailed and don't have to scrimp on texture resolution for the terrain. I'm hoping to make this really good looking and fun to play.
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Post by holger »

Bytrix wrote:when I ran 'make install' the mkdir command that comes with pspdev for win32 wouldn't work with the -p argument, so I ended up copying all the libraries and headers over manually.
is this option really not supported by the cygwin tools? Probably best to fix it there. At least you should need to create the directory structure only once, thenafter the directory tree does not needs to get re-created unless you delete it.
Bytrix
Posts: 72
Joined: Wed Sep 14, 2005 7:26 pm
Location: England

Post by Bytrix »

No, I'm pretty sure the Cygwin tools would work fine with it.. I'm using the pre-packaged PSPdev environment for win32 which differs slightly (as I thought it was the easiest way to get everything fully up to date). Got it all working now anyway.
Post Reply