IOS: Convert the IOS kernel HLE code to a class
This changes the main IOS code (roughly the equivalent of the kernel) to a class instead of being a set of free functions + tons of static variables. The reason for this change is that keeping tons of static variables like that prevents us from making an IOS instance and reusing IOS code easily. Converting the IOS code to a class also allows us to mostly decouple IOS from the PPC emulation. The more interesting changes are in Core/IOS/IOS. Everything else is mostly just boring stuff required by this change... * Because the devices themselves call back to the main IOS code for various things (getting the current version, replying to a request, and other syscall-like functions), just like processes in IOS call kernel syscalls, we have to pass a reference to the kernel to anything that uses IOS syscalls. * Change DoState to save device names instead of device IDs to simplify AddDevice() and get rid of an ugly static count. * Change ES_Launch's ack to be sent at IOS boot, now that we can do this properly.
This commit is contained in:
1 parent
fcc2ed4550
commit
2fc5047d26
88 files changed
+1477
-1428
No files matched your search
@@ -24,7 +24,7 @@ namespace HLE
|
||||
{
|
||||
namespace Device
|
||||
{
|
||||
DI::DI(u32 device_id, const std::string& device_name) : Device(device_id, device_name)
|
||||
DI::DI(Kernel& ios, const std::string& device_name) : Device(ios, device_name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ void DI::FinishIOCtl(DVDInterface::DIInterruptType interrupt_type)
|
||||
// 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();
|
||||
EnqueueReply(IOCtlRequest{command_address}, interrupt_type);
|
||||
m_ios.EnqueueIPCReply(IOCtlRequest{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
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/IOS/Device.h"
|
||||
#include "Core/IOS/IPC.h"
|
||||
#include "Core/IOS/IOS.h"
|
||||
|
||||
class PointerWrap;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Device
|
||||
class DI : public Device
|
||||
{
|
||||
public:
|
||||
DI(u32 device_id, const std::string& device_name);
|
||||
DI(Kernel& ios, const std::string& device_name);
|
||||
|
||||
void DoState(PointerWrap& p) override;
|
||||
|
||||
|
||||
Reference in new issue
Block a user