summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Liam2024-02-17 12:22:16 -0500
committerGravatar Liam2024-02-18 10:32:21 -0500
commit786fc512e244b47d37d71e940cb70a5f7e59cb20 (patch)
tree02a7d38d951bdf5b08b922f9cd7aed4934052156
parentns: add IDynamicRightsInterface (diff)
downloadyuzu-786fc512e244b47d37d71e940cb70a5f7e59cb20.tar.gz
yuzu-786fc512e244b47d37d71e940cb70a5f7e59cb20.tar.xz
yuzu-786fc512e244b47d37d71e940cb70a5f7e59cb20.zip
ns: rewrite IReadOnlyApplicationRecordInterface
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/ns/ns.cpp35
-rw-r--r--src/core/hle/service/ns/ns.h11
-rw-r--r--src/core/hle/service/ns/read_only_application_record_interface.cpp38
-rw-r--r--src/core/hle/service/ns/read_only_application_record_interface.h22
5 files changed, 63 insertions, 45 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 8f70d2599..ab8b1c6c9 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -765,6 +765,8 @@ add_library(core STATIC
765 hle/service/ns/pdm_qry.h 765 hle/service/ns/pdm_qry.h
766 hle/service/ns/platform_service_manager.cpp 766 hle/service/ns/platform_service_manager.cpp
767 hle/service/ns/platform_service_manager.h 767 hle/service/ns/platform_service_manager.h
768 hle/service/ns/read_only_application_record_interface.cpp
769 hle/service/ns/read_only_application_record_interface.h
768 hle/service/nvdrv/core/container.cpp 770 hle/service/nvdrv/core/container.cpp
769 hle/service/nvdrv/core/container.h 771 hle/service/nvdrv/core/container.h
770 hle/service/nvdrv/core/heap_mapper.cpp 772 hle/service/nvdrv/core/heap_mapper.cpp
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp
index 6f8427d51..5dc15dad5 100644
--- a/src/core/hle/service/ns/ns.cpp
+++ b/src/core/hle/service/ns/ns.cpp
@@ -24,6 +24,7 @@
24#include "core/hle/service/ns/ns_results.h" 24#include "core/hle/service/ns/ns_results.h"
25#include "core/hle/service/ns/pdm_qry.h" 25#include "core/hle/service/ns/pdm_qry.h"
26#include "core/hle/service/ns/platform_service_manager.h" 26#include "core/hle/service/ns/platform_service_manager.h"
27#include "core/hle/service/ns/read_only_application_record_interface.h"
27#include "core/hle/service/server_manager.h" 28#include "core/hle/service/server_manager.h"
28#include "core/hle/service/set/settings_server.h" 29#include "core/hle/service/set/settings_server.h"
29 30
@@ -468,40 +469,6 @@ Result IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode(
468 return ResultSuccess; 469 return ResultSuccess;
469} 470}
470 471
471IReadOnlyApplicationRecordInterface::IReadOnlyApplicationRecordInterface(Core::System& system_)
472 : ServiceFramework{system_, "IReadOnlyApplicationRecordInterface"} {
473 static const FunctionInfo functions[] = {
474 {0, &IReadOnlyApplicationRecordInterface::HasApplicationRecord, "HasApplicationRecord"},
475 {1, nullptr, "NotifyApplicationFailure"},
476 {2, &IReadOnlyApplicationRecordInterface::IsDataCorruptedResult, "IsDataCorruptedResult"},
477 };
478 // clang-format on
479
480 RegisterHandlers(functions);
481}
482
483IReadOnlyApplicationRecordInterface::~IReadOnlyApplicationRecordInterface() = default;
484
485void IReadOnlyApplicationRecordInterface::HasApplicationRecord(HLERequestContext& ctx) {
486 IPC::RequestParser rp{ctx};
487 const u64 program_id = rp.PopRaw<u64>();
488 LOG_WARNING(Service_NS, "(STUBBED) called, program_id={:X}", program_id);
489
490 IPC::ResponseBuilder rb{ctx, 3};
491 rb.Push(ResultSuccess);
492 rb.Push<u8>(1);
493}
494
495void IReadOnlyApplicationRecordInterface::IsDataCorruptedResult(HLERequestContext& ctx) {
496 IPC::RequestParser rp{ctx};
497 const auto result = rp.PopRaw<Result>();
498 LOG_WARNING(Service_NS, "(STUBBED) called, result={:#x}", result.GetInnerValue());
499
500 IPC::ResponseBuilder rb{ctx, 3};
501 rb.Push(ResultSuccess);
502 rb.Push<u8>(0);
503}
504
505IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterface( 472IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterface(
506 Core::System& system_) 473 Core::System& system_)
507 : ServiceFramework{system_, "IReadOnlyApplicationControlDataInterface"} { 474 : ServiceFramework{system_, "IReadOnlyApplicationControlDataInterface"} {
diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h
index 197895cdf..20a2243ff 100644
--- a/src/core/hle/service/ns/ns.h
+++ b/src/core/hle/service/ns/ns.h
@@ -32,17 +32,6 @@ private:
32 void ConvertApplicationLanguageToLanguageCode(HLERequestContext& ctx); 32 void ConvertApplicationLanguageToLanguageCode(HLERequestContext& ctx);
33}; 33};
34 34
35class IReadOnlyApplicationRecordInterface final
36 : public ServiceFramework<IReadOnlyApplicationRecordInterface> {
37public:
38 explicit IReadOnlyApplicationRecordInterface(Core::System& system_);
39 ~IReadOnlyApplicationRecordInterface() override;
40
41private:
42 void HasApplicationRecord(HLERequestContext& ctx);
43 void IsDataCorruptedResult(HLERequestContext& ctx);
44};
45
46class IReadOnlyApplicationControlDataInterface final 35class IReadOnlyApplicationControlDataInterface final
47 : public ServiceFramework<IReadOnlyApplicationControlDataInterface> { 36 : public ServiceFramework<IReadOnlyApplicationControlDataInterface> {
48public: 37public:
diff --git a/src/core/hle/service/ns/read_only_application_record_interface.cpp b/src/core/hle/service/ns/read_only_application_record_interface.cpp
new file mode 100644
index 000000000..816a1e1dc
--- /dev/null
+++ b/src/core/hle/service/ns/read_only_application_record_interface.cpp
@@ -0,0 +1,38 @@
1// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "core/hle/service/cmif_serialization.h"
5#include "core/hle/service/ns/read_only_application_record_interface.h"
6
7namespace Service::NS {
8
9IReadOnlyApplicationRecordInterface::IReadOnlyApplicationRecordInterface(Core::System& system_)
10 : ServiceFramework{system_, "IReadOnlyApplicationRecordInterface"} {
11 static const FunctionInfo functions[] = {
12 {0, D<&IReadOnlyApplicationRecordInterface::HasApplicationRecord>, "HasApplicationRecord"},
13 {1, nullptr, "NotifyApplicationFailure"},
14 {2, D<&IReadOnlyApplicationRecordInterface::IsDataCorruptedResult>,
15 "IsDataCorruptedResult"},
16 };
17 // clang-format on
18
19 RegisterHandlers(functions);
20}
21
22IReadOnlyApplicationRecordInterface::~IReadOnlyApplicationRecordInterface() = default;
23
24Result IReadOnlyApplicationRecordInterface::HasApplicationRecord(
25 Out<bool> out_has_application_record, u64 program_id) {
26 LOG_WARNING(Service_NS, "(STUBBED) called, program_id={:016X}", program_id);
27 *out_has_application_record = true;
28 R_SUCCEED();
29}
30
31Result IReadOnlyApplicationRecordInterface::IsDataCorruptedResult(
32 Out<bool> out_is_data_corrupted_result, Result result) {
33 LOG_WARNING(Service_NS, "(STUBBED) called, result={:#x}", result.GetInnerValue());
34 *out_is_data_corrupted_result = false;
35 R_SUCCEED();
36}
37
38} // namespace Service::NS
diff --git a/src/core/hle/service/ns/read_only_application_record_interface.h b/src/core/hle/service/ns/read_only_application_record_interface.h
new file mode 100644
index 000000000..d06e8f5e6
--- /dev/null
+++ b/src/core/hle/service/ns/read_only_application_record_interface.h
@@ -0,0 +1,22 @@
1// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "core/hle/service/cmif_types.h"
7#include "core/hle/service/service.h"
8
9namespace Service::NS {
10
11class IReadOnlyApplicationRecordInterface final
12 : public ServiceFramework<IReadOnlyApplicationRecordInterface> {
13public:
14 explicit IReadOnlyApplicationRecordInterface(Core::System& system_);
15 ~IReadOnlyApplicationRecordInterface() override;
16
17private:
18 Result HasApplicationRecord(Out<bool> out_has_application_record, u64 program_id);
19 Result IsDataCorruptedResult(Out<bool> out_is_data_corrupted_result, Result result);
20};
21
22} // namespace Service::NS