summaryrefslogtreecommitdiffstats
path: root/src/core/hle/applets/swkbd.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-05-05 19:36:07 +0200
committerSubv <subv2112@gmail.com>2016-05-07 17:01:40 +0200
commit6970b7d3d511194d3b229358375c528b0136e82c (patch)
tree02685af986ae1adf6e0de3e17dae67dc0fb367ed /src/core/hle/applets/swkbd.cpp
parentMerge pull request #1754 from JayFoxRox/fix-const_color-revert (diff)
downloadyuzu-6970b7d3d511194d3b229358375c528b0136e82c.tar
yuzu-6970b7d3d511194d3b229358375c528b0136e82c.tar.gz
yuzu-6970b7d3d511194d3b229358375c528b0136e82c.tar.bz2
yuzu-6970b7d3d511194d3b229358375c528b0136e82c.tar.lz
yuzu-6970b7d3d511194d3b229358375c528b0136e82c.tar.xz
yuzu-6970b7d3d511194d3b229358375c528b0136e82c.tar.zst
yuzu-6970b7d3d511194d3b229358375c528b0136e82c.zip
Diffstat (limited to 'src/core/hle/applets/swkbd.cpp')
-rw-r--r--src/core/hle/applets/swkbd.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp
index 1db6b5a17..87238aa1c 100644
--- a/src/core/hle/applets/swkbd.cpp
+++ b/src/core/hle/applets/swkbd.cpp
@@ -24,13 +24,6 @@
namespace HLE {
namespace Applets {
-SoftwareKeyboard::SoftwareKeyboard(Service::APT::AppletId id) : Applet(id), started(false) {
- // Create the SharedMemory that will hold the framebuffer data
- // TODO(Subv): What size should we use here?
- using Kernel::MemoryPermission;
- framebuffer_memory = Kernel::SharedMemory::Create(0x1000, MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, "SoftwareKeyboard Memory");
-}
-
ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter const& parameter) {
if (parameter.signal != static_cast<u32>(Service::APT::SignalType::LibAppJustStarted)) {
LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal);
@@ -39,8 +32,19 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con
return ResultCode(-1);
}
+ // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared memory.
+ // Create the SharedMemory that will hold the framebuffer data
+ Service::APT::CaptureBufferInfo capture_info;
+ 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, "SoftwareKeyboard Memory");
+
+ // Send the response message with the newly created SharedMemory
Service::APT::MessageParameter result;
- // The buffer passed in parameter contains the data returned by GSPGPU::ImportDisplayCaptureInfo
result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished);
result.data = nullptr;
result.buffer_size = 0;