cellpad: add pclass_profile flags

This commit is contained in:
Megamouse 2020-04-25 02:12:19 +02:00
parent 4e6d95c5b8
commit e4cb9ef7cd
7 changed files with 196 additions and 19 deletions

View file

@ -3,6 +3,7 @@
#ifdef HAVE_LIBEVDEV
#include "Input/product_info.h"
#include "Emu/Io/pad_config.h"
#include "evdev_joystick_handler.h"
#include "util/logs.hpp"
@ -922,12 +923,23 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std
return button;
};
u32 pclass_profile = 0x0;
for (const auto product : input::get_products_by_class(p_profile->device_class_type))
{
if (product.vendor_id == p_profile->vendor_id && product.product_id == p_profile->product_id)
{
pclass_profile = product.pclass_profile;
}
}
pad->Init
(
CELL_PAD_STATUS_DISCONNECTED,
CELL_PAD_CAPABILITY_PS3_CONFORMITY | CELL_PAD_CAPABILITY_PRESS_MODE | CELL_PAD_CAPABILITY_HP_ANALOG_STICK | CELL_PAD_CAPABILITY_ACTUATOR | CELL_PAD_CAPABILITY_SENSOR_MODE,
CELL_PAD_DEV_TYPE_STANDARD,
p_profile->device_class_type,
pclass_profile,
p_profile->vendor_id,
p_profile->product_id
);