Merge branch 'release0253' into mainline-master

This commit is contained in:
Vas Crabb 2023-03-29 16:09:55 +11:00
commit a028ca0642
3 changed files with 28 additions and 25 deletions

View File

@ -375,6 +375,9 @@ void h19_state::machine_start()
save_item(NAME(m_keyclickactive));
save_item(NAME(m_bellactive));
m_keyclickactive = false;
m_bellactive = false;
m_key_click_timer = timer_alloc(FUNC(h19_state::key_click_off), this);
m_bell_timer = timer_alloc(FUNC(h19_state::bell_off), this);
}

View File

@ -51,13 +51,13 @@ might expect from the HID mapping.
Gamepads:
Axis Logitech Xinput Switch
X Left X Left X Left X
Y Left Y Left Y Left Y
Z Right X Triggers
Rx Right X Right X
Ry Right Y Right Y
Rz Right Y
Axis Logitech DS4 Xinput Switch
X Left X Left X Left X Left X
Y Left Y Left Y Left Y Left Y
Z Right X Right X Triggers
Rx Left trigger Right X Right X
Ry Right trigger Right Y Right Y
Rz Right Y Right Y
Thrustmaster controllers:
@ -1041,12 +1041,11 @@ void dinput_joystick_device::configure(input_device &device)
{ axisitems[0], axisitems[1] },
{ ITEM_ID_INVALID, ITEM_ID_INVALID } };
input_item_id pedalaxis = ITEM_ID_INVALID;
if ((ITEM_ID_INVALID != axisitems[3]) && (ITEM_ID_INVALID != axisitems[4]))
if ((ITEM_ID_INVALID != axisitems[2]) && (ITEM_ID_INVALID != axisitems[5]))
{
// assume Rx/Ry are right stick and Z is triggers if present
stickaxes[1][0] = axisitems[3];
stickaxes[1][1] = axisitems[4];
pedalaxis = axisitems[2];
// assume Z/Rz are right stick
stickaxes[1][0] = axisitems[2];
stickaxes[1][1] = axisitems[5];
add_twin_stick_assignments(
assignments,
stickaxes[0][0],
@ -1062,11 +1061,12 @@ void dinput_joystick_device::configure(input_device &device)
ITEM_ID_INVALID,
ITEM_ID_INVALID);
}
else if ((ITEM_ID_INVALID != axisitems[2]) && (ITEM_ID_INVALID != axisitems[5]))
else if ((ITEM_ID_INVALID != axisitems[3]) && (ITEM_ID_INVALID != axisitems[4]))
{
// assume Z/Rz are right stick
stickaxes[1][0] = axisitems[2];
stickaxes[1][1] = axisitems[5];
// assume Rx/Ry are right stick and Z is triggers if present
stickaxes[1][0] = axisitems[3];
stickaxes[1][1] = axisitems[4];
pedalaxis = axisitems[2];
add_twin_stick_assignments(
assignments,
stickaxes[0][0],

View File

@ -24,6 +24,7 @@
#include <mutex>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <windows.h>
@ -87,17 +88,10 @@ public:
template <typename T>
HRESULT enum_attached_devices(int devclass, T &&callback) const
{
struct helper
{
static BOOL CALLBACK callback(LPCDIDEVICEINSTANCE instance, LPVOID ref)
{
return (*reinterpret_cast<T *>(ref))(instance);
}
};
return m_dinput->EnumDevices(
devclass,
&helper::callback,
reinterpret_cast<LPVOID>(&callback),
&di_emun_devices_cb<std::remove_reference_t<T> >,
LPVOID(&callback),
DIEDFL_ATTACHEDONLY);
}
@ -128,6 +122,12 @@ private:
static std::string make_id(LPCDIDEVICEINSTANCE instance);
template <typename T>
static BOOL CALLBACK di_emun_devices_cb(LPCDIDEVICEINSTANCE instance, LPVOID ref)
{
return (*reinterpret_cast<T *>(ref))(instance);
}
Microsoft::WRL::ComPtr<IDirectInput8> m_dinput;
dynamic_module::ptr m_dinput_dll;
};