IPC_HLE: Namespace IOS HLE

Gets all of the IOS HLE code out of the global scope.
This commit is contained in:
Lioncash 2017-01-17 15:01:30 -05:00
parent f1542c8e5a
commit 722162b54a
70 changed files with 423 additions and 108 deletions

View File

@ -282,7 +282,7 @@ bool CBoot::BootUp()
std::vector<u8> tmd_buffer = pVolume.GetTMD();
if (!tmd_buffer.empty())
{
WII_IPC_HLE_Interface::ES_DIVerify(tmd_buffer);
IOS::HLE::ES_DIVerify(tmd_buffer);
}
_StartupPara.bWii = pVolume.GetVolumeType() == DiscIO::Platform::WII_DISC;

View File

@ -87,7 +87,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename)
File::CreateFullPath(Common::GetTitleDataPath(titleID, Common::FROM_SESSION_ROOT));
if (titleID == TITLEID_SYSMENU)
HLE_IPC_CreateVirtualFATFilesystem();
IOS::HLE::HLE_IPC_CreateVirtualFATFilesystem();
// setup Wii memory
if (!SetupWiiMemory())
return false;
@ -97,7 +97,7 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename)
if (pContent == nullptr)
return false;
WII_IPC_HLE_Interface::SetDefaultContentFile(_pFilename);
IOS::HLE::SetDefaultContentFile(_pFilename);
std::unique_ptr<CDolLoader> pDolLoader = std::make_unique<CDolLoader>(pContent->m_Data->Get());
if (!pDolLoader->IsValid())

View File

@ -375,7 +375,7 @@ void SConfig::SaveSettingsToSysconf()
sysconf.SetData<u8>("IPL.IDL", 0x00);
NOTICE_LOG(COMMON, "Disabling WC24 'standby' (shutdown to idle) to avoid hanging on shutdown");
RestoreBTInfoSection(&sysconf);
IOS::HLE::RestoreBTInfoSection(&sysconf);
sysconf.Save();
}

View File

@ -544,7 +544,7 @@ void EmuThread()
// Activate Wiimotes which don't have source set to "None"
for (unsigned int i = 0; i != MAX_BBMOTES; ++i)
if (g_wiimote_sources[i])
GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true);
IOS::HLE::GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true);
}
AudioCommon::InitSoundStream();
@ -985,7 +985,7 @@ void UpdateWantDeterminism(bool initial)
bool was_unpaused = Core::PauseAndLock(true);
g_want_determinism = new_want_determinism;
WiiSockMan::GetInstance().UpdateWantDeterminism(new_want_determinism);
IOS::HLE::WiiSockMan::GetInstance().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

@ -1155,9 +1155,9 @@ void FinishExecutingCommand(ReplyType reply_type, DIInterruptType interrupt_type
case ReplyType::IOS_HLE:
{
std::shared_ptr<IWII_IPC_HLE_Device> di = WII_IPC_HLE_Interface::GetDeviceByName("/dev/di");
std::shared_ptr<IOS::HLE::IWII_IPC_HLE_Device> di = IOS::HLE::GetDeviceByName("/dev/di");
if (di)
std::static_pointer_cast<CWII_IPC_HLE_Device_di>(di)->FinishIOCtl(interrupt_type);
std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_di>(di)->FinishIOCtl(interrupt_type);
break;
}

View File

@ -53,8 +53,8 @@ void Init()
Core::InitializeWiiRoot(Core::g_want_determinism);
DiscIO::cUIDsys::AccessInstance().UpdateLocation();
DiscIO::CSharedContent::AccessInstance().UpdateLocation();
WII_IPCInterface::Init();
WII_IPC_HLE_Interface::Init(); // Depends on Memory
IOS::Init();
IOS::HLE::Init(); // Depends on Memory
}
}
@ -62,8 +62,8 @@ void Shutdown()
{
if (SConfig::GetInstance().bWii)
{
WII_IPC_HLE_Interface::Shutdown(); // Depends on Memory
WII_IPCInterface::Shutdown();
IOS::HLE::Shutdown(); // Depends on Memory
IOS::Shutdown();
Core::ShutdownWiiRoot();
}
@ -103,10 +103,10 @@ void DoState(PointerWrap& p)
if (SConfig::GetInstance().bWii)
{
WII_IPCInterface::DoState(p);
p.DoMarker("WII_IPCInterface");
WII_IPC_HLE_Interface::DoState(p);
p.DoMarker("WII_IPC_HLE_Interface");
IOS::DoState(p);
p.DoMarker("IOS");
IOS::HLE::DoState(p);
p.DoMarker("IOS::HLE");
}
p.DoMarker("WIIHW");

View File

@ -79,7 +79,7 @@ static std::unique_ptr<MMIO::Mapping> InitMMIOWii()
{
auto mmio = InitMMIO();
WII_IPCInterface::RegisterMMIO(mmio.get(), 0x0D000000);
IOS::RegisterMMIO(mmio.get(), 0x0D000000);
DVDInterface::RegisterMMIO(mmio.get(), 0x0D006000);
SerialInterface::RegisterMMIO(mmio.get(), 0x0D006400);
ExpansionInterface::RegisterMMIO(mmio.get(), 0x0D006800);

View File

@ -212,10 +212,10 @@ static void IOSNotifyResetButtonCallback(u64 userdata, s64 cyclesLate)
{
if (SConfig::GetInstance().bWii)
{
std::shared_ptr<IWII_IPC_HLE_Device> stm =
WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
std::shared_ptr<IOS::HLE::IWII_IPC_HLE_Device> stm =
IOS::HLE::GetDeviceByName("/dev/stm/eventhook");
if (stm)
std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->ResetButton();
std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_stm_eventhook>(stm)->ResetButton();
}
}
@ -223,10 +223,10 @@ static void IOSNotifyPowerButtonCallback(u64 userdata, s64 cyclesLate)
{
if (SConfig::GetInstance().bWii)
{
std::shared_ptr<IWII_IPC_HLE_Device> stm =
WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
std::shared_ptr<IOS::HLE::IWII_IPC_HLE_Device> stm =
IOS::HLE::GetDeviceByName("/dev/stm/eventhook");
if (stm)
std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->PowerButton();
std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_stm_eventhook>(stm)->PowerButton();
}
}

View File

@ -29,7 +29,7 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule:
IPC_HLE_UpdateCallback() // In this file
// This function seems to call all devices' Update() function four times per frame
WII_IPC_HLE_Interface::Update()
IOS::HLE::Update()
// If the AclFrameQue is empty this will call Wiimote_Update() and make it send
the current input status to the game. I'm not sure if this occurs approximately
@ -37,7 +37,7 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule:
CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
PluginWiimote::Wiimote_Update()
// This is also a device updated by WII_IPC_HLE_Interface::Update() but it doesn't
// This is also a device updated by IOS::HLE::Update() but it doesn't
seem to ultimately call PluginWiimote::Wiimote_Update(). However it can be called
by the /dev/usb/oh1 device if the AclFrameQue is empty.
CWII_IPC_HLE_WiiMote::Update()
@ -112,7 +112,7 @@ static void IPC_HLE_UpdateCallback(u64 userdata, s64 cyclesLate)
{
if (SConfig::GetInstance().bWii)
{
WII_IPC_HLE_Interface::UpdateDevices();
IOS::HLE::UpdateDevices();
CoreTiming::ScheduleEvent(s_ipc_hle_period - cyclesLate, et_IPC_HLE);
}
}
@ -236,8 +236,6 @@ void Init()
// AyuanX: TO BE TWEAKED
// Now the 1500 is a pure assumption
// We need to figure out the real frequency though
// FYI, WII_IPC_HLE_Interface::Update is also called in WII_IPCInterface::Write32
const int freq = 1500;
s_ipc_hle_period = GetTicksPerSecond() / freq;
}

View File

@ -21,7 +21,7 @@
// ppc_msg is a pointer to 0x40byte command structure
// arm_msg is, similarly, starlet's response buffer*
namespace WII_IPCInterface
namespace IOS
{
enum
{
@ -139,7 +139,7 @@ void Reset()
{
INFO_LOG(WII_IPC, "Resetting ...");
InitState();
WII_IPC_HLE_Interface::Reset();
HLE::Reset();
}
void Shutdown()
@ -154,8 +154,8 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
MMIO::ComplexWrite<u32>([](u32, u32 val) {
ctrl.ppc(val);
if (ctrl.X1)
WII_IPC_HLE_Interface::EnqueueRequest(ppc_msg);
WII_IPC_HLE_Interface::Update();
HLE::EnqueueRequest(ppc_msg);
HLE::Update();
CoreTiming::ScheduleEvent(0, updateInterrupts, 0);
}));
@ -164,7 +164,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
mmio->Register(base | PPC_IRQFLAG, MMIO::InvalidRead<u32>(),
MMIO::ComplexWrite<u32>([](u32, u32 val) {
ppc_irq_flags &= ~val;
WII_IPC_HLE_Interface::Update();
HLE::Update();
CoreTiming::ScheduleEvent(0, updateInterrupts, 0);
}));
@ -173,7 +173,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
ppc_irq_masks = val;
if (ppc_irq_masks & INT_CAUSE_IPC_BROADWAY) // wtf?
Reset();
WII_IPC_HLE_Interface::Update();
HLE::Update();
CoreTiming::ScheduleEvent(0, updateInterrupts, 0);
}));
@ -229,4 +229,4 @@ bool IsReady()
{
return ((ctrl.Y1 == 0) && (ctrl.Y2 == 0) && ((ppc_irq_flags & INT_CAUSE_IPC_BROADWAY) == 0));
}
}
} // namespace IOS

