From 215f1bc8eea66f99a38516df6a2f25367d194c7b Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 5 Aug 2019 18:55:04 -0700 Subject: [PATCH] fatal: fix abort in viSetDisplayPowerState on < 3.0.0 --- stratosphere/fatal/source/fatal_task_screen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stratosphere/fatal/source/fatal_task_screen.cpp b/stratosphere/fatal/source/fatal_task_screen.cpp index cac98f22d..0b7c26ff8 100644 --- a/stratosphere/fatal/source/fatal_task_screen.cpp +++ b/stratosphere/fatal/source/fatal_task_screen.cpp @@ -101,7 +101,13 @@ namespace sts::fatal::srv { ON_SCOPE_EXIT { viCloseDisplay(&temp_display); }; /* Turn on the screen. */ - R_TRY(viSetDisplayPowerState(&temp_display, ViPowerState_On)); + if (GetRuntimeFirmwareVersion() >= FirmwareVersion_300) { + R_TRY(viSetDisplayPowerState(&temp_display, ViPowerState_On)); + } else { + /* Prior to 3.0.0, the ViPowerState enum was different (0 = Off, 1 = On). */ + /* In lieu of a ViPowerState_OnDeprecated entry, just send the correct value manually. */ + R_TRY(viSetDisplayPowerState(&temp_display, static_cast(1))); + } /* Set alpha to 1.0f. */ R_TRY(viSetDisplayAlpha(&temp_display, 1.0f));