Pad: Simplify is_fake_pad logic

This commit is contained in:
Florin9doi 2024-05-18 10:31:52 +03:00 committed by Megamouse
parent b4e4aa9822
commit 58d27a9438
2 changed files with 4 additions and 1 deletions

View File

@ -146,7 +146,9 @@ enum
CELL_PAD_PCLASS_TYPE_SKATEBOARD = 0x8001,
// these are used together with pad->is_fake_pad to capture input events for usbd/gem/move without conflicting with cellPad
CELL_PAD_FAKE_TYPE_FIRST = 0xa000,
CELL_PAD_FAKE_TYPE_GUNCON3 = 0xa000,
CELL_PAD_FAKE_TYPE_LAST,
CELL_PAD_PCLASS_TYPE_MAX // last item
};

View File

@ -190,7 +190,8 @@ void pad_thread::Init()
i, cfg->device.to_string(), m_pads[i]->m_pad_handler, m_pads[i]->m_vendor_id, m_pads[i]->m_product_id, m_pads[i]->m_class_type, m_pads[i]->m_class_profile);
}
m_pads[i]->is_fake_pad = (g_cfg.io.move == move_handler::fake && i >= (static_cast<u32>(CELL_PAD_MAX_PORT_NUM) - static_cast<u32>(CELL_GEM_MAX_NUM))) || m_pads[i]->m_class_type == CELL_PAD_FAKE_TYPE_GUNCON3;
m_pads[i]->is_fake_pad = (g_cfg.io.move == move_handler::fake && i >= (static_cast<u32>(CELL_PAD_MAX_PORT_NUM) - static_cast<u32>(CELL_GEM_MAX_NUM)))
|| (m_pads[i]->m_class_type >= CELL_PAD_FAKE_TYPE_FIRST && m_pads[i]->m_class_type <= CELL_PAD_FAKE_TYPE_LAST);
connect_usb_controller(i, input::get_product_by_vid_pid(m_pads[i]->m_vendor_id, m_pads[i]->m_product_id));
}
}