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 

sceCtrlReadBufferPositive Vs sceCtrlPeekBufferPositive

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



Joined: 08 Feb 2006
Posts: 25

PostPosted: Tue Feb 14, 2006 2:37 am    Post subject: sceCtrlReadBufferPositive Vs sceCtrlPeekBufferPositive Reply with quote

Can anyone explain the difference between sceCtrlReadBufferPositive and sceCtrlPeekBufferPositive?

Peek is undocumented in the PSPSDK docs.

I've not done any experiments other than using one in my game vs using the other I still get all the same information about the analogue nub and the buttons using both methods.

Read limits my update to 60Hz, regardless of anything else in the game, but Peek doesn't. Is Read waiting inside the function for the pad information to be updated by the system? or is there another reason that it limits limits the speed?
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Tue Feb 14, 2006 4:03 am    Post subject: Reply with quote

Read will always return a result. However, to do that, it might stall until new data is available (as you noticed). This stall seems to wait until the next vertical blank.

Peek might fail to return a result (hence the returncode), but it will never stall the execution to collect controller data. This is the preferred method if you want to be in control of what stalls your application.
_________________
GE Dominator
Back to top
View user's profile Send private message
fish



Joined: 08 Feb 2006
Posts: 25

PostPosted: Tue Feb 14, 2006 4:31 am    Post subject: Reply with quote

Ta much, that's what I figured but I wanted to be sure in case it messed up later:)
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