summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-03 20:21:45 +0200
committerbunnei <bunneidev@gmail.com>2018-06-04 04:10:06 +0200
commit2dcb98226b6e8222d073d9ee1e247bb116ac1d2c (patch)
tree76c2347deb92fab7c2b8c573f6275713369c9bc6 /src
parentam: Cleanup IStorageAccessor::Read. (diff)
downloadyuzu-2dcb98226b6e8222d073d9ee1e247bb116ac1d2c.tar
yuzu-2dcb98226b6e8222d073d9ee1e247bb116ac1d2c.tar.gz
yuzu-2dcb98226b6e8222d073d9ee1e247bb116ac1d2c.tar.bz2
yuzu-2dcb98226b6e8222d073d9ee1e247bb116ac1d2c.tar.lz
yuzu-2dcb98226b6e8222d073d9ee1e247bb116ac1d2c.tar.xz
yuzu-2dcb98226b6e8222d073d9ee1e247bb116ac1d2c.tar.zst
yuzu-2dcb98226b6e8222d073d9ee1e247bb116ac1d2c.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/am/am.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 26fd8c933..c47228935 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -397,7 +397,7 @@ public:
: ServiceFramework("IStorageAccessor"), buffer(std::move(buffer)) {
static const FunctionInfo functions[] = {
{0, &IStorageAccessor::GetSize, "GetSize"},
- {10, nullptr, "Write"},
+ {10, &IStorageAccessor::Write, "Write"},
{11, &IStorageAccessor::Read, "Read"},
};
RegisterHandlers(functions);
@@ -415,6 +415,22 @@ private:
NGLOG_DEBUG(Service_AM, "called");
}
+ void Write(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+
+ const u64 offset{rp.Pop<u64>()};
+ const std::vector<u8> data{ctx.ReadBuffer()};
+
+ ASSERT(offset + data.size() <= buffer.size());
+
+ std::memcpy(&buffer[offset], data.data(), data.size());
+
+ IPC::ResponseBuilder rb{rp.MakeBuilder(2, 0, 0)};
+ rb.Push(RESULT_SUCCESS);
+
+ NGLOG_DEBUG(Service_AM, "called, offset={}", offset);
+ }
+
void Read(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};