winebus.sys: Avoid unnecessary scaling of effect parameter values.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-11-19 09:39:39 +01:00 committed by Alexandre Julliard
parent ef5fa6c716
commit fca0f18d08
5 changed files with 104 additions and 110 deletions

View File

@ -480,13 +480,13 @@ static NTSTATUS sdl_device_physical_device_control(struct unix_device *iface, US
return STATUS_NOT_SUPPORTED;
}
static NTSTATUS sdl_device_physical_device_set_gain(struct unix_device *iface, BYTE value)
static NTSTATUS sdl_device_physical_device_set_gain(struct unix_device *iface, BYTE percent)
{
struct sdl_device *impl = impl_from_unix_device(iface);
TRACE("iface %p, value %#x.\n", iface, value);
TRACE("iface %p, percent %#x.\n", iface, percent);
pSDL_HapticSetGain(impl->sdl_haptic, value * 100 / 255);
pSDL_HapticSetGain(impl->sdl_haptic, percent);
return STATUS_SUCCESS;
}
@ -583,10 +583,10 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
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;
effect.periodic.direction.dir[0] = params->direction[0];
effect.periodic.direction.dir[1] = params->direction[1];
effect.periodic.period = params->periodic.period;
effect.periodic.magnitude = params->periodic.magnitude * 128;
effect.periodic.magnitude = params->periodic.magnitude;
effect.periodic.offset = params->periodic.offset;
effect.periodic.phase = params->periodic.phase;
effect.periodic.attack_length = params->envelope.attack_time;
@ -604,8 +604,8 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
effect.condition.button = params->trigger_button;
effect.condition.interval = params->trigger_repeat_interval;
effect.condition.direction.type = SDL_HAPTIC_SPHERICAL;
effect.condition.direction.dir[0] = params->direction[0] * 36000 / 256;
effect.condition.direction.dir[1] = params->direction[1] * 36000 / 256;
effect.condition.direction.dir[0] = params->direction[0];
effect.condition.direction.dir[1] = params->direction[1];
if (params->condition_count >= 1)
{
effect.condition.right_sat[0] = params->condition[0].positive_saturation;
@ -632,8 +632,8 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
effect.constant.button = params->trigger_button;
effect.constant.interval = params->trigger_repeat_interval;
effect.constant.direction.type = SDL_HAPTIC_SPHERICAL;
effect.constant.direction.dir[0] = params->direction[0] * 36000 / 256;
effect.constant.direction.dir[1] = params->direction[1] * 36000 / 256;
effect.constant.direction.dir[0] = params->direction[0];
effect.constant.direction.dir[1] = params->direction[1];
effect.constant.level = params->constant_force.magnitude;
effect.constant.attack_length = params->envelope.attack_time;
effect.constant.attack_level = params->envelope.attack_level;
@ -647,8 +647,8 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT
effect.ramp.button = params->trigger_button;
effect.ramp.interval = params->trigger_repeat_interval;
effect.ramp.direction.type = SDL_HAPTIC_SPHERICAL;
effect.ramp.direction.dir[0] = params->direction[0] * 36000 / 256;
effect.ramp.direction.dir[1] = params->direction[1] * 36000 / 256;
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.attack_length = params->envelope.attack_time;

View File

@ -924,17 +924,17 @@ static NTSTATUS lnxev_device_physical_device_control(struct unix_device *iface,
return STATUS_NOT_SUPPORTED;
}
static NTSTATUS lnxev_device_physical_device_set_gain(struct unix_device *iface, BYTE value)
static NTSTATUS lnxev_device_physical_device_set_gain(struct unix_device *iface, BYTE percent)
{
struct lnxev_device *impl = lnxev_impl_from_unix_device(iface);
struct input_event ie =
{
.type = EV_FF,
.code = FF_GAIN,
.value = value * 100 / 255,
.value = percent,
};
TRACE("iface %p, value %#x.\n", iface, value);
TRACE("iface %p, percent %#x.\n", iface, percent);
if (write(impl->base.device_fd, &ie, sizeof(ie)) == -1)
WARN("write failed %d %s\n", errno, strerror(errno));
@ -1031,7 +1031,7 @@ static NTSTATUS lnxev_device_physical_effect_update(struct unix_device *iface, B
effect.trigger.button = params->trigger_button;
effect.trigger.interval = params->trigger_repeat_interval;
/* only supports polar with one direction angle */
effect.direction = params->direction[0] * 256;
effect.direction = params->direction[0] * 0x800 / 1125;
switch (params->effect_type)
{
@ -1041,9 +1041,9 @@ 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 * 128;
effect.u.periodic.magnitude = params->periodic.magnitude;
effect.u.periodic.offset = params->periodic.offset;
effect.u.periodic.phase = params->periodic.phase;
effect.u.periodic.phase = params->periodic.phase * 0x800 / 1125;
effect.u.periodic.envelope.attack_length = params->envelope.attack_time;
effect.u.periodic.envelope.attack_level = params->envelope.attack_level;
effect.u.periodic.envelope.fade_length = params->envelope.fade_time;

View File

@ -170,8 +170,6 @@ BOOL hid_device_add_buttons(struct unix_device *iface, USAGE usage_page, USAGE u
USAGE_MAXIMUM(2, usage_max),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 1),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 1),
REPORT_COUNT(2, count),
REPORT_SIZE(1, 1),
INPUT(1, Data|Var|Abs),
@ -225,8 +223,6 @@ BOOL hid_device_add_hatswitch(struct unix_device *iface, INT count)
USAGE(1, HID_USAGE_GENERIC_HATSWITCH),
LOGICAL_MINIMUM(1, 1),
LOGICAL_MAXIMUM(1, 8),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, 8),
REPORT_SIZE(1, 8),
REPORT_COUNT(4, count),
UNIT(1, 0x0e /* none */),
@ -286,8 +282,6 @@ BOOL hid_device_add_axes(struct unix_device *iface, BYTE count, USAGE usage_page
{
LOGICAL_MINIMUM(4, min),
LOGICAL_MAXIMUM(4, max),
PHYSICAL_MINIMUM(4, min),
PHYSICAL_MAXIMUM(4, max),
REPORT_SIZE(1, 32),
REPORT_COUNT(1, count),
INPUT(1, Data|Var|(rel ? Rel : Abs)),
@ -354,8 +348,6 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
UNIT_EXPONENT(1, -3), /* 10^-3 */
LOGICAL_MINIMUM(4, 0x00000000),
LOGICAL_MAXIMUM(4, 0x7fffffff),
PHYSICAL_MINIMUM(4, 0x00000000),
PHYSICAL_MAXIMUM(4, 0x7fffffff),
REPORT_SIZE(1, 32),
REPORT_COUNT(1, 1),
FEATURE(1, Data|Var|Abs),
@ -367,8 +359,6 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
USAGE(1, HID_USAGE_HAPTICS_MANUAL_TRIGGER),
LOGICAL_MINIMUM(1, 1),
LOGICAL_MAXIMUM(1, 4),
PHYSICAL_MINIMUM(1, 1),
PHYSICAL_MAXIMUM(1, 4),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
@ -376,8 +366,6 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
USAGE(1, HID_USAGE_HAPTICS_INTENSITY),
LOGICAL_MINIMUM(4, 0x00000000),
LOGICAL_MAXIMUM(4, 0x0000ffff),
PHYSICAL_MINIMUM(4, 0x00000000),
PHYSICAL_MAXIMUM(4, 0x0000ffff),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
@ -442,23 +430,23 @@ struct pid_effect_update
UINT16 start_delay;
BYTE trigger_button;
BYTE enable_bits;
BYTE direction[2];
UINT16 direction[2];
};
struct pid_set_periodic
{
BYTE index;
BYTE magnitude;
BYTE offset;
BYTE phase;
UINT16 magnitude;
INT16 offset;
UINT16 phase;
UINT16 period;
};
struct pid_set_envelope
{
BYTE index;
BYTE attack_level;
BYTE fade_level;
UINT16 attack_level;
UINT16 fade_level;
UINT16 attack_time;
UINT16 fade_time;
};
@ -467,25 +455,25 @@ struct pid_set_condition
{
BYTE index;
BYTE condition_index;
BYTE center_point_offset;
BYTE positive_coefficient;
BYTE negative_coefficient;
BYTE positive_saturation;
BYTE negative_saturation;
BYTE dead_band;
INT16 center_point_offset;
INT16 positive_coefficient;
INT16 negative_coefficient;
UINT16 positive_saturation;
UINT16 negative_saturation;
UINT16 dead_band;
};
struct pid_set_constant_force
{
BYTE index;
UINT16 magnitude;
INT16 magnitude;
};
struct pid_set_ramp_force
{
BYTE index;
BYTE ramp_start;
BYTE ramp_end;
INT16 ramp_start;
INT16 ramp_end;
};
#include "poppack.h"
@ -501,38 +489,40 @@ static BOOL hid_descriptor_add_set_periodic(struct unix_device *iface)
REPORT_ID(1, report_id),
USAGE(1, PID_USAGE_EFFECT_BLOCK_INDEX),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(1, 0x00),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
USAGE(1, PID_USAGE_MAGNITUDE),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x00ff),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, 10000),
REPORT_SIZE(1, 8),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
USAGE(1, PID_USAGE_OFFSET),
LOGICAL_MINIMUM(1, 0x80),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(2, 0x8000),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(2, -10000),
PHYSICAL_MAXIMUM(2, 10000),
REPORT_SIZE(1, 8),
PHYSICAL_MAXIMUM(2, +10000),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
USAGE(1, PID_USAGE_PHASE),
UNIT(1, 0x14), /* Eng Rot:Angular Pos */
UNIT_EXPONENT(1, -2),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0xff),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(4, 36000),
REPORT_SIZE(1, 8),
LOGICAL_MAXIMUM(4, 36000),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
@ -541,13 +531,10 @@ static BOOL hid_descriptor_add_set_periodic(struct unix_device *iface)
UNIT_EXPONENT(1, -3), /* 10^-3 */
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, 0x7fff),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MAXIMUM(1, 0),
UNIT_EXPONENT(1, 0),
UNIT(1, 0), /* None */
END_COLLECTION,
@ -569,30 +556,30 @@ static BOOL hid_descriptor_add_set_envelope(struct unix_device *iface)
REPORT_ID(1, report_id),
USAGE(1, PID_USAGE_EFFECT_BLOCK_INDEX),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(1, 0x00),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
USAGE(1, PID_USAGE_ATTACK_LEVEL),
USAGE(1, PID_USAGE_FADE_LEVEL),
LOGICAL_MINIMUM(1, 0x00),
LOGICAL_MAXIMUM(2, 0x00ff),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, 10000),
REPORT_SIZE(1, 8),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 2),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
USAGE(1, PID_USAGE_ATTACK_TIME),
USAGE(1, PID_USAGE_FADE_TIME),
UNIT(2, 0x1003), /* Eng Lin:Time */
UNIT_EXPONENT(1, -3),
LOGICAL_MINIMUM(1, 0x00),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, 0x7fff),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 2),
OUTPUT(1, Data|Var|Abs),
@ -618,8 +605,8 @@ static BOOL hid_descriptor_add_set_condition(struct unix_device *iface)
REPORT_ID(1, report_id),
USAGE(1, PID_USAGE_EFFECT_BLOCK_INDEX),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(1, 0x00),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
@ -634,24 +621,28 @@ static BOOL hid_descriptor_add_set_condition(struct unix_device *iface)
USAGE(1, PID_USAGE_CP_OFFSET),
USAGE(1, PID_USAGE_POSITIVE_COEFFICIENT),
USAGE(1, PID_USAGE_NEGATIVE_COEFFICIENT),
LOGICAL_MINIMUM(1, -128),
LOGICAL_MAXIMUM(1, +127),
LOGICAL_MINIMUM(2, 0x8000),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(2, -10000),
PHYSICAL_MAXIMUM(2, +10000),
REPORT_SIZE(1, 8),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 3),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
USAGE(1, PID_USAGE_POSITIVE_SATURATION),
USAGE(1, PID_USAGE_NEGATIVE_SATURATION),
USAGE(1, PID_USAGE_DEAD_BAND),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x00ff),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, +10000),
REPORT_SIZE(1, 8),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 3),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
END_COLLECTION,
};
@ -671,20 +662,22 @@ static BOOL hid_descriptor_add_set_constant_force(struct unix_device *iface)
REPORT_ID(1, report_id),
USAGE(1, PID_USAGE_EFFECT_BLOCK_INDEX),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(1, 0x00),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
USAGE(1, PID_USAGE_MAGNITUDE),
LOGICAL_MINIMUM(2, 0xff01),
LOGICAL_MAXIMUM(2, 0x00ff),
PHYSICAL_MINIMUM(2, -1000),
PHYSICAL_MAXIMUM(2, 1000),
LOGICAL_MINIMUM(2, 0x8000),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(2, -10000),
PHYSICAL_MAXIMUM(2, +10000),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
END_COLLECTION,
};
@ -704,21 +697,23 @@ static BOOL hid_descriptor_add_set_ramp_force(struct unix_device *iface)
REPORT_ID(1, report_id),
USAGE(1, PID_USAGE_EFFECT_BLOCK_INDEX),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(1, 0x00),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
USAGE(1, PID_USAGE_RAMP_START),
USAGE(1, PID_USAGE_RAMP_END),
LOGICAL_MINIMUM(1, 0x80),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(2, 0x8000),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(2, -10000),
PHYSICAL_MAXIMUM(2, +10000),
REPORT_SIZE(1, 8),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 2),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
END_COLLECTION,
};
@ -762,12 +757,14 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co
USAGE(1, PID_USAGE_DEVICE_GAIN),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x00ff),
LOGICAL_MAXIMUM(1, 100),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, 0x2710),
PHYSICAL_MAXIMUM(2, 10000),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(1, 0),
END_COLLECTION,
};
@ -780,8 +777,8 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co
REPORT_ID(1, effect_control_report),
USAGE(1, PID_USAGE_EFFECT_BLOCK_INDEX),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(1, 0x00),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
@ -816,8 +813,8 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co
REPORT_ID(1, effect_update_report),
USAGE(1, PID_USAGE_EFFECT_BLOCK_INDEX),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 0x7f),
LOGICAL_MINIMUM(1, 0x00),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
OUTPUT(1, Data|Var|Abs),
@ -841,16 +838,14 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co
UNIT_EXPONENT(1, -3), /* 10^-3 */
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x7fff),
PHYSICAL_MINIMUM(1, 0),
PHYSICAL_MAXIMUM(2, 0x7fff),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 4),
OUTPUT(1, Data|Var|Abs),
PHYSICAL_MAXIMUM(1, 0),
UNIT_EXPONENT(1, 0),
UNIT(1, 0), /* None */
USAGE(1, PID_USAGE_TRIGGER_BUTTON),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, state->button_count),
REPORT_SIZE(1, 8),
REPORT_COUNT(1, 1),
@ -860,6 +855,7 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co
COLLECTION(1, Logical),
USAGE(4, (HID_USAGE_PAGE_GENERIC<<16)|HID_USAGE_GENERIC_X),
USAGE(4, (HID_USAGE_PAGE_GENERIC<<16)|HID_USAGE_GENERIC_Y),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(1, 1),
REPORT_SIZE(1, 1),
REPORT_COUNT(1, 2),
@ -878,13 +874,11 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co
UNIT(1, 0x14), /* Eng Rot:Angular Pos */
UNIT_EXPONENT(1, -2),
LOGICAL_MINIMUM(1, 0),
LOGICAL_MAXIMUM(2, 0x00ff),
PHYSICAL_MAXIMUM(4, 36000),
REPORT_SIZE(1, 8),
LOGICAL_MAXIMUM(4, 36000),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 2),
OUTPUT(1, Data|Var|Abs),
END_COLLECTION,
PHYSICAL_MAXIMUM(1, 0),
UNIT_EXPONENT(1, 0),
UNIT(1, 0), /* None */
END_COLLECTION,

