Implement #989: Add configurable splash duration

This commit is contained in:
Mikaela RJ Szekely 2017-12-28 21:50:06 -05:00
parent 1572bfd989
commit 93561003e8
5 changed files with 15 additions and 2 deletions

View File

@ -19,6 +19,7 @@ enum multiOptions
DEFAULTEMU = 0, DEFAULTEMU = 0,
BRIGHTNESS, BRIGHTNESS,
SPLASH, SPLASH,
SPLASH_DURATION,
PIN, PIN,
NEWCPU NEWCPU
}; };

View File

@ -81,6 +81,7 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
static const char *multiOptionsText[] = { "Default EmuNAND: 1( ) 2( ) 3( ) 4( )", static const char *multiOptionsText[] = { "Default EmuNAND: 1( ) 2( ) 3( ) 4( )",
"Screen brightness: 4( ) 3( ) 2( ) 1( )", "Screen brightness: 4( ) 3( ) 2( ) 1( )",
"Splash: Off( ) Before( ) After( ) payloads", "Splash: Off( ) Before( ) After( ) payloads",
"Splash duration 1( ) 3( ) 5( ) 7( ) seconds",
"PIN lock: Off( ) 4( ) 6( ) 8( ) digits", "PIN lock: Off( ) 4( ) 6( ) 8( ) digits",
"New 3DS CPU: Off( ) Clock( ) L2( ) Clock+L2( )", "New 3DS CPU: Off( ) Clock( ) L2( ) Clock+L2( )",
}; };
@ -109,6 +110,11 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
"\t* 'After payloads' displays it\n" "\t* 'After payloads' displays it\n"
"afterwards.", "afterwards.",
"Select how long the splash screen\n"
"displays.\n\n"
"This has no effect if the splash\n"
"screen is not enabled.",
"Activate a PIN lock.\n\n" "Activate a PIN lock.\n\n"
"The PIN will be asked each time\n" "The PIN will be asked each time\n"
"Luma3DS boots.\n\n" "Luma3DS boots.\n\n"
@ -198,6 +204,7 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
{ .posXs = {19, 24, 29, 34}, .visible = isSdMode }, { .posXs = {19, 24, 29, 34}, .visible = isSdMode },
{ .posXs = {21, 26, 31, 36}, .visible = true }, { .posXs = {21, 26, 31, 36}, .visible = true },
{ .posXs = {12, 22, 31, 0}, .visible = true }, { .posXs = {12, 22, 31, 0}, .visible = true },
{ .posXs = {18, 23, 28, 33}, .visible = true },
{ .posXs = {14, 19, 24, 29}, .visible = true }, { .posXs = {14, 19, 24, 29}, .visible = true },
{ .posXs = {17, 26, 32, 44}, .visible = ISN3DS }, { .posXs = {17, 26, 32, 44}, .visible = ISN3DS },
}; };

View File

@ -34,7 +34,7 @@
#define CONFIG_FILE "config.bin" #define CONFIG_FILE "config.bin"
#define CONFIG_VERSIONMAJOR 2 #define CONFIG_VERSIONMAJOR 2
#define CONFIG_VERSIONMINOR 2 #define CONFIG_VERSIONMINOR 3
#define BOOTCFG_NAND BOOTCONFIG(0, 7) #define BOOTCFG_NAND BOOTCONFIG(0, 7)
#define BOOTCFG_FIRM BOOTCONFIG(3, 7) #define BOOTCFG_FIRM BOOTCONFIG(3, 7)
@ -46,6 +46,7 @@ enum multiOptions
DEFAULTEMU = 0, DEFAULTEMU = 0,
BRIGHTNESS, BRIGHTNESS,
SPLASH, SPLASH,
SPLASH_DURATION,
PIN, PIN,
NEWCPU NEWCPU
}; };

View File

@ -36,6 +36,7 @@
#include "fs.h" #include "fs.h"
#include "fmt.h" #include "fmt.h"
#include "font.h" #include "font.h"
#include "config.h"
bool loadSplash(void) bool loadSplash(void)
{ {
@ -56,7 +57,9 @@ bool loadSplash(void)
if(!isTopSplashValid && !isBottomSplashValid) return false; if(!isTopSplashValid && !isBottomSplashValid) return false;
swapFramebuffers(true); swapFramebuffers(true);
wait(3000ULL);
u32 durationIndex = MULTICONFIG(SPLASH_DURATION);
wait(1000ULL + (durationIndex * 2000ULL));
return true; return true;
} }

View File

@ -21,6 +21,7 @@ enum multiOptions
DEFAULTEMU = 0, DEFAULTEMU = 0,
BRIGHTNESS, BRIGHTNESS,
SPLASH, SPLASH,
SPLASH_DURATION,
PIN, PIN,
NEWCPU NEWCPU
}; };