mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-27 14:23:06 +00:00
Rename hid_driver_instance members for clarity
This commit is contained in:
parent
4b9d5c0ab7
commit
dc6f4c23ed
@ -45,8 +45,8 @@ static void *wiiu_gca_init(hid_driver_instance_t *driver)
|
||||
memset(instance, 0, sizeof(wiiu_gca_instance_t));
|
||||
instance->driver = driver;
|
||||
|
||||
driver->hid_driver->send_control(driver->hid_data, activation_packet, sizeof(activation_packet));
|
||||
driver->hid_driver->read(driver->hid_data, instance->device_state, sizeof(instance->device_state));
|
||||
driver->os_driver->send_control(driver->os_driver_data, activation_packet, sizeof(activation_packet));
|
||||
driver->os_driver->read(driver->os_driver_data, instance->device_state, sizeof(instance->device_state));
|
||||
instance->online = true;
|
||||
|
||||
return instance;
|
||||
@ -110,13 +110,13 @@ static joypad_connection_t *register_pad(wiiu_gca_instance_t *instance) {
|
||||
if(!instance || !instance->online)
|
||||
return NULL;
|
||||
|
||||
slot = pad_connection_find_vacant_pad(instance->driver->pad_connection_list);
|
||||
slot = pad_connection_find_vacant_pad(instance->driver->pad_list);
|
||||
if(slot < 0)
|
||||
return NULL;
|
||||
|
||||
result = &(instance->driver->pad_connection_list[slot]);
|
||||
result = &(instance->driver->pad_list[slot]);
|
||||
result->iface = &wiiu_gca_pad_connection;
|
||||
result->data = result->iface->init(instance, slot, instance->driver->hid_driver);
|
||||
result->data = result->iface->init(instance, slot, instance->driver->os_driver);
|
||||
result->connected = true;
|
||||
input_pad_connect(slot, instance->driver->pad_driver);
|
||||
|
||||
|
@ -61,20 +61,20 @@ bool hid_init(hid_driver_instance_t *instance,
|
||||
if(!instance || !hid_driver || !pad_driver || slots > MAX_USERS)
|
||||
return false;
|
||||
|
||||
instance->hid_data = hid_driver->init(instance);
|
||||
if(!instance->hid_data)
|
||||
instance->os_driver_data = hid_driver->init(instance);
|
||||
if(!instance->os_driver_data)
|
||||
return false;
|
||||
|
||||
instance->pad_connection_list = pad_connection_init(slots);
|
||||
if(!instance->pad_connection_list)
|
||||
instance->pad_list = pad_connection_init(slots);
|
||||
if(!instance->pad_list)
|
||||
{
|
||||
hid_driver->free(instance->hid_data);
|
||||
instance->hid_data = NULL;
|
||||
hid_driver->free(instance->os_driver_data);
|
||||
instance->os_driver_data = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
instance->max_slot = slots;
|
||||
instance->hid_driver = hid_driver;
|
||||
instance->os_driver = hid_driver;
|
||||
instance->pad_driver = pad_driver;
|
||||
|
||||
return true;
|
||||
@ -90,11 +90,11 @@ void hid_deinit(hid_driver_instance_t *instance)
|
||||
if(!instance)
|
||||
return;
|
||||
|
||||
pad_connection_destroy(instance->pad_connection_list);
|
||||
pad_connection_destroy(instance->pad_list);
|
||||
|
||||
if(instance->hid_driver && instance->hid_data)
|
||||
if(instance->os_driver && instance->os_driver_data)
|
||||
{
|
||||
instance->hid_driver->free(instance->hid_data);
|
||||
instance->os_driver->free(instance->os_driver_data);
|
||||
}
|
||||
|
||||
memset(instance, 0, sizeof(hid_driver_instance_t));
|
||||
|
@ -53,10 +53,10 @@ struct hid_driver
|
||||
};
|
||||
|
||||
struct hid_driver_instance {
|
||||
hid_driver_t *hid_driver;
|
||||
void *hid_data;
|
||||
hid_driver_t *os_driver;
|
||||
void *os_driver_data;
|
||||
input_device_driver_t *pad_driver;
|
||||
joypad_connection_t *pad_connection_list;
|
||||
joypad_connection_t *pad_list;
|
||||
unsigned max_slot;
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ static const char *wiiu_hid_joypad_name(void *data, unsigned slot)
|
||||
|
||||
wiiu_hid_t *hid = (wiiu_hid_t *)data;
|
||||
|
||||
return hid->driver->pad_connection_list[slot].iface->get_name(data);
|
||||
return hid->driver->pad_list[slot].iface->get_name(data);
|
||||
}
|
||||
|
||||
static void wiiu_hid_joypad_get_buttons(void *data, unsigned port, retro_bits_t *state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user