diff --git a/troposphere/daybreak/source/ui.cpp b/troposphere/daybreak/source/ui.cpp
index dfbd4151e..e7e726f27 100644
--- a/troposphere/daybreak/source/ui.cpp
+++ b/troposphere/daybreak/source/ui.cpp
@@ -43,7 +43,6 @@ namespace dbk {
static constexpr float VerticalGap = 10.0f;
-
u32 g_screen_width;
u32 g_screen_height;
@@ -51,8 +50,10 @@ namespace dbk {
bool g_initialized = false;
bool g_exit_requested = false;
+ PadState g_pad;
+
u32 g_prev_touch_count = -1;
- touchPosition g_start_touch_position;
+ HidTouchScreenState g_start_touch;
bool g_started_touching = false;
bool g_tapping = false;
bool g_touches_moving = false;
@@ -67,15 +68,14 @@ namespace dbk {
constexpr u32 MaxTapMovement = 20;
void UpdateInput() {
- /* Update the previous touch count. */
- g_prev_touch_count = hidTouchCount();
-
/* Scan for input and update touch state. */
- hidScanInput();
- const u32 touch_count = hidTouchCount();
+ padUpdate(&g_pad);
+ HidTouchScreenState current_touch;
+ hidGetTouchScreenStates(¤t_touch, 1);
+ const u32 touch_count = current_touch.count;
if (g_prev_touch_count == 0 && touch_count > 0) {
- hidTouchRead(&g_start_touch_position, 0);
+ hidGetTouchScreenStates(&g_start_touch, 1);
g_started_touching = true;
g_tapping = true;
} else {
@@ -91,10 +91,7 @@ namespace dbk {
/* Check if currently moving. */
if (g_prev_touch_count > 0 && touch_count > 0) {
- touchPosition current_touch_position;
- hidTouchRead(¤t_touch_position, 0);
-
- if ((abs(current_touch_position.px - g_start_touch_position.px) > MaxTapMovement || abs(current_touch_position.py - g_start_touch_position.py) > MaxTapMovement)) {
+ if ((abs(current_touch.touches[0].x - g_start_touch.touches[0].x) > MaxTapMovement || abs(current_touch.touches[0].y - g_start_touch.touches[0].y) > MaxTapMovement)) {
g_touches_moving = true;
g_tapping = false;
} else {
@@ -103,6 +100,9 @@ namespace dbk {
} else {
g_touches_moving = false;
}
+
+ /* Update the previous touch count. */
+ g_prev_touch_count = current_touch.count;
}
void ChangeMenu(std::shared_ptr