From 2e4c2fedb2f1189bc902b4f0a6a0f87cba20bda6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 4 Oct 2014 18:35:23 +0200 Subject: [PATCH] Change apple_pad_interface to pad_connection_interface --- input/apple_input.h | 5 ++++- input/apple_joypad_hid.c | 4 ++-- input/apple_joypad_ios.c | 4 ++-- input/apple_joypad_ps3.c | 2 +- input/apple_joypad_ps4.c | 2 +- input/apple_joypad_wii.c | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/input/apple_input.h b/input/apple_input.h index c5861112ee..1cbc73845a 100644 --- a/input/apple_input.h +++ b/input/apple_input.h @@ -53,11 +53,14 @@ typedef struct struct pad_connection; -struct apple_pad_interface +struct pad_connection_interface { void* (*connect)(void *data, uint32_t slot); + void (*disconnect)(void* device); + void (*packet_handler)(void* device, uint8_t *packet, uint16_t size); + void (*set_rumble)(void* device, enum retro_rumble_effect effect, uint16_t strength); }; diff --git a/input/apple_joypad_hid.c b/input/apple_joypad_hid.c index 47d05d6a84..0736c1abf8 100644 --- a/input/apple_joypad_hid.c +++ b/input/apple_joypad_hid.c @@ -23,7 +23,7 @@ typedef struct { bool used; - struct apple_pad_interface* iface; + struct pad_connection_interface *iface; void* data; bool is_gcapi; @@ -263,7 +263,7 @@ int32_t apple_joypad_connect(const char* name, void *data) static const struct { const char* name; - struct apple_pad_interface* iface; + struct pad_connection_interface *iface; } pad_map[] = { { "Nintendo RVL-CNT-01", &apple_pad_wii }, diff --git a/input/apple_joypad_ios.c b/input/apple_joypad_ios.c index 6fbabe7828..33f1d64cd6 100644 --- a/input/apple_joypad_ios.c +++ b/input/apple_joypad_ios.c @@ -26,7 +26,7 @@ typedef struct { bool used; - struct apple_pad_interface* iface; + struct pad_connection_interface *iface; void* data; bool is_gcapi; @@ -64,7 +64,7 @@ int32_t apple_joypad_connect(const char* name, void *data) static const struct { const char* name; - struct apple_pad_interface* iface; + struct pad_connection_interface *iface; } pad_map[] = { { "Nintendo RVL-CNT-01", &apple_pad_wii }, diff --git a/input/apple_joypad_ps3.c b/input/apple_joypad_ps3.c index 68eb76a4bd..e4b05f1c75 100644 --- a/input/apple_joypad_ps3.c +++ b/input/apple_joypad_ps3.c @@ -169,7 +169,7 @@ static void hidpad_ps3_set_rumble(void *data, } } -struct apple_pad_interface apple_pad_ps3 = +struct pad_connection_interface apple_pad_ps3 = { &hidpad_ps3_connect, &hidpad_ps3_disconnect, diff --git a/input/apple_joypad_ps4.c b/input/apple_joypad_ps4.c index 0f14cd7dc0..99b753ba55 100644 --- a/input/apple_joypad_ps4.c +++ b/input/apple_joypad_ps4.c @@ -178,7 +178,7 @@ static void hidpad_ps4_set_rumble(void *data, #endif } -struct apple_pad_interface apple_pad_ps4 = +struct pad_connection_interface apple_pad_ps4 = { &hidpad_ps4_connect, &hidpad_ps4_disconnect, diff --git a/input/apple_joypad_wii.c b/input/apple_joypad_wii.c index 4bf8ad5e31..ad5c05aed9 100644 --- a/input/apple_joypad_wii.c +++ b/input/apple_joypad_wii.c @@ -116,7 +116,7 @@ static void hidpad_wii_set_rumble(void *data, (void)strength; } -struct apple_pad_interface apple_pad_wii = +struct pad_connection_interface apple_pad_wii = { &hidpad_wii_connect, &hidpad_wii_disconnect,