diff options
| author | 2018-06-03 14:19:24 -0400 | |
|---|---|---|
| committer | 2018-06-03 22:10:05 -0400 | |
| commit | d73c22bf4d975379d0e379f4f03398f102e7836d (patch) | |
| tree | 39698cf6a0acd0069cfdef7ef158f273372eaa4f /src | |
| parent | Merge pull request #494 from bunnei/shader-tex (diff) | |
| download | yuzu-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.cpp | 54 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 1 |
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 | ||
| 394 | ILibraryAppletCreator::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 | |||
| 406 | void 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 | |||
| 415 | class IStorageAccessor final : public ServiceFramework<IStorageAccessor> { | 394 | class IStorageAccessor final : public ServiceFramework<IStorageAccessor> { |
| 416 | public: | 395 | public: |
| 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 | ||
| 461 | ILibraryAppletCreator::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 | |||
| 473 | void 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 | |||
| 482 | void 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 | |||
| 482 | IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { | 494 | IApplicationFunctions::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 | ||
| 122 | private: | 122 | private: |
| 123 | void CreateLibraryApplet(Kernel::HLERequestContext& ctx); | 123 | void CreateLibraryApplet(Kernel::HLERequestContext& ctx); |
| 124 | void CreateStorage(Kernel::HLERequestContext& ctx); | ||
| 124 | }; | 125 | }; |
| 125 | 126 | ||
| 126 | class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { | 127 | class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { |