mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
commit
a3757cea70
@ -42,7 +42,15 @@ struct _wiimote_state
|
||||
|
||||
static bool ready = false;
|
||||
|
||||
wiimote_state wiimotes[WIIU_WIIMOTE_CHANNELS];
|
||||
/* it would be nice to use designated initializers here,
|
||||
* but those are only in C99 and newer. Oh well.
|
||||
*/
|
||||
wiimote_state wiimotes[WIIU_WIIMOTE_CHANNELS] = {
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
};
|
||||
|
||||
static unsigned to_wiimote_channel(unsigned pad)
|
||||
{
|
||||
@ -156,13 +164,17 @@ static void kpad_poll_one_channel(unsigned channel, KPADData *kpad)
|
||||
static void kpad_poll(void)
|
||||
{
|
||||
unsigned channel;
|
||||
KPADData kpad;
|
||||
int32_t result = 0;
|
||||
|
||||
for (channel = 0; channel < WIIU_WIIMOTE_CHANNELS; channel++)
|
||||
{
|
||||
KPADData kpad;
|
||||
memset(&kpad, 0, sizeof(kpad));
|
||||
|
||||
if (!KPADRead(channel, &kpad, 1))
|
||||
result = KPADRead(channel, &kpad, 1);
|
||||
if (result == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
kpad_poll_one_channel(channel, &kpad);
|
||||
}
|
||||
@ -186,6 +198,7 @@ static const char *kpad_name(unsigned pad)
|
||||
return PAD_NAME_WIIMOTE;
|
||||
case WIIMOTE_TYPE_NONE:
|
||||
default:
|
||||
RARCH_LOG("[kpad]: Unknown pad type %d\n", wiimotes[pad].type);
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user