View File

@ -12,7 +12,7 @@ namespace MMIO
class Mapping;
}
namespace WII_IPCInterface
namespace IOS
{
enum StarletInterruptCause
{
@ -46,4 +46,4 @@ void GenerateAck(u32 _Address);
void GenerateReply(u32 _Address);
bool IsReady();
}
} // namespace IOS

View File

@ -12,6 +12,10 @@
#include "Common/CommonFuncs.h"
#include "Common/CommonTypes.h"
namespace IOS
{
namespace HLE
{
TMDReader::TMDReader(const std::vector<u8>& bytes) : m_bytes(bytes)
{
}
@ -94,3 +98,5 @@ void TMDReader::DoState(PointerWrap& p)
{
p.Do(m_bytes);
}
} // namespace HLE
} // namespace IOS

View File

@ -13,6 +13,10 @@
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
namespace IOS
{
namespace HLE
{
class TMDReader final
{
public:
@ -44,3 +48,5 @@ public:
private:
std::vector<u8> m_bytes;
};
} // namespace HLE
} // namespace IOS

View File

@ -12,6 +12,10 @@
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
namespace IOS
{
namespace HLE
{
namespace NWC24
{
NWC24Config::NWC24Config()
@ -215,3 +219,5 @@ void NWC24Config::SetEmail(const char* email)
m_data.email[MAX_EMAIL_LENGTH - 1] = '\0';
}
} // namespace NWC24
} // namespace HLE
} // namespace IOS

View File

@ -7,6 +7,10 @@
#include <string>
#include "Common/CommonTypes.h"
namespace IOS
{
namespace HLE
{
namespace NWC24
{
enum ErrorCode : int
@ -94,3 +98,5 @@ private:
ConfigData m_data;
};
} // namespace NWC24
} // namespace HLE
} // namespace IOS

View File

@ -60,7 +60,9 @@ struct EventType;
#include "Core/IPC_HLE/WII_IPC_HLE_Device_hid.h"
#endif
namespace WII_IPC_HLE_Interface
namespace IOS
{
namespace HLE
{
static std::map<u32, std::shared_ptr<IWII_IPC_HLE_Device>> s_device_map;
static std::mutex s_device_map_mutex;
@ -465,12 +467,12 @@ void EnqueueCommandAcknowledgement(u32 address, int cycles_in_future)
// Takes care of routing ipc <-> ipc HLE
void Update()
{
if (!WII_IPCInterface::IsReady())
if (!IsReady())
return;
if (s_request_queue.size())
{
WII_IPCInterface::GenerateAck(s_request_queue.front());
GenerateAck(s_request_queue.front());
DEBUG_LOG(WII_IPC_HLE, "||-- Acknowledge IPC Request @ 0x%08x", s_request_queue.front());
u32 command = s_request_queue.front();
s_request_queue.pop_front();
@ -480,7 +482,7 @@ void Update()
if (s_reply_queue.size())
{
WII_IPCInterface::GenerateReply(s_reply_queue.front());
GenerateReply(s_reply_queue.front());
DEBUG_LOG(WII_IPC_HLE, "<<-- Reply to IPC Request @ 0x%08x", s_reply_queue.front());
s_reply_queue.pop_front();
return;
@ -488,7 +490,7 @@ void Update()
if (s_ack_queue.size())
{
WII_IPCInterface::GenerateAck(s_ack_queue.front());
GenerateAck(s_ack_queue.front());
WARN_LOG(WII_IPC_HLE, "<<-- Double-ack to IPC Request @ 0x%08x", s_ack_queue.front());
s_ack_queue.pop_front();
return;
@ -506,5 +508,5 @@ void UpdateDevices()
}
}
}
} // end of namespace WII_IPC_HLE_Interface
} // namespace HLE
} // namespace IOS

View File

