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 

performance cost of sceCtrlReadBufferPositive() ?

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



Joined: 19 Jul 2005
Posts: 3

PostPosted: Tue Jul 19, 2005 7:24 pm    Post subject: performance cost of sceCtrlReadBufferPositive() ? Reply with quote

Hi guys,

possibly a newbie question - but is there a severe performance cost to
a call to sceCtrlReadBufferPositive(&pad, 1); or to repeat calls to it?

I had an app going easily 60 fps but an extra call to this function slowed it down to 30 fps - even if I disabled a lot of other stuff. It's almost if it forced a wait of a full frame. Any ideas?

Thanks in advance. :)
Back to top
View user's profile Send private message
rinco



Joined: 21 Jan 2005
Posts: 255
Location: Canberra, Australia

PostPosted: Tue Jul 19, 2005 8:29 pm    Post subject: Reply with quote

I found things started to freeze if I polled quicker than 1000usec.
Try to limit polling to 1/60th of a second (~16666usec).
Back to top
View user's profile Send private message
whizz



Joined: 19 Jul 2005
Posts: 3

PostPosted: Tue Jul 19, 2005 8:43 pm    Post subject: Reply with quote

Thanks for confirming this. Still wondering why, as it does seem that there's a delay comparable to forcing an extra 1/60th of a second wait (or waiting for next retrace).

Also slightly paranoid now that even the single call could take half a frame... but don't have profiling code in place to test this in any way.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Tue Jul 19, 2005 11:00 pm    Post subject: Reply with quote

whizz wrote:
Thanks for confirming this. Still wondering why, as it does seem that there's a delay comparable to forcing an extra 1/60th of a second wait (or waiting for next retrace).

Also slightly paranoid now that even the single call could take half a frame... but don't have profiling code in place to test this in any way.


The problem is probably that the controls cannot be sampled quicker than 1/60th of a second, and if the function detects that it has been called with a shorter interval than this, it stalls until such time has passed.
_________________
GE Dominator
Back to top
View user's profile Send private message
jpadams



Joined: 02 Jul 2005
Posts: 23
Location: Los Angeles

PostPosted: Wed Jul 20, 2005 2:30 am    Post subject: Reply with quote

try the peek version of the read ?

sceCtrlPeekBufferPositive

worked for me ( i never tested the analog stick with this though )

- j
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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