diff --git a/Utilities/Config.h b/Utilities/Config.h index 4cbc88a85f..be7c58d2dc 100644 --- a/Utilities/Config.h +++ b/Utilities/Config.h @@ -118,7 +118,7 @@ namespace cfg bool m_value; public: - const bool def; + bool def; _bool(node* owner, const std::string& name, bool def = false) : _base(type::_bool, owner, name) @@ -150,6 +150,11 @@ namespace cfg return true; } + + void set(const bool& value) + { + m_value = value; + } }; // Value node with fixed set of possible values, each maps to an enum value of type T. @@ -217,7 +222,7 @@ namespace cfg int_type m_value; public: - const int_type def; + int_type def; _int(node* owner, const std::string& name, int_type def = std::min(Max, std::max(Min, 0))) : _base(type::_int, owner, name) @@ -253,6 +258,11 @@ namespace cfg return false; } + void set(const s64& value) + { + m_value = static_cast(value); + } + std::vector to_list() const override { return make_int_range(Min, Max); @@ -271,7 +281,7 @@ namespace cfg std::string m_value; public: - const std::string def; + std::string def; string(node* owner, const std::string& name, const std::string& def = {}) : _base(type::string, owner, name) diff --git a/rpcs3/Emu/Io/PadHandler.h b/rpcs3/Emu/Io/PadHandler.h index 288665180a..fd49f87195 100644 --- a/rpcs3/Emu/Io/PadHandler.h +++ b/rpcs3/Emu/Io/PadHandler.h @@ -1,7 +1,10 @@ #pragma once +#include #include #include +#include "stdafx.h" +#include "../../Utilities/Config.h" #include "../../Utilities/types.h" // TODO: HLE info (constants, structs, etc.) should not be available here @@ -159,6 +162,13 @@ struct Pad u32 m_device_capability; u32 m_device_type; + // Cable State: 0 - 1 plugged in ? + u8 m_cable_state; + + // DS4: 0 - 9 while unplugged, 0 - 10 while plugged in, 11 charge complete + // XInput: 0 = Empty, 1 = Low, 2 = Medium, 3 = Full + u8 m_battery_level; + std::vector