@ -12,10 +12,15 @@
#include "Core/CoreTiming.h"
#include "Core/HW/SystemTimers.h"
struct IOSRequest;
class IWII_IPC_HLE_Device;
class PointerWrap;
namespace IOS
{
namespace HLE
{
class IWII_IPC_HLE_Device;
struct IOSRequest;
struct IPCCommandResult
{
s32 return_value;
@ -36,8 +41,6 @@ enum IPCCommandType : u32
IPC_REPLY = 8,
};
namespace WII_IPC_HLE_Interface
{
// Init
void Init();
@ -74,5 +77,5 @@ void EnqueueRequest(u32 address);
void EnqueueReply(const IOSRequest& request, s32 return_value, int cycles_in_future = 0,
CoreTiming::FromThread from = CoreTiming::FromThread::CPU);
void EnqueueCommandAcknowledgement(u32 address, int cycles_in_future = 0);
} // end of namespace WII_IPC_HLE_Interface
} // namespace HLE
} // namespace IOS

View File

@ -12,6 +12,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
namespace IOS
{
namespace HLE
{
IOSRequest::IOSRequest(const u32 address_) : address(address_)
{
command = static_cast<IPCCommandType>(Memory::Read_U32(address));
@ -171,3 +175,5 @@ IPCCommandResult IWII_IPC_HLE_Device::GetNoReply()
{
return {IPC_SUCCESS, false, 0};
}
} // namespace HLE
} // namespace IOS

View File

@ -13,6 +13,10 @@
#include "Common/Logging/Log.h"
#include "Core/IPC_HLE/WII_IPC_HLE.h"
namespace IOS
{
namespace HLE
{
enum IOSReturnCode : s32
{
IPC_SUCCESS = 0, // Success
@ -168,3 +172,5 @@ protected:
private:
IPCCommandResult Unsupported(const IOSRequest& request);
};
} // namespace HLE
} // namespace IOS

View File

@ -17,6 +17,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_Device_DI.h"
#include "DiscIO/Volume.h"
namespace IOS
{
namespace HLE
{
CWII_IPC_HLE_Device_di::CWII_IPC_HLE_Device_di(u32 _DeviceID, const std::string& _rDeviceName)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
{
@ -74,7 +78,7 @@ void CWII_IPC_HLE_Device_di::FinishIOCtl(DVDInterface::DIInterruptType interrupt
// This command has been executed, so it's removed from the queue
u32 command_address = m_commands_to_execute.front();
m_commands_to_execute.pop_front();
WII_IPC_HLE_Interface::EnqueueReply(IOSIOCtlRequest{command_address}, interrupt_type);
EnqueueReply(IOSIOCtlRequest{command_address}, interrupt_type);
// DVDInterface is now ready to execute another command,
// so we start executing a command from the queue if there is one
@ -107,7 +111,7 @@ IPCCommandResult CWII_IPC_HLE_Device_di::IOCtlV(const IOSIOCtlVRequest& request)
// Read TMD to the buffer
std::vector<u8> tmd_buffer = DVDInterface::GetVolume().GetTMD();
Memory::CopyToEmu(request.io_vectors[0].address, tmd_buffer.data(), tmd_buffer.size());
WII_IPC_HLE_Interface::ES_DIVerify(tmd_buffer);
ES_DIVerify(tmd_buffer);
return_value = 1;
break;
@ -117,3 +121,5 @@ IPCCommandResult CWII_IPC_HLE_Device_di::IOCtlV(const IOSIOCtlVRequest& request)
}
return GetDefaultReply(return_value);
}
} // namespace HLE
} // namespace IOS

View File

@ -18,6 +18,10 @@ namespace DVDInterface
enum DIInterruptType : int;
}
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_di : public IWII_IPC_HLE_Device
{
public:
@ -37,3 +41,5 @@ private:
std::deque<u32> m_commands_to_execute;
};
} // namespace HLE
} // namespace IOS

View File

@ -17,6 +17,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h"
namespace IOS
{
namespace HLE
{
static std::map<std::string, std::weak_ptr<File::IOFile>> openFiles;
// This is used by several of the FileIO and /dev/fs functions
@ -334,3 +338,5 @@ void CWII_IPC_HLE_Device_FileIO::DoState(PointerWrap& p)
// Open it again
OpenFile();
}
} // namespace HLE
} // namespace IOS

View File

@ -18,6 +18,10 @@ namespace File
class IOFile;
}
namespace IOS
{
namespace HLE
{
std::string HLE_IPC_BuildFilename(const std::string& wii_path);
void HLE_IPC_CreateVirtualFATFilesystem();
@ -70,3 +74,5 @@ private:
std::string m_filepath;
std::shared_ptr<File::IOFile> m_file;
};
} // namespace HLE
} // namespace IOS

View File

@ -67,6 +67,10 @@
#include <Windows.h>
#endif
namespace IOS
{
namespace HLE
{
std::string CWII_IPC_HLE_Device_es::m_ContentFile;
CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 device_id, const std::string& device_name)
@ -1114,8 +1118,8 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(const IOSIOCtlVRequest& request)
wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected();
}
WII_IPC_HLE_Interface::Reset(true);
WII_IPC_HLE_Interface::Reinit();
Reset(true);
Reinit();
if (!SConfig::GetInstance().m_bt_passthrough_enabled)
{
@ -1134,7 +1138,7 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(const IOSIOCtlVRequest& request)
}
}
delete[] wiiMoteConnected;
WII_IPC_HLE_Interface::SetDefaultContentFile(tContentFile);
SetDefaultContentFile(tContentFile);
}
// Pass the "#002 check"
// Apploader should write the IOS version and revision to 0x3140, and compare it
@ -1167,7 +1171,7 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(const IOSIOCtlVRequest& request)
// Generate a "reply" to the IPC command. ES_LAUNCH is unique because it
// involves restarting IOS; IOS generates two acknowledgements in a row.
WII_IPC_HLE_Interface::EnqueueCommandAcknowledgement(request.address, 0);
EnqueueCommandAcknowledgement(request.address, 0);
return GetNoReply();
}
break;
@ -1319,3 +1323,5 @@ u32 CWII_IPC_HLE_Device_es::ES_DIVerify(const std::vector<u8>& tmd)
DiscIO::CNANDContentManager::Access().ClearCache();
return 0;
}
} // namespace HLE
} // namespace IOS

View File

@ -22,6 +22,10 @@ class CNANDContentLoader;
struct SNANDContent;
}
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_es : public IWII_IPC_HLE_Device
{
public:
@ -162,3 +166,5 @@ private:
u8 padding[0x3c];
};
};
} // namespace HLE
} // namespace IOS

View File

@ -22,6 +22,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_Device_FileIO.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_fs.h"
namespace IOS
{
namespace HLE
{
static bool IsValidWiiPath(const std::string& path)
{
return path.compare(0, 1, "/") == 0;
@ -634,3 +638,5 @@ void CWII_IPC_HLE_Device_fs::DoState(PointerWrap& p)
p.Do(type);
}
}
} // namespace HLE
} // namespace IOS

View File

@ -12,6 +12,10 @@
class PointerWrap;
namespace IOS
{
namespace HLE
{
struct NANDStat
{
u32 BlockSize;
@ -52,3 +56,5 @@ private:
IPCCommandResult GetFSReply(s32 return_value) const;
s32 ExecuteCommand(const IOSIOCtlRequest& request);
};
} // namespace HLE
} // namespace IOS

