libogc: Pads unusable if unplugged then plugged back in

Post Reply
PeterM
Posts: 9
Joined: Fri Feb 08, 2008 9:34 pm
Location: Edinburgh, UK
Contact:

libogc: Pads unusable if unplugged then plugged back in

Post by PeterM » Fri Feb 08, 2008 9:52 pm

I've tried calling PAD_Init again, but it doesn't seem to help.

WinterMute
Site Admin
Posts: 1478
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: libogc: Pads unusable if unplugged then plugged back in

Post by WinterMute » Sat Feb 09, 2008 5:00 pm

We'll need a testcase I think, currently this works for me although I'm using current CVS & the next toolchain iteration.
Help keep devkitPro toolchains free, Donate today

Personal Blog

PeterM
Posts: 9
Joined: Fri Feb 08, 2008 9:34 pm
Location: Edinburgh, UK
Contact:

Re: libogc: Pads unusable if unplugged then plugged back in

Post by PeterM » Sat Feb 09, 2008 5:35 pm

Thanks for looking into it. I had a quick look through CVS and it's possible that there were fixes:
http://devkitpro.cvs.sourceforge.net/de ... 19&r2=1.20
(Note new variable "connected" in PAD_ScanPads).

I don't use PAD_ScanPads though, I just call PAD_Read in Quake's input update function. It's entirely possible that I'm "doing it wrong". :oops:

WinterMute
Site Admin
Posts: 1478
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: libogc: Pads unusable if unplugged then plugged back in

Post by WinterMute » Mon Feb 11, 2008 3:35 pm

Well, yeah. You should be using the scanpads function or at least providing the same functionality we have in there now. That's one of those lot check items commercial games have to deal with too - input failure after replugging pads is a big no no.
Help keep devkitPro toolchains free, Donate today

Personal Blog

PeterM
Posts: 9
Joined: Fri Feb 08, 2008 9:34 pm
Location: Edinburgh, UK
Contact:

Re: libogc: Pads unusable if unplugged then plugged back in

Post by PeterM » Mon Feb 11, 2008 7:32 pm

Even though I was calling PAD_Read myself, I was checking for all the error codes and acting (as far as I could tell) accordingly.

I switched my code over to use PAD_ScanPads as the post-retrace callback, but still no dice. Once the pad is unplugged, the buttons are always zero. The code is a lot simpler though, so I'll probably keep it this way!

Do you know if this is something which is fixed in the CVS version and handled internally by PAD_ScanPads?
Edit: Sorry, just realised you confirmed that already.

Thanks for looking into these issues by the way.

Eke
Posts: 64
Joined: Sat Mar 01, 2008 11:01 am

Re: libogc: Pads unusable if unplugged then plugged back in

Post by Eke » Sat Mar 01, 2008 12:08 pm

About PAD_ScanPad, we got warnings when we pass it at argument for the function "VIDEO_SetPostRetraceCallback"

the reason is in function type declaration:
typedef void (*VIRetraceCallback)(u32 retraceCnt);
u32 PAD_ScanPads();

it's not really important but maybe this should be fixed as PAD_ScanPads is, as you said, mostly used as PostRetraceCallback

PeterM
Posts: 9
Joined: Fri Feb 08, 2008 9:34 pm
Location: Edinburgh, UK
Contact:

Re: libogc: Pads unusable if unplugged then plugged back in

Post by PeterM » Sat Mar 01, 2008 12:09 pm

I mentioned that to WinterMute recently, who said the PAD_ScanPads call should be moved to your update/main loop and not done in the retrace callback any more.

Eke
Posts: 64
Joined: Sat Mar 01, 2008 11:01 am

Re: libogc: Pads unusable if unplugged then plugged back in

Post by Eke » Sat Mar 01, 2008 9:03 pm

ok, using PostRetraceCallback seemed more optimized but why not :|

anyway, from my first tests with the new release,it seems the issue when unplugging pads has been fixed in libogc , which is good news :P

Eke
Posts: 64
Joined: Sat Mar 01, 2008 11:01 am

Re: libogc: Pads unusable if unplugged then plugged back in

Post by Eke » Sat Apr 12, 2008 3:13 pm

Some precisions: it is fixed in GC mode but NOT in Wii mode !

remove the gamepad then reinsert it, it is not readable anymore

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests