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

@ -2,6 +2,7 @@
#include "PadHandler.h"
#include "Emu/System.h"
#include "Input/pad_thread.h"
#include "Input/product_info.h"
cfg_input g_cfg_input;
@ -429,12 +430,23 @@ bool PadHandlerBase::bindPadToDevice(std::shared_ptr<Pad> pad, const std::string
std::array<u32, button::button_count> mapping = get_mapped_key_codes(pad_device, profile);
u32 pclass_profile = 0x0;
for (const auto product : input::get_products_by_class(profile->device_class_type))
{
if (product.vendor_id == profile->vendor_id && product.product_id == 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,
profile->device_class_type,
pclass_profile,
profile->vendor_id,
profile->product_id
);