mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
IPC_HLE: Namespace IOS HLE
Gets all of the IOS HLE code out of the global scope.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user