| View previous topic :: View next topic |
| Author |
Message |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Mon Apr 14, 2008 12:27 am Post subject: more information about pspctrl.h |
|
|
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 |
|
 |
Smong
Joined: 04 Sep 2007 Posts: 82
|
Posted: Thu Apr 17, 2008 6:44 pm Post subject: |
|
|
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 |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Fri Apr 18, 2008 6:16 am Post subject: Re: more information about pspctrl.h |
|
|
| 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 |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Fri Apr 18, 2008 8:30 am Post subject: |
|
|
Thanks, didn't know that :) _________________ If not actually, then potentially. |
|
| Back to top |
|
 |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Sat Apr 19, 2008 2:18 am Post subject: |
|
|
thanks very much! _________________ Ciao! from Italy |
|
| Back to top |
|
 |
|