diff options
author | bunnei <bunneidev@gmail.com> | 2016-05-13 21:33:44 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2016-05-13 21:33:44 +0200 |
commit | 18b517e236b7f6710567e57dab6a7c5329db948f (patch) | |
tree | 5257e9ace394fa6062768c27b95e807df87c61b2 /src/core/hle/applets | |
parent | Merge pull request #1788 from MerryMage/ext-soundtouch (diff) | |
parent | HLE/Applets: Give each applet its own block of heap memory, and use that when creating the framebuffer shared memory block. (diff) | |
download | yuzu-18b517e236b7f6710567e57dab6a7c5329db948f.tar yuzu-18b517e236b7f6710567e57dab6a7c5329db948f.tar.gz yuzu-18b517e236b7f6710567e57dab6a7c5329db948f.tar.bz2 yuzu-18b517e236b7f6710567e57dab6a7c5329db948f.tar.lz yuzu-18b517e236b7f6710567e57dab6a7c5329db948f.tar.xz yuzu-18b517e236b7f6710567e57dab6a7c5329db948f.tar.zst yuzu-18b517e236b7f6710567e57dab6a7c5329db948f.zip |
Diffstat (limited to 'src/core/hle/applets')
-rw-r--r-- | src/core/hle/applets/applet.h | 1 | ||||
-rw-r--r-- | src/core/hle/applets/mii_selector.cpp | 9 | ||||
-rw-r--r-- | src/core/hle/applets/swkbd.cpp | 8 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h index af442f81d..754c6f7db 100644 --- a/src/core/hle/applets/applet.h +++ b/src/core/hle/applets/applet.h @@ -65,6 +65,7 @@ protected: virtual ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) = 0; Service::APT::AppletId id; ///< Id of this Applet + std::shared_ptr<std::vector<u8>> heap_memory; ///< Heap memory for this Applet }; /// Returns whether a library applet is currently running diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index b4456ca90..bf39eca22 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -35,9 +35,14 @@ ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& p ASSERT(sizeof(capture_info) == parameter.buffer_size); memcpy(&capture_info, parameter.data, sizeof(capture_info)); + using Kernel::MemoryPermission; - framebuffer_memory = Kernel::SharedMemory::Create(capture_info.size, MemoryPermission::ReadWrite, - MemoryPermission::ReadWrite, "MiiSelector Memory"); + // Allocate a heap block of the required size for this applet. + heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); + // Create a SharedMemory that directly points to this heap block. + framebuffer_memory = Kernel::SharedMemory::CreateForApplet(heap_memory, 0, heap_memory->size(), + MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, + "MiiSelector Memory"); // Send the response message with the newly created SharedMemory Service::APT::MessageParameter result; diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index 87238aa1c..90c6adc65 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp @@ -40,8 +40,12 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con memcpy(&capture_info, parameter.data, sizeof(capture_info)); using Kernel::MemoryPermission; - framebuffer_memory = Kernel::SharedMemory::Create(capture_info.size, MemoryPermission::ReadWrite, - MemoryPermission::ReadWrite, "SoftwareKeyboard Memory"); + // Allocate a heap block of the required size for this applet. + heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); + // Create a SharedMemory that directly points to this heap block. + framebuffer_memory = Kernel::SharedMemory::CreateForApplet(heap_memory, 0, heap_memory->size(), + MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, + "SoftwareKeyboard Memory"); // Send the response message with the newly created SharedMemory Service::APT::MessageParameter result; |