diff options
Diffstat (limited to 'src/core/hle/applets/swkbd.cpp')
| -rw-r--r-- | src/core/hle/applets/swkbd.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index d87bf3d57..06ddf538b 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp | |||
| @@ -4,19 +4,16 @@ | |||
| 4 | 4 | ||
| 5 | #include <cstring> | 5 | #include <cstring> |
| 6 | #include <string> | 6 | #include <string> |
| 7 | |||
| 8 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 9 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 10 | #include "common/string_util.h" | 9 | #include "common/string_util.h" |
| 11 | |||
| 12 | #include "core/hle/applets/swkbd.h" | 10 | #include "core/hle/applets/swkbd.h" |
| 13 | #include "core/hle/kernel/kernel.h" | 11 | #include "core/hle/kernel/kernel.h" |
| 14 | #include "core/hle/kernel/shared_memory.h" | 12 | #include "core/hle/kernel/shared_memory.h" |
| 15 | #include "core/hle/service/hid/hid.h" | ||
| 16 | #include "core/hle/service/gsp_gpu.h" | ||
| 17 | #include "core/hle/result.h" | 13 | #include "core/hle/result.h" |
| 14 | #include "core/hle/service/gsp_gpu.h" | ||
| 15 | #include "core/hle/service/hid/hid.h" | ||
| 18 | #include "core/memory.h" | 16 | #include "core/memory.h" |
| 19 | |||
| 20 | #include "video_core/video_core.h" | 17 | #include "video_core/video_core.h" |
| 21 | 18 | ||
| 22 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 19 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| @@ -32,7 +29,8 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con | |||
| 32 | return ResultCode(-1); | 29 | return ResultCode(-1); |
| 33 | } | 30 | } |
| 34 | 31 | ||
| 35 | // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared memory. | 32 | // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared |
| 33 | // memory. | ||
| 36 | // Create the SharedMemory that will hold the framebuffer data | 34 | // Create the SharedMemory that will hold the framebuffer data |
| 37 | Service::APT::CaptureBufferInfo capture_info; | 35 | Service::APT::CaptureBufferInfo capture_info; |
| 38 | ASSERT(sizeof(capture_info) == parameter.buffer.size()); | 36 | ASSERT(sizeof(capture_info) == parameter.buffer.size()); |
| @@ -43,9 +41,9 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con | |||
| 43 | // Allocate a heap block of the required size for this applet. | 41 | // Allocate a heap block of the required size for this applet. |
| 44 | heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); | 42 | heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); |
| 45 | // Create a SharedMemory that directly points to this heap block. | 43 | // Create a SharedMemory that directly points to this heap block. |
| 46 | framebuffer_memory = Kernel::SharedMemory::CreateForApplet(heap_memory, 0, heap_memory->size(), | 44 | framebuffer_memory = Kernel::SharedMemory::CreateForApplet( |
| 47 | MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, | 45 | heap_memory, 0, heap_memory->size(), MemoryPermission::ReadWrite, |
| 48 | "SoftwareKeyboard Memory"); | 46 | MemoryPermission::ReadWrite, "SoftwareKeyboard Memory"); |
| 49 | 47 | ||
| 50 | // Send the response message with the newly created SharedMemory | 48 | // Send the response message with the newly created SharedMemory |
| 51 | Service::APT::MessageParameter result; | 49 | Service::APT::MessageParameter result; |
| @@ -60,10 +58,12 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con | |||
| 60 | } | 58 | } |
| 61 | 59 | ||
| 62 | ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) { | 60 | ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) { |
| 63 | ASSERT_MSG(parameter.buffer.size() == sizeof(config), "The size of the parameter (SoftwareKeyboardConfig) is wrong"); | 61 | ASSERT_MSG(parameter.buffer.size() == sizeof(config), |
| 62 | "The size of the parameter (SoftwareKeyboardConfig) is wrong"); | ||
| 64 | 63 | ||
| 65 | memcpy(&config, parameter.buffer.data(), parameter.buffer.size()); | 64 | memcpy(&config, parameter.buffer.data(), parameter.buffer.size()); |
| 66 | text_memory = boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object); | 65 | text_memory = |
| 66 | boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object); | ||
| 67 | 67 | ||
| 68 | // TODO(Subv): Verify if this is the correct behavior | 68 | // TODO(Subv): Verify if this is the correct behavior |
| 69 | memset(text_memory->GetPointer(), 0, text_memory->size); | 69 | memset(text_memory->GetPointer(), 0, text_memory->size); |
| @@ -115,6 +115,5 @@ void SoftwareKeyboard::Finalize() { | |||
| 115 | 115 | ||
| 116 | started = false; | 116 | started = false; |
| 117 | } | 117 | } |
| 118 | |||
| 119 | } | 118 | } |
| 120 | } // namespace | 119 | } // namespace |