summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-03 20:23:44 +0200
committerbunnei <bunneidev@gmail.com>2018-06-04 04:10:06 +0200
commit876b805e50f77a837304baa6015e5c506bf2df22 (patch)
tree5f0c8a5c0033b095c77624211b73c14121a1f0d1 /src
parentam: Implement IStorageAccessor::Write. (diff)
downloadyuzu-876b805e50f77a837304baa6015e5c506bf2df22.tar
yuzu-876b805e50f77a837304baa6015e5c506bf2df22.tar.gz
yuzu-876b805e50f77a837304baa6015e5c506bf2df22.tar.bz2
yuzu-876b805e50f77a837304baa6015e5c506bf2df22.tar.lz
yuzu-876b805e50f77a837304baa6015e5c506bf2df22.tar.xz
yuzu-876b805e50f77a837304baa6015e5c506bf2df22.tar.zst
yuzu-876b805e50f77a837304baa6015e5c506bf2df22.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp98
1 files changed, 55 insertions, 43 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index c47228935..40922ec3a 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <cinttypes>
+#include <stack>
#include "core/file_sys/filesystem.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/event.h"
@@ -348,49 +349,6 @@ void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
NGLOG_WARNING(Service_AM, "(STUBBED) called");
}
-class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
-public:
- explicit ILibraryAppletAccessor() : ServiceFramework("ILibraryAppletAccessor") {
- static const FunctionInfo functions[] = {
- {0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"},
- {1, nullptr, "IsCompleted"},
- {10, nullptr, "Start"},
- {20, nullptr, "RequestExit"},
- {25, nullptr, "Terminate"},
- {30, nullptr, "GetResult"},
- {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"},
- {100, nullptr, "PushInData"},
- {101, nullptr, "PopOutData"},
- {102, nullptr, "PushExtraStorage"},
- {103, nullptr, "PushInteractiveInData"},
- {104, nullptr, "PopInteractiveOutData"},
- {105, nullptr, "GetPopOutDataEvent"},
- {106, nullptr, "GetPopInteractiveOutDataEvent"},
- {110, nullptr, "NeedsToExitProcess"},
- {120, nullptr, "GetLibraryAppletInfo"},
- {150, nullptr, "RequestForAppletToGetForeground"},
- {160, nullptr, "GetIndirectLayerConsumerHandle"},
- };
- RegisterHandlers(functions);
-
- state_changed_event = Kernel::Event::Create(Kernel::ResetType::OneShot,
- "ILibraryAppletAccessor:StateChangedEvent");
- }
-
-private:
- void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) {
- state_changed_event->Signal();
-
- IPC::ResponseBuilder rb{ctx, 2, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(state_changed_event);
-
- NGLOG_WARNING(Service_AM, "(STUBBED) called");
- }
-
- Kernel::SharedPtr<Kernel::Event> state_changed_event;
-};
-
class IStorageAccessor final : public ServiceFramework<IStorageAccessor> {
public:
explicit IStorageAccessor(std::vector<u8> buffer)
@@ -472,6 +430,60 @@ private:
}
};
+class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
+public:
+ explicit ILibraryAppletAccessor() : ServiceFramework("ILibraryAppletAccessor") {
+ static const FunctionInfo functions[] = {
+ {0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"},
+ {1, nullptr, "IsCompleted"},
+ {10, nullptr, "Start"},
+ {20, nullptr, "RequestExit"},
+ {25, nullptr, "Terminate"},
+ {30, nullptr, "GetResult"},
+ {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"},
+ {100, &ILibraryAppletAccessor::PushInData, "PushInData"},
+ {101, nullptr, "PopOutData"},
+ {102, nullptr, "PushExtraStorage"},
+ {103, nullptr, "PushInteractiveInData"},
+ {104, nullptr, "PopInteractiveOutData"},
+ {105, nullptr, "GetPopOutDataEvent"},
+ {106, nullptr, "GetPopInteractiveOutDataEvent"},
+ {110, nullptr, "NeedsToExitProcess"},
+ {120, nullptr, "GetLibraryAppletInfo"},
+ {150, nullptr, "RequestForAppletToGetForeground"},
+ {160, nullptr, "GetIndirectLayerConsumerHandle"},
+ };
+ RegisterHandlers(functions);
+
+ state_changed_event = Kernel::Event::Create(Kernel::ResetType::OneShot,
+ "ILibraryAppletAccessor:StateChangedEvent");
+ }
+
+private:
+ void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) {
+ state_changed_event->Signal();
+
+ IPC::ResponseBuilder rb{ctx, 2, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushCopyObjects(state_changed_event);
+
+ NGLOG_WARNING(Service_AM, "(STUBBED) called");
+ }
+
+ void PushInData(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ storage_stack.push(rp.PopIpcInterface<AM::IStorage>());
+
+ IPC::ResponseBuilder rb{rp.MakeBuilder(2, 0, 0)};
+ rb.Push(RESULT_SUCCESS);
+
+ NGLOG_DEBUG(Service_AM, "called");
+ }
+
+ std::stack<std::shared_ptr<AM::IStorage>> storage_stack;
+ Kernel::SharedPtr<Kernel::Event> state_changed_event;
+};
+
ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {
static const FunctionInfo functions[] = {
{0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"},