mirror of
https://github.com/holub/mame
synced 2025-07-02 16:49:22 +03:00
01663: Hat switches not working
All custom itemids were mapped to class SWITCH. With the recent modification, this implicitly changed to ABSOLUTE. This fix will use the passed itemid to determine the class.
This commit is contained in:
parent
6498f1b8f2
commit
0c79f46193
@ -759,6 +759,7 @@ input_device *input_device_add(input_device_class devclass, const char *name, vo
|
||||
void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate)
|
||||
{
|
||||
input_device_item *item;
|
||||
input_item_id itemid_std = itemid;
|
||||
|
||||
assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call input_device_item_add at init time!");
|
||||
assert(name != NULL);
|
||||
@ -787,7 +788,7 @@ void input_device_item_add(input_device *device, const char *name, void *interna
|
||||
item->name = astring_cpyc(auto_astring_alloc(), name);
|
||||
item->token = NULL;
|
||||
item->internal = internal;
|
||||
item->itemclass = input_item_standard_class(device->devclass, itemid);
|
||||
item->itemclass = input_item_standard_class(device->devclass, itemid_std);
|
||||
item->itemid = itemid;
|
||||
item->getstate = getstate;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user