Path: blob/master/RSDKv5/RSDK/Input/Input.hpp
1163 views
#ifndef INPUT_H1#define INPUT_H23namespace RSDK4{56#define PLAYER_COUNT (4)7#define INPUTDEVICE_COUNT (0x10)89#define INPUT_DEADZONE (0.3)1011enum InputIDs {12INPUT_UNASSIGNED = -2,13INPUT_AUTOASSIGN = -1,14INPUT_NONE = 0,15};1617enum InputSlotIDs {18CONT_ANY,19CONT_P1,20CONT_P2,21CONT_P3,22CONT_P4,23};2425enum InputDeviceTypes {26DEVICE_TYPE_NONE,27DEVICE_TYPE_KEYBOARD,28DEVICE_TYPE_CONTROLLER,29DEVICE_TYPE_UNKNOWN,30DEVICE_TYPE_STEAMOVERLAY,31};3233enum InputDeviceIDs {34DEVICE_KEYBOARD,35DEVICE_XBOX,36DEVICE_PS4,37DEVICE_SATURN,38DEVICE_SWITCH_HANDHELD,39DEVICE_SWITCH_JOY_GRIP,40DEVICE_SWITCH_JOY_L,41DEVICE_SWITCH_JOY_R,42DEVICE_SWITCH_PRO,43};4445enum InputDeviceAPIs {46DEVICE_API_NONE,47DEVICE_API_KEYBOARD,48DEVICE_API_XINPUT,49DEVICE_API_RAWINPUT,50DEVICE_API_STEAM,5152// CUSTOM APIs53#if RETRO_INPUTDEVICE_SDL254DEVICE_API_SDL2, // custom-made for SDL2 API, afaik it's not in original RSDKv5 (since it could be in a mac-version, but I do not have that so...)55#endif56#if RETRO_INPUTDEVICE_GLFW57DEVICE_API_GLFW, // custom-made for OGL, won't be in ANY real RSDKv5 version ever, it's just cool58#endif59#if RETRO_INPUTDEVICE_PDBOAT60DEVICE_API_PDBOAT // custom-made for android (paddleboat API)61#endif62};6364enum ControllerKeys {65KEY_UP,66KEY_DOWN,67KEY_LEFT,68KEY_RIGHT,69KEY_A,70KEY_B,71KEY_C,72KEY_X,73KEY_Y,74KEY_Z,75KEY_START,76KEY_SELECT,77KEY_MAX,78};7980enum KeyMasks {81KEYMASK_UP = 1 << 0,82KEYMASK_DOWN = 1 << 1,83KEYMASK_LEFT = 1 << 2,84KEYMASK_RIGHT = 1 << 3,85KEYMASK_START = 1 << 4,86KEYMASK_SELECT = 1 << 5,87KEYMASK_STICKL = 1 << 6,88KEYMASK_STICKR = 1 << 7,89KEYMASK_BUMPERL = 1 << 8,90KEYMASK_BUMPERR = 1 << 9,91KEYMASK_C = 1 << 10,92KEYMASK_Z = 1 << 11,93KEYMASK_A = 1 << 12,94KEYMASK_B = 1 << 13,95KEYMASK_X = 1 << 14,96KEYMASK_Y = 1 << 15,97KEYMASK_TRIGGERL = 1 << 16,98KEYMASK_TRIGGERR = 1 << 17,99};100101enum WinMappings {102KEYMAP_AUTO_MAPPING = -1,103KEYMAP_NO_MAPPING = 0,104105#ifndef VK_LBUTTON106VK_LBUTTON = 0x01,107VK_RBUTTON = 0x02,108VK_CANCEL = 0x03,109VK_MBUTTON = 0x04,110VK_XBUTTON1 = 0x05,111VK_XBUTTON2 = 0x06,112VK_BACK = 0x08,113VK_TAB = 0x09,114VK_CLEAR = 0x0C,115VK_RETURN = 0x0D,116VK_SHIFT = 0x10,117VK_CONTROL = 0x11,118VK_MENU = 0x12,119VK_PAUSE = 0x13,120VK_CAPITAL = 0x14,121VK_KANA = 0x15,122VK_HANGEUL = 0x15,123VK_HANGUL = 0x15,124VK_JUNJA = 0x17,125VK_FINAL = 0x18,126VK_HANJA = 0x19,127VK_KANJI = 0x19,128VK_ESCAPE = 0x1B,129VK_CONVERT = 0x1C,130VK_NONCONVERT = 0x1D,131VK_ACCEPT = 0x1E,132VK_MODECHANGE = 0x1F,133VK_SPACE = 0x20,134VK_PRIOR = 0x21,135VK_NEXT = 0x22,136VK_END = 0x23,137VK_HOME = 0x24,138VK_LEFT = 0x25,139VK_UP = 0x26,140VK_RIGHT = 0x27,141VK_DOWN = 0x28,142VK_SELECT = 0x29,143VK_PRINT = 0x2A,144VK_EXECUTE = 0x2B,145VK_SNAPSHOT = 0x2C,146VK_INSERT = 0x2D,147VK_DELETE = 0x2E,148VK_HELP = 0x2F,149#endif150VK_0 = 0x30,151VK_1 = 0x31,152VK_2 = 0x32,153VK_3 = 0x33,154VK_4 = 0x34,155VK_5 = 0x35,156VK_6 = 0x36,157VK_7 = 0x37,158VK_8 = 0x38,159VK_9 = 0x39,160VK_A = 0x41,161VK_B = 0x42,162VK_C = 0x43,163VK_D = 0x44,164VK_E = 0x45,165VK_F = 0x46,166VK_G = 0x47,167VK_H = 0x48,168VK_I = 0x49,169VK_J = 0x4A,170VK_K = 0x4B,171VK_L = 0x4C,172VK_M = 0x4D,173VK_N = 0x4E,174VK_O = 0x4F,175VK_P = 0x50,176VK_Q = 0x51,177VK_R = 0x52,178VK_S = 0x53,179VK_T = 0x54,180VK_U = 0x55,181VK_V = 0x56,182VK_W = 0x57,183VK_X = 0x58,184VK_Y = 0x59,185VK_Z = 0x5A,186#ifndef VK_LBUTTON187VK_LWIN = 0x5B,188VK_RWIN = 0x5C,189VK_APPS = 0x5D,190VK_SLEEP = 0x5F,191VK_NUMPAD0 = 0x60,192VK_NUMPAD1 = 0x61,193VK_NUMPAD2 = 0x62,194VK_NUMPAD3 = 0x63,195VK_NUMPAD4 = 0x64,196VK_NUMPAD5 = 0x65,197VK_NUMPAD6 = 0x66,198VK_NUMPAD7 = 0x67,199VK_NUMPAD8 = 0x68,200VK_NUMPAD9 = 0x69,201VK_MULTIPLY = 0x6A,202VK_ADD = 0x6B,203VK_SEPARATOR = 0x6C,204VK_SUBTRACT = 0x6D,205VK_DECIMAL = 0x6E,206VK_DIVIDE = 0x6F,207VK_F1 = 0x70,208VK_F2 = 0x71,209VK_F3 = 0x72,210VK_F4 = 0x73,211VK_F5 = 0x74,212VK_F6 = 0x75,213VK_F7 = 0x76,214VK_F8 = 0x77,215VK_F9 = 0x78,216VK_F10 = 0x79,217VK_F11 = 0x7A,218VK_F12 = 0x7B,219VK_F13 = 0x7C,220VK_F14 = 0x7D,221VK_F15 = 0x7E,222VK_F16 = 0x7F,223VK_F17 = 0x80,224VK_F18 = 0x81,225VK_F19 = 0x82,226VK_F20 = 0x83,227VK_F21 = 0x84,228VK_F22 = 0x85,229VK_F23 = 0x86,230VK_F24 = 0x87,231#endif232#ifndef VK_NAVIGATION_VIEW233VK_NAVIGATION_VIEW = 0x88,234VK_NAVIGATION_MENU = 0x89,235VK_NAVIGATION_UP = 0x8A,236VK_NAVIGATION_DOWN = 0x8B,237VK_NAVIGATION_LEFT = 0x8C,238VK_NAVIGATION_RIGHT = 0x8D,239VK_NAVIGATION_ACCEPT = 0x8E,240VK_NAVIGATION_CANCEL = 0x8F,241#endif242#ifndef VK_LBUTTON243VK_NUMLOCK = 0x90,244VK_SCROLL = 0x91,245VK_OEM_NEC_EQUAL = 0x92,246VK_OEM_FJ_JISHO = 0x92,247VK_OEM_FJ_MASSHOU = 0x93,248VK_OEM_FJ_TOUROKU = 0x94,249VK_OEM_FJ_LOYA = 0x95,250VK_OEM_FJ_ROYA = 0x96,251VK_LSHIFT = 0xA0,252VK_RSHIFT = 0xA1,253VK_LCONTROL = 0xA2,254VK_RCONTROL = 0xA3,255VK_LMENU = 0xA4,256VK_RMENU = 0xA5,257VK_BROWSER_BACK = 0xA6,258VK_BROWSER_FORWARD = 0xA7,259VK_BROWSER_REFRESH = 0xA8,260VK_BROWSER_STOP = 0xA9,261VK_BROWSER_SEARCH = 0xAA,262VK_BROWSER_FAVORITES = 0xAB,263VK_BROWSER_HOME = 0xAC,264VK_VOLUME_MUTE = 0xAD,265VK_VOLUME_DOWN = 0xAE,266VK_VOLUME_UP = 0xAF,267VK_MEDIA_NEXT_TRACK = 0xB0,268VK_MEDIA_PREV_TRACK = 0xB1,269VK_MEDIA_STOP = 0xB2,270VK_MEDIA_PLAY_PAUSE = 0xB3,271VK_LAUNCH_MAIL = 0xB4,272VK_LAUNCH_MEDIA_SELECT = 0xB5,273VK_LAUNCH_APP1 = 0xB6,274VK_LAUNCH_APP2 = 0xB7,275VK_OEM_1 = 0xBA,276VK_OEM_PLUS = 0xBB,277VK_OEM_COMMA = 0xBC,278VK_OEM_MINUS = 0xBD,279VK_OEM_PERIOD = 0xBE,280VK_OEM_2 = 0xBF,281VK_OEM_3 = 0xC0,282#endif283#ifndef VK_GAMEPAD_A284VK_GAMEPAD_A = 0xC3,285VK_GAMEPAD_B = 0xC4,286VK_GAMEPAD_X = 0xC5,287VK_GAMEPAD_Y = 0xC6,288VK_GAMEPAD_RIGHT_SHOULDER = 0xC7,289VK_GAMEPAD_LEFT_SHOULDER = 0xC8,290VK_GAMEPAD_LEFT_TRIGGER = 0xC9,291VK_GAMEPAD_RIGHT_TRIGGER = 0xCA,292VK_GAMEPAD_DPAD_UP = 0xCB,293VK_GAMEPAD_DPAD_DOWN = 0xCC,294VK_GAMEPAD_DPAD_LEFT = 0xCD,295VK_GAMEPAD_DPAD_RIGHT = 0xCE,296VK_GAMEPAD_MENU = 0xCF,297VK_GAMEPAD_VIEW = 0xD0,298VK_GAMEPAD_LEFT_THUMBSTICK_BUTTON = 0xD1,299VK_GAMEPAD_RIGHT_THUMBSTICK_BUTTON = 0xD2,300VK_GAMEPAD_LEFT_THUMBSTICK_UP = 0xD3,301VK_GAMEPAD_LEFT_THUMBSTICK_DOWN = 0xD4,302VK_GAMEPAD_LEFT_THUMBSTICK_RIGHT = 0xD5,303VK_GAMEPAD_LEFT_THUMBSTICK_LEFT = 0xD6,304VK_GAMEPAD_RIGHT_THUMBSTICK_UP = 0xD7,305VK_GAMEPAD_RIGHT_THUMBSTICK_DOWN = 0xD8,306VK_GAMEPAD_RIGHT_THUMBSTICK_RIGHT = 0xD9,307VK_GAMEPAD_RIGHT_THUMBSTICK_LEFT = 0xDA,308#endif309#ifndef VK_LBUTTON310VK_OEM_4 = 0xDB,311VK_OEM_5 = 0xDC,312VK_OEM_6 = 0xDD,313VK_OEM_7 = 0xDE,314VK_OEM_8 = 0xDF,315VK_OEM_AX = 0xE1,316VK_OEM_102 = 0xE2,317VK_ICO_HELP = 0xE3,318VK_ICO_00 = 0xE4,319VK_PROCESSKEY = 0xE5,320VK_ICO_CLEAR = 0xE6,321VK_PACKET = 0xE7,322VK_OEM_RESET = 0xE9,323VK_OEM_JUMP = 0xEA,324VK_OEM_PA1 = 0xEB,325VK_OEM_PA2 = 0xEC,326VK_OEM_PA3 = 0xED,327VK_OEM_WSCTRL = 0xEE,328VK_OEM_CUSEL = 0xEF,329VK_OEM_ATTN = 0xF0,330VK_OEM_FINISH = 0xF1,331VK_OEM_COPY = 0xF2,332VK_OEM_AUTO = 0xF3,333VK_OEM_ENLW = 0xF4,334VK_OEM_BACKTAB = 0xF5,335VK_ATTN = 0xF6,336VK_CRSEL = 0xF7,337VK_EXSEL = 0xF8,338VK_EREOF = 0xF9,339VK_PLAY = 0xFA,340VK_ZOOM = 0xFB,341VK_NONAME = 0xFC,342VK_PA1 = 0xFD,343VK_OEM_CLEAR = 0xFE,344#endif345};346347struct GamePadButtonMap {348int32 maskVal;349int16 mappingType;350int16 offset;351};352353struct GamePadMappings {354char name[0x40];355GamePadButtonMap buttons[24];356int32 vendorID;357int32 productID;358int32 type;359};360361struct InputDevice {362virtual void UpdateInput() {}363virtual void ProcessInput(int32 controllerID) {}364virtual void CloseDevice() {}365virtual int32 Unknown1(int32 unknown1, int32 unknown2) { return 0; }366virtual int32 Unknown2(int32 unknown1, int32 unknown2) { return 0; }367368virtual ~InputDevice() = default;369370int32 gamepadType;371uint32 id;372uint8 active;373uint8 isAssigned;374uint8 unused;375uint8 disabled;376uint8 anyPress;377int32 inactiveTimer[2];378};379380struct InputState {381bool32 down;382bool32 press;383int32 keyMap;384};385386struct ControllerState {387InputState keyUp;388InputState keyDown;389InputState keyLeft;390InputState keyRight;391InputState keyA;392InputState keyB;393InputState keyC;394InputState keyX;395InputState keyY;396InputState keyZ;397InputState keyStart;398InputState keySelect;399400// Rev01 hasn't split these into different structs yet401#if !RETRO_REV02402InputState keyBumperL;403InputState keyBumperR;404InputState keyTriggerL;405InputState keyTriggerR;406InputState keyStickL;407InputState keyStickR;408#endif409};410411struct AnalogState {412InputState keyUp;413InputState keyDown;414InputState keyLeft;415InputState keyRight;416#if RETRO_REV02417InputState keyStick;418float deadzone;419float hDelta;420float vDelta;421#else422float deadzone;423float triggerDeltaL;424float triggerDeltaR;425float hDeltaL;426float vDeltaL;427float hDeltaR;428float vDeltaR;429#endif430};431432#if RETRO_REV02433struct TriggerState {434InputState keyBumper;435InputState keyTrigger;436float bumperDelta;437float triggerDelta;438};439#endif440441struct TouchInfo {442float x[0x10];443float y[0x10];444bool32 down[0x10];445uint8 count;446#if !RETRO_REV02447bool32 pauseHold;448bool32 pausePress;449bool32 unknown1;450bool32 anyKeyHold;451bool32 anyKeyPress;452bool32 unknown2;453#endif454};455456extern InputDevice *inputDeviceList[INPUTDEVICE_COUNT];457extern int32 inputDeviceCount;458459extern int32 inputSlots[PLAYER_COUNT];460extern InputDevice *inputSlotDevices[PLAYER_COUNT];461462extern ControllerState controller[PLAYER_COUNT + 1];463extern AnalogState stickL[PLAYER_COUNT + 1];464#if RETRO_REV02465extern AnalogState stickR[PLAYER_COUNT + 1];466extern TriggerState triggerL[PLAYER_COUNT + 1];467extern TriggerState triggerR[PLAYER_COUNT + 1];468#endif469extern TouchInfo touchInfo;470471extern GamePadMappings *gamePadMappings;472extern int32 gamePadCount;473474#if RETRO_INPUTDEVICE_KEYBOARD475#include "Keyboard/KBInputDevice.hpp"476#endif477478#if RETRO_INPUTDEVICE_XINPUT479#include "XInput/XInputDevice.hpp"480#endif481482#if RETRO_INPUTDEVICE_RAWINPUT483#include "RawInput/RawInputDevice.hpp"484#endif485486#if RETRO_INPUTDEVICE_STEAM487#include "Steam/SteamInputDevice.hpp"488#endif489490#if RETRO_INPUTDEVICE_NX491#include "NX/NXInputDevice.hpp"492#endif493494#if RETRO_INPUTDEVICE_SDL2495#include "SDL2/SDL2InputDevice.hpp"496#endif497498#if RETRO_INPUTDEVICE_GLFW499#include "GLFW/GLFWInputDevice.hpp"500#endif501502#if RETRO_INPUTDEVICE_PDBOAT503#include "Paddleboat/PDBInputDevice.hpp"504#endif505506// Initializes the input devices & the backend APIs powering em507void InitInputDevices();508// clears the input states, used by ProcessInput()509void ClearInput();510// Processes the state of the input devices & parses that as data that RSDK can use511void ProcessInput();512// used to process various events on input devices, switch uses it to controller connects/disconnects/changes513void ProcessInputDevices();514// Releases the input devices & closes the backend APIs powering em515void ReleaseInputDevices();516517void RemoveInputDevice(InputDevice *targetDevice);518519inline InputDevice *InputDeviceFromID(uint32 deviceID)520{521for (int32 i = 0; i < inputDeviceCount; ++i) {522if (inputDeviceList[i] && inputDeviceList[i]->id == deviceID)523return inputDeviceList[i];524}525526return NULL;527}528inline int32 GetAvaliableInputDevice()529{530for (int32 i = 0; i < inputDeviceCount; ++i) {531if (inputDeviceList[i] && inputDeviceList[i]->active && !inputDeviceList[i]->disabled && !inputDeviceList[i]->isAssigned532&& inputDeviceList[i]->anyPress) {533return inputDeviceList[i]->id;534}535}536537return INPUT_AUTOASSIGN;538}539540inline uint32 GetInputDeviceID(uint8 inputSlot)541{542uint8 slotID = inputSlot - 1;543if (slotID < PLAYER_COUNT)544return inputSlots[slotID];545546return INPUT_NONE;547}548549#if RETRO_REV02550inline uint32 GetFilteredInputDeviceID(bool32 confirmOnly, bool32 unassignedOnly, uint32 maxInactiveTimer)551{552uint32 mostRecentTime = -1;553int32 mostRecentValidID = 0;554int32 mostRecentID = 0;555uint32 maxTime = maxInactiveTimer ? maxInactiveTimer : -1;556557if (inputDeviceCount) {558for (int32 i = 0; i < inputDeviceCount; ++i) {559if (inputDeviceList[i] && inputDeviceList[i]->active && !inputDeviceList[i]->disabled560&& (!inputDeviceList[i]->isAssigned || !unassignedOnly)) {561if (inputDeviceList[i]->inactiveTimer[confirmOnly] < mostRecentTime) {562mostRecentTime = inputDeviceList[i]->inactiveTimer[confirmOnly];563if (inputDeviceList[i]->inactiveTimer[confirmOnly] <= maxTime)564mostRecentValidID = inputDeviceList[i]->id;565mostRecentID = inputDeviceList[i]->id;566}567}568}569570if (mostRecentValidID)571return mostRecentValidID;572}573574if (mostRecentID)575return mostRecentID;576577for (int32 i = 0; i < inputDeviceCount; ++i) {578if (inputDeviceList[i] && inputDeviceList[i]->active && !inputDeviceList[i]->disabled579&& (!inputDeviceList[i]->isAssigned || !unassignedOnly)) {580return inputDeviceList[i]->id;581}582}583584return mostRecentID;585}586#else587inline int32 GetFilteredInputDeviceID(uint32 deviceID)588{589bool32 confirmOnly = false;590bool32 unassignedOnly = false;591592uint32 mostRecentTime = -1;593int32 mostRecentValidID = 0;594int32 mostRecentID = 0;595uint32 maxTime = -1;596597if (inputDeviceCount) {598for (int32 i = 0; i < inputDeviceCount; ++i) {599if (inputDeviceList[i] && inputDeviceList[i]->active && !inputDeviceList[i]->disabled600&& (!inputDeviceList[i]->isAssigned || !unassignedOnly)) {601602if (deviceID && inputDeviceList[i]->id == deviceID)603continue;604605if (inputDeviceList[i]->inactiveTimer[confirmOnly] < mostRecentTime) {606mostRecentTime = inputDeviceList[i]->inactiveTimer[confirmOnly];607if (inputDeviceList[i]->inactiveTimer[confirmOnly] <= maxTime)608mostRecentValidID = inputDeviceList[i]->id;609mostRecentID = inputDeviceList[i]->id;610}611}612}613614if (mostRecentValidID)615return mostRecentValidID;616}617618if (mostRecentID)619return mostRecentID;620621for (int32 i = 0; i < inputDeviceCount; ++i) {622if (inputDeviceList[i] && inputDeviceList[i]->active && !inputDeviceList[i]->disabled623&& (!inputDeviceList[i]->isAssigned || !unassignedOnly)) {624return inputDeviceList[i]->id;625}626}627628return mostRecentID;629}630#endif631632int32 GetInputDeviceType(uint32 deviceID);633634inline bool32 IsInputDeviceAssigned(uint32 deviceID)635{636for (int32 i = 0; i < inputDeviceCount; ++i) {637if (inputDeviceList[i] && inputDeviceList[i]->id == deviceID) {638return inputDeviceList[i]->isAssigned;639}640}641642return false;643}644645inline int32 GetInputDeviceUnknown(uint32 deviceID)646{647for (int32 i = 0; i < inputDeviceCount; ++i) {648if (inputDeviceList[i] && inputDeviceList[i]->id == deviceID) {649return 0xFFFF; // ???650}651}652653return 0xFFFF;654}655656inline int32 InputDeviceUnknown1(uint32 deviceID, int32 unknown1, int32 unknown2)657{658for (int32 i = 0; i < inputDeviceCount; ++i) {659if (inputDeviceList[i] && inputDeviceList[i]->id == deviceID) {660return inputDeviceList[i]->Unknown1(unknown1, unknown2);661}662}663664return 0;665}666667inline int32 InputDeviceUnknown2(uint32 deviceID, int32 unknown1, int32 unknown2)668{669for (int32 i = 0; i < inputDeviceCount; ++i) {670if (inputDeviceList[i] && inputDeviceList[i]->id == deviceID) {671return inputDeviceList[i]->Unknown2(unknown1, unknown2);672}673}674675return 0;676}677678inline int32 GetInputSlotUnknown(uint8 inputSlot) { return 0xFFFF; }679680inline int32 InputSlotUnknown1(uint8 inputSlot, int32 unknown1, int32 unknown2)681{682uint8 slotID = inputSlot - 1;683684if (slotID < PLAYER_COUNT && inputSlots[slotID])685return inputSlotDevices[slotID]->Unknown1(unknown1, unknown2);686687return 0;688}689690inline int32 InputSlotUnknown2(uint8 inputSlot, int32 unknown1, int32 unknown2)691{692uint8 slotID = inputSlot - 1;693694if (slotID < PLAYER_COUNT && inputSlots[slotID])695return inputSlotDevices[slotID]->Unknown2(unknown1, unknown2);696697return 0;698}699700inline void AssignInputSlotToDevice(uint8 inputSlot, uint32 deviceID)701{702uint8 slotID = inputSlot - 1;703704if (slotID < PLAYER_COUNT) {705if (deviceID && deviceID != INPUT_AUTOASSIGN) {706if (deviceID == INPUT_UNASSIGNED) {707inputSlots[slotID] = INPUT_UNASSIGNED;708}709else {710for (int32 i = 0; i < inputDeviceCount; ++i) {711if (inputDeviceList[i] && inputDeviceList[i]->id == deviceID) {712inputDeviceList[i]->isAssigned = true;713inputSlots[slotID] = deviceID;714inputSlotDevices[slotID] = inputDeviceList[i];715break;716}717}718}719}720else {721InputDevice *device = InputDeviceFromID(inputSlots[slotID]);722if (device)723device->isAssigned = false;724inputSlots[slotID] = deviceID;725}726}727}728729#if RETRO_REV02730inline bool32 IsInputSlotAssigned(uint8 inputSlot)731{732uint8 slotID = inputSlot - 1;733734if (slotID < PLAYER_COUNT)735return inputSlots[slotID] != INPUT_NONE;736737return false;738}739#else740inline bool32 InputIDIsDisconnected(uint8 inputSlot)741{742uint8 slotID = inputSlot - 1;743744if (slotID < PLAYER_COUNT)745return inputSlots[slotID] == INPUT_NONE;746747return false;748}749#endif750751inline void ResetInputSlotAssignments()752{753for (int32 i = 0; i < PLAYER_COUNT; ++i) {754inputSlots[i] = INPUT_NONE;755inputSlotDevices[i] = NULL;756}757758for (int32 i = 0; i < inputDeviceCount; ++i) {759if (inputDeviceList[i])760inputDeviceList[i]->isAssigned = false;761}762}763764inline void SetInputLEDColor()765{766// empty767}768769#if !RETRO_REV02770inline void GetUnknownInputValue(int32 inputSlot, int32 type, int32 *value)771{772uint8 slotID = inputSlot - 1;773774if (value && type < PLAYER_COUNT && inputSlotDevices[slotID]) {775switch (type) {776default:777break;778// case 0: *value = inputSlotDevices[slotID].unknown1; break;779// case 1: *value = inputSlotDevices[slotID].unknown2; break;780}781}782}783#endif784785} // namespace RSDK786787#endif // !INPUT_H788789