mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-13 22:08:34 +00:00
(iOS) Fix icade button mapping
This commit is contained in:
parent
dc16abe728
commit
68e8fbc45f
@ -86,6 +86,11 @@ void apple_input_enable_icade(bool on)
|
||||
icade_buttons = 0;
|
||||
}
|
||||
|
||||
uint32_t apple_input_get_icade_buttons()
|
||||
{
|
||||
return icade_enabled ? icade_buttons : 0;
|
||||
}
|
||||
|
||||
void apple_input_handle_key_event(unsigned keycode, bool down)
|
||||
{
|
||||
keycode = HIDKEY(keycode);
|
||||
@ -131,7 +136,7 @@ static void apple_input_poll(void *data)
|
||||
}
|
||||
|
||||
input_joypad_poll(g_joydriver);
|
||||
g_polled_input_data.pad_buttons[0] |= icade_buttons;
|
||||
g_polled_input_data.pad_buttons[0] |= apple_input_get_icade_buttons();
|
||||
|
||||
g_current_input_data.mouse_delta[0] = 0;
|
||||
g_current_input_data.mouse_delta[1] = 0;
|
||||
|
@ -47,6 +47,7 @@ extern apple_input_data_t g_polled_input_data; //< Game thread data
|
||||
|
||||
// Main thread only
|
||||
void apple_input_enable_icade(bool on);
|
||||
uint32_t apple_input_get_icade_buttons();
|
||||
void apple_input_handle_key_event(unsigned keycode, bool down);
|
||||
|
||||
#endif
|
||||
|
@ -755,7 +755,6 @@ static NSArray* build_input_port_group(config_file_t* config, uint32_t player)
|
||||
{ "nul", 0x00},
|
||||
};
|
||||
|
||||
|
||||
for (int i = 0; ios_key_name_map[i].hid_id; i++)
|
||||
{
|
||||
if (g_current_input_data.keys[ios_key_name_map[i].hid_id])
|
||||
@ -767,9 +766,12 @@ static NSArray* build_input_port_group(config_file_t* config, uint32_t player)
|
||||
}
|
||||
|
||||
// Pad Buttons
|
||||
for (int i = 0; g_current_input_data.pad_buttons[_value.player] && i < sizeof(g_current_input_data.pad_buttons[_value.player]) * 8; i++)
|
||||
uint32_t buttons = g_current_input_data.pad_buttons[_value.player] |
|
||||
((_value.player == 0) ? apple_input_get_icade_buttons() : 0);
|
||||
|
||||
for (int i = 0; buttons && i < sizeof(buttons) * 8; i++)
|
||||
{
|
||||
if (g_current_input_data.pad_buttons[_value.player] & (1 << i))
|
||||
if (buttons & (1 << i))
|
||||
{
|
||||
_value.msubValues[1] = [NSString stringWithFormat:@"%d", i];
|
||||
[self finish];
|
||||
|
Loading…
Reference in New Issue
Block a user