mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-05 15:49:20 +00:00
sys_usbd: Fix emulated devices not being created without a physical device
This commit is contained in:
parent
8752bdbc61
commit
f4e5110ef3
1 changed files with 4 additions and 4 deletions
|
@ -508,7 +508,7 @@ usb_handler_thread::usb_handler_thread()
|
||||||
perform_scan();
|
perform_scan();
|
||||||
|
|
||||||
// Set up emulated devices for any devices that are not already being passed through
|
// Set up emulated devices for any devices that are not already being passed through
|
||||||
std::map<usb_allow_list_entry, int> emulate_device_check;
|
std::map<usb_allow_list_entry, int> passthrough_usb_device_counts;
|
||||||
for (const auto& dev : usb_devices)
|
for (const auto& dev : usb_devices)
|
||||||
{
|
{
|
||||||
for (const auto& entry : device_allow_list)
|
for (const auto& entry : device_allow_list)
|
||||||
|
@ -517,7 +517,7 @@ usb_handler_thread::usb_handler_thread()
|
||||||
const u16 idProduct = dev->device._device.idProduct;
|
const u16 idProduct = dev->device._device.idProduct;
|
||||||
if (entry.max_device_count != nullptr && (idVendor == entry.id_vendor && idProduct >= entry.id_product_min && idProduct <= entry.id_product_max))
|
if (entry.max_device_count != nullptr && (idVendor == entry.id_vendor && idProduct >= entry.id_product_min && idProduct <= entry.id_product_max))
|
||||||
{
|
{
|
||||||
emulate_device_check[entry]++;
|
passthrough_usb_device_counts[entry]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -526,8 +526,8 @@ usb_handler_thread::usb_handler_thread()
|
||||||
{
|
{
|
||||||
if (entry.max_device_count && entry.make_instance)
|
if (entry.max_device_count && entry.make_instance)
|
||||||
{
|
{
|
||||||
const int real_device_count = emulate_device_check[entry];
|
const int count = passthrough_usb_device_counts[entry];
|
||||||
for (int i = real_device_count; i < entry.max_device_count(); i++)
|
for (int i = count; i < entry.max_device_count(); i++)
|
||||||
{
|
{
|
||||||
sys_usbd.success("Emulating device: %s (%d)", std::basic_string(entry.device_name), i);
|
sys_usbd.success("Emulating device: %s (%d)", std::basic_string(entry.device_name), i);
|
||||||
auto usb_dev = entry.make_instance(i, get_new_location());
|
auto usb_dev = entry.make_instance(i, get_new_location());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue