Thank you for this. I am trying to get my head around it but I'm not quite there yet!
I have the following code, which is copied from example code and edited a bit. I can't find any mention of axisEnable.
Here is a link where I've found a version of the original example code, posted by Chuck Walbourn:
https://github.com/walbourn/directx-sdk-samples/blob/main/DirectInput/FFConst/ffconst.cpp
See the function at the bottom "SetDeviceForcesXY" - when setting cf.lMagnitude it results in the same as my abs(nXForce).
So I'm a bit torn here as I'm reluctant to diverge from the proper way of doing things, to try to somehow make LFS compatible with bugged wheel drivers. It seems that something could go wrong. But I realise my understanding is incomplete.
LFS code:
INT nYForce = 0;
// modifying an effect is basically the same as creating a new one, except you need only specify the parameters you are modifying
LONG rglDirection[2];
DICONSTANTFORCE cf;
if (g_dwNumFFAxis==1) // if only one force feedback axis, then apply only one direction and keep the direction at zero
{
rglDirection[0] = 0;
rglDirection[1] = 0;
cf.lMagnitude = nXForce;
}
else // if two force feedback axis, then apply magnitude from both directions
{
rglDirection[0] = nXForce;
rglDirection[1] = nYForce;
cf.lMagnitude = abs(nXForce);
}
DIEFFECT eff;
memset(&eff, 0, sizeof(eff));
eff.dwSize = sizeof(DIEFFECT);
eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS;
eff.cAxes = g_dwNumFFAxis;
eff.rglDirection = rglDirection;
eff.lpEnvelope = 0;
eff.cbTypeSpecificParams = sizeof(DICONSTANTFORCE);
eff.lpvTypeSpecificParams = &cf;
eff.dwStartDelay = 0;
// Now set the new parameters and start the effect immediately.
HRESULT hr = g_pEffect->SetParameters(&eff, DIEP_DIRECTION | DIEP_TYPESPECIFICPARAMS | DIEP_START);