Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c436b546
Commit
c436b546
authored
Oct 05, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Look for the PID effect update output report.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
12d91995
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
joystick_hid.c
dlls/dinput/joystick_hid.c
+43
-0
No files found.
dlls/dinput/joystick_hid.c
View file @
c436b546
...
...
@@ -85,6 +85,19 @@ struct pid_control_report
ULONG
control_coll
;
};
struct
pid_effect_update
{
BYTE
id
;
ULONG
collection
;
ULONG
type_coll
;
struct
hid_value_caps
*
duration_caps
;
struct
hid_value_caps
*
gain_caps
;
struct
hid_value_caps
*
sample_period_caps
;
struct
hid_value_caps
*
start_delay_caps
;
struct
hid_value_caps
*
trigger_button_caps
;
struct
hid_value_caps
*
trigger_repeat_interval_caps
;
};
#define DEVICE_STATE_MAX_SIZE 1024
struct
hid_joystick
...
...
@@ -115,6 +128,7 @@ struct hid_joystick
struct
list
effect_list
;
struct
pid_control_report
pid_device_control
;
struct
pid_control_report
pid_effect_control
;
struct
pid_effect_update
pid_effect_update
;
};
static
inline
struct
hid_joystick
*
impl_from_IDirectInputDevice8W
(
IDirectInputDevice8W
*
iface
)
...
...
@@ -1589,6 +1603,7 @@ static BOOL init_pid_reports( struct hid_joystick *impl, struct hid_value_caps *
{
struct
pid_control_report
*
device_control
=
&
impl
->
pid_device_control
;
struct
pid_control_report
*
effect_control
=
&
impl
->
pid_effect_control
;
struct
pid_effect_update
*
effect_update
=
&
impl
->
pid_effect_update
;
#define SET_COLLECTION( rep ) \
do \
...
...
@@ -1613,9 +1628,14 @@ static BOOL init_pid_reports( struct hid_joystick *impl, struct hid_value_caps *
{
case
PID_USAGE_DEVICE_CONTROL_REPORT
:
SET_COLLECTION
(
device_control
);
break
;
case
PID_USAGE_EFFECT_OPERATION_REPORT
:
SET_COLLECTION
(
effect_control
);
break
;
case
PID_USAGE_SET_EFFECT_REPORT
:
SET_COLLECTION
(
effect_update
);
break
;
case
PID_USAGE_DEVICE_CONTROL
:
SET_SUB_COLLECTION
(
device_control
,
control_coll
);
break
;
case
PID_USAGE_EFFECT_OPERATION
:
SET_SUB_COLLECTION
(
effect_control
,
control_coll
);
break
;
case
PID_USAGE_EFFECT_TYPE
:
if
(
instance
->
wCollectionNumber
==
effect_update
->
collection
)
SET_SUB_COLLECTION
(
effect_update
,
type_coll
);
break
;
}
}
...
...
@@ -1630,6 +1650,7 @@ static BOOL init_pid_caps( struct hid_joystick *impl, struct hid_value_caps *cap
{
struct
pid_control_report
*
device_control
=
&
impl
->
pid_device_control
;
struct
pid_control_report
*
effect_control
=
&
impl
->
pid_effect_control
;
struct
pid_effect_update
*
effect_update
=
&
impl
->
pid_effect_update
;
if
(
!
(
instance
->
dwType
&
DIDFT_OUTPUT
))
return
DIENUM_CONTINUE
;
...
...
@@ -1646,6 +1667,24 @@ static BOOL init_pid_caps( struct hid_joystick *impl, struct hid_value_caps *cap
SET_REPORT_ID
(
device_control
);
if
(
instance
->
wCollectionNumber
==
effect_control
->
control_coll
)
SET_REPORT_ID
(
effect_control
);
if
(
instance
->
wCollectionNumber
==
effect_update
->
type_coll
)
SET_REPORT_ID
(
effect_update
);
if
(
instance
->
wCollectionNumber
==
effect_update
->
collection
)
{
SET_REPORT_ID
(
effect_update
);
if
(
instance
->
wUsage
==
PID_USAGE_DURATION
)
effect_update
->
duration_caps
=
caps
;
if
(
instance
->
wUsage
==
PID_USAGE_GAIN
)
effect_update
->
gain_caps
=
caps
;
if
(
instance
->
wUsage
==
PID_USAGE_SAMPLE_PERIOD
)
effect_update
->
sample_period_caps
=
caps
;
if
(
instance
->
wUsage
==
PID_USAGE_START_DELAY
)
effect_update
->
start_delay_caps
=
caps
;
if
(
instance
->
wUsage
==
PID_USAGE_TRIGGER_BUTTON
)
effect_update
->
trigger_button_caps
=
caps
;
if
(
instance
->
wUsage
==
PID_USAGE_TRIGGER_REPEAT_INTERVAL
)
effect_update
->
trigger_repeat_interval_caps
=
caps
;
}
#undef SET_REPORT_ID
...
...
@@ -1750,10 +1789,14 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID
TRACE
(
"device control id %u, coll %u, control coll %u
\n
"
,
impl
->
pid_device_control
.
id
,
impl
->
pid_device_control
.
collection
,
impl
->
pid_device_control
.
control_coll
);
TRACE
(
"effect control id %u, coll %u
\n
"
,
impl
->
pid_effect_control
.
id
,
impl
->
pid_effect_control
.
collection
);
TRACE
(
"effect update id %u, coll %u, type_coll %u
\n
"
,
impl
->
pid_effect_update
.
id
,
impl
->
pid_effect_update
.
collection
,
impl
->
pid_effect_update
.
type_coll
);
if
(
impl
->
pid_device_control
.
id
)
{
impl
->
dev_caps
.
dwFlags
|=
DIDC_FORCEFEEDBACK
;
if
(
impl
->
pid_effect_update
.
start_delay_caps
)
impl
->
dev_caps
.
dwFlags
|=
DIDC_STARTDELAY
;
impl
->
dev_caps
.
dwFFSamplePeriod
=
1000000
;
impl
->
dev_caps
.
dwFFMinTimeResolution
=
1000000
;
impl
->
dev_caps
.
dwHardwareRevision
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment