summaryrefslogtreecommitdiff
path: root/src/core/hle/service/am
diff options
context:
space:
mode:
authorGravatar Subv2018-03-04 13:03:58 -0500
committerGravatar Subv2018-03-04 14:30:07 -0500
commit0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902 (patch)
treed6fbf1e18b6b17fcb089306af26c48331100814c /src/core/hle/service/am
parentMerge pull request #226 from Subv/buffer_queue_event (diff)
downloadyuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar.gz
yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.tar.xz
yuzu-0eefe6e4d15cbc7a5902dfbe5e7742ef4ea71902.zip
FS: Make EnsureSaveData create the savedata folder when called for the first time.
Diffstat (limited to 'src/core/hle/service/am')
-rw-r--r--src/core/hle/service/am/am.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index d3a674cf6..d9f003ed4 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -2,12 +2,15 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <cinttypes>
6#include "core/file_sys/filesystem.h"
5#include "core/hle/ipc_helpers.h" 7#include "core/hle/ipc_helpers.h"
6#include "core/hle/kernel/event.h" 8#include "core/hle/kernel/event.h"
7#include "core/hle/service/am/am.h" 9#include "core/hle/service/am/am.h"
8#include "core/hle/service/am/applet_ae.h" 10#include "core/hle/service/am/applet_ae.h"
9#include "core/hle/service/am/applet_oe.h" 11#include "core/hle/service/am/applet_oe.h"
10#include "core/hle/service/apm/apm.h" 12#include "core/hle/service/apm/apm.h"
13#include "core/hle/service/filesystem/filesystem.h"
11#include "core/hle/service/nvflinger/nvflinger.h" 14#include "core/hle/service/nvflinger/nvflinger.h"
12 15
13namespace Service { 16namespace Service {
@@ -416,9 +419,24 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
416} 419}
417 420
418void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) { 421void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
419 LOG_WARNING(Service, "(STUBBED) called"); 422 IPC::RequestParser rp{ctx};
423 u128 uid = rp.PopRaw<u128>();
424
425 LOG_WARNING(Service, "(STUBBED) called uid = %016" PRIX64 "%016" PRIX64, uid[1], uid[0]);
426
420 IPC::ResponseBuilder rb{ctx, 4}; 427 IPC::ResponseBuilder rb{ctx, 4};
421 rb.Push(RESULT_SUCCESS); 428
429 FileSys::Path unused;
430 auto savedata = FileSystem::OpenFileSystem(FileSystem::Type::SaveData, unused);
431 if (savedata.Failed()) {
432 // Create the save data and return an error indicating that the operation was performed.
433 FileSystem::FormatFileSystem(FileSystem::Type::SaveData);
434 // TODO(Subv): Find out the correct error code for this.
435 rb.Push(ResultCode(ErrorModule::FS, 40));
436 } else {
437 rb.Push(RESULT_SUCCESS);
438 }
439
422 rb.Push<u64>(0); 440 rb.Push<u64>(0);
423} 441}
424 442