IOS: Add UpdateWantDeterminism to devices

This will be useful for the USB devices to disconnect and hide any real
devices when Core::g_want_determinism is true.
This commit is contained in:
Léo Lam 2017-01-21 19:08:17 +01:00
parent b7cc25535f
commit e246afb049
4 changed files with 13 additions and 2 deletions

View File

@ -54,7 +54,7 @@
#include "Core/HW/SystemTimers.h"
#include "Core/HW/VideoInterface.h"
#include "Core/HW/Wiimote.h"
#include "Core/IOS/Network/Socket.h"
#include "Core/IOS/IPC.h"
#include "Core/IOS/USB/Bluetooth/BTEmu.h"
#include "Core/IOS/USB/Bluetooth/WiimoteDevice.h"
#include "Core/Movie.h"
@ -975,7 +975,7 @@ void UpdateWantDeterminism(bool initial)
bool was_unpaused = Core::PauseAndLock(true);
g_want_determinism = new_want_determinism;
IOS::HLE::WiiSockMan::GetInstance().UpdateWantDeterminism(new_want_determinism);
IOS::HLE::UpdateWantDeterminism(new_want_determinism);
Fifo::UpdateWantDeterminism(new_want_determinism);
// We need to clear the cache because some parts of the JIT depend on want_determinism, e.g. use
// of FMA.

View File

@ -159,6 +159,7 @@ public:
virtual IPCCommandResult IOCtl(const IOCtlRequest& ioctl) { return Unsupported(ioctl); }
virtual IPCCommandResult IOCtlV(const IOCtlVRequest& ioctlv) { return Unsupported(ioctlv); }
virtual void Update() {}
virtual void UpdateWantDeterminism(bool new_want_determinism) {}
virtual DeviceType GetDeviceType() const { return m_device_type; }
virtual bool IsOpened() const { return m_is_active; }
static IPCCommandResult GetDefaultReply(s32 return_value);

View File

@ -44,6 +44,7 @@
#include "Core/IOS/IPC.h"
#include "Core/IOS/Network/Net.h"
#include "Core/IOS/Network/SSL.h"
#include "Core/IOS/Network/Socket.h"
#include "Core/IOS/SDIO/SDIOSlot0.h"
#include "Core/IOS/STM/STM.h"
#include "Core/IOS/USB/Bluetooth/BTEmu.h"
@ -851,5 +852,12 @@ void UpdateDevices()
}
}
}
void UpdateWantDeterminism(const bool new_want_determinism)
{
WiiSockMan::GetInstance().UpdateWantDeterminism(new_want_determinism);
for (const auto& device : s_device_map)
device.second->UpdateWantDeterminism(new_want_determinism);
}
} // namespace HLE
} // namespace IOS

View File

@ -77,6 +77,8 @@ void Update();
// Update Devices
void UpdateDevices();
void UpdateWantDeterminism(bool new_want_determinism);
void ExecuteCommand(u32 address);
void EnqueueRequest(u32 address);