View File

@ -20,6 +20,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_hid.h"
namespace IOS
{
namespace HLE
{
#define MAX_DEVICE_DEVNUM 256
static u64 hidDeviceAliases[MAX_DEVICE_DEVNUM];
@ -39,8 +43,7 @@ void CWII_IPC_HLE_Device_hid::checkUsbUpdates(CWII_IPC_HLE_Device_hid* hid)
{
IOSIOCtlRequest request{hid->deviceCommandAddress};
hid->FillOutDevices(request);
WII_IPC_HLE_Interface::EnqueueReply(request, IPC_SUCCESS, 0,
CoreTiming::FromThread::NON_CPU);
EnqueueReply(request, IPC_SUCCESS, 0, CoreTiming::FromThread::NON_CPU);
hid->deviceCommandAddress = 0;
}
}
@ -61,7 +64,7 @@ void CWII_IPC_HLE_Device_hid::handleUsbUpdates(struct libusb_transfer* transfer)
}
IOSIOCtlRequest request{replyAddress};
WII_IPC_HLE_Interface::EnqueueReply(request, ret, 0, CoreTiming::FromThread::NON_CPU);
EnqueueReply(request, ret, 0, CoreTiming::FromThread::NON_CPU);
}
CWII_IPC_HLE_Device_hid::CWII_IPC_HLE_Device_hid(u32 _DeviceID, const std::string& _rDeviceName)
@ -211,7 +214,7 @@ IPCCommandResult CWII_IPC_HLE_Device_hid::IOCtl(const IOSIOCtlRequest& request)
{
IOSIOCtlRequest pending_request{deviceCommandAddress};
Memory::Write_U32(0xFFFFFFFF, pending_request.buffer_out);
WII_IPC_HLE_Interface::EnqueueReply(pending_request, -1);
EnqueueReply(pending_request, -1);
deviceCommandAddress = 0;
}
INFO_LOG(WII_IPC_HID, "HID::IOCtl(Shutdown) (BufferIn: (%08x, %i), BufferOut: (%08x, %i)",
@ -570,3 +573,5 @@ int CWII_IPC_HLE_Device_hid::GetAvailableDevNum(u16 idVendor, u16 idProduct, u8
return -1;
}
} // namespace HLE
} // namespace IOS

View File

@ -28,6 +28,10 @@ struct libusb_endpoint_descriptor;
struct libusb_interface_descriptor;
struct libusb_transfer;
namespace IOS
{
namespace HLE
{
#define HID_ID_MASK 0x0000FFFFFFFFFFFF
#define MAX_HID_INTERFACES 1
@ -136,3 +140,5 @@ private:
std::thread usb_thread;
bool usb_thread_running;
};
} // namespace HLE
} // namespace IOS

View File

@ -59,6 +59,10 @@ typedef struct pollfd pollfd_t;
#define UNSUPPORTED_WSAPOLL 0
#endif
namespace IOS
{
namespace HLE
{
// **********************************************************************************
// Handle /dev/net/kd/request requests
CWII_IPC_HLE_Device_net_kd_request::CWII_IPC_HLE_Device_net_kd_request(
@ -1373,3 +1377,5 @@ void CWII_IPC_HLE_Device_net_ip_top::Update()
{
WiiSockMan::GetInstance().Update();
}
} // namespace HLE
} // namespace IOS

View File

@ -19,6 +19,10 @@
#include <ws2tcpip.h>
#endif
namespace IOS
{
namespace HLE
{
//////////////////////////////////////////////////////////////////////////
// KD is the IOS module responsible for implementing WiiConnect24 functionality.
// It can perform HTTPS downloads, send and receive mail via SMTP, and execute a
@ -331,3 +335,5 @@ private:
};
#pragma pack(pop)
};
} // namespace HLE
} // namespace IOS

View File

@ -16,6 +16,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h"
#include "Core/IPC_HLE/WII_Socket.h"
namespace IOS
{
namespace HLE
{
WII_SSL CWII_IPC_HLE_Device_net_ssl::_SSL[NET_SSL_MAXINSTANCES];
static constexpr mbedtls_x509_crt_profile mbedtls_x509_crt_profile_wii = {
@ -494,3 +498,5 @@ IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtlV(const IOSIOCtlVRequest& req
// SSL return codes are written to BufferIn
return GetDefaultReply(IPC_SUCCESS);
}
} // namespace HLE
} // namespace IOS

View File

@ -22,6 +22,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
namespace IOS
{
namespace HLE
{
#define NET_SSL_MAXINSTANCES 4
#define SSLID_VALID(x) \
@ -94,3 +98,5 @@ public:
static WII_SSL _SSL[NET_SSL_MAXINSTANCES];
};
} // namespace HLE
} // namespace IOS

View File

@ -17,6 +17,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h"
namespace IOS
{
namespace HLE
{
CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(const u32 device_id,
const std::string& device_name)
: IWII_IPC_HLE_Device(device_id, device_name)
@ -45,7 +49,7 @@ void CWII_IPC_HLE_Device_sdio_slot0::EventNotify()
if ((SConfig::GetInstance().m_WiiSDCard && m_event->type == EVENT_INSERT) ||
(!SConfig::GetInstance().m_WiiSDCard && m_event->type == EVENT_REMOVE))
{
WII_IPC_HLE_Interface::EnqueueReply(m_event->request, m_event->type);
EnqueueReply(m_event->request, m_event->type);
m_event.reset();
}
}
@ -391,7 +395,7 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(const IOSRequest& request, u3
// release returns 0
// unknown sd int
// technically we do it out of order, oh well
WII_IPC_HLE_Interface::EnqueueReply(m_event->request, EVENT_INVALID);
EnqueueReply(m_event->request, EVENT_INVALID);
m_event.reset();
break;
}
@ -403,3 +407,5 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(const IOSRequest& request, u3
return ret;
}
} // namespace HLE
} // namespace IOS

View File

@ -16,6 +16,10 @@
class PointerWrap;
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_sdio_slot0 : public IWII_IPC_HLE_Device
{
public:
@ -125,3 +129,5 @@ private:
u32 BufferInSize2, u32 _BufferOut, u32 BufferOutSize);
void OpenInternal();
};
} // namespace HLE
} // namespace IOS

View File

