mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 18:35:22 +00:00
(iOS) Add Classic Controller support.
This commit is contained in:
parent
dbc3e3f7ff
commit
92d0cac17a
@ -53,7 +53,14 @@ static int16_t ios_joypad_axis(unsigned port, uint32_t joyaxis)
|
||||
static void ios_joypad_poll(void)
|
||||
{
|
||||
for (int i = 0; i != MAX_PLAYERS; i ++)
|
||||
g_buttons[i] = (i < myosd_num_of_joys) ? joys[i].btns : 0;
|
||||
{
|
||||
g_buttons[i] = 0;
|
||||
if (i < myosd_num_of_joys)
|
||||
{
|
||||
g_buttons[i] = joys[i].btns;
|
||||
g_buttons[i] |= (joys[i].exp.type == EXP_CLASSIC) ? (joys[i].exp.classic.btns << 16) : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const rarch_joypad_driver_t ios_joypad = {
|
||||
|
@ -149,9 +149,12 @@ static NSString* get_key_config_name(uint32_t hid_id)
|
||||
{
|
||||
for (int i = 0; i != myosd_num_of_joys; i ++)
|
||||
{
|
||||
for (int j = 0; j != sizeof(joys[i].btns) * 8; j ++)
|
||||
uint32_t buttons = joys[i].btns;
|
||||
buttons |= (joys[i].exp.type == EXP_CLASSIC) ? (joys[i].exp.classic.btns << 16) : 0;
|
||||
|
||||
for (int j = 0; j != sizeof(buttons) * 8; j ++)
|
||||
{
|
||||
if (joys[i].btns & (1 << j))
|
||||
if (buttons & (1 << j))
|
||||
{
|
||||
_value.msubValues[1] = [NSString stringWithFormat:@"%d", j];
|
||||
[self finish];
|
||||
|
Loading…
x
Reference in New Issue
Block a user