VERY experimental Nintendo Switch 2 emulator
C++
GetIUserInterface->CreateUserInterface, Added todos and stub logs. Playreport->PlayReport.
David Marcec9591689dbc64
diff --git a/src/common/logging/log.h b/src/common/logging/log.hindex 45821850c9..ade44d9c7c 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 servicesService_NVDRV, ///< The NVDRV (Nvidia driver) serviceService_PCTL, ///< The PCTL (Parental control) service+ Service_PREPO, ///< The PREPO(Play report) serviceService_SET, ///< The SET (Settings) serviceService_SM, ///< The SM (Service manager) serviceService_SPL, ///< The SPL servicediff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cppindex fe445552ad..a9360614c6 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.cppindex 2f21d8f565..a1cd6b24a5 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.hindex c0688f232a..262a666cb0 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> module, const char* name);- void GetIUserInterface(Kernel::HLERequestContext& ctx);+ void CreateUserInterface(Kernel::HLERequestContext& ctx);protected:std::shared_ptr<Module> module;diff --git a/src/core/hle/service/nfp/nfp_user.cpp b/src/core/hle/service/nfp/nfp_user.cppindex 678f7a9276..b608fe693b 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): 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.cppindex 44ae9c08a6..5008d7cbf6 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<u8>& input, std::vector<u8>&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.cppindex b9a7e1ff0c..02db548271 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<std::array<u64, 2>>();u64 unk = rp.Pop<u64>();@@ -23,18 +36,19 @@ void Playreport::SaveReportWithUser(Kernel::HLERequestContext& ctx) {std::vector<u8> 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<Playreport>("prepo:a")->InstallAsService(service_manager);- std::make_shared<Playreport>("prepo:m")->InstallAsService(service_manager);- std::make_shared<Playreport>("prepo:s")->InstallAsService(service_manager);- std::make_shared<Playreport>("prepo:u")->InstallAsService(service_manager);+ std::make_shared<PlayReport>("prepo:a")->InstallAsService(service_manager);+ std::make_shared<PlayReport>("prepo:m")->InstallAsService(service_manager);+ std::make_shared<PlayReport>("prepo:s")->InstallAsService(service_manager);+ std::make_shared<PlayReport>("prepo:u")->InstallAsService(service_manager);}-} // namespace Service::Playreport+} // namespace Service::PlayReportdiff --git a/src/core/hle/service/prepo/prepo.h b/src/core/hle/service/prepo/prepo.hindex 40e26adcfc..3708e0dcb3 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<Playreport> {+class PlayReport final : public ServiceFramework<PlayReport> {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::PlayReportdiff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cppindex 1e759b21ea..68d2b9f175 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::ServiceManager>& 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.cppindex 7e21fec8e9..27d91640eb 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<u32>(); // Probably minor/major?u32 unk2 = rp.Pop<u32>();