mirror of https://github.com/PCSX2/pcsx2.git
USB: Don't register the device if the DeviceType is none.
This commit is contained in:
parent
c46d316e95
commit
4de0fbe6b0
|
@ -74,7 +74,7 @@ OHCIPort& USB::GetOHCIPort(u32 port)
|
||||||
bool USB::CreateDevice(u32 port)
|
bool USB::CreateDevice(u32 port)
|
||||||
{
|
{
|
||||||
const Pcsx2Config::USBOptions::Port& portcfg = EmuConfig.USB.Ports[port];
|
const Pcsx2Config::USBOptions::Port& portcfg = EmuConfig.USB.Ports[port];
|
||||||
const DeviceProxy* proxy = RegisterDevice::instance().Device(portcfg.DeviceType);
|
const DeviceProxy* proxy = (portcfg.DeviceType != DEVTYPE_NONE) ? RegisterDevice::instance().Device(portcfg.DeviceType) : nullptr;
|
||||||
if (!proxy)
|
if (!proxy)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ s32 USB::DeviceTypeNameToIndex(const std::string_view& device)
|
||||||
const char* USB::DeviceTypeIndexToName(s32 device)
|
const char* USB::DeviceTypeIndexToName(s32 device)
|
||||||
{
|
{
|
||||||
RegisterDevice& rd = RegisterDevice::instance();
|
RegisterDevice& rd = RegisterDevice::instance();
|
||||||
const DeviceProxy* proxy = rd.Device(device);
|
const DeviceProxy* proxy = (device != DEVTYPE_NONE) ? rd.Device(device) : nullptr;
|
||||||
return proxy ? proxy->TypeName() : "None";
|
return proxy ? proxy->TypeName() : "None";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue