MCPcopy Create free account
hub / github.com/360Controller/360Controller / getAbsolute

Function getAbsolute

360Controller/_60Controller.cpp:707–719  ·  view source on GitHub ↗

This returns the abs() value of a short, swapping it if necessary

Source from the content-addressed store, hash-verified

705
706// This returns the abs() value of a short, swapping it if necessary
707static inline Xbox360_SShort getAbsolute(Xbox360_SShort value)
708{
709 Xbox360_SShort reverse;
710
711#ifdef __LITTLE_ENDIAN__
712 reverse=value;
713#elif __BIG_ENDIAN__
714 reverse=((value&0xFF00)>>8)|((value&0x00FF)<<8);
715#else
716#error Unknown CPU byte order
717#endif
718 return (reverse<0)?~reverse:reverse;
719}
720
721void Xbox360Peripheral::normalizeAxis(SInt16& axis, short deadzone)
722{

Callers 2

normalizeAxisMethod · 0.70
fiddleReportMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected