mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Emu: some cleanup
This commit is contained in:
parent
a3e8a61547
commit
03b76b4606
149 changed files with 957 additions and 1139 deletions
|
|
@ -186,7 +186,7 @@ void ds4_pad_handler::init_config(pad_config* cfg, const std::string& name)
|
|||
|
||||
u32 ds4_pad_handler::get_battery_level(const std::string& padId)
|
||||
{
|
||||
std::shared_ptr<DS4Device> device = get_hid_device(padId);
|
||||
const std::shared_ptr<DS4Device> device = get_hid_device(padId);
|
||||
if (device == nullptr || device->hidDevice == nullptr)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -266,7 +266,7 @@ std::unordered_map<u64, u16> ds4_pad_handler::get_button_values(const std::share
|
|||
keyBuffer[DS4KeyCodes::RSYPos] = Clamp0To255((127.5f - buf[4]) * 2.0f);
|
||||
|
||||
// bleh, dpad in buffer is stored in a different state
|
||||
u8 dpadState = buf[5] & 0xf;
|
||||
const u8 dpadState = buf[5] & 0xf;
|
||||
switch (dpadState)
|
||||
{
|
||||
case 0x08: // none pressed
|
||||
|
|
@ -366,7 +366,7 @@ pad_preview_values ds4_pad_handler::get_preview_values(const std::unordered_map<
|
|||
};
|
||||
}
|
||||
|
||||
bool ds4_pad_handler::GetCalibrationData(DS4Device* ds4Dev)
|
||||
bool ds4_pad_handler::GetCalibrationData(DS4Device* ds4Dev) const
|
||||
{
|
||||
if (!ds4Dev || !ds4Dev->hidDevice)
|
||||
{
|
||||
|
|
@ -601,7 +601,7 @@ int ds4_pad_handler::send_output_report(DS4Device* device)
|
|||
if (!device || !device->hidDevice)
|
||||
return -2;
|
||||
|
||||
auto config = device->config;
|
||||
const auto config = device->config;
|
||||
if (config == nullptr)
|
||||
return -2; // hid_write and hid_write_control return -1 on error
|
||||
|
||||
|
|
@ -682,7 +682,7 @@ ds4_pad_handler::DataStatus ds4_pad_handler::get_data(DS4Device* device)
|
|||
return DataStatus::NoNewData;
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
int offset;
|
||||
// check report and set offset
|
||||
if (device->bt_controller && buf[0] == 0x11 && res == 78)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue