elishacloud / dinputto8

A dll module that is designed to improve compatibility in games using DirectInput 1-7 (dinput.dll) by converting all API calls to their equivalent DirectInput 8 (dinput8.dll) ones. This allows older games to be able to use newer tools and wrappers written for DirectInput 8.
zlib License
115 stars 11 forks source link

Add compatibility to Grand Prix Legends #29

Open jakewdes opened 2 months ago

jakewdes commented 2 months ago

I am writing to request Grand Prix Legends added to the list of compatible games. This game has support for a limited number of Joystick devices and it would be valuable to use tools like devreorder to control which HID devices are seen by the game and which order they are in. The game uses dinput.dll rather than dinput8.dll so the use of these tools is currently not possible.

Currently when trying to use dinputto8 for Grand Prix Legends the controllers are no longer recognized.

jakewdes commented 2 months ago

Attached is a log from the debug version. When using the dinput.dll controllers no longer calibrate at all (moving axis does nothing).

dinput.log

I can tell the dll is working because when using it in conjunction with the devreorder dll I am able to disable certain axis, but no controller calibrates or responds to input using the dinputto8 dll on its own or with the devreorder dll.

elishacloud commented 2 months ago

Can you try with an older release? Specifically try with this release here.

jakewdes commented 2 months ago

Thanks for the quick reply. I have tried with that version and experience the same behavior, controllers are detected but none respond to calibration.

elishacloud commented 2 months ago

This game uses DI version 1 and version 2. However, there is code in there that prevents apps that run version 3 or older from seeing any controllers. I just disabled that part of the code. Can you try this update: dinput.zip

jakewdes commented 2 months ago

This game uses DI version 1 and version 2. However, there is code in there that prevents apps that run version 3 or older from seeing any controllers. I just disabled that part of the code. Can you try this update: dinput.zip

Unfortunately the same behavior. I have tried it with and without devreoder and am not able to get any axis to calibrate. It recognizes controllers but calibration does not move.

elishacloud commented 2 months ago

I suspect the issue is somewhere in here:

16904 20:03:48.834 m_IDirectInputX::CreateDeviceExX (0848BF10)
16904 20:03:48.834 Creating interface m_IDirectInputDeviceX::m_IDirectInputDeviceX(085691F8) converting interface from v1 to v8 using ANSI
16904 20:03:48.834 m_IDirectInputDeviceX::QueryInterface (085691F8)
16904 20:03:48.834 dinputto8::ProxyQueryInterface Query for IID_IDirectInputDevice2A from IID_IDirectInputDevice2A
16904 20:03:48.834 m_IDirectInputDeviceX::AddRef (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetCooperativeLevel (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetDataFormat (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::Unacquire (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::SetProperty (085691F8)
16904 20:03:48.834 m_IDirectInputDeviceX::Acquire (085691F8)
16904 20:03:48.835 m_IDirectInputDeviceX::Release (085691F8)
16904 20:03:48.835 m_IDirectInputDeviceX::Release (085691F8)
16904 20:03:48.835 m_IDirectInputDeviceX::~m_IDirectInputDeviceX (085691F8) deleting interface!
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (04088A38)
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (08568D78)
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (08569BB8)
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (08568CB8)
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (08569138)
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (085692B8)
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (08569AF8)
16904 20:03:48.835 m_IDirectInputDeviceX::EnumObjectsX (08569A38)

However, without reproducing the issue I am not sure exactly where.

jakewdes commented 2 months ago

Appreciate the help. Out of my depths a bit on what I could try. The devices are recognized without using any dinput wrappers, however the need comes from the game's limitation in how many devices can be used, and specifically the order they are in. This is where a tool like devreorder could be useful and what led me to this application.

elishacloud commented 2 months ago

Can you try with the latest build here. I put a fix in that may fix this issue: dinput.zip