summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/control_metadata.h4
-rw-r--r--src/core/hle/service/am/service/application_functions.cpp19
-rw-r--r--src/core/hle/service/am/service/application_functions.h1
-rw-r--r--src/core/hle/service/filesystem/fsp/fsp_srv.cpp9
-rw-r--r--src/core/hle/service/filesystem/fsp/fsp_srv.h1
5 files changed, 30 insertions, 4 deletions
diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h
index 555b9d8f7..667efbbab 100644
--- a/src/core/file_sys/control_metadata.h
+++ b/src/core/file_sys/control_metadata.h
@@ -64,8 +64,8 @@ struct RawNACP {
64 u64_le cache_storage_size; 64 u64_le cache_storage_size;
65 u64_le cache_storage_journal_size; 65 u64_le cache_storage_journal_size;
66 u64_le cache_storage_data_and_journal_max_size; 66 u64_le cache_storage_data_and_journal_max_size;
67 u64_le cache_storage_max_index; 67 u16_le cache_storage_max_index;
68 INSERT_PADDING_BYTES(0xE70); 68 INSERT_PADDING_BYTES(0xE76);
69}; 69};
70static_assert(sizeof(RawNACP) == 0x4000, "RawNACP has incorrect size."); 70static_assert(sizeof(RawNACP) == 0x4000, "RawNACP has incorrect size.");
71 71
diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp
index b788fddd4..63dd12a47 100644
--- a/src/core/hle/service/am/service/application_functions.cpp
+++ b/src/core/hle/service/am/service/application_functions.cpp
@@ -15,6 +15,7 @@
15#include "core/hle/service/cmif_serialization.h" 15#include "core/hle/service/cmif_serialization.h"
16#include "core/hle/service/filesystem/filesystem.h" 16#include "core/hle/service/filesystem/filesystem.h"
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/glue/glue_manager.h"
18#include "core/hle/service/ns/ns.h" 19#include "core/hle/service/ns/ns.h"
19#include "core/hle/service/sm/sm.h" 20#include "core/hle/service/sm/sm.h"
20 21
@@ -40,7 +41,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_
40 {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, 41 {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"},
41 {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, 42 {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"},
42 {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, 43 {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"},
43 {29, nullptr, "GetCacheStorageMax"}, 44 {29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"},
44 {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, 45 {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"},
45 {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, 46 {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"},
46 {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, 47 {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"},
@@ -267,6 +268,22 @@ Result IApplicationFunctions::GetSaveDataSizeMax(Out<u64> out_max_normal_size,
267 R_SUCCEED(); 268 R_SUCCEED();
268} 269}
269 270
271Result IApplicationFunctions::GetCacheStorageMax(Out<u32> out_cache_storage_index_max,
272 Out<u64> out_max_journal_size) {
273 LOG_DEBUG(Service_AM, "called");
274
275 std::vector<u8> nacp;
276 R_TRY(system.GetARPManager().GetControlProperty(&nacp, m_applet->program_id));
277
278 auto raw_nacp = std::make_unique<FileSys::RawNACP>();
279 std::memcpy(raw_nacp.get(), nacp.data(), std::min(sizeof(*raw_nacp), nacp.size()));
280
281 *out_cache_storage_index_max = static_cast<u32>(raw_nacp->cache_storage_max_index);
282 *out_max_journal_size = static_cast<u64>(raw_nacp->cache_storage_data_and_journal_max_size);
283
284 R_SUCCEED();
285}
286
270Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) { 287Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) {
271 LOG_WARNING(Service_AM, "(STUBBED) called"); 288 LOG_WARNING(Service_AM, "(STUBBED) called");
272 289
diff --git a/src/core/hle/service/am/service/application_functions.h b/src/core/hle/service/am/service/application_functions.h
index 3548202f8..10025a152 100644
--- a/src/core/hle/service/am/service/application_functions.h
+++ b/src/core/hle/service/am/service/application_functions.h
@@ -40,6 +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_cache_storage_index_max, Out<u64> out_max_journal_size);
43 Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused); 44 Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused);
44 Result EndBlockingHomeButtonShortAndLongPressed(); 45 Result EndBlockingHomeButtonShortAndLongPressed();
45 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 63c2d3a58..2d49f30c8 100644
--- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
@@ -336,7 +336,7 @@ FSP_SRV::FSP_SRV(Core::System& system_)
336 {1012, nullptr, "GetFsStackUsage"}, 336 {1012, nullptr, "GetFsStackUsage"},
337 {1013, nullptr, "UnsetSaveDataRootPath"}, 337 {1013, nullptr, "UnsetSaveDataRootPath"},
338 {1014, nullptr, "OutputMultiProgramTagAccessLog"}, 338 {1014, nullptr, "OutputMultiProgramTagAccessLog"},
339 {1016, nullptr, "FlushAccessLogOnSdCard"}, 339 {1016, &FSP_SRV::FlushAccessLogOnSdCard, "FlushAccessLogOnSdCard"},
340 {1017, nullptr, "OutputApplicationInfoAccessLog"}, 340 {1017, nullptr, "OutputApplicationInfoAccessLog"},
341 {1018, nullptr, "SetDebugOption"}, 341 {1018, nullptr, "SetDebugOption"},
342 {1019, nullptr, "UnsetDebugOption"}, 342 {1019, nullptr, "UnsetDebugOption"},
@@ -706,6 +706,13 @@ void FSP_SRV::GetProgramIndexForAccessLog(HLERequestContext& ctx) {
706 rb.Push(access_log_program_index); 706 rb.Push(access_log_program_index);
707} 707}
708 708
709void FSP_SRV::FlushAccessLogOnSdCard(HLERequestContext& ctx) {
710 LOG_DEBUG(Service_FS, "(STUBBED) called");
711
712 IPC::ResponseBuilder rb{ctx, 2};
713 rb.Push(ResultSuccess);
714}
715
709void FSP_SRV::GetCacheStorageSize(HLERequestContext& ctx) { 716void FSP_SRV::GetCacheStorageSize(HLERequestContext& ctx) {
710 IPC::RequestParser rp{ctx}; 717 IPC::RequestParser rp{ctx};
711 const auto index{rp.Pop<s32>()}; 718 const auto index{rp.Pop<s32>()};
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h
index 26980af99..59406e6f9 100644
--- a/src/core/hle/service/filesystem/fsp/fsp_srv.h
+++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h
@@ -58,6 +58,7 @@ private:
58 void SetGlobalAccessLogMode(HLERequestContext& ctx); 58 void SetGlobalAccessLogMode(HLERequestContext& ctx);
59 void GetGlobalAccessLogMode(HLERequestContext& ctx); 59 void GetGlobalAccessLogMode(HLERequestContext& ctx);
60 void OutputAccessLogToSdCard(HLERequestContext& ctx); 60 void OutputAccessLogToSdCard(HLERequestContext& ctx);
61 void FlushAccessLogOnSdCard(HLERequestContext& ctx);
61 void GetProgramIndexForAccessLog(HLERequestContext& ctx); 62 void GetProgramIndexForAccessLog(HLERequestContext& ctx);
62 void OpenMultiCommitManager(HLERequestContext& ctx); 63 void OpenMultiCommitManager(HLERequestContext& ctx);
63 void GetCacheStorageSize(HLERequestContext& ctx); 64 void GetCacheStorageSize(HLERequestContext& ctx);