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 

SDL Initialization / Issues

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



Joined: 14 Aug 2005
Posts: 20

PostPosted: Tue Aug 22, 2006 11:03 pm    Post subject: SDL Initialization / Issues Reply with quote

So I wrote my recent RPG engine on my Macbook pro using SDL (for faster compilation and testing) and began running it on the PSP last week. I'm noticing some definitely issues and lag when running on the handheld.

- The first issue was my fading screen code was "flickering" when using double buffering. Now, I'm sure this is something I can figure out... but is there an issue with SDL_DOUBLEBUF that I need to be aware of?

- The main issues is the lagging. I'm rather new to the PSP scene, and my graphics are NOT optimized in any way shape or form (they're rather big). Could it be possible that the graphics are taking up too much memory causing the game to lag a bit? Or would this be based entirely on the CPU?

- My currently released demo uses the following initialization:
Code:

screen = SDL_SetVideoMode(480, 272, 32,SDL_SWSURFACE|SDL_NOFRAME);
SDL_ShowCursor(SDL_DISABLE);


Notice the lack of doublebuf since I didn't notice any improvement with it enabled... I may be naive here so I was hoping I could get some suggestions on the best way to initialize SDL for the PSP? (hardware vs software.. does doublebuf make a big difference? I read up on how SDL handles it if doublebuf is NOT present and it seems very similar...)

Thanks in advance for the help guys!
Back to top
View user's profile Send private message
danzel



Joined: 04 Nov 2005
Posts: 182

PostPosted: Wed Aug 23, 2006 6:44 am    Post subject: Reply with quote

Go to 16 bit color to get a big speed increase:

screen = SDL_SetVideoMode(480, 272, 16,SDL_SWSURFACE|SDL_NOFRAME);
Back to top
View user's profile Send private message
framerate



Joined: 14 Aug 2005
Posts: 20

PostPosted: Wed Aug 23, 2006 6:54 am    Post subject: Reply with quote

danzel wrote:
Go to 16 bit color to get a big speed increase:

screen = SDL_SetVideoMode(480, 272, 16,SDL_SWSURFACE|SDL_NOFRAME);


It really makes that big of a difference, eh?. Also, you're recommending SWSURFACE over HWSURFACE and don't think DOUBLEBUF makes that big of a diff? Or just correcting my code? :)
Back to top
View user's profile Send private message
danzel



Joined: 04 Nov 2005
Posts: 182

PostPosted: Wed Aug 23, 2006 11:43 am    Post subject: Reply with quote

Not really sure on what flags to pass through, In AFKIM I'm passing 0.

Based on the readme I don't think passing SDL_HWSURFACE will do anything
Quote:
Video - yes, single 32-bit ABGR framebuffer surface only; SDL will
emulate other formats as necessary. No HW accel. No 3D.
Back to top
View user's profile Send private message
ufoz



Joined: 10 Nov 2005
Posts: 86
Location: Tokyo

PostPosted: Wed Aug 23, 2006 11:50 am    Post subject: Reply with quote

danzel wrote:
Not really sure on what flags to pass through, In AFKIM I'm passing 0.

Based on the readme I don't think passing SDL_HWSURFACE will do anything
Quote:
Video - yes, single 32-bit ABGR framebuffer surface only; SDL will
emulate other formats as necessary. No HW accel. No 3D.


Looking at the sdl-psp source, it makes all the difference. HW_SURFACE data goes in video memory and uses the GU for blits, and I remember it being a huge speedup when I finally remembered setting it back when I tried SDL.

(then I abandoned SDL because the input lagged horribly, not sure why that was happening)
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
framerate



Joined: 14 Aug 2005
Posts: 20

PostPosted: Wed Aug 23, 2006 12:54 pm    Post subject: Reply with quote

ufoz wrote:
danzel wrote:
Not really sure on what flags to pass through, In AFKIM I'm passing 0.

Based on the readme I don't think passing SDL_HWSURFACE will do anything
Quote:
Video - yes, single 32-bit ABGR framebuffer surface only; SDL will
emulate other formats as necessary. No HW accel. No 3D.


Looking at the sdl-psp source, it makes all the difference. HW_SURFACE data goes in video memory and uses the GU for blits, and I remember it being a huge speedup when I finally remembered setting it back when I tried SDL.

(then I abandoned SDL because the input lagged horribly, not sure why that was happening)


Interesting...

I'm gonna try a build tomorrow with SDL_HWSURFACE and 16 bit textures.. see how drastic the framerate increase is.

Any experiences enable/disable SDL_DOUBLEBUF ?
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