mirror of https://github.com/PCSX2/pcsx2.git
USB: Fix loading old states without USB.bin
This commit is contained in:
parent
72d6ff625c
commit
51f29f40ee
|
@ -383,15 +383,15 @@ bool USB::DoState(StateWrapper& sw)
|
||||||
{
|
{
|
||||||
std::array<bool, 2> valid_devices = {};
|
std::array<bool, 2> valid_devices = {};
|
||||||
|
|
||||||
|
if (sw.IsReading())
|
||||||
|
{
|
||||||
if (!sw.DoMarker("USB") || !USB::DoOHCIState(sw))
|
if (!sw.DoMarker("USB") || !USB::DoOHCIState(sw))
|
||||||
{
|
{
|
||||||
Console.Error("USB state is invalid, resetting.");
|
Console.Error("USB state is invalid, resetting.");
|
||||||
USBreset();
|
USBreset();
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sw.IsReading())
|
|
||||||
{
|
|
||||||
for (u32 port = 0; port < USB::NUM_PORTS; port++)
|
for (u32 port = 0; port < USB::NUM_PORTS; port++)
|
||||||
{
|
{
|
||||||
s32 state_devtype;
|
s32 state_devtype;
|
||||||
|
@ -444,6 +444,9 @@ bool USB::DoState(StateWrapper& sw)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!sw.DoMarker("USB") || !USB::DoOHCIState(sw))
|
||||||
|
return false;
|
||||||
|
|
||||||
for (u32 port = 0; port < USB::NUM_PORTS; port++)
|
for (u32 port = 0; port < USB::NUM_PORTS; port++)
|
||||||
{
|
{
|
||||||
s32 state_devtype = EmuConfig.USB.Ports[port].DeviceType;
|
s32 state_devtype = EmuConfig.USB.Ports[port].DeviceType;
|
||||||
|
|
Loading…
Reference in New Issue