Skip to content

Commit

Permalink
libnx: use stock clock for swkbd
Browse files Browse the repository at this point in the history
  • Loading branch information
natinusala committed Jan 14, 2019
1 parent 5c09cf2 commit ea027c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions menu/widgets/menu_input_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#ifdef HAVE_LIBNX
#include <switch.h>
#include "../../switch_performance_profiles.h"
#include "menu_osk.h"
#endif

Expand Down Expand Up @@ -92,6 +93,7 @@ unsigned menu_input_dialog_get_kb_idx(void)
#ifdef HAVE_LIBNX
#define LIBNX_SWKBD_LIMIT 500 /* enforced by HOS */
extern u32 __nx_applet_type;
extern void libnx_apply_overclock();
#endif

bool menu_input_dialog_get_display_kb(void)
Expand All @@ -106,6 +108,8 @@ bool menu_input_dialog_get_display_kb(void)

SwkbdConfig kbd;

pcvSetClockRate(PcvModule_Cpu, SWITCH_CPU_SPEEDS_VALUES[SWITCH_DEFAULT_CPU_PROFILE]);

Result rc = swkbdCreate(&kbd, 0);

if (R_SUCCEEDED(rc))
Expand Down Expand Up @@ -145,10 +149,14 @@ bool menu_input_dialog_get_display_kb(void)
if (menu_input_dialog_keyboard_display)
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);

libnx_apply_overclock();
return false;
}
else
{
libnx_apply_overclock();
return menu_input_dialog_keyboard_display;
}
#endif
return menu_input_dialog_keyboard_display;
}
Expand Down

0 comments on commit ea027c0

Please sign in to comment.