From 93561003e82950472362e9d8b5039fd44eceb07e Mon Sep 17 00:00:00 2001 From: Mikaela RJ Szekely Date: Thu, 28 Dec 2017 21:50:06 -0500 Subject: [PATCH] Implement #989: Add configurable splash duration --- k11_extension/include/config.h | 1 + source/config.c | 7 +++++++ source/config.h | 3 ++- source/draw.c | 5 ++++- sysmodules/loader/source/patcher.h | 1 + 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/k11_extension/include/config.h b/k11_extension/include/config.h index e1c6392..5193cc2 100644 --- a/k11_extension/include/config.h +++ b/k11_extension/include/config.h @@ -19,6 +19,7 @@ enum multiOptions DEFAULTEMU = 0, BRIGHTNESS, SPLASH, + SPLASH_DURATION, PIN, NEWCPU }; diff --git a/source/config.c b/source/config.c index 58262da..e6abadb 100644 --- a/source/config.c +++ b/source/config.c @@ -81,6 +81,7 @@ void configMenu(bool oldPinStatus, u32 oldPinMode) static const char *multiOptionsText[] = { "Default EmuNAND: 1( ) 2( ) 3( ) 4( )", "Screen brightness: 4( ) 3( ) 2( ) 1( )", "Splash: Off( ) Before( ) After( ) payloads", + "Splash duration 1( ) 3( ) 5( ) 7( ) seconds", "PIN lock: Off( ) 4( ) 6( ) 8( ) digits", "New 3DS CPU: Off( ) Clock( ) L2( ) Clock+L2( )", }; @@ -109,6 +110,11 @@ void configMenu(bool oldPinStatus, u32 oldPinMode) "\t* 'After payloads' displays it\n" "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" "The PIN will be asked each time\n" "Luma3DS boots.\n\n" @@ -198,6 +204,7 @@ void configMenu(bool oldPinStatus, u32 oldPinMode) { .posXs = {19, 24, 29, 34}, .visible = isSdMode }, { .posXs = {21, 26, 31, 36}, .visible = true }, { .posXs = {12, 22, 31, 0}, .visible = true }, + { .posXs = {18, 23, 28, 33}, .visible = true }, { .posXs = {14, 19, 24, 29}, .visible = true }, { .posXs = {17, 26, 32, 44}, .visible = ISN3DS }, }; diff --git a/source/config.h b/source/config.h index dfcb5d7..ebd14cd 100644 --- a/source/config.h +++ b/source/config.h @@ -34,7 +34,7 @@ #define CONFIG_FILE "config.bin" #define CONFIG_VERSIONMAJOR 2 -#define CONFIG_VERSIONMINOR 2 +#define CONFIG_VERSIONMINOR 3 #define BOOTCFG_NAND BOOTCONFIG(0, 7) #define BOOTCFG_FIRM BOOTCONFIG(3, 7) @@ -46,6 +46,7 @@ enum multiOptions DEFAULTEMU = 0, BRIGHTNESS, SPLASH, + SPLASH_DURATION, PIN, NEWCPU }; diff --git a/source/draw.c b/source/draw.c index 485a821..76d7334 100644 --- a/source/draw.c +++ b/source/draw.c @@ -36,6 +36,7 @@ #include "fs.h" #include "fmt.h" #include "font.h" +#include "config.h" bool loadSplash(void) { @@ -56,7 +57,9 @@ bool loadSplash(void) if(!isTopSplashValid && !isBottomSplashValid) return false; swapFramebuffers(true); - wait(3000ULL); + + u32 durationIndex = MULTICONFIG(SPLASH_DURATION); + wait(1000ULL + (durationIndex * 2000ULL)); return true; } diff --git a/sysmodules/loader/source/patcher.h b/sysmodules/loader/source/patcher.h index a4e4ee9..e2eebd7 100644 --- a/sysmodules/loader/source/patcher.h +++ b/sysmodules/loader/source/patcher.h @@ -21,6 +21,7 @@ enum multiOptions DEFAULTEMU = 0, BRIGHTNESS, SPLASH, + SPLASH_DURATION, PIN, NEWCPU };