diff options
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 79 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 3 |
2 files changed, 80 insertions, 2 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 242ea6665..cc643ea09 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include "core/hle/service/am/applets/applet_cabinet.h" | 23 | #include "core/hle/service/am/applets/applet_cabinet.h" |
| 24 | #include "core/hle/service/am/applets/applet_mii_edit_types.h" | 24 | #include "core/hle/service/am/applets/applet_mii_edit_types.h" |
| 25 | #include "core/hle/service/am/applets/applet_profile_select.h" | 25 | #include "core/hle/service/am/applets/applet_profile_select.h" |
| 26 | #include "core/hle/service/am/applets/applet_software_keyboard_types.h" | ||
| 26 | #include "core/hle/service/am/applets/applet_web_browser.h" | 27 | #include "core/hle/service/am/applets/applet_web_browser.h" |
| 27 | #include "core/hle/service/am/applets/applets.h" | 28 | #include "core/hle/service/am/applets/applets.h" |
| 28 | #include "core/hle/service/am/idle.h" | 29 | #include "core/hle/service/am/idle.h" |
| @@ -1571,7 +1572,7 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_) | |||
| 1571 | {16, nullptr, "GetMainAppletStorageId"}, | 1572 | {16, nullptr, "GetMainAppletStorageId"}, |
| 1572 | {17, nullptr, "GetCallerAppletIdentityInfoStack"}, | 1573 | {17, nullptr, "GetCallerAppletIdentityInfoStack"}, |
| 1573 | {18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"}, | 1574 | {18, nullptr, "GetNextReturnDestinationAppletIdentityInfo"}, |
| 1574 | {19, nullptr, "GetDesirableKeyboardLayout"}, | 1575 | {19, &ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout, "GetDesirableKeyboardLayout"}, |
| 1575 | {20, nullptr, "PopExtraStorage"}, | 1576 | {20, nullptr, "PopExtraStorage"}, |
| 1576 | {25, nullptr, "GetPopExtraStorageEvent"}, | 1577 | {25, nullptr, "GetPopExtraStorageEvent"}, |
| 1577 | {30, nullptr, "UnpopInData"}, | 1578 | {30, nullptr, "UnpopInData"}, |
| @@ -1590,7 +1591,7 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_) | |||
| 1590 | {120, nullptr, "GetLaunchStorageInfoForDebug"}, | 1591 | {120, nullptr, "GetLaunchStorageInfoForDebug"}, |
| 1591 | {130, nullptr, "GetGpuErrorDetectedSystemEvent"}, | 1592 | {130, nullptr, "GetGpuErrorDetectedSystemEvent"}, |
| 1592 | {140, nullptr, "SetApplicationMemoryReservation"}, | 1593 | {140, nullptr, "SetApplicationMemoryReservation"}, |
| 1593 | {150, nullptr, "ShouldSetGpuTimeSliceManually"}, | 1594 | {150, &ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually, "ShouldSetGpuTimeSliceManually"}, |
| 1594 | }; | 1595 | }; |
| 1595 | // clang-format on | 1596 | // clang-format on |
| 1596 | RegisterHandlers(functions); | 1597 | RegisterHandlers(functions); |
| @@ -1605,6 +1606,9 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_) | |||
| 1605 | case Applets::AppletId::PhotoViewer: | 1606 | case Applets::AppletId::PhotoViewer: |
| 1606 | PushInShowAlbum(); | 1607 | PushInShowAlbum(); |
| 1607 | break; | 1608 | break; |
| 1609 | case Applets::AppletId::SoftwareKeyboard: | ||
| 1610 | PushInShowSoftwareKeyboard(); | ||
| 1611 | break; | ||
| 1608 | default: | 1612 | default: |
| 1609 | break; | 1613 | break; |
| 1610 | } | 1614 | } |
| @@ -1681,6 +1685,14 @@ void ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo(HLERequestContext& | |||
| 1681 | rb.PushRaw(applet_info); | 1685 | rb.PushRaw(applet_info); |
| 1682 | } | 1686 | } |
| 1683 | 1687 | ||
| 1688 | void ILibraryAppletSelfAccessor::GetDesirableKeyboardLayout(HLERequestContext& ctx) { | ||
| 1689 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 1690 | |||
| 1691 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 1692 | rb.Push(ResultSuccess); | ||
| 1693 | rb.Push<u32>(0); | ||
| 1694 | } | ||
| 1695 | |||
| 1684 | void ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(HLERequestContext& ctx) { | 1696 | void ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(HLERequestContext& ctx) { |
| 1685 | const Service::Account::ProfileManager manager{}; | 1697 | const Service::Account::ProfileManager manager{}; |
| 1686 | bool is_empty{true}; | 1698 | bool is_empty{true}; |
| @@ -1700,6 +1712,14 @@ void ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers(HLERequestContext& | |||
| 1700 | rb.Push(user_count); | 1712 | rb.Push(user_count); |
| 1701 | } | 1713 | } |
| 1702 | 1714 | ||
| 1715 | void ILibraryAppletSelfAccessor::ShouldSetGpuTimeSliceManually(HLERequestContext& ctx) { | ||
| 1716 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 1717 | |||
| 1718 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1719 | rb.Push(ResultSuccess); | ||
| 1720 | rb.Push<u8>(0); | ||
| 1721 | } | ||
| 1722 | |||
| 1703 | void ILibraryAppletSelfAccessor::PushInShowAlbum() { | 1723 | void ILibraryAppletSelfAccessor::PushInShowAlbum() { |
| 1704 | const Applets::CommonArguments arguments{ | 1724 | const Applets::CommonArguments arguments{ |
| 1705 | .arguments_version = Applets::CommonArgumentVersion::Version3, | 1725 | .arguments_version = Applets::CommonArgumentVersion::Version3, |
| @@ -1768,6 +1788,61 @@ void ILibraryAppletSelfAccessor::PushInShowMiiEditData() { | |||
| 1768 | queue_data.emplace_back(std::move(argument_data)); | 1788 | queue_data.emplace_back(std::move(argument_data)); |
| 1769 | } | 1789 | } |
| 1770 | 1790 | ||
| 1791 | void ILibraryAppletSelfAccessor::PushInShowSoftwareKeyboard() { | ||
| 1792 | const Applets::CommonArguments arguments{ | ||
| 1793 | .arguments_version = Applets::CommonArgumentVersion::Version3, | ||
| 1794 | .size = Applets::CommonArgumentSize::Version3, | ||
| 1795 | .library_version = static_cast<u32>(Applets::SwkbdAppletVersion::Version524301), | ||
| 1796 | .theme_color = Applets::ThemeColor::BasicBlack, | ||
| 1797 | .play_startup_sound = true, | ||
| 1798 | .system_tick = system.CoreTiming().GetClockTicks(), | ||
| 1799 | }; | ||
| 1800 | |||
| 1801 | std::vector<char16_t> initial_string(0); | ||
| 1802 | |||
| 1803 | const Applets::SwkbdConfigCommon swkbd_config{ | ||
| 1804 | .type = Applets::SwkbdType::Qwerty, | ||
| 1805 | .ok_text{}, | ||
| 1806 | .left_optional_symbol_key{}, | ||
| 1807 | .right_optional_symbol_key{}, | ||
| 1808 | .use_prediction = false, | ||
| 1809 | .key_disable_flags{}, | ||
| 1810 | .initial_cursor_position = Applets::SwkbdInitialCursorPosition::Start, | ||
| 1811 | .header_text{}, | ||
| 1812 | .sub_text{}, | ||
| 1813 | .guide_text{}, | ||
| 1814 | .max_text_length = 500, | ||
| 1815 | .min_text_length = 0, | ||
| 1816 | .password_mode = Applets::SwkbdPasswordMode::Disabled, | ||
| 1817 | .text_draw_type = Applets::SwkbdTextDrawType::Box, | ||
| 1818 | .enable_return_button = true, | ||
| 1819 | .use_utf8 = false, | ||
| 1820 | .use_blur_background = true, | ||
| 1821 | .initial_string_offset{}, | ||
| 1822 | .initial_string_length = static_cast<u32>(initial_string.size()), | ||
| 1823 | .user_dictionary_offset{}, | ||
| 1824 | .user_dictionary_entries{}, | ||
| 1825 | .use_text_check = false, | ||
| 1826 | }; | ||
| 1827 | |||
| 1828 | Applets::SwkbdConfigNew swkbd_config_new{}; | ||
| 1829 | |||
| 1830 | std::vector<u8> argument_data(sizeof(arguments)); | ||
| 1831 | std::vector<u8> swkbd_data(sizeof(swkbd_config) + sizeof(swkbd_config_new)); | ||
| 1832 | std::vector<u8> work_buffer(swkbd_config.initial_string_length * sizeof(char16_t)); | ||
| 1833 | |||
| 1834 | std::memcpy(argument_data.data(), &arguments, sizeof(arguments)); | ||
| 1835 | std::memcpy(swkbd_data.data(), &swkbd_config, sizeof(swkbd_config)); | ||
| 1836 | std::memcpy(swkbd_data.data() + sizeof(swkbd_config), &swkbd_config_new, | ||
| 1837 | sizeof(Applets::SwkbdConfigNew)); | ||
| 1838 | std::memcpy(work_buffer.data(), initial_string.data(), | ||
| 1839 | swkbd_config.initial_string_length * sizeof(char16_t)); | ||
| 1840 | |||
| 1841 | queue_data.emplace_back(std::move(argument_data)); | ||
| 1842 | queue_data.emplace_back(std::move(swkbd_data)); | ||
| 1843 | queue_data.emplace_back(std::move(work_buffer)); | ||
| 1844 | } | ||
| 1845 | |||
| 1771 | IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_) | 1846 | IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_) |
| 1772 | : ServiceFramework{system_, "IAppletCommonFunctions"} { | 1847 | : ServiceFramework{system_, "IAppletCommonFunctions"} { |
| 1773 | // clang-format off | 1848 | // clang-format off |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 64b3f3fe2..8f8cb8a9e 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -347,11 +347,14 @@ private: | |||
| 347 | void GetLibraryAppletInfo(HLERequestContext& ctx); | 347 | void GetLibraryAppletInfo(HLERequestContext& ctx); |
| 348 | void ExitProcessAndReturn(HLERequestContext& ctx); | 348 | void ExitProcessAndReturn(HLERequestContext& ctx); |
| 349 | void GetCallerAppletIdentityInfo(HLERequestContext& ctx); | 349 | void GetCallerAppletIdentityInfo(HLERequestContext& ctx); |
| 350 | void GetDesirableKeyboardLayout(HLERequestContext& ctx); | ||
| 350 | void GetMainAppletAvailableUsers(HLERequestContext& ctx); | 351 | void GetMainAppletAvailableUsers(HLERequestContext& ctx); |
| 352 | void ShouldSetGpuTimeSliceManually(HLERequestContext& ctx); | ||
| 351 | 353 | ||
| 352 | void PushInShowAlbum(); | 354 | void PushInShowAlbum(); |
| 353 | void PushInShowCabinetData(); | 355 | void PushInShowCabinetData(); |
| 354 | void PushInShowMiiEditData(); | 356 | void PushInShowMiiEditData(); |
| 357 | void PushInShowSoftwareKeyboard(); | ||
| 355 | 358 | ||
| 356 | std::deque<std::vector<u8>> queue_data; | 359 | std::deque<std::vector<u8>> queue_data; |
| 357 | }; | 360 | }; |