diff options
| author | 2024-02-18 05:02:35 +0100 | |
|---|---|---|
| committer | 2024-02-18 05:02:35 +0100 | |
| commit | d93fdc8a6ca246928fde7b76b41fc9aae487e31a (patch) | |
| tree | 86d0f19e0d00d7166464bec03d3d17e36957303a | |
| parent | fsp: Add FlushAccessLogOnSdCard stub (diff) | |
| download | yuzu-d93fdc8a6ca246928fde7b76b41fc9aae487e31a.tar.gz yuzu-d93fdc8a6ca246928fde7b76b41fc9aae487e31a.tar.xz yuzu-d93fdc8a6ca246928fde7b76b41fc9aae487e31a.zip | |
service: Add proper GetCacheStorageMax implementation to IApplicationFunctions
| -rw-r--r-- | src/core/hle/service/am/service/application_functions.cpp | 20 | ||||
| -rw-r--r-- | src/core/hle/service/am/service/application_functions.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp/fsp_srv.cpp | 2 |
3 files changed, 17 insertions, 7 deletions
diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index ac3b0066e..eee9428ce 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include "core/hle/service/filesystem/save_data_controller.h" | 17 | #include "core/hle/service/filesystem/save_data_controller.h" |
| 18 | #include "core/hle/service/ns/ns.h" | 18 | #include "core/hle/service/ns/ns.h" |
| 19 | #include "core/hle/service/sm/sm.h" | 19 | #include "core/hle/service/sm/sm.h" |
| 20 | #include "core/hle/service/glue/glue_manager.h" | ||
| 20 | 21 | ||
| 21 | namespace Service::AM { | 22 | namespace Service::AM { |
| 22 | 23 | ||
| @@ -267,14 +268,23 @@ Result IApplicationFunctions::GetSaveDataSizeMax(Out<u64> out_max_normal_size, | |||
| 267 | R_SUCCEED(); | 268 | R_SUCCEED(); |
| 268 | } | 269 | } |
| 269 | 270 | ||
| 270 | Result IApplicationFunctions::GetCacheStorageMax(Out<u32> out_max_normal_size, | 271 | Result IApplicationFunctions::GetCacheStorageMax(Out<u32> out_cache_storage_index_max, |
| 271 | Out<u64> out_max_journal_size) { | 272 | Out<u64> out_max_journal_size) { |
| 272 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 273 | LOG_DEBUG(Service_AM, "called"); |
| 273 | 274 | ||
| 274 | *out_max_normal_size = 0xFFFFFF; | 275 | const auto title_id = m_applet->program_id; |
| 275 | *out_max_journal_size = 0xFFFFFF; | ||
| 276 | 276 | ||
| 277 | R_SUCCEED(); | 277 | std::vector<u8> nacp; |
| 278 | const auto result = system.GetARPManager().GetControlProperty(&nacp, title_id); | ||
| 279 | |||
| 280 | if (R_SUCCEEDED(result)) { | ||
| 281 | const auto rawnacp = reinterpret_cast<FileSys::RawNACP*>(nacp.data()); | ||
| 282 | |||
| 283 | *out_cache_storage_index_max = static_cast<u32>(rawnacp->cache_storage_max_index); | ||
| 284 | *out_max_journal_size = static_cast<u64>(rawnacp->cache_storage_data_and_journal_max_size); | ||
| 285 | } | ||
| 286 | |||
| 287 | R_SUCCEED(); | ||
| 278 | } | 288 | } |
| 279 | 289 | ||
| 280 | Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) { | 290 | Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) { |
diff --git a/src/core/hle/service/am/service/application_functions.h b/src/core/hle/service/am/service/application_functions.h index c86f0d8ac..10025a152 100644 --- a/src/core/hle/service/am/service/application_functions.h +++ b/src/core/hle/service/am/service/application_functions.h | |||
| @@ -40,7 +40,7 @@ private: | |||
| 40 | Result CreateCacheStorage(Out<u32> out_target_media, Out<u64> out_required_size, u16 index, | 40 | Result CreateCacheStorage(Out<u32> out_target_media, Out<u64> out_required_size, u16 index, |
| 41 | u64 normal_size, u64 journal_size); | 41 | u64 normal_size, u64 journal_size); |
| 42 | Result GetSaveDataSizeMax(Out<u64> out_max_normal_size, Out<u64> out_max_journal_size); | 42 | Result GetSaveDataSizeMax(Out<u64> out_max_normal_size, Out<u64> out_max_journal_size); |
| 43 | Result GetCacheStorageMax(Out<u32> out_max_normal_size, Out<u64> out_max_journal_size); | 43 | Result GetCacheStorageMax(Out<u32> out_cache_storage_index_max, Out<u64> out_max_journal_size); |
| 44 | Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused); | 44 | Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused); |
| 45 | Result EndBlockingHomeButtonShortAndLongPressed(); | 45 | Result EndBlockingHomeButtonShortAndLongPressed(); |
| 46 | Result BeginBlockingHomeButton(s64 timeout_ns); | 46 | Result BeginBlockingHomeButton(s64 timeout_ns); |
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index e1238527e..2d49f30c8 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp | |||
| @@ -762,4 +762,4 @@ void FSP_SRV::OpenMultiCommitManager(HLERequestContext& ctx) { | |||
| 762 | rb.PushIpcInterface<IMultiCommitManager>(std::make_shared<IMultiCommitManager>(system)); | 762 | rb.PushIpcInterface<IMultiCommitManager>(std::make_shared<IMultiCommitManager>(system)); |
| 763 | } | 763 | } |
| 764 | 764 | ||
| 765 | } // namespace Service::FileSystem \ No newline at end of file | 765 | } // namespace Service::FileSystem |