mirror of https://github.com/stella-emu/stella.git
added four more axis to joystick handlers (fixes #1063)
This commit is contained in:
parent
66823c533a
commit
01c8a87e19
|
@ -129,10 +129,10 @@ class JoyMap
|
||||||
size_t operator()(const JoyMapping& m)const {
|
size_t operator()(const JoyMapping& m)const {
|
||||||
return std::hash<uInt64>()((static_cast<uInt64>(m.mode)) // 3 bits
|
return std::hash<uInt64>()((static_cast<uInt64>(m.mode)) // 3 bits
|
||||||
+ ((static_cast<uInt64>(m.button)) * 7) // 3 bits
|
+ ((static_cast<uInt64>(m.button)) * 7) // 3 bits
|
||||||
+ (((static_cast<uInt64>(m.axis)) << 0) // 2 bits
|
+ (((static_cast<uInt64>(m.axis)) << 0) // 3 bits
|
||||||
| ((static_cast<uInt64>(m.adir)) << 2) // 2 bits
|
| ((static_cast<uInt64>(m.adir)) << 3) // 2 bits
|
||||||
| ((static_cast<uInt64>(m.hat )) << 4) // 1 bit
|
| ((static_cast<uInt64>(m.hat )) << 5) // 1 bit
|
||||||
| ((static_cast<uInt64>(m.hdir)) << 5) // 2 bits
|
| ((static_cast<uInt64>(m.hdir)) << 6) // 2 bits
|
||||||
) * 61
|
) * 61
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,11 @@ NLOHMANN_JSON_SERIALIZE_ENUM(JoyAxis, {
|
||||||
{JoyAxis::X, "x"},
|
{JoyAxis::X, "x"},
|
||||||
{JoyAxis::Y, "y"},
|
{JoyAxis::Y, "y"},
|
||||||
{JoyAxis::Z, "z"},
|
{JoyAxis::Z, "z"},
|
||||||
{JoyAxis::A3, "a3"}
|
{JoyAxis::A3, "a3"},
|
||||||
|
{JoyAxis::A4, "a4"},
|
||||||
|
{JoyAxis::A5, "a5"},
|
||||||
|
{JoyAxis::A6, "a6"},
|
||||||
|
{JoyAxis::A7, "a7"}
|
||||||
})
|
})
|
||||||
|
|
||||||
NLOHMANN_JSON_SERIALIZE_ENUM(JoyDir, {
|
NLOHMANN_JSON_SERIALIZE_ENUM(JoyDir, {
|
||||||
|
|
|
@ -52,6 +52,10 @@ enum class JoyAxis: Int8 {
|
||||||
Y = 1, // since they'll be used as array indices
|
Y = 1, // since they'll be used as array indices
|
||||||
Z = 2,
|
Z = 2,
|
||||||
A3 = 3,
|
A3 = 3,
|
||||||
|
A4 = 4,
|
||||||
|
A5 = 5,
|
||||||
|
A6 = 6,
|
||||||
|
A7 = 7,
|
||||||
NONE = JOY_CTRL_NONE
|
NONE = JOY_CTRL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue