diff --git a/troposphere/daybreak/source/main.cpp b/troposphere/daybreak/source/main.cpp
index ba7656873..268808366 100644
--- a/troposphere/daybreak/source/main.cpp
+++ b/troposphere/daybreak/source/main.cpp
@@ -26,10 +26,6 @@ extern "C" {
void userAppInit(void) {
Result rc = 0;
- if (R_FAILED(rc = amssuInitialize())) {
- fatalThrow(rc);
- }
-
if (R_FAILED(rc = romfsInit())) {
fatalThrow(rc);
}
@@ -42,6 +38,10 @@ extern "C" {
fatalThrow(rc);
}
+ if (R_FAILED(rc = splInitialize())) {
+ fatalThrow(rc);
+ }
+
if (R_FAILED(rc = hiddbgInitialize())) {
fatalThrow(rc);
}
@@ -50,6 +50,7 @@ extern "C" {
void userAppExit(void) {
hiddbgExit();
+ splExit();
plExit();
spsmExit();
romfsExit();
diff --git a/troposphere/daybreak/source/ui.cpp b/troposphere/daybreak/source/ui.cpp
index d055efbaf..71ee72e74 100644
--- a/troposphere/daybreak/source/ui.cpp
+++ b/troposphere/daybreak/source/ui.cpp
@@ -26,6 +26,10 @@ namespace dbk {
namespace {
+ static constexpr u32 ExosphereApiVersionConfigItem = 65000;
+ static constexpr u32 ExosphereHasRcmBugPatch = 65004;
+ static constexpr u32 ExosphereEmummcType = 65007;
+
u32 g_screen_width;
u32 g_screen_height;
@@ -313,6 +317,132 @@ 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;
+
+ /* Copy the input text. */
+ strncpy(m_text, text, sizeof(m_text)-1);
+ strncpy(m_subtext, subtext, sizeof(m_subtext)-1);
+
+ /* Copy result text if there is a result. */
+ if (R_FAILED(rc)) {
+ snprintf(m_result_text, sizeof(m_result_text)-1, "Result: 0x%08x", rc);
+ }
+
+ const float button_y = y + TitleGap + SubTextHeight + VerticalGap + (R_FAILED(m_rc) ? SubTextHeight : 0.0f);
+ this->AddButton(ExitButtonId, "Exit", x + HorizontalGap, button_y, ButtonWidth, ButtonHeight);
+ this->SetButtonSelected(ExitButtonId, true);
+ }
+
+ void ErrorMenu::Update(u64 ns) {
+ u64 k_down = hidKeysDown(CONTROLLER_P1_AUTO);
+
+ /* Go back if B is pressed. */
+ if (k_down & KEY_B) {
+ g_exit_requested = true;
+ return;
+ }
+
+ /* Take action if a button has been activated. */
+ if (const Button *activated_button = this->GetActivatedButton(); activated_button != nullptr) {
+ switch (activated_button->id) {
+ case ExitButtonId:
+ g_exit_requested = true;
+ break;
+ }
+ }
+
+ this->UpdateButtons();
+
+ /* Fallback on selecting the exfat button. */
+ if (const Button *selected_button = this->GetSelectedButton(); k_down && selected_button == nullptr) {
+ this->SetButtonSelected(ExitButtonId, true);
+ }
+ }
+
+ void ErrorMenu::Draw(NVGcontext *vg, u64 ns) {
+ 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;
+
+ DrawWindow(vg, m_text, x, y, WindowWidth, window_height);
+ DrawText(vg, x + HorizontalGap, y + TitleGap, WindowWidth - HorizontalGap * 2.0f, m_subtext);
+
+ /* Draw the result if there is one. */
+ if (R_FAILED(m_rc)) {
+ DrawText(vg, x + HorizontalGap, y + TitleGap + SubTextHeight, WindowWidth - HorizontalGap * 2.0f, m_result_text);
+ }
+
+ this->DrawButtons(vg, ns);
+ }
+
+ WarningMenu::WarningMenu(std::shared_ptr