From 83a849126a92cfb31f02779fb164397ccf3beebc Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 15 Aug 2016 13:23:27 +0200 Subject: [PATCH] Move stuff from firm.c (2) --- source/config.c | 3 ++- source/firm.c | 26 +++++++++++--------------- source/pin.c | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/source/config.c b/source/config.c index 6949b7e..f544a84 100644 --- a/source/config.c +++ b/source/config.c @@ -29,7 +29,8 @@ void configureCFW(const char *configPath) { - clearScreens(); + initScreens(); + drawString(CONFIG_TITLE, 10, 10, COLOR_TITLE); drawString("Press A to select, START to save", 10, 30, COLOR_WHITE); diff --git a/source/firm.c b/source/firm.c index fa619f3..f13de09 100755 --- a/source/firm.c +++ b/source/firm.c @@ -133,26 +133,22 @@ void main(void) //Boot options aren't being forced if(needConfig != DONT_CONFIGURE) { + bool pinExists = CONFIG(7) && readPin(&pin); + + //If we get here we should check the PIN (if it exists) in all cases + if(pinExists) verifyPin(&pin, true); + //If no configuration file exists or SELECT is held, load configuration menu - bool shouldLoadConfigurationMenu = needConfig == CREATE_CONFIGURATION || ((pressed & BUTTON_SELECT) && !(pressed & BUTTON_L1)), - pinExists = CONFIG(7) && readPin(&pin); + bool shouldLoadConfigurationMenu = needConfig == CREATE_CONFIGURATION || ((pressed & BUTTON_SELECT) && !(pressed & BUTTON_L1)); - if(pinExists || shouldLoadConfigurationMenu) + if(shouldLoadConfigurationMenu) { - initScreens(); + configureCFW(configPath); - //If we get here we should check the PIN (if it exists) in all cases - if(pinExists) verifyPin(&pin, true); + if(!pinExists && CONFIG(7)) pin = newPin(); - if(shouldLoadConfigurationMenu) - { - configureCFW(configPath); - - if(!pinExists && CONFIG(7)) pin = newPin(); - - //Update pressed buttons - pressed = HID_PAD; - } + //Update pressed buttons + pressed = HID_PAD; } if(isA9lh && !CFG_BOOTENV && pressed == SAFE_MODE) diff --git a/source/pin.c b/source/pin.c index 772afa4..d228a4f 100644 --- a/source/pin.c +++ b/source/pin.c @@ -113,7 +113,7 @@ PINData newPin(void) void verifyPin(PINData *in, bool allowQuit) { - clearScreens(); + initScreens(); drawString("Press START to shutdown or enter pin to proceed.", 10, 10, COLOR_WHITE); drawString("Pin: ", 10, 10 + 2 * SPACING_Y, COLOR_WHITE);