1

Topic: PSP port

Hi there,

I'm trying to port neverball on PSP since a week. Here's my current progress :
http://www.youtube.com/watch?v=-0uGv8SYfYo

I run through several GL issues with the 1.5.4 version, though.
Do you think it's a good idea to restart my work with the current svn version? Does it have any known issues ?

Thanks in advance smile

2

Re: PSP port

Cool!

What kind of issues have you run into?

I recommend basing your work on SVN code, if possible. SVN has had a massive renderer rewrite to make it OpenGL ES compatible, which eases porting to embedded platforms but also makes 1.5.4 based ports mostly obsolete (i.e., difficult to update).

Looking forward to seeing more progress on this.

3 (edited by GeeckoDev 2012-01-17 13:42:09)

Re: PSP port

I made a fresh start on the r3727.

For the moment, SDL crashes at launch. I'm investigating right now...

See my Git ( tongue ) repos here : https://github.com/GeeckoDev

EDIT: since the PSP doesn't support multitexturing and point sprites, glext_init was returning 0 causing a breakpoint.
Multitexturing is only used for shadows, which are desactivated, but point sprites ?

4

Re: PSP port

Point sprites are used for coin particles.

Both multitexture and point sprites are meant to be optional, there's just a little bit of code missing. Basically you would simply need to ensure that you don't use features (functions and probably symbols) from these extensions if the extensions are not found. Then you can safely remove the checks in the return statement of glext_init to make them optional.

Note that VBO support is mandatory, though. glext_init should still return 0 if VBOs are not supported.

I'll fix the code in SVN when I get a chance.

5

Re: PSP port

A PSP port is long overdue!

Out of curiosity, what kind of performance are you getting?

Currently Playing:
Celeste and Electronic Super Joy

6 (edited by GeeckoDev 2012-01-18 12:17:48)

Re: PSP port

Ok then, particles will not be drawn. In 1.5.4 it was one of the only thing that was working properly tongue
Thanks for fixing this !

The 1.5.4 version achieved ~10fps ingame, but there was some I/O when going ingame for some reason. It was slowing the framerate. Display lists were not supported well unlike the VBOs, so the render was again very slow because of this (lists were not compiled). There's a few VFPU (vector floating point unit on the PSP) optimizations to do with quaternions on the current svn version to get even more performance. smile

Currently, I get crashes when I call glGenBuffers. Looks like the function pointer is set to NULL. I don't know why for the moment.

7

Re: PSP port

GeeckoDev wrote:

Ok then, particles will not be drawn. In 1.5.4 it was one of the only thing that was working properly tongue

Eventually I hope to restore the billboard-based (quad) particles as an option. We switched to point sprites originally to gain performance on embedded systems, but desktop systems don't really benefit from that and point sprites are quite limited compared to billboards.

Currently, I get crashes when I call glGenBuffers. Looks like the function pointer is set to NULL. I don't know why for the moment.

If the ARB_vertex_buffer_object extension is present, but the corresponding function pointers are NULL, SDL is probably at fault (SDL_GL_GetProcAddress). You may have to find a different (e.g., platform-specific) way to retrieve the necessary entry points.

8 (edited by GeeckoDev 2012-01-19 16:17:28)

Re: PSP port

Some progress today.
I fixed the crash by including "GLES/gl.h" instead of "GL/gl.h". I had to comment calls to glClientActiveTexture_ and glActiveTexture_ calls (these are used for multitexturing?).
The menu appears, the background is drawn fine, as well as the checkpoint. I hear the music.
But, the text and the level are not drawn at all. The framerate seems very bad, but I think it is due to the intense error log of pspgl

EDIT
Commented out every GL call not supported. The framerate almost doubled to 20fps.
-> glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 1);
-> glEnable(GL_POLYGON_OFFSET_FILL);
-> glPolygonOffset(-1.0f, -2.0f);
-> glEnable(GL_COLOR_MATERIAL);
-> glEnable(GL_CLIP_PLANE*);
-> glEnable(GL_NORMALIZE);

EDIT 2
I desactived GL_BLEND in sol_draw_all and guess what!

https://p.twimg.com/Ajh1HpLCAAA003_.png

big_smile ... but the checkpoints are filled with black now.

EDIT 3
FPU exception (divide by zero) solid_sim_sol.c:76
again in solid_sim_sol.c:222

EDIT 4
I corrected the first crash by using the hack described in a comment.
The second crash was solved by replacing :
if (vn - wn <= 0.0f) to if (vn - wn < 0.0f)
in line 217.

EDIT 5
I'm busy cutting down the resolution of the textures. For example, the ball's texture size is 512*256, which is enormous for the PSP. I scaled it down to 128*64, to get better framerate and more available memory.

