summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-05-11 00:49:46 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-05-11 01:05:29 +0200
commit774eea83741286338e249e1bf188f53b53243411 (patch)
tree57f077f8c88afc74bb1dac5573db511d823af1a5 /src
parentKernel: Capture SharedMemory attributes at creation, not when mapping (diff)
downloadyuzu-774eea83741286338e249e1bf188f53b53243411.tar
yuzu-774eea83741286338e249e1bf188f53b53243411.tar.gz
yuzu-774eea83741286338e249e1bf188f53b53243411.tar.bz2
yuzu-774eea83741286338e249e1bf188f53b53243411.tar.lz
yuzu-774eea83741286338e249e1bf188f53b53243411.tar.xz
yuzu-774eea83741286338e249e1bf188f53b53243411.tar.zst
yuzu-774eea83741286338e249e1bf188f53b53243411.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/shared_memory.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index 178589cbb..0c59f4876 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <cstring>
+
#include "common/logging/log.h"
#include "core/mem_map.h"
@@ -38,6 +40,12 @@ ResultCode SharedMemory::Map(VAddr address, MemoryPermission permissions,
// TODO: Test permissions
+ // HACK: Since there's no way to write to the memory block without mapping it onto the game
+ // process yet, at least initialize memory the first time it's mapped.
+ if (address != this->base_address) {
+ std::memset(Memory::GetPointer(address), 0, size);
+ }
+
this->base_address = address;
return RESULT_SUCCESS;