Skip to content

Commit

Permalink
Fix another comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RedPanda4552 committed Nov 24, 2023
1 parent fa5111b commit 96e0ec3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pcsx2/SIO/Pad/Pad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ void Pad::LoadConfig(const SettingsInterface& si)
const ControllerInfo* ci = GetControllerInfo(EmuConfig.Pad.Ports[i].Type);
pxAssert(ci);

// If a pad is not yet constructed, at minimum place a NotConnected pad in the slot.
// Do not abort the for loop - If there are pad settings, we want those to be applied to the slot.
PadBase* pad = Pad::GetPad(i);

// If pad pointer is not occupied yet, type in settings no longer matches the current type, or a multitap was slotted in/out,
// then reconstruct a new pad.
if (!pad || pad->GetType() != ci->type || (mtapPort0Changed && (i <= 4 && i != 1)) || (mtapPort1Changed && (i >= 5 || i == 1)))
{
// Create the new pad. If the VM is in any kind of running state at all, set eject ticks so the PS2 will think
// there was some kind of pad ejection event and properly detect the new one, and properly initiate its config sequence.
pad = Pad::CreatePad(i, ci->type, (VMManager::GetState() != VMState::Shutdown ? Pad::DEFAULT_EJECT_TICKS : 0));
pxAssert(pad);
}
Expand Down

0 comments on commit 96e0ec3

Please sign in to comment.