dinput: Always send both "Type Specific" and "Set Effect" reports on initial Download.

Fixes the Download method not sending an initial type specific
HID PID report in the rare cases where all type specific params
are set to 0 through the initial SetParameters call, so they aren't
considered as modified.

FH5 is affected by this issue, since it initially sets the
direction of its constant effect to 0, which translates to 0
magnitude in dinput.
This commit is contained in:
Ivo Ivanov 2022-07-26 13:22:17 +03:00 committed by Alexandre Julliard
parent a146f9b6f1
commit cd75ed1800
2 changed files with 3 additions and 4 deletions

View file

@ -2993,6 +2993,7 @@ static HRESULT WINAPI hid_joystick_effect_Download( IDirectInputEffect *iface )
case PID_USAGE_ET_SAWTOOTH_DOWN:
case PID_USAGE_ET_CONSTANT_FORCE:
case PID_USAGE_ET_RAMP:
if (!(impl->flags & DIEP_ENVELOPE)) break;
if (!(impl->modified & DIEP_ENVELOPE)) break;
set_parameter_value( impl, impl->set_envelope_buf, set_envelope->attack_level_caps,
@ -3100,7 +3101,7 @@ static HRESULT WINAPI hid_joystick_effect_Unload( IDirectInputEffect *iface )
else hr = DIERR_INPUTLOST;
}
impl->modified = impl->flags;
impl->modified = ~0;
impl->index = 0;
check_empty_force_feedback_state( joystick );
}
@ -3161,6 +3162,7 @@ static HRESULT hid_joystick_create_effect( IDirectInputDevice8W *iface, IDirectI
impl->params.rgdwAxes = impl->axes;
impl->params.rglDirection = impl->directions;
impl->params.dwTriggerButton = -1;
impl->modified = ~0;
impl->status = 0;
*out = &impl->IDirectInputEffect_iface;

View file

@ -367,7 +367,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
.report_id = 5,
.report_len = 2,
.report_buf = {0x05,0x00},
.todo = TRUE,
},
/* set envelope */
{
@ -375,7 +374,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
.report_id = 6,
.report_len = 7,
.report_buf = {0x06,0x00,0x00,0x00,0x00,0x00,0x00},
.todo = TRUE,
},
/* update effect */
{
@ -393,7 +391,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
.report_id = 5,
.report_len = 2,
.report_buf = {0x05,0x00},
.todo = TRUE,
},
/* update effect */
{