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 Controls?

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



Joined: 21 Jul 2006
Posts: 36

PostPosted: Sat Sep 23, 2006 9:25 am    Post subject: SDL Controls? Reply with quote

What are the controls in SDL?
For exmaple what is pad.Buttons&PSP_CTRL_CROSS in SDL? I know its sumtin todo with joystick....
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Sep 23, 2006 4:02 pm    Post subject: Reply with quote

README.PSP
Back to top
View user's profile Send private message
bronxbomber92



Joined: 21 Jul 2006
Posts: 36

PostPosted: Sun Sep 24, 2006 3:20 am    Post subject: Reply with quote

I saw that but I'm still confused. Can anyone provide an example?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sun Sep 24, 2006 5:58 pm    Post subject: Reply with quote

The PSP buttons show up as joystick buttons. For SDL documentation on joysticks, see http://psp.jim.sh/sdl-doc/guideinput.html
Back to top
View user's profile Send private message
FreePlay



Joined: 04 Jan 2006
Posts: 71
Location: Schenectady, New York, USA

PostPosted: Mon Sep 25, 2006 7:14 am    Post subject: Reply with quote

My port of LPairs uses the D pad and buttons in SDL. If you want to check out the source, it's included with the release here.

Specifically, in pairs.c, in run_game, you'll see an example of using buttons to simulate a mouse click at a specific location. You could use it to do pretty much anything else, too.

The definitions for the keys I use (X_CROSS, X_SELECT, etc.) are in psp.h.

Porting an SDL game is an excellent way to familiarize yourself with the API. I knew nothing of SDL before I did LPairs, and I still managed to do rather well.
Back to top
View user's profile Send private message
bronxbomber92



Joined: 21 Jul 2006
Posts: 36

PostPosted: Mon Sep 25, 2006 7:48 am    Post subject: Reply with quote

Thanks, but I think there's a password on the zip?
Back to top
View user's profile Send private message
FreePlay



Joined: 04 Jan 2006
Posts: 71
Location: Schenectady, New York, USA

PostPosted: Mon Sep 25, 2006 8:11 am    Post subject: Reply with quote

There shouldn't be. I don't put passwords on my release files. In case you can't get to it:
pairs.h
pairs.c
psp.h
psp.c

Also, I've got this for my init_sdl call:
Code:
init_sdl( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK);
Back to top
View user's profile Send private message
bronxbomber92



Joined: 21 Jul 2006
Posts: 36

PostPosted: Mon Sep 25, 2006 9:05 am    Post subject: Reply with quote

:) Thanks, I'll take a look at these
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