pcv + better oob for hle

This commit is contained in:
lizzie
2026-08-15 09:25:52 +00:00
parent 26c761736b
commit f76174bd2a
7 changed files with 84 additions and 40 deletions
+6 -14
View File
@@ -18,20 +18,12 @@ void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
auto album_manager = std::make_shared<AlbumManager>(system);
server_manager->RegisterNamedService(
"caps:a", std::make_shared<IAlbumAccessorService>(system, album_manager));
server_manager->RegisterNamedService(
"caps:c", std::make_shared<IAlbumControlService>(system, album_manager));
server_manager->RegisterNamedService(
"caps:u", std::make_shared<IAlbumApplicationService>(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));
server_manager->RegisterNamedService("caps:a", std::make_shared<IAlbumAccessorService>(system, album_manager));
server_manager->RegisterNamedService("caps:c", std::make_shared<IAlbumControlService>(system, album_manager));
server_manager->RegisterNamedService("caps:u", std::make_shared<IAlbumApplicationService>(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));
}
@@ -263,6 +263,9 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry,
return result;
}
// TODO: ???
R_UNLESS(!image_data.empty(), ResultUnknown);
const auto date = ConvertToAlbumDateTime(posix_time);
return SaveImage(out_entry, image_data, title_id, date);
+24
View File
@@ -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"} {
// clang-format off
static const FunctionInfo functions[] = {
+12
View File
@@ -11,6 +11,18 @@ class System;
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> {
public:
explicit ECTX_AW(Core::System& system_);
+9 -22
View File
@@ -19,40 +19,27 @@ void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
// ARP
server_manager->RegisterNamedService("arp:r",
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:r", std::make_shared<ARP_R>(system, system.GetARPManager()));
server_manager->RegisterNamedService("arp:w", std::make_shared<ARP_W>(system, system.GetARPManager()));
// BackGround Task Controller
server_manager->RegisterNamedService("bgtc:t", std::make_shared<BGTC_T>(system));
server_manager->RegisterNamedService("bgtc:sc", std::make_shared<BGTC_SC>(system));
// 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));
// Notification Services
server_manager->RegisterNamedService(
"notif:a", std::make_shared<INotificationServicesForApplication>(system));
server_manager->RegisterNamedService("notif:s",
std::make_shared<INotificationServices>(system));
server_manager->RegisterNamedService("notif:a", std::make_shared<INotificationServicesForApplication>(system));
server_manager->RegisterNamedService("notif:s", std::make_shared<INotificationServices>(system));
// Time
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(
"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"));
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("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));
}
+4 -4
View File
@@ -330,12 +330,12 @@ public:
/// 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]] Handle GetCopyHandle(std::size_t index) const {
return incoming_copy_handles.at(index);
[[nodiscard]] Handle GetCopyHandle(std::size_t index) const noexcept {
return index >= incoming_copy_handles.size() ? 0 : incoming_copy_handles[index];
}
[[nodiscard]] Handle GetMoveHandle(std::size_t index) const {
return incoming_move_handles.at(index);
[[nodiscard]] Handle GetMoveHandle(std::size_t index) const noexcept {
return index >= incoming_move_handles.size() ? 0 : incoming_move_handles[index];
}
void AddMoveObject(Kernel::KAutoObject* object) {
+26
View File
@@ -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> {
public:
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);
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:i", std::make_shared<CLKRST>(system, "clkrst:i"));
server_manager->RegisterNamedService("clkrst:a", std::make_shared<CLKRST_A>(system));