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 

more information about pspctrl.h

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



Joined: 24 Mar 2008
Posts: 140

PostPosted: Mon Apr 14, 2008 12:27 am    Post subject: more information about pspctrl.h Reply with quote

ok.. I want to ask some questions about the pspctrl.h file.

1) what's the meaning of
Code:
 int sceCtrlSetSamplingCycle(int cycle);
? i mean when do i have to use it?

2)same question for
Code:
int sceCtrlSetSamplingMode(int mode);


3) which is the difference between all of these functions?
Code:
int sceCtrlPeekBufferPositive(SceCtrlData *pad_data, int count);

int sceCtrlPeekBufferNegative(SceCtrlData *pad_data, int count);

int sceCtrlReadBufferPositive(SceCtrlData *pad_data, int count);

int sceCtrlReadBufferNegative(SceCtrlData *pad_data, int count);


4)what does these do?
Code:
int sceCtrlPeekLatch(SceCtrlLatch *latch_data);

int sceCtrlReadLatch(SceCtrlLatch *latch_data);


5)and this?
Code:
int sceCtrlSetIdleCancelThreshold(int idlereset, int idleback);



ok, i've asked about all of the functions... but i haven't found anything about them

plaese answer also only one question, it is better than nothing...
_________________
Ciao! from Italy
Back to top
View user's profile Send private message
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Thu Apr 17, 2008 6:44 pm    Post subject: Reply with quote

I don't know about the other functions but I have a comment in my code telling me if I don't call sceCtrlSetSamplingCycle(0); the analog stick doesn't work.

I also have a comment saying this doesn't make any difference:
sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);

I haven't tested my findings thoroughly so I could be wrong. Also as a side note I noticed in homebrew if you put the PSP into "hold mode" the analog stick still generates input (it locks correctly in the XMB picture viewer).
_________________
(+[__]%)
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Apr 18, 2008 6:16 am    Post subject: Re: more information about pspctrl.h Reply with quote

Code:
int sceCtrlSetSamplingCycle(int cycle);

This function tells the controller how often (period in ms) the sampling is performed. Note that if cycle == 0, a VSYNC period is used.

Code:
int sceCtrlSetSamplingMode(int mode);

This function tells the controller whether analog pad should be read as well.

Code:
int sceCtrlPeekBufferPositive(SceCtrlData *pad_data, int count);
int sceCtrlPeekBufferNegative(SceCtrlData *pad_data, int count);
int sceCtrlReadBufferPositive(SceCtrlData *pad_data, int count);
int sceCtrlReadBufferNegative(SceCtrlData *pad_data, int count);

Peek : read up to 'count' data but don't eat them from buffer
Read : eat up to 'count' data from buffer
Positive : bit in data set to 1 means a button pressed
Negative : bit in data set to 0 means a button pressed

Code:
int sceCtrlPeekLatch(SceCtrlLatch *latch_data);
int sceCtrlReadLatch(SceCtrlLatch *latch_data);

Peek/Read : see above
each bit in make/break/oress/release fields describes a button state :
Code:
  x     x     x     1 -> permanent released state
  x     x     1     x -> permanent pressed state
  x     1     x     x -> previously just pressed
  1     x     x     x -> previously just released


so a 1010 -> previously released and now continually pressed
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Fri Apr 18, 2008 8:30 am    Post subject: Reply with quote

Thanks, didn't know that :)
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
phobox



Joined: 24 Mar 2008
Posts: 140

PostPosted: Sat Apr 19, 2008 2:18 am    Post subject: Reply with quote

thanks very much!
_________________
Ciao! from Italy
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