@ -17,6 +17,10 @@ void QueueHostJob(std::function<void()> job, bool run_during_stop);
void Stop();
}
namespace IOS
{
namespace HLE
{
static std::unique_ptr<IOSIOCtlRequest> s_event_hook_request;
IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(const IOSIOCtlRequest& request)
@ -37,7 +41,7 @@ IPCCommandResult CWII_IPC_HLE_Device_stm_immediate::IOCtl(const IOSIOCtlRequest&
break;
}
Memory::Write_U32(0, s_event_hook_request->buffer_out);
WII_IPC_HLE_Interface::EnqueueReply(*s_event_hook_request, IPC_SUCCESS);
EnqueueReply(*s_event_hook_request, IPC_SUCCESS);
s_event_hook_request.reset();
break;
@ -99,7 +103,7 @@ void CWII_IPC_HLE_Device_stm_eventhook::TriggerEvent(const u32 event) const
return;
Memory::Write_U32(event, s_event_hook_request->buffer_out);
WII_IPC_HLE_Interface::EnqueueReply(*s_event_hook_request, IPC_SUCCESS);
EnqueueReply(*s_event_hook_request, IPC_SUCCESS);
s_event_hook_request.reset();
}
@ -113,3 +117,5 @@ void CWII_IPC_HLE_Device_stm_eventhook::PowerButton() const
{
TriggerEvent(STM_EVENT_POWER);
}
} // namespace HLE
} // namespace IOS

View File

@ -10,6 +10,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
namespace IOS
{
namespace HLE
{
enum
{
IOCTL_STM_EVENTHOOK = 0x1000,
@ -65,3 +69,5 @@ public:
private:
void TriggerEvent(u32 event) const;
};
} // namespace HLE
} // namespace IOS

View File

@ -5,6 +5,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_Device_stub.h"
#include "Common/Logging/Log.h"
namespace IOS
{
namespace HLE
{
CWII_IPC_HLE_Device_stub::CWII_IPC_HLE_Device_stub(u32 device_id, const std::string& device_name)
: IWII_IPC_HLE_Device(device_id, device_name)
{
@ -34,3 +38,5 @@ IPCCommandResult CWII_IPC_HLE_Device_stub::IOCtlV(const IOSIOCtlVRequest& reques
WARN_LOG(WII_IPC_HLE, "%s faking IOCtlV()", m_name.c_str());
return GetDefaultReply(IPC_SUCCESS);
}
} // namespace HLE
} // namespace IOS

View File

@ -10,6 +10,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_stub : public IWII_IPC_HLE_Device
{
public:
@ -20,3 +24,5 @@ public:
IPCCommandResult IOCtl(const IOSIOCtlRequest& request) override;
IPCCommandResult IOCtlV(const IOSIOCtlVRequest& request) override;
};
} // namespace HLE
} // namespace IOS

View File

@ -16,6 +16,10 @@
#include "Core/HW/Memmap.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h"
namespace IOS
{
namespace HLE
{
constexpr u16 BT_INFO_SECTION_LENGTH = 0x460;
void BackUpBTInfoSection(SysConf* sysconf)
@ -76,3 +80,5 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_base::CtrlBuffer::FillBuffer(const u8*
m_length);
Memory::CopyToEmu(m_payload_addr, src, size);
}
} // namespace HLE
} // namespace IOS

View File

@ -14,6 +14,10 @@
class PointerWrap;
class SysConf;
namespace IOS
{
namespace HLE
{
void BackUpBTInfoSection(SysConf* sysconf);
void RestoreBTInfoSection(SysConf* sysconf);
@ -71,3 +75,5 @@ protected:
u32 m_payload_addr = 0;
};
};
} // namespace HLE
} // namespace IOS

View File

@ -28,6 +28,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
namespace IOS
{
namespace HLE
{
SQueuedEvent::SQueuedEvent(u32 size, u16 handle) : m_size(size), m_connectionHandle(handle)
{
if (m_size > 1024)
@ -267,8 +271,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::SendACLPacket(u16 connection_handl
// Write the packet to the buffer
memcpy(reinterpret_cast<u8*>(header) + sizeof(hci_acldata_hdr_t), data, header->length);
WII_IPC_HLE_Interface::EnqueueReply(m_ACLEndpoint->ios_request,
sizeof(hci_acldata_hdr_t) + size);
EnqueueReply(m_ACLEndpoint->ios_request, sizeof(hci_acldata_hdr_t) + size);
m_ACLEndpoint.reset();
}
else
@ -295,8 +298,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::AddEventToQueue(const SQueuedEvent
DEBUG_LOG(WII_IPC_WIIMOTE, "HCI endpoint valid, sending packet to %08x",
m_HCIEndpoint->ios_request.address);
m_HCIEndpoint->FillBuffer(_event.m_buffer, _event.m_size);
// Send a reply to indicate HCI buffer is filled
WII_IPC_HLE_Interface::EnqueueReply(m_HCIEndpoint->ios_request, _event.m_size);
EnqueueReply(m_HCIEndpoint->ios_request, _event.m_size);
m_HCIEndpoint.reset();
}
else // push new one, pop oldest
@ -310,8 +314,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::AddEventToQueue(const SQueuedEvent
((hci_event_hdr_t*)event.m_buffer)->event, m_EventQueue.size() - 1,
m_HCIEndpoint->ios_request.address);
m_HCIEndpoint->FillBuffer(event.m_buffer, event.m_size);
// Send a reply to indicate HCI buffer is filled
WII_IPC_HLE_Interface::EnqueueReply(m_HCIEndpoint->ios_request, event.m_size);
EnqueueReply(m_HCIEndpoint->ios_request, event.m_size);
m_HCIEndpoint.reset();
m_EventQueue.pop_front();
}
@ -335,8 +340,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::Update()
((hci_event_hdr_t*)event.m_buffer)->event, m_EventQueue.size() - 1,
m_HCIEndpoint->ios_request.address);
m_HCIEndpoint->FillBuffer(event.m_buffer, event.m_size);
// Send a reply to indicate HCI buffer is filled
WII_IPC_HLE_Interface::EnqueueReply(m_HCIEndpoint->ios_request, event.m_size);
EnqueueReply(m_HCIEndpoint->ios_request, event.m_size);
m_HCIEndpoint.reset();
m_EventQueue.pop_front();
}
@ -432,7 +438,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::ACLPool::WriteToEndpoint(CtrlBuffe
m_queue.pop_front();
WII_IPC_HLE_Interface::EnqueueReply(endpoint.ios_request, sizeof(hci_acldata_hdr_t) + size);
EnqueueReply(endpoint.ios_request, sizeof(hci_acldata_hdr_t) + size);
}
bool CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::SendEventInquiryComplete()
@ -1152,7 +1158,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::ExecuteHCICommandMessage(
}
// HCI command is finished, send a reply to command
WII_IPC_HLE_Interface::EnqueueReply(ctrl_message.ios_request, ctrl_message.length);
EnqueueReply(ctrl_message.ios_request, ctrl_message.length);
}
//
@ -1806,3 +1812,5 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::DisplayDisconnectMessage(const int
Core::DisplayMessage(
StringFromFormat("Wii Remote %i disconnected by emulated software", wiimoteNumber), 3000);
}
} // namespace HLE
} // namespace IOS

View File