9

Re: PSP port

This is starting to look a lot like the Android port... great (and fast) work!

Currently Playing:
Celeste and Electronic Super Joy

10 (edited by GeeckoDev 2012-01-21 10:31:48)

Re: PSP port

Thanks ! Two screenshots :

https://p.twimg.com/Aji41isCMAAVfd_.png

https://p.twimg.com/Aji4mpmCMAAu-vD.png

Any clues about the text rendering problem?

11

Re: PSP port

No idea on the text rendering, but otherwise it's looking pretty neat.

Cheese
==========
cheesetalks.net

12

Re: PSP port

There are many things that can fail there, you'll need to do your own debugging. We use SDL_ttf to render text, so you should probably check that first.

13

Re: PSP port

I found this PSP SDL_ttf on the interwebs. Sorry about the long link.

http://psp.jim.sh/svn/listing.php?repna … 3be466fa8a

Looking good!

Currently Playing:
Celeste and Electronic Super Joy

14

Re: PSP port

There's no problem with SDL_ttf, because I got the text render fine with 1.5.4.
In fact, sometimes I see a corrupted glyph somewhere. I think there's some memory corruption somewhere, but it will be _very_ hard to find...

15 (edited by themacmeister 2012-01-22 10:07:54)

Re: PSP port

I have seen other homebrew for PSP that uses a .bmp font file. Do you think Unicode support might be to blame?

I know there were some severe bugs in later versions of SDL.

If you search through the many other devel threads here, you may well find a sensible solution...?

EDIT: readability

Currently Playing:
Celeste and Electronic Super Joy

16

Re: PSP port

GeeckoDev wrote:

There's no problem with SDL_ttf, because I got the text render fine with 1.5.4.
In fact, sometimes I see a corrupted glyph somewhere. I think there's some memory corruption somewhere, but it will be _very_ hard to find...

Out of memory maybe? Does pspgl implement glGetError?

17 (edited by GeeckoDev 2012-01-23 23:07:55)

Re: PSP port

I'm getting this in a log file :

*** GL error 0x0505 in __pspgl_teximg_new ***

I have to investigate to find when this error happens (out of memory indeed).

EDIT: Since the background will not be drawn, i removed the data/png/ folder. No more 512*512 useless background textures loaded, i think the memory problem is solved lol

EDIT2: This doesn't seem to change anything about the font rendering problem.

18 (edited by themacmeister 2012-01-24 06:39:52)

Re: PSP port

are you using this?

svn checkout svn://svn.pspdev.org/psp/trunk/SDL_ttf

also: saw this:

2009/07/07
1. rename font color from rbga to rgba.(this is a bug)

I am unaware what NB uses, but I believe the format has changed at least once.

Also saw this (valloc.h, and others, many fixes)

http://psp.jim.sh/svn/comp.php?repname= … %5D=/@2494

In this code there is the phrase "bad font format". Also, I am unaware of the endianess of font files, and if this is even an issue (I am not a programmer). Although, I WOULD like to see a PSP port at some point!

Cheers.

EDIT: more useless ill-informed links smile

Currently Playing:
Celeste and Electronic Super Joy

19

Re: PSP port

Can you publish the log file you are referring to?

Why will the background not be drawn, BTW?

20 (edited by GeeckoDev 2012-01-24 07:19:04)

Re: PSP port

The framerate is already low, so I don't think the background is THAT useful wink
The log file is created by pspgl. It was containing this single line.

@themacmeister:
I'm using an old and a very new version of SDL_ttf, but it gaves me the same result.
Also, your repo is very outdated. I recently rebuilt my SDK with this : https://github.com/pspdev

There is issues with the environment mapping, as you can see in the first screenshot. How can I get rid of these repeating textures?

21

Re: PSP port

Wow, I didn't think drawing the background would introduce much extra load.

Cheese
==========
cheesetalks.net

22

Re: PSP port

The PSP isn't designed to draw large textures. The background will be drawn, but not the textures like "space.png" or "jupiter.png".

23

Re: PSP port

Hmm... space.png is 146 bytes (the smallest background image we use).

But yeah, most of the background billboard images are probably a bit big. Could lower res/simpler images be doable, do you think? The level that is made up of the text "Neverball" looks pretty naked the way it is in your screenshot big_smile

Cheese
==========
cheesetalks.net

24

Re: PSP port

I don't think that a fancy-looking game which is not playable is prefered to the inverse.
Anyway, when i'll get this playable game, we'll see about the background smile

25

Re: PSP port

I totally agree. Just saying it'd be nice to maintain as much of Neverball's visual characteristics as possible (but not at the expense of gameplay smile )

Cheese
==========
cheesetalks.net