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
2dd36904
Commit
2dd36904
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
winebus.sys: Implement PID effect update for SDL devices.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c436b546
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
2 deletions
+91
-2
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+91
-2
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
2dd36904
...
...
@@ -106,6 +106,7 @@ MAKE_FUNCPTR(SDL_HapticSetGain);
MAKE_FUNCPTR
(
SDL_HapticStopAll
);
MAKE_FUNCPTR
(
SDL_HapticStopEffect
);
MAKE_FUNCPTR
(
SDL_HapticUnpause
);
MAKE_FUNCPTR
(
SDL_HapticUpdateEffect
);
MAKE_FUNCPTR
(
SDL_JoystickIsHaptic
);
MAKE_FUNCPTR
(
SDL_GameControllerAddMapping
);
MAKE_FUNCPTR
(
SDL_RegisterEvents
);
...
...
@@ -478,12 +479,99 @@ static NTSTATUS sdl_device_physical_effect_control(struct unix_device *iface, BY
return
STATUS_SUCCESS
;
}
static
NTSTATUS
set_effect_type_from_usage
(
SDL_HapticEffect
*
effect
,
USAGE
type
)
{
switch
(
type
)
{
case
PID_USAGE_ET_SINE
:
effect
->
type
=
SDL_HAPTIC_SINE
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_TRIANGLE
:
effect
->
type
=
SDL_HAPTIC_TRIANGLE
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_SAWTOOTH_UP
:
effect
->
type
=
SDL_HAPTIC_SAWTOOTHUP
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_SAWTOOTH_DOWN
:
effect
->
type
=
SDL_HAPTIC_SAWTOOTHDOWN
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_SPRING
:
effect
->
type
=
SDL_HAPTIC_SPRING
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_DAMPER
:
effect
->
type
=
SDL_HAPTIC_DAMPER
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_INERTIA
:
effect
->
type
=
SDL_HAPTIC_INERTIA
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_FRICTION
:
effect
->
type
=
SDL_HAPTIC_FRICTION
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_CONSTANT_FORCE
:
effect
->
type
=
SDL_HAPTIC_CONSTANT
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_RAMP
:
effect
->
type
=
SDL_HAPTIC_RAMP
;
return
STATUS_SUCCESS
;
case
PID_USAGE_ET_CUSTOM_FORCE_DATA
:
effect
->
type
=
SDL_HAPTIC_CUSTOM
;
return
STATUS_SUCCESS
;
default:
return
STATUS_NOT_SUPPORTED
;
}
}
static
NTSTATUS
sdl_device_physical_effect_update
(
struct
unix_device
*
iface
,
BYTE
index
,
struct
effect_params
*
params
)
{
FIXME
(
"iface %p, index %u, params %p stub!
\n
"
,
iface
,
index
,
params
);
struct
sdl_device
*
impl
=
impl_from_unix_device
(
iface
);
int
id
=
impl
->
effect_ids
[
index
];
SDL_HapticEffect
effect
=
{
0
};
NTSTATUS
status
;
return
STATUS_NOT_IMPLEMENTED
;
TRACE
(
"iface %p, index %u, params %p.
\n
"
,
iface
,
index
,
params
);
if
((
status
=
set_effect_type_from_usage
(
&
effect
,
params
->
effect_type
)))
return
status
;
switch
(
params
->
effect_type
)
{
case
PID_USAGE_ET_SINE
:
case
PID_USAGE_ET_SQUARE
:
case
PID_USAGE_ET_TRIANGLE
:
case
PID_USAGE_ET_SAWTOOTH_UP
:
case
PID_USAGE_ET_SAWTOOTH_DOWN
:
FIXME
(
"periodic effect semi-stub!"
);
effect
.
periodic
.
length
=
params
->
duration
;
effect
.
periodic
.
delay
=
params
->
start_delay
;
effect
.
periodic
.
button
=
params
->
trigger_button
;
effect
.
periodic
.
interval
=
params
->
trigger_repeat_interval
;
effect
.
periodic
.
direction
.
type
=
SDL_HAPTIC_SPHERICAL
;
effect
.
periodic
.
direction
.
dir
[
0
]
=
params
->
direction
[
0
]
*
36000
/
256
;
effect
.
periodic
.
direction
.
dir
[
1
]
=
params
->
direction
[
1
]
*
36000
/
256
;
break
;
case
PID_USAGE_ET_SPRING
:
case
PID_USAGE_ET_DAMPER
:
case
PID_USAGE_ET_INERTIA
:
case
PID_USAGE_ET_FRICTION
:
FIXME
(
"not implemented!"
);
break
;
case
PID_USAGE_ET_CONSTANT_FORCE
:
FIXME
(
"not implemented!"
);
break
;
case
PID_USAGE_ET_RAMP
:
FIXME
(
"not implemented!"
);
break
;
case
PID_USAGE_ET_CUSTOM_FORCE_DATA
:
FIXME
(
"not implemented!"
);
break
;
}
if
(
id
<
0
)
impl
->
effect_ids
[
index
]
=
pSDL_HapticNewEffect
(
impl
->
sdl_haptic
,
&
effect
);
else
pSDL_HapticUpdateEffect
(
impl
->
sdl_haptic
,
id
,
&
effect
);
return
STATUS_SUCCESS
;
}
static
const
struct
hid_device_vtbl
sdl_device_vtbl
=
...
...
@@ -758,6 +846,7 @@ NTSTATUS sdl_bus_init(void *args)
LOAD_FUNCPTR
(
SDL_HapticStopAll
);
LOAD_FUNCPTR
(
SDL_HapticStopEffect
);
LOAD_FUNCPTR
(
SDL_HapticUnpause
);
LOAD_FUNCPTR
(
SDL_HapticUpdateEffect
);
LOAD_FUNCPTR
(
SDL_JoystickIsHaptic
);
LOAD_FUNCPTR
(
SDL_GameControllerAddMapping
);
LOAD_FUNCPTR
(
SDL_RegisterEvents
);
...
...
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