@ -19,9 +19,14 @@
#include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h"
#include "Core/IPC_HLE/hci.h"
class CWII_IPC_HLE_WiiMote;
class PointerWrap;
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_WiiMote;
struct SQueuedEvent
{
u8 m_buffer[1024] = {0};
@ -189,3 +194,5 @@ private:
};
#pragma pack(pop)
};
} // namespace HLE
} // namespace IOS

View File

@ -31,6 +31,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.h"
#include "Core/IPC_HLE/hci.h"
namespace IOS
{
namespace HLE
{
// This stores the address of paired devices and associated link keys.
// It is needed because some adapters forget all stored link keys when they are reset,
// which breaks pairings because the Wii relies on the Bluetooth module to remember them.
@ -393,7 +397,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeVendorCommandReply(CtrlBuffer
hci_event->PayloadLength = sizeof(SHCIEventCommand) - 2;
hci_event->PacketIndicator = 0x01;
hci_event->Opcode = m_fake_vendor_command_reply_opcode;
WII_IPC_HLE_Interface::EnqueueReply(ctrl.ios_request, static_cast<s32>(sizeof(SHCIEventCommand)));
EnqueueReply(ctrl.ios_request, static_cast<s32>(sizeof(SHCIEventCommand)));
}
// Due to how the widcomm stack which Nintendo uses is coded, we must never
@ -418,9 +423,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeReadBufferSizeReply(CtrlBuffe
reply.num_sco_pkts = SCO_PKT_NUM;
memcpy(packet + sizeof(SHCIEventCommand), &reply, sizeof(hci_read_buffer_size_rp));
WII_IPC_HLE_Interface::EnqueueReply(
ctrl.ios_request,
static_cast<s32>(sizeof(SHCIEventCommand) + sizeof(hci_read_buffer_size_rp)));
EnqueueReply(ctrl.ios_request,
static_cast<s32>(sizeof(SHCIEventCommand) + sizeof(hci_read_buffer_size_rp)));
}
void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeSyncButtonEvent(CtrlBuffer& ctrl,
@ -431,8 +435,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::FakeSyncButtonEvent(CtrlBuffer& c
hci_event->event = HCI_EVENT_VENDOR;
hci_event->length = size;
memcpy(packet + sizeof(hci_event_hdr_t), payload, size);
WII_IPC_HLE_Interface::EnqueueReply(ctrl.ios_request,
static_cast<s32>(sizeof(hci_event_hdr_t) + size));
EnqueueReply(ctrl.ios_request, static_cast<s32>(sizeof(hci_event_hdr_t) + size));
}
// When the red sync button is pressed, a HCI event is generated:
@ -578,8 +581,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::CommandCallback(libusb_transfer*
s_showed_failed_transfer.Clear();
}
WII_IPC_HLE_Interface::EnqueueReply(cmd->ios_request, tr->actual_length, 0,
CoreTiming::FromThread::NON_CPU);
EnqueueReply(cmd->ios_request, tr->actual_length, 0, CoreTiming::FromThread::NON_CPU);
}
void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::TransferCallback(libusb_transfer* tr)
@ -623,6 +625,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::TransferCallback(libusb_transfer*
}
}
WII_IPC_HLE_Interface::EnqueueReply(ctrl->ios_request, tr->actual_length, 0,
CoreTiming::FromThread::NON_CPU);
EnqueueReply(ctrl->ios_request, tr->actual_length, 0, CoreTiming::FromThread::NON_CPU);
}
} // namespace HLE
} // namespace IOS

View File

@ -22,6 +22,10 @@ struct libusb_device;
struct libusb_device_handle;
struct libusb_transfer;
namespace IOS
{
namespace HLE
{
enum class SyncButtonState
{
Unpressed,
@ -96,9 +100,17 @@ private:
static void CommandCallback(libusb_transfer* transfer);
static void TransferCallback(libusb_transfer* transfer);
};
} // namespace HLE
} // namespace IOS
#else
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.h"
namespace IOS
{
namespace HLE
{
using CWII_IPC_HLE_Device_usb_oh1_57e_305_real = CWII_IPC_HLE_Device_usb_oh1_57e_305_stub;
} // namespace HLE
} // namespace IOS
#endif

View File

@ -12,6 +12,10 @@ namespace Core
void DisplayMessage(const std::string& message, int time_in_ms);
}
namespace IOS
{
namespace HLE
{
IOSReturnCode CWII_IPC_HLE_Device_usb_oh1_57e_305_stub::Open(const IOSOpenRequest& request)
{
PanicAlertT("Bluetooth passthrough mode is enabled, but Dolphin was built without libusb."
@ -24,3 +28,5 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_stub::DoState(PointerWrap& p)
Core::DisplayMessage("The current IPC_HLE_Device_usb is a stub. Aborting load.", 4000);
p.SetMode(PointerWrap::MODE_VERIFY);
}
} // namespace HLE
} // namespace IOS

View File

@ -12,6 +12,10 @@
class PointerWrap;
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_usb_oh1_57e_305_stub final
: public CWII_IPC_HLE_Device_usb_oh1_57e_305_base
{
@ -23,3 +27,5 @@ public:
IOSReturnCode Open(const IOSOpenRequest& request) override;
void DoState(PointerWrap& p) override;
};
} // namespace HLE
} // namespace IOS

View File

@ -17,6 +17,10 @@
#include <windows.h>
#endif
namespace IOS
{
namespace HLE
{
CWII_IPC_HLE_Device_usb_kbd::SMessageData::SMessageData(u32 type, u8 modifiers, u8* pressed_keys)
{
MsgType = Common::swap32(type);
@ -313,3 +317,5 @@ u8 CWII_IPC_HLE_Device_usb_kbd::m_KeyCodesQWERTY[256] = {0};
u8 CWII_IPC_HLE_Device_usb_kbd::m_KeyCodesAZERTY[256] = {0};
#endif
} // namespace HLE
} // namespace IOS

View File

@ -11,6 +11,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_usb_kbd : public IWII_IPC_HLE_Device
{
public:
@ -57,3 +61,5 @@ private:
static u8 m_KeyCodesQWERTY[256];
static u8 m_KeyCodesAZERTY[256];
};
} // namespace HLE
} // namespace IOS

View File

@ -6,6 +6,10 @@
#include "Common/Logging/Log.h"
#include "Core/HW/Memmap.h"
namespace IOS
{
namespace HLE
{
CWII_IPC_HLE_Device_usb_ven::CWII_IPC_HLE_Device_usb_ven(const u32 device_id,
const std::string& device_name)
: IWII_IPC_HLE_Device(device_id, device_name)
@ -74,3 +78,5 @@ IPCCommandResult CWII_IPC_HLE_Device_usb_ven::IOCtl(const IOSIOCtlRequest& reque
}
return reply;
}
} // namespace HLE
} // namespace IOS

View File

@ -10,6 +10,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_usb_ven final : public IWII_IPC_HLE_Device
{
public:
@ -35,3 +39,5 @@ private:
USBV5_IOCTL_BULKMSG = 21
};
};
} // namespace HLE
} // namespace IOS

