Based on the libpad sample, i noticed that when calling initializePad when none inserted hangs. Then i found code in the turnips source that must have been pulled out that chekcs for pad's existence: (cheers to pukko!)
Code: Select all
while((ret=padGetState(port, slot)) != PAD_STATE_STABLE) {
if(ret==0) {
// No pad connected!
printf("Pad(%d, %d) is disconnected\n", port, slot);
return 0;
}
printf("looping\n");
}
The problem is that this only seems to work with dualshock (1 and 2) If i have a old digi pad or (more importantly) my remote IR-dongle the above loop goes for ever.(both have 0 modes and identify as a vanilla digital pad) However to find the type i have to do other stuff, which dies when no pad is inserted.
So now i just have to know at compile time what type of pad, rather than if there is one or not.
There has to be a way to achieve this, but i'm yet to find any source to assist.
All ideas are welcome!
thanks - cheriff