summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-04-17 17:59:07 +0200
committerZach Hilman <zachhilman@gmail.com>2019-09-21 22:43:10 +0200
commit1b04b7265301684530dd2298b5d148a05dc010c3 (patch)
tree5b92dd4992c08eefb9bd0160f93a8311d1c7bfda /src/core
parentfilesystem: Pass Size Getter functions to IFileSystem for sizes (diff)
downloadyuzu-1b04b7265301684530dd2298b5d148a05dc010c3.tar
yuzu-1b04b7265301684530dd2298b5d148a05dc010c3.tar.gz
yuzu-1b04b7265301684530dd2298b5d148a05dc010c3.tar.bz2
yuzu-1b04b7265301684530dd2298b5d148a05dc010c3.tar.lz
yuzu-1b04b7265301684530dd2298b5d148a05dc010c3.tar.xz
yuzu-1b04b7265301684530dd2298b5d148a05dc010c3.tar.zst
yuzu-1b04b7265301684530dd2298b5d148a05dc010c3.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/am/am.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index aa2c83937..eae052ce0 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1143,13 +1143,20 @@ void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(
void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
- u128 uid = rp.PopRaw<u128>(); // What does this do?
- LOG_WARNING(Service, "(STUBBED) called uid = {:016X}{:016X}", uid[1], uid[0]);
+ u128 user_id = rp.PopRaw<u128>();
+
+ LOG_DEBUG(Service_AM, "called, uid={:016X}{:016X}", user_id[1], user_id[0]);
+
+ FileSys::SaveDataDescriptor descriptor{};
+ descriptor.title_id = Core::CurrentProcess()->GetTitleID();
+ descriptor.user_id = user_id;
+ descriptor.type = FileSys::SaveDataType::SaveData;
+ const auto res = fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, descriptor);
IPC::ResponseBuilder rb{ctx, 4};
- rb.Push(RESULT_SUCCESS);
+ rb.Push(res.Code());
rb.Push<u64>(0);
-} // namespace Service::AM
+}
void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) {
// Takes an input u32 Result, no output.
@@ -1261,8 +1268,8 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {
"new_journal={:016X}",
static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size);
- const auto title_id = system.CurrentProcess()->GetTitleID();
- FileSystem::WriteSaveDataSize(type, title_id, user_id, {new_normal_size, new_journal_size});
+ fsc.WriteSaveDataSize(type, Core::CurrentProcess()->GetTitleID(), user_id,
+ {new_normal_size, new_journal_size});
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
@@ -1281,8 +1288,7 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type),
user_id[1], user_id[0]);
- const auto title_id = system.CurrentProcess()->GetTitleID();
- const auto size = FileSystem::ReadSaveDataSize(type, title_id, user_id);
+ const auto size = fsc.ReadSaveDataSize(type, Core::CurrentProcess()->GetTitleID(), user_id);
IPC::ResponseBuilder rb{ctx, 6};
rb.Push(RESULT_SUCCESS);