View File

@ -14,13 +14,17 @@
#include "Core/HW/DVDInterface.h"
#include "Core/HW/Memmap.h"
namespace IOS
{
namespace HLE
{
namespace WFS
{
std::string NativePath(const std::string& wfs_path)
{
return File::GetUserPath(D_WFSROOT_IDX) + Common::EscapePath(wfs_path);
}
}
} // namespace WFS
CWII_IPC_HLE_Device_usb_wfssrv::CWII_IPC_HLE_Device_usb_wfssrv(u32 device_id,
const std::string& device_name)
@ -223,3 +227,5 @@ bool CWII_IPC_HLE_Device_usb_wfssrv::FileDescriptor::Open()
return file.Open(WFS::NativePath(path), mode_string);
}
} // namespace HLE
} // namespace IOS

View File

@ -13,6 +13,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
#include "DiscIO/Volume.h"
namespace IOS
{
namespace HLE
{
namespace WFS
{
std::string NativePath(const std::string& wfs_path);
@ -73,3 +77,5 @@ private:
u16 GetNewFileDescriptor();
void ReleaseFileDescriptor(u16 fd);
};
} // namespace HLE
} // namespace IOS

View File

@ -18,6 +18,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_wfssrv.h"
#include "DiscIO/NANDContentLoader.h"
namespace IOS
{
namespace HLE
{
void ARCUnpacker::Reset()
{
m_whole_file.clear();
@ -240,3 +244,5 @@ IPCCommandResult CWII_IPC_HLE_Device_wfsi::IOCtl(const IOSIOCtlRequest& request)
return GetDefaultReply(return_error_code);
}
} // namespace HLE
} // namespace IOS

View File

@ -14,6 +14,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
namespace IOS
{
namespace HLE
{
class ARCUnpacker
{
public:
@ -69,3 +73,5 @@ private:
IOCTL_WFSI_APPLY_TITLE_PROFILE = 0x89,
};
};
} // namespace HLE
} // namespace IOS

View File

@ -21,6 +21,10 @@
#include "Core/IPC_HLE/WiiMote_HID_Attr.h"
#include "Core/IPC_HLE/l2cap.h"
namespace IOS
{
namespace HLE
{
static CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* s_Usb = nullptr;
CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* GetUsbPointer()
@ -927,6 +931,8 @@ void CWII_IPC_HLE_WiiMote::ReceiveL2capData(u16 scid, const void* _pData, u32 _S
// Send the report
m_pHost->SendACLPacket(GetConnectionHandle(), DataFrame, Offset);
}
} // namespace HLE
} // namespace IOS
namespace Core
{
@ -941,6 +947,6 @@ void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _
DEBUG_LOG(WIIMOTE, " Data: %s", ArrayToString(pData, _Size, 50).c_str());
DEBUG_LOG(WIIMOTE, " Channel: %x", _channelID);
s_Usb->m_WiiMotes[_number].ReceiveL2capData(_channelID, _pData, _Size);
IOS::HLE::s_Usb->m_WiiMotes[_number].ReceiveL2capData(_channelID, _pData, _Size);
}
}

View File

@ -12,9 +12,14 @@
#include "Common/CommonTypes.h"
#include "Core/IPC_HLE/hci.h"
class CWII_IPC_HLE_Device_usb_oh1_57e_305_emu;
class PointerWrap;
namespace IOS
{
namespace HLE
{
class CWII_IPC_HLE_Device_usb_oh1_57e_305_emu;
CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* GetUsbPointer();
void SetUsbPointer(CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* ptr);
@ -134,3 +139,5 @@ private:
u16 _StartAttrID, u16 _EndAttrID,
u16 _MaximumAttributeByteCount, u8* _pContinuationState);
};
} // namespace HLE
} // namespace IOS

View File

@ -24,6 +24,10 @@
#define EITHER(win32, posix) posix
#endif
namespace IOS
{
namespace HLE
{
char* WiiSockMan::DecodeError(s32 ErrorCode)
{
#ifdef _WIN32
@ -567,7 +571,8 @@ void WiiSocket::Update(bool read, bool write, bool except)
"IOCTL(V) Sock: %08x ioctl/v: %d returned: %d nonBlock: %d forceNonBlock: %d", fd,
it->is_ssl ? (int)it->ssl_type : (int)it->net_type, ReturnValue, nonBlock,
forceNonBlock);
WII_IPC_HLE_Interface::EnqueueReply(it->request, ReturnValue);
EnqueueReply(it->request, ReturnValue);
it = pending_sockops.erase(it);
}
else
@ -692,3 +697,5 @@ void WiiSockMan::UpdateWantDeterminism(bool want)
#undef ERRORCODE
#undef EITHER
} // namespace HLE
} // namespace IOS

View File

@ -56,6 +56,10 @@ typedef struct pollfd pollfd_t;
#include "Core/IPC_HLE/WII_IPC_HLE_Device_net.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h"
namespace IOS
{
namespace HLE
{
enum
{
SO_MSG_OOB = 0x01,
@ -230,7 +234,7 @@ public:
{
ERROR_LOG(WII_IPC_NET, "DoSock: Error, fd not found (%08x, %08X, %08X)", sock,
request.address, type);
WII_IPC_HLE_Interface::EnqueueReply(request, -SO_EBADF);
EnqueueReply(request, -SO_EBADF);
}
else
{
@ -246,3 +250,5 @@ private:
std::unordered_map<s32, WiiSocket> WiiSockets;
s32 errno_last;
};
} // namespace HLE
} // namespace IOS

View File

@ -6,6 +6,10 @@
#include "Common/Assert.h"
#include "Common/CommonTypes.h"
namespace IOS
{
namespace HLE
{
static u8 packet1[] = {
0x00, 0x7b, 0x00, 0x76, 0x36, 0x01, 0xcc, 0x09, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x09,
0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x09, 0x00, 0x04, 0x35, 0x0d, 0x35, 0x06, 0x19, 0x01,
@ -96,3 +100,5 @@ const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size)
return nullptr;
}
} // namespace HLE
} // namespace IOS

View File

@ -6,4 +6,10 @@
#include "Common/CommonTypes.h"
namespace IOS
{
namespace HLE
{
const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size);
} // namespace HLE
} // namespace IOS

View File

@ -12,6 +12,10 @@
#include "Common/Logging/Log.h"
#include "Core/HW/Memmap.h"
namespace IOS
{
namespace HLE
{
namespace Net
{
WiiNetConfig::WiiNetConfig()
@ -71,3 +75,5 @@ void WiiNetConfig::ReadFromMem(const u32 address)
Memory::CopyFromEmu(&m_data, address, sizeof(m_data));
}
} // namespace Net
} // namespace HLE
} // namespace IOS

View File

@ -7,6 +7,10 @@
#include <string>
#include "Common/CommonTypes.h"
namespace IOS
{
namespace HLE
{
namespace Net
{
#pragma pack(push, 1)
@ -135,3 +139,5 @@ private:
ConfigData m_data;
};
} // namespace Net
} // namespace HLE
} // namespace IOS

