diff --git a/troposphere/daybreak/source/main.cpp b/troposphere/daybreak/source/main.cpp
index 268808366..0eb1d04bc 100644
--- a/troposphere/daybreak/source/main.cpp
+++ b/troposphere/daybreak/source/main.cpp
@@ -42,6 +42,10 @@ extern "C" {
fatalThrow(rc);
}
+ if (R_FAILED(rc = nsInitialize())) {
+ fatalThrow(rc);
+ }
+
if (R_FAILED(rc = hiddbgInitialize())) {
fatalThrow(rc);
}
@@ -50,6 +54,7 @@ extern "C" {
void userAppExit(void) {
hiddbgExit();
+ nsExit();
splExit();
plExit();
spsmExit();
diff --git a/troposphere/daybreak/source/ui.cpp b/troposphere/daybreak/source/ui.cpp
index 03fd6a7ca..12306a68a 100644
--- a/troposphere/daybreak/source/ui.cpp
+++ b/troposphere/daybreak/source/ui.cpp
@@ -30,6 +30,20 @@ namespace dbk {
static constexpr u32 ExosphereHasRcmBugPatch = 65004;
static constexpr u32 ExosphereEmummcType = 65007;
+ /* Insets of content within windows. */
+ static constexpr float HorizontalInset = 20.0f;
+ static constexpr float BottomInset = 20.0f;
+
+ /* Insets of content within text areas. */
+ static constexpr float TextHorizontalInset = 8.0f;
+ static constexpr float TextVerticalInset = 8.0f;
+
+ static constexpr float ButtonHeight = 60.0f;
+ static constexpr float ButtonHorizontalGap = 10.0f;
+
+ static constexpr float VerticalGap = 10.0f;
+
+
u32 g_screen_width;
u32 g_screen_height;
@@ -46,6 +60,8 @@ namespace dbk {
/* Update install state. */
char g_update_path[FS_MAX_PATH];
+ bool g_reset_to_factory = false;
+ bool g_exfat_supported = false;
bool g_use_exfat = false;
constexpr u32 MaxTapMovement = 20;
@@ -306,7 +322,7 @@ namespace dbk {
char tmp[0x100];
va_list args;
va_start(args, format);
- vsnprintf(tmp, sizeof(tmp)-1, format, args);
+ vsnprintf(tmp, sizeof(tmp), format, args);
va_end(args);
/* Append the text to the log buffer. */
@@ -317,22 +333,42 @@ namespace dbk {
return m_prev_menu;
}
- ErrorMenu::ErrorMenu(const char *text, const char *subtext, Result rc) : Menu(nullptr), m_text{}, m_subtext{}, m_result_text{}, m_rc(rc) {
- const float window_height = WindowHeight + (R_FAILED(m_rc) ? SubTextHeight : 0.0f);
- const float x = g_screen_width / 2.0f - WindowWidth / 2.0f;
- const float y = g_screen_height / 2.0f - window_height / 2.0f;
-
+ AlertMenu::AlertMenu(std::shared_ptr