From f3137d3bc12253ed0406ef01406b3b62c563bbd7 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 21 Apr 2018 22:04:24 -0700 Subject: [PATCH 1/5] Implemented GetIUserInterface properly, Playreport and SSL::SetInterfaceVersion. Fixed ipc issues with IAudioDevice(wrong ids) --- src/core/CMakeLists.txt | 2 + src/core/hle/service/audio/audren_u.cpp | 15 ++++--- src/core/hle/service/nfp/nfp.cpp | 21 +++++++++- src/core/hle/service/nfp/nfp.h | 2 +- src/core/hle/service/nfp/nfp_user.cpp | 2 +- .../service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 1 + src/core/hle/service/prepo/prepo.cpp | 40 +++++++++++++++++++ src/core/hle/service/prepo/prepo.h | 23 +++++++++++ src/core/hle/service/service.cpp | 2 + src/core/hle/service/ssl/ssl.cpp | 11 ++++- src/core/hle/service/ssl/ssl.h | 1 + 11 files changed, 109 insertions(+), 11 deletions(-) create mode 100644 src/core/hle/service/prepo/prepo.cpp create mode 100644 src/core/hle/service/prepo/prepo.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c1a645460..c2a6f56cd 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -187,6 +187,8 @@ add_library(core STATIC hle/service/pctl/pctl.h hle/service/pctl/pctl_a.cpp hle/service/pctl/pctl_a.h + hle/service/prepo/prepo.cpp + hle/service/prepo/prepo.h hle/service/service.cpp hle/service/service.h hle/service/set/set.cpp diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index d9245cb19..fe445552a 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -162,12 +162,15 @@ public: {0x3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"}, {0x4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, {0x5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, - {0x6, nullptr, "ListAudioDeviceNameAuto"}, - {0x7, nullptr, "SetAudioDeviceOutputVolumeAuto"}, + {0x6, &IAudioDevice::ListAudioDeviceName, + "ListAudioDeviceNameAuto"}, // Are these any different? + {0x7, &IAudioDevice::SetAudioDeviceOutputVolume, + "SetAudioDeviceOutputVolumeAuto"}, // Are these any different? {0x8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, - {0x10, nullptr, "GetActiveAudioDeviceNameAuto"}, - {0x11, nullptr, "QueryAudioDeviceInputEvent"}, - {0x12, nullptr, "QueryAudioDeviceOutputEvent"}}; + {0xa, &IAudioDevice::GetActiveAudioDeviceName, + "GetActiveAudioDeviceNameAuto"}, // Are these any different? + {0xb, nullptr, "QueryAudioDeviceInputEvent"}, + {0xc, nullptr, "QueryAudioDeviceOutputEvent"}}; RegisterHandlers(functions); buffer_event = @@ -257,7 +260,7 @@ void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); - rb.Push(0x400); + rb.Push(0x4000); LOG_WARNING(Service_Audio, "(STUBBED) called"); } diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index 91e5f527a..2f21d8f56 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -12,10 +12,27 @@ namespace Service::NFP { Module::Interface::Interface(std::shared_ptr module, const char* name) : ServiceFramework(name), module(std::move(module)) {} -void Module::Interface::Unknown(Kernel::HLERequestContext& ctx) { +class IUser final : public ServiceFramework { +public: + IUser() : ServiceFramework("IUser") { + static const FunctionInfo functions[] = { + {0, &IUser::Initialize, "Initialize"}, + }; + RegisterHandlers(functions); + } + +private: + void Initialize(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } +}; + +void Module::Interface::GetIUserInterface(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NFP, "(STUBBED) called"); - IPC::ResponseBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface(); } void InstallInterfaces(SM::ServiceManager& service_manager) { diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h index 095209ad8..c0688f232 100644 --- a/src/core/hle/service/nfp/nfp.h +++ b/src/core/hle/service/nfp/nfp.h @@ -14,7 +14,7 @@ public: public: Interface(std::shared_ptr module, const char* name); - void Unknown(Kernel::HLERequestContext& ctx); + void GetIUserInterface(Kernel::HLERequestContext& ctx); protected: std::shared_ptr module; diff --git a/src/core/hle/service/nfp/nfp_user.cpp b/src/core/hle/service/nfp/nfp_user.cpp index e94c271e7..678f7a927 100644 --- a/src/core/hle/service/nfp/nfp_user.cpp +++ b/src/core/hle/service/nfp/nfp_user.cpp @@ -9,7 +9,7 @@ namespace Service::NFP { NFP_User::NFP_User(std::shared_ptr module) : Module::Interface(std::move(module), "nfp:user") { static const FunctionInfo functions[] = { - {0, &NFP_User::Unknown, "Unknown"}, + {0, &NFP_User::GetIUserInterface, "GetIUserInterface"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 18ea12ef5..44ae9c08a 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -79,6 +79,7 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector& input, std::vector& std::memcpy(¶ms, input.data(), input.size()); LOG_WARNING(Service_NVDRV, "(STUBBED) called, mask=0x%x, mask_buf_addr=0x%" PRIx64, params.mask_buf_size, params.mask_buf_addr); + params.unk = 0xcafe; // Needs to be non 0, what does this actually do? std::memcpy(output.data(), ¶ms, sizeof(params)); return 0; } diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp new file mode 100644 index 000000000..b9a7e1ff0 --- /dev/null +++ b/src/core/hle/service/prepo/prepo.cpp @@ -0,0 +1,40 @@ +#include +#include "common/logging/log.h" +#include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/event.h" +#include "core/hle/service/prepo/prepo.h" + +namespace Service::Playreport { +Playreport::Playreport(const char* name) : ServiceFramework(name) { + static const FunctionInfo functions[] = { + {10101, &Playreport::SaveReportWithUser, "SaveReportWithUser"}, + }; + RegisterHandlers(functions); +}; + +void Playreport::SaveReportWithUser(Kernel::HLERequestContext& ctx) { + /*IPC::RequestParser rp{ctx}; + auto Uid = rp.PopRaw>(); + u64 unk = rp.Pop(); + std::vector buffer; + buffer.reserve(ctx.BufferDescriptorX()[0].Size()); + Memory::ReadBlock(ctx.BufferDescriptorX()[0].Address(), buffer.data(), buffer.size()); + + std::vector buffer2; + buffer.reserve(ctx.BufferDescriptorA()[0].Size()); + Memory::ReadBlock(ctx.BufferDescriptorA()[0].Address(), buffer.data(), buffer.size());*/ + + // If we ever want to add play reports + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +}; + +void InstallInterfaces(SM::ServiceManager& service_manager) { + std::make_shared("prepo:a")->InstallAsService(service_manager); + std::make_shared("prepo:m")->InstallAsService(service_manager); + std::make_shared("prepo:s")->InstallAsService(service_manager); + std::make_shared("prepo:u")->InstallAsService(service_manager); +} + +} // namespace Service::Playreport diff --git a/src/core/hle/service/prepo/prepo.h b/src/core/hle/service/prepo/prepo.h new file mode 100644 index 000000000..77457b7bd --- /dev/null +++ b/src/core/hle/service/prepo/prepo.h @@ -0,0 +1,23 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include +#include "core/hle/kernel/event.h" +#include "core/hle/service/service.h" + +namespace Service::Playreport { + +class Playreport final : public ServiceFramework { +public: + Playreport(const char* name); + ~Playreport() = default; + +private: + void SaveReportWithUser(Kernel::HLERequestContext& ctx); +}; + +void InstallInterfaces(SM::ServiceManager& service_manager); + +}; // namespace Service::Playreport diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 08ce29677..1e759b21e 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -30,6 +30,7 @@ #include "core/hle/service/ns/ns.h" #include "core/hle/service/nvdrv/nvdrv.h" #include "core/hle/service/pctl/pctl.h" +#include "core/hle/service/prepo/prepo.h" #include "core/hle/service/service.h" #include "core/hle/service/set/settings.h" #include "core/hle/service/sm/controller.h" @@ -192,6 +193,7 @@ void Init(std::shared_ptr& sm) { NS::InstallInterfaces(*sm); Nvidia::InstallInterfaces(*sm); PCTL::InstallInterfaces(*sm); + Playreport::InstallInterfaces(*sm); Sockets::InstallInterfaces(*sm); SPL::InstallInterfaces(*sm); SSL::InstallInterfaces(*sm); diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 11d438728..7e21fec8e 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -96,12 +96,21 @@ SSL::SSL() : ServiceFramework("ssl") { {2, nullptr, "GetCertificates"}, {3, nullptr, "GetCertificateBufSize"}, {4, nullptr, "DebugIoctl"}, - {5, nullptr, "SetInterfaceVersion"}, + {5, &SSL::SetInterfaceVersion, "SetInterfaceVersion"}, {6, nullptr, "FlushSessionCache"}, }; RegisterHandlers(functions); } +void SSL::SetInterfaceVersion(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + u32 unk1 = rp.Pop(); // Probably minor/major? + u32 unk2 = rp.Pop(); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +} + void InstallInterfaces(SM::ServiceManager& service_manager) { std::make_shared()->InstallAsService(service_manager); } diff --git a/src/core/hle/service/ssl/ssl.h b/src/core/hle/service/ssl/ssl.h index 87538a639..8fef13022 100644 --- a/src/core/hle/service/ssl/ssl.h +++ b/src/core/hle/service/ssl/ssl.h @@ -15,6 +15,7 @@ public: private: void CreateContext(Kernel::HLERequestContext& ctx); + void SetInterfaceVersion(Kernel::HLERequestContext& ctx); }; /// Registers all SSL services with the specified service manager. From df669bc540d0ffec4afd298fdeb7767c3a4ea242 Mon Sep 17 00:00:00 2001 From: David <25727384+ogniK5377@users.noreply.github.com> Date: Sun, 22 Apr 2018 00:07:55 -0700 Subject: [PATCH 2/5] lioncash proposed changes --- src/core/hle/service/prepo/prepo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/prepo/prepo.h b/src/core/hle/service/prepo/prepo.h index 77457b7bd..40e26adcf 100644 --- a/src/core/hle/service/prepo/prepo.h +++ b/src/core/hle/service/prepo/prepo.h @@ -11,7 +11,7 @@ namespace Service::Playreport { class Playreport final : public ServiceFramework { public: - Playreport(const char* name); + explicit Playreport(const char* name); ~Playreport() = default; private: @@ -20,4 +20,4 @@ private: void InstallInterfaces(SM::ServiceManager& service_manager); -}; // namespace Service::Playreport +} // namespace Service::Playreport From 27650499bc74ec642c253a84fcf7f1c7812fdcac Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sun, 22 Apr 2018 19:02:18 -0700 Subject: [PATCH 3/5] GetIUserInterface->CreateUserInterface, Added todos and stub logs. Playreport->PlayReport. --- src/common/logging/log.h | 1 + src/core/hle/service/audio/audren_u.cpp | 8 ++--- src/core/hle/service/nfp/nfp.cpp | 27 ++++++++++++++- src/core/hle/service/nfp/nfp.h | 2 +- src/core/hle/service/nfp/nfp_user.cpp | 2 +- .../service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 2 +- src/core/hle/service/prepo/prepo.cpp | 34 +++++++++++++------ src/core/hle/service/prepo/prepo.h | 10 +++--- src/core/hle/service/service.cpp | 2 +- src/core/hle/service/ssl/ssl.cpp | 1 + 10 files changed, 64 insertions(+), 25 deletions(-) diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 45821850c..ade44d9c7 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -65,6 +65,7 @@ enum class Class : ClassType { Service_NS, ///< The NS services Service_NVDRV, ///< The NVDRV (Nvidia driver) service Service_PCTL, ///< The PCTL (Parental control) service + Service_PREPO, ///< The PREPO(Play report) service Service_SET, ///< The SET (Settings) service Service_SM, ///< The SM (Service manager) service Service_SPL, ///< The SPL service diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index fe445552a..a9360614c 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -163,12 +163,10 @@ public: {0x4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, {0x5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, {0x6, &IAudioDevice::ListAudioDeviceName, - "ListAudioDeviceNameAuto"}, // Are these any different? - {0x7, &IAudioDevice::SetAudioDeviceOutputVolume, - "SetAudioDeviceOutputVolumeAuto"}, // Are these any different? + "ListAudioDeviceNameAuto"}, // TODO(ogniK): Confirm if autos are identical to non auto + {0x7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, {0x8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, - {0xa, &IAudioDevice::GetActiveAudioDeviceName, - "GetActiveAudioDeviceNameAuto"}, // Are these any different? + {0xa, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, {0xb, nullptr, "QueryAudioDeviceInputEvent"}, {0xc, nullptr, "QueryAudioDeviceOutputEvent"}}; RegisterHandlers(functions); diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index 2f21d8f56..a1cd6b24a 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -17,18 +17,43 @@ public: IUser() : ServiceFramework("IUser") { static const FunctionInfo functions[] = { {0, &IUser::Initialize, "Initialize"}, + {1, nullptr, "Unknown1"}, + {2, nullptr, "Unknown2"}, + {3, nullptr, "Unknown3"}, + {4, nullptr, "Unknown4"}, + {5, nullptr, "Unknown5"}, + {6, nullptr, "Unknown6"}, + {7, nullptr, "Unknown7"}, + {8, nullptr, "Unknown8"}, + {9, nullptr, "Unknown9"}, + {10, nullptr, "Unknown10"}, + {11, nullptr, "Unknown11"}, + {12, nullptr, "Unknown12"}, + {13, nullptr, "Unknown13"}, + {14, nullptr, "Unknown14"}, + {15, nullptr, "Unknown15"}, + {16, nullptr, "Unknown16"}, + {17, nullptr, "Unknown17"}, + {18, nullptr, "Unknown18"}, + {19, nullptr, "Unknown19"}, + {20, nullptr, "Unknown20"}, + {21, nullptr, "Unknown21"}, + {22, nullptr, "Unknown22"}, + {23, nullptr, "Unknown23"}, + {24, nullptr, "Unknown24"}, }; RegisterHandlers(functions); } private: void Initialize(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_NFP, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } }; -void Module::Interface::GetIUserInterface(Kernel::HLERequestContext& ctx) { +void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NFP, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h index c0688f232..262a666cb 100644 --- a/src/core/hle/service/nfp/nfp.h +++ b/src/core/hle/service/nfp/nfp.h @@ -14,7 +14,7 @@ public: public: Interface(std::shared_ptr module, const char* name); - void GetIUserInterface(Kernel::HLERequestContext& ctx); + void CreateUserInterface(Kernel::HLERequestContext& ctx); protected: std::shared_ptr module; diff --git a/src/core/hle/service/nfp/nfp_user.cpp b/src/core/hle/service/nfp/nfp_user.cpp index 678f7a927..b608fe693 100644 --- a/src/core/hle/service/nfp/nfp_user.cpp +++ b/src/core/hle/service/nfp/nfp_user.cpp @@ -9,7 +9,7 @@ namespace Service::NFP { NFP_User::NFP_User(std::shared_ptr module) : Module::Interface(std::move(module), "nfp:user") { static const FunctionInfo functions[] = { - {0, &NFP_User::GetIUserInterface, "GetIUserInterface"}, + {0, &NFP_User::CreateUserInterface, "CreateUserInterface"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 44ae9c08a..5008d7cbf 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -79,7 +79,7 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector& input, std::vector& std::memcpy(¶ms, input.data(), input.size()); LOG_WARNING(Service_NVDRV, "(STUBBED) called, mask=0x%x, mask_buf_addr=0x%" PRIx64, params.mask_buf_size, params.mask_buf_addr); - params.unk = 0xcafe; // Needs to be non 0, what does this actually do? + params.unk = 0xcafe; // TODO(ogniK): Needs to be non 0, what does this actually do? std::memcpy(output.data(), ¶ms, sizeof(params)); return 0; } diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index b9a7e1ff0..02db54827 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -4,15 +4,28 @@ #include "core/hle/kernel/event.h" #include "core/hle/service/prepo/prepo.h" -namespace Service::Playreport { -Playreport::Playreport(const char* name) : ServiceFramework(name) { +namespace Service::PlayReport { +PlayReport::PlayReport(const char* name) : ServiceFramework(name) { static const FunctionInfo functions[] = { - {10101, &Playreport::SaveReportWithUser, "SaveReportWithUser"}, + {10100, nullptr, "SaveReport"}, + {10101, &PlayReport::SaveReportWithUser, "SaveReportWithUser"}, + {10200, nullptr, "RequestImmediateTransmission"}, + {10300, nullptr, "GetTransmissionStatus"}, + {20100, nullptr, "SaveSystemReport"}, + {20200, nullptr, "SetOperationMode"}, + {20101, nullptr, "SaveSystemReportWithUser"}, + {30100, nullptr, "ClearStorage"}, + {40100, nullptr, "IsUserAgreementCheckEnabled"}, + {40101, nullptr, "SetUserAgreementCheckEnabled"}, + {90100, nullptr, "GetStorageUsage"}, + {90200, nullptr, "GetStatistics"}, + {90201, nullptr, "GetThroughputHistory"}, + {90300, nullptr, "GetLastUploadError"}, }; RegisterHandlers(functions); }; -void Playreport::SaveReportWithUser(Kernel::HLERequestContext& ctx) { +void PlayReport::SaveReportWithUser(Kernel::HLERequestContext& ctx) { /*IPC::RequestParser rp{ctx}; auto Uid = rp.PopRaw>(); u64 unk = rp.Pop(); @@ -23,18 +36,19 @@ void Playreport::SaveReportWithUser(Kernel::HLERequestContext& ctx) { std::vector buffer2; buffer.reserve(ctx.BufferDescriptorA()[0].Size()); Memory::ReadBlock(ctx.BufferDescriptorA()[0].Address(), buffer.data(), buffer.size());*/ + // TODO(ogniK): Do we want to add play report? ^ Buffers/Data required for it - // If we ever want to add play reports + LOG_WARNING(Service_PREPO, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); }; void InstallInterfaces(SM::ServiceManager& service_manager) { - std::make_shared("prepo:a")->InstallAsService(service_manager); - std::make_shared("prepo:m")->InstallAsService(service_manager); - std::make_shared("prepo:s")->InstallAsService(service_manager); - std::make_shared("prepo:u")->InstallAsService(service_manager); + std::make_shared("prepo:a")->InstallAsService(service_manager); + std::make_shared("prepo:m")->InstallAsService(service_manager); + std::make_shared("prepo:s")->InstallAsService(service_manager); + std::make_shared("prepo:u")->InstallAsService(service_manager); } -} // namespace Service::Playreport +} // namespace Service::PlayReport diff --git a/src/core/hle/service/prepo/prepo.h b/src/core/hle/service/prepo/prepo.h index 40e26adcf..3708e0dcb 100644 --- a/src/core/hle/service/prepo/prepo.h +++ b/src/core/hle/service/prepo/prepo.h @@ -7,12 +7,12 @@ #include "core/hle/kernel/event.h" #include "core/hle/service/service.h" -namespace Service::Playreport { +namespace Service::PlayReport { -class Playreport final : public ServiceFramework { +class PlayReport final : public ServiceFramework { public: - explicit Playreport(const char* name); - ~Playreport() = default; + explicit PlayReport(const char* name); + ~PlayReport() = default; private: void SaveReportWithUser(Kernel::HLERequestContext& ctx); @@ -20,4 +20,4 @@ private: void InstallInterfaces(SM::ServiceManager& service_manager); -} // namespace Service::Playreport +} // namespace Service::PlayReport diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 1e759b21e..68d2b9f17 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -193,7 +193,7 @@ void Init(std::shared_ptr& sm) { NS::InstallInterfaces(*sm); Nvidia::InstallInterfaces(*sm); PCTL::InstallInterfaces(*sm); - Playreport::InstallInterfaces(*sm); + PlayReport::InstallInterfaces(*sm); Sockets::InstallInterfaces(*sm); SPL::InstallInterfaces(*sm); SSL::InstallInterfaces(*sm); diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 7e21fec8e..27d91640e 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -103,6 +103,7 @@ SSL::SSL() : ServiceFramework("ssl") { } void SSL::SetInterfaceVersion(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_SSL, "(STUBBED) called"); IPC::RequestParser rp{ctx}; u32 unk1 = rp.Pop(); // Probably minor/major? u32 unk2 = rp.Pop(); From f1f7f2cba93631c67dfd8767f69a2a23a6edcf23 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Thu, 26 Apr 2018 14:19:34 -0700 Subject: [PATCH 4/5] Added PREPO to logging backend, Removed comments from SaveReportWithUser --- src/common/logging/backend.cpp | 1 + src/core/hle/service/prepo/prepo.cpp | 13 +------------ src/core/hle/service/ssl/ssl.cpp | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 26cd75a3e..618be0864 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -48,6 +48,7 @@ namespace Log { SUB(Service, NS) \ SUB(Service, NVDRV) \ SUB(Service, PCTL) \ + SUB(Service, PREPO) \ SUB(Service, SET) \ SUB(Service, SM) \ SUB(Service, SPL) \ diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 02db54827..3c43b8d8c 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -26,18 +26,7 @@ PlayReport::PlayReport(const char* name) : ServiceFramework(name) { }; void PlayReport::SaveReportWithUser(Kernel::HLERequestContext& ctx) { - /*IPC::RequestParser rp{ctx}; - auto Uid = rp.PopRaw>(); - u64 unk = rp.Pop(); - std::vector buffer; - buffer.reserve(ctx.BufferDescriptorX()[0].Size()); - Memory::ReadBlock(ctx.BufferDescriptorX()[0].Address(), buffer.data(), buffer.size()); - - std::vector buffer2; - buffer.reserve(ctx.BufferDescriptorA()[0].Size()); - Memory::ReadBlock(ctx.BufferDescriptorA()[0].Address(), buffer.data(), buffer.size());*/ - // TODO(ogniK): Do we want to add play report? ^ Buffers/Data required for it - + // TODO(ogniK): Do we want to add play report? LOG_WARNING(Service_PREPO, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 27d91640e..40aea6090 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -106,7 +106,7 @@ void SSL::SetInterfaceVersion(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_SSL, "(STUBBED) called"); IPC::RequestParser rp{ctx}; u32 unk1 = rp.Pop(); // Probably minor/major? - u32 unk2 = rp.Pop(); + u32 unk2 = rp.Pop(); // TODO(ogniK): Figure out what this does IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); From abc23416e8f2a0963a5ddff021788cae7f00dd62 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Thu, 26 Apr 2018 20:03:12 -0700 Subject: [PATCH 5/5] Switched to NGLOG_WARNING --- src/common/logging/log.h | 2 +- src/core/hle/service/nfp/nfp.cpp | 4 ++-- src/core/hle/service/prepo/prepo.cpp | 2 +- src/core/hle/service/ssl/ssl.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/logging/log.h b/src/common/logging/log.h index ade44d9c7..1b29ce6e0 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -65,7 +65,7 @@ enum class Class : ClassType { Service_NS, ///< The NS services Service_NVDRV, ///< The NVDRV (Nvidia driver) service Service_PCTL, ///< The PCTL (Parental control) service - Service_PREPO, ///< The PREPO(Play report) service + Service_PREPO, ///< The PREPO (Play report) service Service_SET, ///< The SET (Settings) service Service_SM, ///< The SM (Service manager) service Service_SPL, ///< The SPL service diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index a1cd6b24a..cc0247881 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -47,14 +47,14 @@ public: private: void Initialize(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_NFP, "(STUBBED) called"); + NGLOG_WARNING(Service_NFP, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } }; void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_NFP, "(STUBBED) called"); + NGLOG_DEBUG(Service_NFP, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 3c43b8d8c..eaf30ee6b 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -27,7 +27,7 @@ PlayReport::PlayReport(const char* name) : ServiceFramework(name) { void PlayReport::SaveReportWithUser(Kernel::HLERequestContext& ctx) { // TODO(ogniK): Do we want to add play report? - LOG_WARNING(Service_PREPO, "(STUBBED) called"); + NGLOG_WARNING(Service_PREPO, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 8a85df91a..b3dad8b06 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -103,7 +103,7 @@ SSL::SSL() : ServiceFramework("ssl") { } void SSL::SetInterfaceVersion(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_SSL, "(STUBBED) called"); + NGLOG_WARNING(Service_SSL, "(STUBBED) called"); IPC::RequestParser rp{ctx}; u32 unk1 = rp.Pop(); // Probably minor/major? u32 unk2 = rp.Pop(); // TODO(ogniK): Figure out what this does