Fixed 'Assign_changes' usage for cellpad / padhandler

This commit is contained in:
Jake 2014-05-05 21:58:49 -05:00
parent 29cd11ad06
commit 199845a9d1
3 changed files with 10 additions and 8 deletions

View File

@ -215,7 +215,8 @@ public:
if(button.m_keyCode != code)
continue;
pad.m_port_status |= CELL_PAD_STATUS_ASSIGN_CHANGES;
//This is for reporting when a controller connects/disconnects, shouldn't be here
//pad.m_port_status |= CELL_PAD_STATUS_ASSIGN_CHANGES;
if(button.m_pressed && !pressed)
{
@ -232,8 +233,6 @@ public:
if (stick.m_keyCodeMax != code && stick.m_keyCodeMin != code)
continue;
pad.m_port_status |= CELL_PAD_STATUS_ASSIGN_CHANGES;
if (stick.m_keyCodeMax == code)
{
stick.m_min_pressed = false; //!!! need fix !!!

View File

@ -33,8 +33,10 @@ public:
void LoadSettings()
{
//Fixed assign change, default is both sensor and press off
m_pads.emplace_back(
CELL_PAD_STATUS_CONNECTED, CELL_PAD_SETTING_PRESS_ON | CELL_PAD_SETTING_SENSOR_OFF,
CELL_PAD_STATUS_CONNECTED | CELL_PAD_STATUS_ASSIGN_CHANGES,
CELL_PAD_SETTING_PRESS_OFF | CELL_PAD_SETTING_SENSOR_OFF,
CELL_PAD_CAPABILITY_PS3_CONFORMITY | CELL_PAD_CAPABILITY_PRESS_MODE,
CELL_PAD_DEV_TYPE_STANDARD);

View File

@ -90,8 +90,6 @@ int cellPadGetData(u32 port_no, u32 data_addr)
u16 d1 = 0;
u16 d2 = 0;
pad.m_port_status &= ~CELL_PAD_STATUS_ASSIGN_CHANGES;
for(Button& button : pad.m_buttons)
{
switch(button.m_offset)
@ -191,7 +189,8 @@ int cellPadGetInfo(u32 info_addr)
info.now_connect = rinfo.now_connect;
info.system_info = rinfo.system_info;
const std::vector<Pad>& pads = Emu.GetPadManager().GetPads();
//Can't have this as const, we need to reset Assign Changes Flag here
std::vector<Pad>& pads = Emu.GetPadManager().GetPads();
for(u32 i=0; i<CELL_MAX_PADS; ++i)
{
@ -199,6 +198,7 @@ int cellPadGetInfo(u32 info_addr)
break;
info.status[i] = pads[i].m_port_status;
pads[i].m_port_status &= ~CELL_PAD_STATUS_ASSIGN_CHANGES;
info.product_id[i] = 0x0268;
info.vendor_id[i] = 0x054C;
}
@ -221,7 +221,7 @@ int cellPadGetInfo2(u32 info_addr)
info.now_connect = rinfo.now_connect;
info.system_info = rinfo.system_info;
const std::vector<Pad>& pads = Emu.GetPadManager().GetPads();
std::vector<Pad>& pads = Emu.GetPadManager().GetPads();
for(u32 i=0; i<CELL_PAD_MAX_PORT_NUM; ++i)
{
@ -229,6 +229,7 @@ int cellPadGetInfo2(u32 info_addr)
break;
info.port_status[i] = pads[i].m_port_status;
pads[i].m_port_status &= ~CELL_PAD_STATUS_ASSIGN_CHANGES;
info.port_setting[i] = pads[i].m_port_setting;
info.device_capability[i] = pads[i].m_device_capability;
info.device_type[i] = pads[i].m_device_type;