View File

@ -531,7 +531,7 @@ void ChangeWiiPads(bool instantly)
{
g_wiimote_sources[i] = IsUsingWiimote(i) ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE;
if (!SConfig::GetInstance().m_bt_passthrough_enabled)
GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(IsUsingWiimote(i));
IOS::HLE::GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(IsUsingWiimote(i));
}
}

View File

@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent;
static std::thread g_save_thread;
// Don't forget to increase this after doing changes on the savestate system
static const u32 STATE_VERSION = 69; // Last changed in PR 4661
static const u32 STATE_VERSION = 70; // Last changed in PR 4679
// Maps savestate versions to Dolphin versions.
// Versions after 42 don't need to be added to this list,

View File

@ -201,7 +201,7 @@ void WiiConfigPane::OnPAL60CheckBoxChanged(wxCommandEvent& event)
void WiiConfigPane::OnSDCardCheckBoxChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_WiiSDCard = m_sd_card_checkbox->IsChecked();
WII_IPC_HLE_Interface::SDIO_EventNotify();
IOS::HLE::SDIO_EventNotify();
}
void WiiConfigPane::OnConnectKeyboardCheckBoxChanged(wxCommandEvent& event)

View File

@ -527,9 +527,9 @@ void ControllerConfigDiag::OnPassthroughScanButton(wxCommandEvent& event)
_("Sync Wii Remotes"), wxICON_WARNING);
return;
}
auto device = WII_IPC_HLE_Interface::GetDeviceByName("/dev/usb/oh1/57e/305");
auto device = IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305");
if (device != nullptr)
std::static_pointer_cast<CWII_IPC_HLE_Device_usb_oh1_57e_305_base>(device)
std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_usb_oh1_57e_305_base>(device)
->TriggerSyncButtonPressedEvent();
}
@ -541,9 +541,9 @@ void ControllerConfigDiag::OnPassthroughResetButton(wxCommandEvent& event)
_("Reset Wii Remote pairings"), wxICON_WARNING);
return;
}
auto device = WII_IPC_HLE_Interface::GetDeviceByName("/dev/usb/oh1/57e/305");
auto device = IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305");
if (device != nullptr)
std::static_pointer_cast<CWII_IPC_HLE_Device_usb_oh1_57e_305_base>(device)
std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_usb_oh1_57e_305_base>(device)
->TriggerSyncButtonHeldEvent();
}

View File

@ -1277,9 +1277,9 @@ void CFrame::ParseHotkeys()
if (SConfig::GetInstance().m_bt_passthrough_enabled)
{
auto device = WII_IPC_HLE_Interface::GetDeviceByName("/dev/usb/oh1/57e/305");
auto device = IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305");
if (device != nullptr)
std::static_pointer_cast<CWII_IPC_HLE_Device_usb_oh1_57e_305_base>(device)
std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_usb_oh1_57e_305_base>(device)
->UpdateSyncButtonState(IsHotkey(HK_TRIGGER_SYNC_BUTTON, true));
}

View File

@ -860,9 +860,13 @@ void CFrame::DoStop()
bool CFrame::TriggerSTMPowerEvent()
{
const auto stm = WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
if (!stm || !std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->HasHookInstalled())
const auto stm = IOS::HLE::GetDeviceByName("/dev/stm/eventhook");
if (!stm ||
!std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_stm_eventhook>(stm)
->HasHookInstalled())
{
return false;
}
Core::DisplayMessage("Shutting down", 30000);
// Unpause because gracefully shutting down needs the game to actually request a shutdown
@ -1245,7 +1249,7 @@ void CFrame::ConnectWiimote(int wm_idx, bool connect)
!SConfig::GetInstance().m_bt_passthrough_enabled)
{
bool was_unpaused = Core::PauseAndLock(true);
GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
IOS::HLE::GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
const char* message = connect ? "Wii Remote %i connected" : "Wii Remote %i disconnected";
Core::DisplayMessage(StringFromFormat(message, wm_idx + 1), 3000);
Host_UpdateMainFrame();
@ -1259,7 +1263,7 @@ void CFrame::OnConnectWiimote(wxCommandEvent& event)
return;
bool was_unpaused = Core::PauseAndLock(true);
ConnectWiimote(event.GetId() - IDM_CONNECT_WIIMOTE1,
!GetUsbPointer()
!IOS::HLE::GetUsbPointer()
->AccessWiiMote((event.GetId() - IDM_CONNECT_WIIMOTE1) | 0x100)
->IsConnected());
Core::PauseAndLock(false, was_unpaused);
@ -1428,19 +1432,19 @@ void CFrame::UpdateGUI()
bool was_unpaused = Core::PauseAndLock(true);
GetMenuBar()
->FindItem(IDM_CONNECT_WIIMOTE1)
->Check(GetUsbPointer()->AccessWiiMote(0x0100)->IsConnected());
->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0100)->IsConnected());
GetMenuBar()
->FindItem(IDM_CONNECT_WIIMOTE2)
->Check(GetUsbPointer()->AccessWiiMote(0x0101)->IsConnected());
->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0101)->IsConnected());
GetMenuBar()
->FindItem(IDM_CONNECT_WIIMOTE3)
->Check(GetUsbPointer()->AccessWiiMote(0x0102)->IsConnected());
->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0102)->IsConnected());
GetMenuBar()
->FindItem(IDM_CONNECT_WIIMOTE4)
->Check(GetUsbPointer()->AccessWiiMote(0x0103)->IsConnected());
->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0103)->IsConnected());
GetMenuBar()
->FindItem(IDM_CONNECT_BALANCEBOARD)
->Check(GetUsbPointer()->AccessWiiMote(0x0104)->IsConnected());
->Check(IOS::HLE::GetUsbPointer()->AccessWiiMote(0x0104)->IsConnected());
Core::PauseAndLock(false, was_unpaused);
}

View File

@ -143,7 +143,7 @@ void Host_ConnectWiimote(int wm_idx, bool connect)
{
Core::QueueHostJob([=] {
bool was_unpaused = Core::PauseAndLock(true);
GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
IOS::HLE::GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
Host_UpdateMainFrame();
Core::PauseAndLock(false, was_unpaused);
});
@ -237,9 +237,10 @@ class PlatformX11 : public Platform
{
if (s_shutdown_requested.TestAndClear())
{
const auto& stm = WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
const auto stm = IOS::HLE::GetDeviceByName("/dev/stm/eventhook");
if (!s_tried_graceful_shutdown.IsSet() && stm &&
std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->HasHookInstalled())
std::static_pointer_cast<IOS::HLE::CWII_IPC_HLE_Device_stm_eventhook>(stm)
->HasHookInstalled())
{
ProcessorInterface::PowerButton_Tap();
s_tried_graceful_shutdown.Set();