Add pin hiding option

This commit is contained in:
John Kearney 2017-01-19 16:48:09 -05:00
parent 6e5987e3ca
commit 92cc989dc9
5 changed files with 14 additions and 7 deletions

View File

@ -83,7 +83,8 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
"( ) Enable game patching", "( ) Enable game patching",
"( ) Show NAND or user string in System Settings", "( ) Show NAND or user string in System Settings",
"( ) Show GBA boot screen in patched AGB_FIRM", "( ) Show GBA boot screen in patched AGB_FIRM",
"( ) Patch SVC/service/archive/ARM9 access" "( ) Patch SVC/service/archive/ARM9 access",
"( ) Hide Pin when entering"
}; };
const char *optionsDescription[] = { "Select the default EmuNAND.\n\n" const char *optionsDescription[] = { "Select the default EmuNAND.\n\n"
@ -190,6 +191,9 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
"9.3 and 10.4.\n\n" "9.3 and 10.4.\n\n"
"Only change this if you know what you\n" "Only change this if you know what you\n"
"are doing!", "are doing!",
"Hides the the input when entering pin\n"
"to unlock the 3DS"
}; };
struct multiOption { struct multiOption {
@ -218,6 +222,7 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
{ .visible = true }, { .visible = true },
{ .visible = true }, { .visible = true },
{ .visible = true }, { .visible = true },
{ .visible = true },
{ .visible = true } { .visible = true }
}; };

View File

@ -56,7 +56,8 @@ enum singleOptions
PATCHGAMES, PATCHGAMES,
PATCHVERSTRING, PATCHVERSTRING,
SHOWGBABOOT, SHOWGBABOOT,
PATCHACCESS PATCHACCESS,
HIDEPIN
}; };
typedef enum ConfigurationStatus typedef enum ConfigurationStatus

View File

@ -124,7 +124,8 @@ void main(void)
} }
u32 pinMode = MULTICONFIG(PIN); u32 pinMode = MULTICONFIG(PIN);
bool pinExists = pinMode != 0 && verifyPin(pinMode); bool hidePin = CONFIG(HIDEPIN);
bool pinExists = pinMode != 0 && verifyPin(pinMode, hidePin);
//If no configuration file exists or SELECT is held, load configuration menu //If no configuration file exists or SELECT is held, load configuration menu
bool shouldLoadConfigMenu = needConfig == CREATE_CONFIGURATION || ((pressed & (BUTTON_SELECT | BUTTON_L1)) == BUTTON_SELECT); bool shouldLoadConfigMenu = needConfig == CREATE_CONFIGURATION || ((pressed & (BUTTON_SELECT | BUTTON_L1)) == BUTTON_SELECT);

View File

@ -122,7 +122,7 @@ void newPin(bool allowSkipping, u32 pinMode)
error("Error writing the PIN file"); error("Error writing the PIN file");
} }
bool verifyPin(u32 pinMode) bool verifyPin(u32 pinMode, bool hidePin)
{ {
PinData pin; PinData pin;
@ -199,9 +199,9 @@ bool verifyPin(u32 pinMode)
//Add character to password //Add character to password
enteredPassword[cnt] = (u8)pinKeyToLetter(pressed); enteredPassword[cnt] = (u8)pinKeyToLetter(pressed);
//Visualize character on screen //Visualize character on screen
drawCharacter((char)enteredPassword[cnt], true, 10 + (16 + 2 * cnt) * SPACING_X, 10 + 3 * SPACING_Y, COLOR_WHITE); char display = hidePin ? '*' : (char)enteredPassword[cnt];
drawCharacter(display, true, 10 + (16 + 2 * cnt) * SPACING_X, 10 + 3 * SPACING_Y, COLOR_WHITE);
if(++cnt < lengthBlock[0]) continue; if(++cnt < lengthBlock[0]) continue;

View File

@ -33,4 +33,4 @@
#define PIN_VERSIONMINOR 3 #define PIN_VERSIONMINOR 3
void newPin(bool allowSkipping, u32 pinMode); void newPin(bool allowSkipping, u32 pinMode);
bool verifyPin(u32 pinMode); bool verifyPin(u32 pinMode, bool hidePin);