mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-05 03:54:32 +00:00
pcv + better oob for hle
This commit is contained in:
@@ -18,20 +18,12 @@ void LoopProcess(Core::System& system) {
|
|||||||
auto server_manager = std::make_unique<ServerManager>(system);
|
auto server_manager = std::make_unique<ServerManager>(system);
|
||||||
auto album_manager = std::make_shared<AlbumManager>(system);
|
auto album_manager = std::make_shared<AlbumManager>(system);
|
||||||
|
|
||||||
server_manager->RegisterNamedService(
|
server_manager->RegisterNamedService("caps:a", std::make_shared<IAlbumAccessorService>(system, album_manager));
|
||||||
"caps:a", std::make_shared<IAlbumAccessorService>(system, album_manager));
|
server_manager->RegisterNamedService("caps:c", std::make_shared<IAlbumControlService>(system, album_manager));
|
||||||
server_manager->RegisterNamedService(
|
server_manager->RegisterNamedService("caps:u", std::make_shared<IAlbumApplicationService>(system, album_manager));
|
||||||
"caps:c", std::make_shared<IAlbumControlService>(system, album_manager));
|
server_manager->RegisterNamedService("caps:ss", std::make_shared<IScreenShotService>(system, album_manager));
|
||||||
server_manager->RegisterNamedService(
|
server_manager->RegisterNamedService("caps:sc", std::make_shared<IScreenShotControlService>(system));
|
||||||
"caps:u", std::make_shared<IAlbumApplicationService>(system, album_manager));
|
server_manager->RegisterNamedService("caps:su", std::make_shared<IScreenShotApplicationService>(system, album_manager));
|
||||||
|
|
||||||
server_manager->RegisterNamedService(
|
|
||||||
"caps:ss", std::make_shared<IScreenShotService>(system, album_manager));
|
|
||||||
server_manager->RegisterNamedService("caps:sc",
|
|
||||||
std::make_shared<IScreenShotControlService>(system));
|
|
||||||
server_manager->RegisterNamedService(
|
|
||||||
"caps:su", std::make_shared<IScreenShotApplicationService>(system, album_manager));
|
|
||||||
|
|
||||||
ServerManager::RunServer(std::move(server_manager));
|
ServerManager::RunServer(std::move(server_manager));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,6 +263,9 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: ???
|
||||||
|
R_UNLESS(!image_data.empty(), ResultUnknown);
|
||||||
|
|
||||||
const auto date = ConvertToAlbumDateTime(posix_time);
|
const auto date = ConvertToAlbumDateTime(posix_time);
|
||||||
|
|
||||||
return SaveImage(out_entry, image_data, title_id, date);
|
return SaveImage(out_entry, image_data, title_id, date);
|
||||||
|
|||||||
@@ -43,6 +43,30 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ECTX_W::ECTX_W(Core::System& system_) : ServiceFramework{system_, "ectx:w"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "CreateContextRegistrar"},
|
||||||
|
{1, nullptr, "CommitContext"},
|
||||||
|
{2, nullptr, "RemoveContext"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
ECTX_W::~ECTX_W() = default;
|
||||||
|
|
||||||
|
ECTX_R::ECTX_R(Core::System& system_) : ServiceFramework{system_, "ectx:r"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "GetContextInfo"},
|
||||||
|
{1, nullptr, "PullContext"},
|
||||||
|
{2, nullptr, "ListContextDescriptorWithResultForDebug"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
ECTX_R::~ECTX_R() = default;
|
||||||
|
|
||||||
ECTX_AW::ECTX_AW(Core::System& system_) : ServiceFramework{system_, "ectx:aw"} {
|
ECTX_AW::ECTX_AW(Core::System& system_) : ServiceFramework{system_, "ectx:aw"} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
|
|||||||
@@ -11,6 +11,18 @@ class System;
|
|||||||
|
|
||||||
namespace Service::Glue {
|
namespace Service::Glue {
|
||||||
|
|
||||||
|
class ECTX_W final : public ServiceFramework<ECTX_W> {
|
||||||
|
public:
|
||||||
|
explicit ECTX_W(Core::System& system_);
|
||||||
|
~ECTX_W() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ECTX_R final : public ServiceFramework<ECTX_R> {
|
||||||
|
public:
|
||||||
|
explicit ECTX_R(Core::System& system_);
|
||||||
|
~ECTX_R() override;
|
||||||
|
};
|
||||||
|
|
||||||
class ECTX_AW final : public ServiceFramework<ECTX_AW> {
|
class ECTX_AW final : public ServiceFramework<ECTX_AW> {
|
||||||
public:
|
public:
|
||||||
explicit ECTX_AW(Core::System& system_);
|
explicit ECTX_AW(Core::System& system_);
|
||||||
|
|||||||
@@ -19,40 +19,27 @@ void LoopProcess(Core::System& system) {
|
|||||||
auto server_manager = std::make_unique<ServerManager>(system);
|
auto server_manager = std::make_unique<ServerManager>(system);
|
||||||
|
|
||||||
// ARP
|
// ARP
|
||||||
server_manager->RegisterNamedService("arp:r",
|
server_manager->RegisterNamedService("arp:r", std::make_shared<ARP_R>(system, system.GetARPManager()));
|
||||||
std::make_shared<ARP_R>(system, system.GetARPManager()));
|
server_manager->RegisterNamedService("arp:w", std::make_shared<ARP_W>(system, system.GetARPManager()));
|
||||||
server_manager->RegisterNamedService("arp:w",
|
|
||||||
std::make_shared<ARP_W>(system, system.GetARPManager()));
|
|
||||||
|
|
||||||
// BackGround Task Controller
|
// BackGround Task Controller
|
||||||
server_manager->RegisterNamedService("bgtc:t", std::make_shared<BGTC_T>(system));
|
server_manager->RegisterNamedService("bgtc:t", std::make_shared<BGTC_T>(system));
|
||||||
server_manager->RegisterNamedService("bgtc:sc", std::make_shared<BGTC_SC>(system));
|
server_manager->RegisterNamedService("bgtc:sc", std::make_shared<BGTC_SC>(system));
|
||||||
|
|
||||||
// Error Context
|
// Error Context
|
||||||
|
server_manager->RegisterNamedService("ectx:w", std::make_shared<ECTX_W>(system));
|
||||||
|
server_manager->RegisterNamedService("ectx:r", std::make_shared<ECTX_R>(system));
|
||||||
server_manager->RegisterNamedService("ectx:aw", std::make_shared<ECTX_AW>(system));
|
server_manager->RegisterNamedService("ectx:aw", std::make_shared<ECTX_AW>(system));
|
||||||
|
|
||||||
// Notification Services
|
// Notification Services
|
||||||
server_manager->RegisterNamedService(
|
server_manager->RegisterNamedService("notif:a", std::make_shared<INotificationServicesForApplication>(system));
|
||||||
"notif:a", std::make_shared<INotificationServicesForApplication>(system));
|
server_manager->RegisterNamedService("notif:s", std::make_shared<INotificationServices>(system));
|
||||||
server_manager->RegisterNamedService("notif:s",
|
|
||||||
std::make_shared<INotificationServices>(system));
|
|
||||||
|
|
||||||
// Time
|
// Time
|
||||||
auto time = std::make_shared<Time::TimeManager>(system);
|
auto time = std::make_shared<Time::TimeManager>(system);
|
||||||
|
server_manager->RegisterNamedService("time:u", std::make_shared<Time::StaticService>(system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 0}, time, "time:u"));
|
||||||
server_manager->RegisterNamedService(
|
server_manager->RegisterNamedService("time:a", std::make_shared<Time::StaticService>(system, Service::PSC::Time::StaticServiceSetupInfo{1, 1, 0, 1, 0, 0}, time, "time:a"));
|
||||||
"time:u",
|
server_manager->RegisterNamedService("time:r", std::make_shared<Time::StaticService>(system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 1, 0}, time, "time:r"));
|
||||||
std::make_shared<Time::StaticService>(
|
|
||||||
system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 0}, time, "time:u"));
|
|
||||||
server_manager->RegisterNamedService(
|
|
||||||
"time:a",
|
|
||||||
std::make_shared<Time::StaticService>(
|
|
||||||
system, Service::PSC::Time::StaticServiceSetupInfo{1, 1, 0, 1, 0, 0}, time, "time:a"));
|
|
||||||
server_manager->RegisterNamedService(
|
|
||||||
"time:r",
|
|
||||||
std::make_shared<Time::StaticService>(
|
|
||||||
system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 1, 0}, time, "time:r"));
|
|
||||||
|
|
||||||
ServerManager::RunServer(std::move(server_manager));
|
ServerManager::RunServer(std::move(server_manager));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -330,12 +330,12 @@ public:
|
|||||||
/// Helper function to test whether the output buffer at buffer_index can be written
|
/// Helper function to test whether the output buffer at buffer_index can be written
|
||||||
[[nodiscard]] bool CanWriteBuffer(std::size_t buffer_index = 0) const;
|
[[nodiscard]] bool CanWriteBuffer(std::size_t buffer_index = 0) const;
|
||||||
|
|
||||||
[[nodiscard]] Handle GetCopyHandle(std::size_t index) const {
|
[[nodiscard]] Handle GetCopyHandle(std::size_t index) const noexcept {
|
||||||
return incoming_copy_handles.at(index);
|
return index >= incoming_copy_handles.size() ? 0 : incoming_copy_handles[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] Handle GetMoveHandle(std::size_t index) const {
|
[[nodiscard]] Handle GetMoveHandle(std::size_t index) const noexcept {
|
||||||
return incoming_move_handles.at(index);
|
return index >= incoming_move_handles.size() ? 0 : incoming_move_handles[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddMoveObject(Kernel::KAutoObject* object) {
|
void AddMoveObject(Kernel::KAutoObject* object) {
|
||||||
|
|||||||
@@ -55,6 +55,30 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PCV_ARB final : public ServiceFramework<PCV_ARB> {
|
||||||
|
public:
|
||||||
|
explicit PCV_ARB(Core::System& system_) : ServiceFramework{system_, "pcv:arb"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "ReleaseControl"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class PCV_IMM final : public ServiceFramework<PCV_IMM> {
|
||||||
|
public:
|
||||||
|
explicit PCV_IMM(Core::System& system_) : ServiceFramework{system_, "pcv:imm"} {
|
||||||
|
// clang-format off
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, nullptr, "SetClockRate"},
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class IClkrstSession final : public ServiceFramework<IClkrstSession> {
|
class IClkrstSession final : public ServiceFramework<IClkrstSession> {
|
||||||
public:
|
public:
|
||||||
explicit IClkrstSession(Core::System& system_, DeviceCode device_code_)
|
explicit IClkrstSession(Core::System& system_, DeviceCode device_code_)
|
||||||
@@ -148,6 +172,8 @@ void LoopProcess(Core::System& system) {
|
|||||||
auto server_manager = std::make_unique<ServerManager>(system);
|
auto server_manager = std::make_unique<ServerManager>(system);
|
||||||
|
|
||||||
server_manager->RegisterNamedService("pcv", std::make_shared<PCV>(system));
|
server_manager->RegisterNamedService("pcv", std::make_shared<PCV>(system));
|
||||||
|
server_manager->RegisterNamedService("pcv:arb", std::make_shared<PCV_ARB>(system));
|
||||||
|
server_manager->RegisterNamedService("pcv:imm", std::make_shared<PCV_IMM>(system));
|
||||||
server_manager->RegisterNamedService("clkrst", std::make_shared<CLKRST>(system, "clkrst"));
|
server_manager->RegisterNamedService("clkrst", std::make_shared<CLKRST>(system, "clkrst"));
|
||||||
server_manager->RegisterNamedService("clkrst:i", std::make_shared<CLKRST>(system, "clkrst:i"));
|
server_manager->RegisterNamedService("clkrst:i", std::make_shared<CLKRST>(system, "clkrst:i"));
|
||||||
server_manager->RegisterNamedService("clkrst:a", std::make_shared<CLKRST_A>(system));
|
server_manager->RegisterNamedService("clkrst:a", std::make_shared<CLKRST_A>(system));
|
||||||
|
|||||||
Reference in New Issue
Block a user