summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-06-03 14:19:24 -0400
committerGravatar bunnei2018-06-03 22:10:05 -0400
commitd73c22bf4d975379d0e379f4f03398f102e7836d (patch)
tree39698cf6a0acd0069cfdef7ef158f273372eaa4f /src
parentMerge pull request #494 from bunnei/shader-tex (diff)
downloadyuzu-d73c22bf4d975379d0e379f4f03398f102e7836d.tar.gz
yuzu-d73c22bf4d975379d0e379f4f03398f102e7836d.tar.xz
yuzu-d73c22bf4d975379d0e379f4f03398f102e7836d.zip
am: Implement ILibraryAppletCreator::CreateStorage.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp54
-rw-r--r--src/core/hle/service/am/am.h1
2 files changed, 34 insertions, 21 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 6b1d6bf97..9434512d8 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -391,27 +391,6 @@ private:
391 Kernel::SharedPtr<Kernel::Event> state_changed_event; 391 Kernel::SharedPtr<Kernel::Event> state_changed_event;
392}; 392};
393 393
394ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {
395 static const FunctionInfo functions[] = {
396 {0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"},
397 {1, nullptr, "TerminateAllLibraryApplets"},
398 {2, nullptr, "AreAnyLibraryAppletsLeft"},
399 {10, nullptr, "CreateStorage"},
400 {11, nullptr, "CreateTransferMemoryStorage"},
401 {12, nullptr, "CreateHandleStorage"},
402 };
403 RegisterHandlers(functions);
404}
405
406void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) {
407 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
408
409 rb.Push(RESULT_SUCCESS);
410 rb.PushIpcInterface<AM::ILibraryAppletAccessor>();
411
412 NGLOG_DEBUG(Service_AM, "called");
413}
414
415class IStorageAccessor final : public ServiceFramework<IStorageAccessor> { 394class IStorageAccessor final : public ServiceFramework<IStorageAccessor> {
416public: 395public:
417 explicit IStorageAccessor(std::vector<u8> buffer) 396 explicit IStorageAccessor(std::vector<u8> buffer)
@@ -479,6 +458,39 @@ private:
479 } 458 }
480}; 459};
481 460
461ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {
462 static const FunctionInfo functions[] = {
463 {0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"},
464 {1, nullptr, "TerminateAllLibraryApplets"},
465 {2, nullptr, "AreAnyLibraryAppletsLeft"},
466 {10, &ILibraryAppletCreator::CreateStorage, "CreateStorage"},
467 {11, nullptr, "CreateTransferMemoryStorage"},
468 {12, nullptr, "CreateHandleStorage"},
469 };
470 RegisterHandlers(functions);
471}
472
473void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) {
474 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
475
476 rb.Push(RESULT_SUCCESS);
477 rb.PushIpcInterface<AM::ILibraryAppletAccessor>();
478
479 NGLOG_DEBUG(Service_AM, "called");
480}
481
482void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) {
483 IPC::RequestParser rp{ctx};
484 const u64 size{rp.Pop<u64>()};
485 std::vector<u8> buffer(size);
486
487 IPC::ResponseBuilder rb{rp.MakeBuilder(2, 0, 1)};
488 rb.Push(RESULT_SUCCESS);
489 rb.PushIpcInterface<AM::IStorage>(std::move(buffer));
490
491 NGLOG_DEBUG(Service_AM, "called, size={}", size);
492}
493
482IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { 494IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationFunctions") {
483 static const FunctionInfo functions[] = { 495 static const FunctionInfo functions[] = {
484 {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"}, 496 {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"},
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index ff8eb14d7..301a6c798 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -121,6 +121,7 @@ public:
121 121
122private: 122private:
123 void CreateLibraryApplet(Kernel::HLERequestContext& ctx); 123 void CreateLibraryApplet(Kernel::HLERequestContext& ctx);
124 void CreateStorage(Kernel::HLERequestContext& ctx);
124}; 125};
125 126
126class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { 127class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {