sceCtrlReadBufferPositive Vs sceCtrlPeekBufferPositive

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
fish
Posts: 25
Joined: Wed Feb 08, 2006 5:12 am

sceCtrlReadBufferPositive Vs sceCtrlPeekBufferPositive

Post by fish »

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?
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

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
fish
Posts: 25
Joined: Wed Feb 08, 2006 5:12 am

Post by fish »

Ta much, that's what I figured but I wanted to be sure in case it messed up later:)
Post Reply