mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
Small sys_usbd changes
This commit is contained in:
parent
6847e52364
commit
98f91457bf
1 changed files with 11 additions and 5 deletions
|
@ -136,7 +136,7 @@ usb_handler_thread::usb_handler_thread()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// look if any device which we could be interested in is actually connected
|
// look if any device which we could be interested in is actually connected
|
||||||
libusb_device** list;
|
libusb_device** list = nullptr;
|
||||||
ssize_t ndev = libusb_get_device_list(ctx, &list);
|
ssize_t ndev = libusb_get_device_list(ctx, &list);
|
||||||
|
|
||||||
bool found_skylander = false;
|
bool found_skylander = false;
|
||||||
|
@ -191,7 +191,6 @@ usb_handler_thread::usb_handler_thread()
|
||||||
check_device(0x046D, 0xC220, 0xC220, "buzzer9");
|
check_device(0x046D, 0xC220, 0xC220, "buzzer9");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ndev > 0)
|
|
||||||
libusb_free_device_list(list, 1);
|
libusb_free_device_list(list, 1);
|
||||||
|
|
||||||
if (!found_skylander)
|
if (!found_skylander)
|
||||||
|
@ -363,9 +362,12 @@ void usb_handler_thread::check_devices_vs_ldds()
|
||||||
{
|
{
|
||||||
for (const auto& dev : usb_devices)
|
for (const auto& dev : usb_devices)
|
||||||
{
|
{
|
||||||
|
if (dev->assigned_number)
|
||||||
|
continue;
|
||||||
|
|
||||||
for (const auto& ldd : ldds)
|
for (const auto& ldd : ldds)
|
||||||
{
|
{
|
||||||
if (dev->device._device.idVendor == ldd.id_vendor && dev->device._device.idProduct >= ldd.id_product_min && dev->device._device.idProduct <= ldd.id_product_max && !dev->assigned_number)
|
if (dev->device._device.idVendor == ldd.id_vendor && dev->device._device.idProduct >= ldd.id_product_min && dev->device._device.idProduct <= ldd.id_product_max)
|
||||||
{
|
{
|
||||||
if (!dev->open_device())
|
if (!dev->open_device())
|
||||||
{
|
{
|
||||||
|
@ -637,7 +639,7 @@ error_code sys_usbd_receive_event(ppu_thread& ppu, u32 handle, vm::ptr<u64> arg1
|
||||||
// hack for Guitar Hero Live
|
// hack for Guitar Hero Live
|
||||||
// Attaching the device too fast seems to result in a nullptr along the way
|
// Attaching the device too fast seems to result in a nullptr along the way
|
||||||
if (*arg1 == SYS_USBD_ATTACH)
|
if (*arg1 == SYS_USBD_ATTACH)
|
||||||
lv2_obj::wait_timeout(5000);
|
lv2_obj::sleep(ppu), lv2_obj::wait_timeout(5000);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -659,6 +661,10 @@ error_code sys_usbd_receive_event(ppu_thread& ppu, u32 handle, vm::ptr<u64> arg1
|
||||||
*arg1 = ppu.gpr[4];
|
*arg1 = ppu.gpr[4];
|
||||||
*arg2 = ppu.gpr[5];
|
*arg2 = ppu.gpr[5];
|
||||||
*arg3 = ppu.gpr[6];
|
*arg3 = ppu.gpr[6];
|
||||||
|
|
||||||
|
if (*arg1 == SYS_USBD_ATTACH)
|
||||||
|
lv2_obj::sleep(ppu), lv2_obj::wait_timeout(5000);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue