aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/applets/swkbd.h
diff options
context:
space:
mode:
authorGravatar Subv <subv2112@gmail.com>2015-05-25 23:30:20 -0500
committerGravatar Subv <subv2112@gmail.com>2015-07-11 21:47:22 -0500
commit2a6ebadf66051362cdcf07d722f7e2d3cee14c82 (patch)
treef016b2ee81df95aabccc426762c42073d645803c /src/core/hle/applets/swkbd.h
parentb0d72e3de1ec2350716300c86bc02930893e9e23 (diff)
HLE/APT: Initial HLE support for applets.
Currently only the SWKBD is emulated, and there's currently no way to ask the user for input, so it always returns "Subv" as the text.
Diffstat (limited to 'src/core/hle/applets/swkbd.h')
-rw-r--r--src/core/hle/applets/swkbd.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/core/hle/applets/swkbd.h b/src/core/hle/applets/swkbd.h
new file mode 100644
index 00000000..d7199690
--- /dev/null
+++ b/src/core/hle/applets/swkbd.h
@@ -0,0 +1,67 @@
+// Copyright 2015 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "common/common_types.h"
+#include "core/hle/applets/applet.h"
+#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/shared_memory.h"
+#include "core/hle/service/apt/apt.h"
+
+namespace HLE {
+namespace Applets {
+
+struct SoftwareKeyboardConfig {
+ INSERT_PADDING_WORDS(0x8);
+
+ u16 max_text_length; ///< Maximum length of the input text
+
+ INSERT_PADDING_BYTES(0x6E);
+
+ char16_t display_text[65]; ///< Text to display when asking the user for input
+
+ INSERT_PADDING_BYTES(0xE);
+
+ u32 default_text_offset; ///< Offset of the default text in the output SharedMemory
+
+ INSERT_PADDING_WORDS(0x3);
+
+ u32 shared_memory_size; ///< Size of the SharedMemory
+
+ INSERT_PADDING_WORDS(0x1);
+
+ u32 return_code; ///< Return code of the SoftwareKeyboard, usually 2, other values are unknown
+
+ INSERT_PADDING_WORDS(0x2);
+
+ u32 text_offset; ///< Offset in the SharedMemory where the output text starts
+ u16 text_length; ///< Length in characters of the output text
+
+ INSERT_PADDING_BYTES(0x2B6);
+};
+
+static_assert(sizeof(SoftwareKeyboardConfig) == 0x400, "Software Keyboard Config size is wrong");
+
+class SoftwareKeyboard : public Applet {
+public:
+ SoftwareKeyboard(Service::APT::AppletId id);
+ ~SoftwareKeyboard() {}
+
+ ResultCode ReceiveParameter(Service::APT::MessageParameter const& parameter) override;
+ ResultCode Start(Service::APT::AppletStartupParameter const& parameter) override;
+
+ /// TODO(Subv): Find out what this is actually used for.
+ // It is believed that the application stores the current screen image here.
+ Kernel::SharedPtr<Kernel::SharedMemory> framebuffer_memory;
+
+ /// SharedMemory where the output text will be stored
+ Kernel::SharedPtr<Kernel::SharedMemory> text_memory;
+
+ /// Configuration of this instance of the SoftwareKeyboard, as received from the application
+ SoftwareKeyboardConfig config;
+};
+
+}
+} // namespace