summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Zach Hilman2019-09-21 18:43:11 -0400
committerGravatar Zach Hilman2019-09-21 18:43:20 -0400
commit038bcec11153cefd713ddb06eddcc42b0a936df2 (patch)
treedb5abfb3d9b350ce931ec89ad8722233c8534a5e /src/core
parentconfig: Remove Dump options from configure_debug (diff)
downloadyuzu-038bcec11153cefd713ddb06eddcc42b0a936df2.tar.gz
yuzu-038bcec11153cefd713ddb06eddcc42b0a936df2.tar.xz
yuzu-038bcec11153cefd713ddb06eddcc42b0a936df2.zip
configure_debug: Move reporting option to logging
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/registered_cache.cpp8
-rw-r--r--src/core/hle/service/am/am.cpp9
-rw-r--r--src/core/hle/service/am/applet_ae.cpp2
-rw-r--r--src/core/hle/service/am/applet_oe.cpp2
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp5
-rw-r--r--src/core/hle/service/filesystem/filesystem.h2
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp3
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.h2
-rw-r--r--src/core/hle/service/service.cpp4
9 files changed, 19 insertions, 18 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp
index d1ef1e72d..ac3fbd849 100644
--- a/src/core/file_sys/registered_cache.cpp
+++ b/src/core/file_sys/registered_cache.cpp
@@ -59,12 +59,12 @@ static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bo
59 bool within_two_digit, bool cnmt_suffix) { 59 bool within_two_digit, bool cnmt_suffix) {
60 if (!within_two_digit) 60 if (!within_two_digit)
61 return fmt::format(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca", 61 return fmt::format(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca",
62 Common::HexArrayToString(nca_id, second_hex_upper)); 62 Common::HexToString(nca_id, second_hex_upper));
63 63
64 Core::Crypto::SHA256Hash hash{}; 64 Core::Crypto::SHA256Hash hash{};
65 mbedtls_sha256(nca_id.data(), nca_id.size(), hash.data(), 0); 65 mbedtls_sha256(nca_id.data(), nca_id.size(), hash.data(), 0);
66 return fmt::format(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca", hash[0], 66 return fmt::format(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca", hash[0],
67 Common::HexArrayToString(nca_id, second_hex_upper)); 67 Common::HexToString(nca_id, second_hex_upper));
68} 68}
69 69
70static std::string GetCNMTName(TitleType type, u64 title_id) { 70static std::string GetCNMTName(TitleType type, u64 title_id) {
@@ -149,7 +149,7 @@ bool PlaceholderCache::Create(const NcaID& id, u64 size) const {
149 if (dir2 == nullptr) 149 if (dir2 == nullptr)
150 return false; 150 return false;
151 151
152 const auto file = dir2->CreateFile(fmt::format("{}.nca", Common::HexArrayToString(id, false))); 152 const auto file = dir2->CreateFile(fmt::format("{}.nca", Common::HexToString(id, false)));
153 153
154 if (file == nullptr) 154 if (file == nullptr)
155 return false; 155 return false;
@@ -170,7 +170,7 @@ bool PlaceholderCache::Delete(const NcaID& id) const {
170 170
171 const auto dir2 = GetOrCreateDirectoryRelative(dir, dirname); 171 const auto dir2 = GetOrCreateDirectoryRelative(dir, dirname);
172 172
173 const auto res = dir2->DeleteFile(fmt::format("{}.nca", Common::HexArrayToString(id, false))); 173 const auto res = dir2->DeleteFile(fmt::format("{}.nca", Common::HexToString(id, false)));
174 174
175 return res; 175 return res;
176} 176}
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 7f8514b0d..6c594dcaf 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1151,7 +1151,8 @@ void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
1151 descriptor.title_id = Core::CurrentProcess()->GetTitleID(); 1151 descriptor.title_id = Core::CurrentProcess()->GetTitleID();
1152 descriptor.user_id = user_id; 1152 descriptor.user_id = user_id;
1153 descriptor.type = FileSys::SaveDataType::SaveData; 1153 descriptor.type = FileSys::SaveDataType::SaveData;
1154 const auto res = fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, descriptor); 1154 const auto res = system.GetFileSystemController().CreateSaveData(
1155 FileSys::SaveDataSpaceId::NandUser, descriptor);
1155 1156
1156 IPC::ResponseBuilder rb{ctx, 4}; 1157 IPC::ResponseBuilder rb{ctx, 4};
1157 rb.Push(res.Code()); 1158 rb.Push(res.Code());
@@ -1268,8 +1269,8 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {
1268 "new_journal={:016X}", 1269 "new_journal={:016X}",
1269 static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size); 1270 static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size);
1270 1271
1271 fsc.WriteSaveDataSize(type, system.CurrentProcess()->GetTitleID(), user_id, 1272 system.GetFileSystemController().WriteSaveDataSize(
1272 {new_normal_size, new_journal_size}); 1273 type, system.CurrentProcess()->GetTitleID(), user_id, {new_normal_size, new_journal_size});
1273 1274
1274 IPC::ResponseBuilder rb{ctx, 4}; 1275 IPC::ResponseBuilder rb{ctx, 4};
1275 rb.Push(RESULT_SUCCESS); 1276 rb.Push(RESULT_SUCCESS);
@@ -1288,7 +1289,7 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
1288 LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type), 1289 LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type),
1289 user_id[1], user_id[0]); 1290 user_id[1], user_id[0]);
1290 1291
1291 const auto size = system.FileSystemController().ReadSaveDataSize( 1292 const auto size = system.GetFileSystemController().ReadSaveDataSize(
1292 type, system.CurrentProcess()->GetTitleID(), user_id); 1293 type, system.CurrentProcess()->GetTitleID(), user_id);
1293 1294
1294 IPC::ResponseBuilder rb{ctx, 6}; 1295 IPC::ResponseBuilder rb{ctx, 6};
diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cpp
index d04476ae0..e454b77d8 100644
--- a/src/core/hle/service/am/applet_ae.cpp
+++ b/src/core/hle/service/am/applet_ae.cpp
@@ -106,7 +106,7 @@ private:
106 106
107 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 107 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
108 rb.Push(RESULT_SUCCESS); 108 rb.Push(RESULT_SUCCESS);
109 rb.PushIpcInterface<IApplicationFunctions>(system.FileSystemController()); 109 rb.PushIpcInterface<IApplicationFunctions>(system);
110 } 110 }
111 111
112 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 112 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index 2ee21620b..a2ffaa440 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -95,7 +95,7 @@ private:
95 95
96 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 96 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
97 rb.Push(RESULT_SUCCESS); 97 rb.Push(RESULT_SUCCESS);
98 rb.PushIpcInterface<IApplicationFunctions>(system.FileSystemController()); 98 rb.PushIpcInterface<IApplicationFunctions>(system);
99 } 99 }
100 100
101 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 101 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 31d5fd79b..14cd0e322 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -711,11 +711,10 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove
711} 711}
712 712
713void InstallInterfaces(Core::System& system) { 713void InstallInterfaces(Core::System& system) {
714 romfs_factory = nullptr;
715 CreateFactories(*system.GetFilesystem(), false);
716 std::make_shared<FSP_LDR>()->InstallAsService(system.ServiceManager()); 714 std::make_shared<FSP_LDR>()->InstallAsService(system.ServiceManager());
717 std::make_shared<FSP_PR>()->InstallAsService(system.ServiceManager()); 715 std::make_shared<FSP_PR>()->InstallAsService(system.ServiceManager());
718 std::make_shared<FSP_SRV>(system.GetReporter())->InstallAsService(system.ServiceManager()); 716 std::make_shared<FSP_SRV>(system.GetFileSystemController(), system.GetReporter())
717 ->InstallAsService(system.ServiceManager());
719} 718}
720 719
721} // namespace Service::FileSystem 720} // namespace Service::FileSystem
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index 4d7da3b6f..3e0c03ec0 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -125,7 +125,7 @@ private:
125 std::unique_ptr<FileSys::PlaceholderCache> gamecard_placeholder; 125 std::unique_ptr<FileSys::PlaceholderCache> gamecard_placeholder;
126}; 126};
127 127
128void InstallInterfaces(SM::ServiceManager& service_manager, FileSystemController& controller); 128void InstallInterfaces(Core::System& system);
129 129
130// A class that wraps a VfsDirectory with methods that return ResultVal and ResultCode instead of 130// A class that wraps a VfsDirectory with methods that return ResultVal and ResultCode instead of
131// pointers and booleans. This makes using a VfsDirectory with switch services much easier and 131// pointers and booleans. This makes using a VfsDirectory with switch services much easier and
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 305d9e176..eb982ad49 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -650,7 +650,8 @@ private:
650 u64 next_entry_index = 0; 650 u64 next_entry_index = 0;
651}; 651};
652 652
653FSP_SRV::FSP_SRV(FileSystemController& fsc) : ServiceFramework("fsp-srv"), fsc(fsc) { 653FSP_SRV::FSP_SRV(FileSystemController& fsc, const Core::Reporter& reporter)
654 : ServiceFramework("fsp-srv"), fsc(fsc), reporter(reporter) {
654 // clang-format off 655 // clang-format off
655 static const FunctionInfo functions[] = { 656 static const FunctionInfo functions[] = {
656 {0, nullptr, "OpenFileSystem"}, 657 {0, nullptr, "OpenFileSystem"},
diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.h
index 494348598..d52b55999 100644
--- a/src/core/hle/service/filesystem/fsp_srv.h
+++ b/src/core/hle/service/filesystem/fsp_srv.h
@@ -32,7 +32,7 @@ enum class LogMode : u32 {
32 32
33class FSP_SRV final : public ServiceFramework<FSP_SRV> { 33class FSP_SRV final : public ServiceFramework<FSP_SRV> {
34public: 34public:
35 explicit FSP_SRV(FileSystemController& fsc); 35 explicit FSP_SRV(FileSystemController& fsc, const Core::Reporter& reporter);
36 ~FSP_SRV() override; 36 ~FSP_SRV() override;
37 37
38private: 38private:
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 3d6a5990f..454387467 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -199,7 +199,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {
199 // NVFlinger needs to be accessed by several services like Vi and AppletOE so we instantiate it 199 // NVFlinger needs to be accessed by several services like Vi and AppletOE so we instantiate it
200 // here and pass it into the respective InstallInterfaces functions. 200 // here and pass it into the respective InstallInterfaces functions.
201 auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(system.CoreTiming()); 201 auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(system.CoreTiming());
202 fsc.CreateFactories(*system.GetFilesystem(), false); 202 system.GetFileSystemController().CreateFactories(*system.GetFilesystem(), false);
203 203
204 SM::ServiceManager::InstallInterfaces(sm); 204 SM::ServiceManager::InstallInterfaces(sm);
205 205
@@ -236,7 +236,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {
236 NIFM::InstallInterfaces(*sm); 236 NIFM::InstallInterfaces(*sm);
237 NIM::InstallInterfaces(*sm); 237 NIM::InstallInterfaces(*sm);
238 NPNS::InstallInterfaces(*sm); 238 NPNS::InstallInterfaces(*sm);
239 NS::InstallInterfaces(*sm, fsc); 239 NS::InstallInterfaces(*sm, system.GetFileSystemController());
240 Nvidia::InstallInterfaces(*sm, *nv_flinger, system); 240 Nvidia::InstallInterfaces(*sm, *nv_flinger, system);
241 PCIe::InstallInterfaces(*sm); 241 PCIe::InstallInterfaces(*sm);
242 PCTL::InstallInterfaces(*sm); 242 PCTL::InstallInterfaces(*sm);