View File

@ -31,39 +31,39 @@
struct effect_periodic
{
BYTE magnitude;
BYTE offset;
BYTE phase;
UINT16 magnitude;
INT16 offset;
UINT16 phase;
UINT16 period;
};
struct effect_envelope
{
BYTE attack_level;
BYTE fade_level;
UINT16 attack_level;
UINT16 fade_level;
UINT16 attack_time;
UINT16 fade_time;
};
struct effect_condition
{
BYTE center_point_offset;
BYTE positive_coefficient;
BYTE negative_coefficient;
BYTE positive_saturation;
BYTE negative_saturation;
BYTE dead_band;
INT16 center_point_offset;
INT16 positive_coefficient;
INT16 negative_coefficient;
UINT16 positive_saturation;
UINT16 negative_saturation;
UINT16 dead_band;
};
struct effect_constant_force
{
UINT16 magnitude;
INT16 magnitude;
};
struct effect_ramp_force
{
BYTE ramp_start;
BYTE ramp_end;
INT16 ramp_start;
INT16 ramp_end;
};
struct effect_params
@ -76,7 +76,7 @@ struct effect_params
BYTE trigger_button;
BOOL axis_enabled[2];
BOOL direction_enabled;
BYTE direction[2];
UINT16 direction[2];
BYTE condition_count;
/* only for periodic, constant or ramp forces */
struct effect_envelope envelope;
@ -108,7 +108,7 @@ struct hid_device_vtbl
NTSTATUS (*haptics_start)(struct unix_device *iface, DWORD duration_ms,
USHORT rumble_intensity, USHORT buzz_intensity);
NTSTATUS (*physical_device_control)(struct unix_device *iface, USAGE control);
NTSTATUS (*physical_device_set_gain)(struct unix_device *iface, BYTE value);
NTSTATUS (*physical_device_set_gain)(struct unix_device *iface, BYTE percent);
NTSTATUS (*physical_effect_control)(struct unix_device *iface, BYTE index, USAGE control, BYTE iterations);
NTSTATUS (*physical_effect_update)(struct unix_device *iface, BYTE index, struct effect_params *params);
};

View File

@ -106,7 +106,7 @@ static NTSTATUS mouse_physical_device_control(struct unix_device *iface, USAGE c
return STATUS_NOT_SUPPORTED;
}
static NTSTATUS mouse_physical_device_set_gain(struct unix_device *iface, BYTE value)
static NTSTATUS mouse_physical_device_set_gain(struct unix_device *iface, BYTE percent)
{
return STATUS_NOT_SUPPORTED;
}
@ -189,7 +189,7 @@ static NTSTATUS keyboard_physical_device_control(struct unix_device *iface, USAG
return STATUS_NOT_SUPPORTED;
}
static NTSTATUS keyboard_physical_device_set_gain(struct unix_device *iface, BYTE value)
static NTSTATUS keyboard_physical_device_set_gain(struct unix_device *iface, BYTE percent)
{
return STATUS_NOT_SUPPORTED;
}