From df3886edb6a49987e7dd2c713ead4e71a2fcafc2 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 28 Mar 2023 18:40:22 +1100 Subject: [PATCH] Rebase against d62e2268d77c237e8430e158bb337958d88486ba. --- ...ping-of-controls-based-of-Genre-type.patch | 74 ------------------- staging/upstream-commit | 2 +- 2 files changed, 1 insertion(+), 75 deletions(-) delete mode 100644 patches/dinput-joy-mappings/0004-dinput-Allow-mapping-of-controls-based-of-Genre-type.patch diff --git a/patches/dinput-joy-mappings/0004-dinput-Allow-mapping-of-controls-based-of-Genre-type.patch b/patches/dinput-joy-mappings/0004-dinput-Allow-mapping-of-controls-based-of-Genre-type.patch deleted file mode 100644 index 3af812b6..00000000 --- a/patches/dinput-joy-mappings/0004-dinput-Allow-mapping-of-controls-based-of-Genre-type.patch +++ /dev/null @@ -1,74 +0,0 @@ -From f1c2e802d382007f8b4de0ddb9f8d23b24073747 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Fri, 24 May 2019 16:16:13 +1000 -Subject: [PATCH] dinput: Allow mapping of controls based of Genre type. - ---- - dlls/dinput/device.c | 41 ++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 40 insertions(+), 1 deletion(-) - -diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c -index b010dc8dbf0..ed7bd5ae64a 100644 ---- a/dlls/dinput/device.c -+++ b/dlls/dinput/device.c -@@ -2020,8 +2020,15 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D - - /* Count the actions */ - for (i = 0; i < format->dwNumActions; i++) -- if (IsEqualGUID( &impl->guid, &format->rgoAction[i].guidInstance )) -+ { -+ if (IsEqualGUID(&impl->guid, &format->rgoAction[i].guidInstance) || -+ (IsEqualGUID(&IID_NULL, &format->rgoAction[i].guidInstance) && -+ ((format->rgoAction[i].dwSemantic & format->dwGenre) == format->dwGenre || -+ (format->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */) )) -+ { - num_actions++; -+ } -+ } - - if (num_actions == 0) return DI_NOEFFECT; - -@@ -2054,8 +2061,40 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D - - action++; - } -+ else if ((format->rgoAction[i].dwSemantic & format->dwGenre) == format->dwGenre || -+ (format->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */) -+ { -+ DWORD obj_id = semantic_to_obj_id(impl, format->rgoAction[i].dwSemantic); -+ DWORD type = DIDFT_GETTYPE(obj_id); -+ DWORD inst = DIDFT_GETINSTANCE(obj_id); -+ LPDIOBJECTDATAFORMAT obj; -+ -+ if (type == DIDFT_PSHBUTTON) type = DIDFT_BUTTON; -+ else if (type == DIDFT_RELAXIS) type = DIDFT_AXIS; -+ -+ obj = dataformat_to_odf_by_type(df, inst, type); -+ TRACE("obj %p, inst 0x%08lx, type 0x%08lx\n", obj, inst, type); -+ if(obj) -+ { -+ memcpy(&obj_df[action], obj, df->dwObjSize); -+ -+ impl->action_map[action].uAppData = format->rgoAction[i].uAppData; -+ impl->action_map[action].offset = offset; -+ obj_df[action].dwOfs = offset; -+ offset += (type & DIDFT_BUTTON) ? 1 : 4; -+ -+ action++; -+ } -+ } - } - -+ if (action == 0) -+ { -+ free( obj_df ); -+ return DI_NOEFFECT; -+ } -+ data_format.dwNumObjs = action; -+ - IDirectInputDevice8_SetDataFormat( iface, &data_format ); - - impl->action_map = action_map; --- -2.39.0 - diff --git a/staging/upstream-commit b/staging/upstream-commit index 7d5566f1..20cbd6e6 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -3149d27220acaf276bfa651e040ff006edcd6944 +d62e2268d77c237e8430e158bb337958d88486ba