Port the OsJoystick API, device enumeration, polling with dead zones, hat emulation and joystick mouse mode. OsJoystickPoll becomes Mac's OsPollJoysticks. Clamp (0x5C59F0) goes to _Triage. Os links dinput8 and dxguid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
12 lines
290 B
C++
12 lines
290 B
C++
#include "_Triage/Clamp.h"
|
|
|
|
// VERIFY: c8057e49 manual
|
|
// OFFSET: 0x005C59F0
|
|
int32_t Clamp(int32_t value, int32_t low, int32_t high) {
|
|
if (static_cast<uint32_t>(value - low) > static_cast<uint32_t>(high - low)) {
|
|
value = value - low < 0 ? low : high;
|
|
}
|
|
|
|
return value;
|
|
}
|