mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(connect_wii.c) Refactor hidpad_wii_axis
This commit is contained in:
parent
e7c7b55004
commit
b9d244bd3b
@ -647,9 +647,13 @@ error:
|
|||||||
static int16_t hidpad_wii_get_axis(void *data, unsigned axis)
|
static int16_t hidpad_wii_get_axis(void *data, unsigned axis)
|
||||||
{
|
{
|
||||||
struct wiimote_t* device = (struct wiimote_t*)data;
|
struct wiimote_t* device = (struct wiimote_t*)data;
|
||||||
|
|
||||||
|
if (!device)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (device && device->exp.type == EXP_CLASSIC)
|
switch (device->exp.type)
|
||||||
{
|
{
|
||||||
|
case EXP_CLASSIC:
|
||||||
switch (axis)
|
switch (axis)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@ -661,6 +665,9 @@ static int16_t hidpad_wii_get_axis(void *data, unsigned axis)
|
|||||||
case 3:
|
case 3:
|
||||||
return device->exp.cc.classic.rjs.y.value * 0x7FFF;
|
return device->exp.cc.classic.rjs.y.value * 0x7FFF;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user