|
|
@ -67,40 +67,19 @@ bool Pad::DoState(StateWrapper& sw)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (controller_type != state_controller_type)
|
|
|
|
if (controller_type != state_controller_type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (g_settings.load_devices_from_save_states)
|
|
|
|
g_host_interface->AddFormattedOSDMessage(
|
|
|
|
{
|
|
|
|
10.0f,
|
|
|
|
g_host_interface->AddFormattedOSDMessage(
|
|
|
|
g_host_interface->TranslateString(
|
|
|
|
10.0f,
|
|
|
|
"OSDMessage", "Save state contains controller type %s in port %u, but %s is used. Switching."),
|
|
|
|
g_host_interface->TranslateString(
|
|
|
|
Settings::GetControllerTypeName(state_controller_type), i + 1u,
|
|
|
|
"OSDMessage", "Save state contains controller type %s in port %u, but %s is used. Switching."),
|
|
|
|
Settings::GetControllerTypeName(controller_type));
|
|
|
|
Settings::GetControllerTypeName(state_controller_type), i + 1u,
|
|
|
|
|
|
|
|
Settings::GetControllerTypeName(controller_type));
|
|
|
|
m_controllers[i].reset();
|
|
|
|
|
|
|
|
if (state_controller_type != ControllerType::None)
|
|
|
|
m_controllers[i].reset();
|
|
|
|
|
|
|
|
if (state_controller_type != ControllerType::None)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_controllers[i] = Controller::Create(state_controller_type, i);
|
|
|
|
|
|
|
|
if (!sw.DoMarker("Controller") || !m_controllers[i]->DoState(sw, false))
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_host_interface->AddFormattedOSDMessage(
|
|
|
|
m_controllers[i] = Controller::Create(state_controller_type, i);
|
|
|
|
10.0f,
|
|
|
|
if (!sw.DoMarker("Controller") || !m_controllers[i]->DoState(sw, false))
|
|
|
|
g_host_interface->TranslateString("OSDMessage", "Ignoring mismatched controller type %s in port %u."),
|
|
|
|
return false;
|
|
|
|
Settings::GetControllerTypeName(state_controller_type), i + 1u);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// we still need to read the save state controller state
|
|
|
|
|
|
|
|
if (state_controller_type != ControllerType::None)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
std::unique_ptr<Controller> dummy_controller = Controller::Create(state_controller_type, i);
|
|
|
|
|
|
|
|
if (dummy_controller)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!sw.DoMarker("Controller") || !dummy_controller->DoState(sw, true))
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|