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
4860e529
Commit
4860e529
authored
Apr 29, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Add support for PID effect gain.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0a4b2bbd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+4
-4
bus_udev.c
dlls/winebus.sys/bus_udev.c
+4
-4
hid.c
dlls/winebus.sys/hid.c
+9
-0
unix_private.h
dlls/winebus.sys/unix_private.h
+1
-0
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
4860e529
...
...
@@ -647,7 +647,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
effect
.
periodic
.
direction
.
dir
[
0
]
=
direction
;
effect
.
periodic
.
direction
.
dir
[
1
]
=
params
->
direction
[
1
];
effect
.
periodic
.
period
=
params
->
periodic
.
period
;
effect
.
periodic
.
magnitude
=
params
->
periodic
.
magnitude
;
effect
.
periodic
.
magnitude
=
(
params
->
periodic
.
magnitude
*
params
->
gain_percent
)
/
100
;
effect
.
periodic
.
offset
=
params
->
periodic
.
offset
;
effect
.
periodic
.
phase
=
params
->
periodic
.
phase
;
effect
.
periodic
.
attack_length
=
params
->
envelope
.
attack_time
;
...
...
@@ -695,7 +695,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
effect
.
constant
.
direction
.
type
=
SDL_HAPTIC_SPHERICAL
;
effect
.
constant
.
direction
.
dir
[
0
]
=
direction
;
effect
.
constant
.
direction
.
dir
[
1
]
=
params
->
direction
[
1
];
effect
.
constant
.
level
=
params
->
constant_force
.
magnitude
;
effect
.
constant
.
level
=
(
params
->
constant_force
.
magnitude
*
params
->
gain_percent
)
/
100
;
effect
.
constant
.
attack_length
=
params
->
envelope
.
attack_time
;
effect
.
constant
.
attack_level
=
params
->
envelope
.
attack_level
;
effect
.
constant
.
fade_length
=
params
->
envelope
.
fade_time
;
...
...
@@ -712,8 +712,8 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
effect
.
ramp
.
direction
.
type
=
SDL_HAPTIC_SPHERICAL
;
effect
.
ramp
.
direction
.
dir
[
0
]
=
params
->
direction
[
0
];
effect
.
ramp
.
direction
.
dir
[
1
]
=
params
->
direction
[
1
];
effect
.
ramp
.
start
=
params
->
ramp_force
.
ramp_start
;
effect
.
ramp
.
end
=
params
->
ramp_force
.
ramp_end
;
effect
.
ramp
.
start
=
(
params
->
ramp_force
.
ramp_start
*
params
->
gain_percent
)
/
100
;
effect
.
ramp
.
end
=
(
params
->
ramp_force
.
ramp_end
*
params
->
gain_percent
)
/
100
;
effect
.
ramp
.
attack_length
=
params
->
envelope
.
attack_time
;
effect
.
ramp
.
attack_level
=
params
->
envelope
.
attack_level
;
effect
.
ramp
.
fade_length
=
params
->
envelope
.
fade_time
;
...
...
dlls/winebus.sys/bus_udev.c
View file @
4860e529
...
...
@@ -1138,7 +1138,7 @@ static NTSTATUS lnxev_device_physical_effect_update(struct unix_device *iface, B
case
PID_USAGE_ET_SAWTOOTH_UP
:
case
PID_USAGE_ET_SAWTOOTH_DOWN
:
effect
.
u
.
periodic
.
period
=
params
->
periodic
.
period
;
effect
.
u
.
periodic
.
magnitude
=
params
->
periodic
.
magnitude
;
effect
.
u
.
periodic
.
magnitude
=
(
params
->
periodic
.
magnitude
*
params
->
gain_percent
)
/
100
;
effect
.
u
.
periodic
.
offset
=
params
->
periodic
.
offset
;
effect
.
u
.
periodic
.
phase
=
params
->
periodic
.
phase
*
0x800
/
1125
;
effect
.
u
.
periodic
.
envelope
.
attack_length
=
params
->
envelope
.
attack_time
;
...
...
@@ -1172,7 +1172,7 @@ static NTSTATUS lnxev_device_physical_effect_update(struct unix_device *iface, B
break
;
case
PID_USAGE_ET_CONSTANT_FORCE
:
effect
.
u
.
constant
.
level
=
params
->
constant_force
.
magnitude
;
effect
.
u
.
constant
.
level
=
(
params
->
constant_force
.
magnitude
*
params
->
gain_percent
)
/
100
;
effect
.
u
.
constant
.
envelope
.
attack_length
=
params
->
envelope
.
attack_time
;
effect
.
u
.
constant
.
envelope
.
attack_level
=
params
->
envelope
.
attack_level
;
effect
.
u
.
constant
.
envelope
.
fade_length
=
params
->
envelope
.
fade_time
;
...
...
@@ -1180,8 +1180,8 @@ static NTSTATUS lnxev_device_physical_effect_update(struct unix_device *iface, B
break
;
case
PID_USAGE_ET_RAMP
:
effect
.
u
.
ramp
.
start_level
=
params
->
ramp_force
.
ramp_start
;
effect
.
u
.
ramp
.
end_level
=
params
->
ramp_force
.
ramp_end
;
effect
.
u
.
ramp
.
start_level
=
(
params
->
ramp_force
.
ramp_start
*
params
->
gain_percent
)
/
100
;
effect
.
u
.
ramp
.
end_level
=
(
params
->
ramp_force
.
ramp_end
*
params
->
gain_percent
)
/
100
;
effect
.
u
.
ramp
.
envelope
.
attack_length
=
params
->
envelope
.
attack_time
;
effect
.
u
.
ramp
.
envelope
.
attack_level
=
params
->
envelope
.
attack_level
;
effect
.
u
.
ramp
.
envelope
.
fade_length
=
params
->
envelope
.
fade_time
;
...
...
dlls/winebus.sys/hid.c
View file @
4860e529
...
...
@@ -487,6 +487,7 @@ struct pid_effect_update
UINT16
trigger_repeat_interval
;
UINT16
sample_period
;
UINT16
start_delay
;
BYTE
gain_percent
;
BYTE
trigger_button
;
BYTE
enable_bits
;
UINT16
direction
[
2
];
...
...
@@ -909,6 +910,13 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co
UNIT_EXPONENT
(
1
,
0
),
UNIT
(
1
,
0
),
/* None */
USAGE
(
1
,
PID_USAGE_GAIN
),
LOGICAL_MINIMUM
(
1
,
0
),
LOGICAL_MAXIMUM
(
1
,
100
),
REPORT_SIZE
(
1
,
8
),
REPORT_COUNT
(
1
,
1
),
OUTPUT
(
1
,
Data
|
Var
|
Abs
|
Null
),
USAGE
(
1
,
PID_USAGE_TRIGGER_BUTTON
),
LOGICAL_MINIMUM
(
1
,
0
),
LOGICAL_MAXIMUM
(
2
,
state
->
button_count
),
...
...
@@ -1181,6 +1189,7 @@ static void hid_device_set_output_report(struct unix_device *iface, HID_XFER_PAC
params
->
trigger_repeat_interval
=
report
->
trigger_repeat_interval
;
params
->
sample_period
=
report
->
sample_period
;
params
->
start_delay
=
report
->
start_delay
;
params
->
gain_percent
=
report
->
gain_percent
;
params
->
trigger_button
=
report
->
trigger_button
==
0xff
?
0
:
report
->
trigger_button
;
params
->
axis_enabled
[
0
]
=
(
report
->
enable_bits
&
1
)
!=
0
;
params
->
axis_enabled
[
1
]
=
(
report
->
enable_bits
&
2
)
!=
0
;
...
...
dlls/winebus.sys/unix_private.h
View file @
4860e529
...
...
@@ -78,6 +78,7 @@ struct effect_params
BOOL
axis_enabled
[
2
];
BOOL
direction_enabled
;
UINT16
direction
[
2
];
BYTE
gain_percent
;
BYTE
condition_count
;
/* only for periodic, constant or ramp forces */
struct
effect_envelope
envelope
;
...
...
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