From 63160a22a6fa1bd5fd619b8e8b078b721688e333 Mon Sep 17 00:00:00 2001 From: Aurora Date: Sun, 11 Sep 2016 18:42:59 +0200 Subject: [PATCH] Hide N3DS CPU setting on O3DS --- source/config.c | 17 +++++++++++------ source/config.h | 6 +++++- source/patches.h | 2 -- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/source/config.c b/source/config.c index 0c049d0d..900bc932 100644 --- a/source/config.c +++ b/source/config.c @@ -130,9 +130,12 @@ void configMenu(bool oldPinStatus) //Display all the multiple choice options in white for(u32 i = 0; i < multiOptionsAmount; i++) { - multiOptions[i].posY = endPos + SPACING_Y; - endPos = drawString(multiOptionsText[i], 10, multiOptions[i].posY, COLOR_WHITE); - drawCharacter(selected, 10 + multiOptions[i].posXs[multiOptions[i].enabled] * SPACING_X, multiOptions[i].posY, COLOR_WHITE); + if(!(i == CONFIG_NEWCPUINDEX && !isN3DS)) + { + multiOptions[i].posY = endPos + SPACING_Y; + endPos = drawString(multiOptionsText[i], 10, multiOptions[i].posY, COLOR_WHITE); + drawCharacter(selected, 10 + multiOptions[i].posXs[multiOptions[i].enabled] * SPACING_X, multiOptions[i].posY, COLOR_WHITE); + } } endPos += SPACING_Y / 2; @@ -166,10 +169,12 @@ void configMenu(bool oldPinStatus) switch(pressed) { case BUTTON_UP: - selectedOption = !selectedOption ? totalIndexes : selectedOption - 1; + if(!selectedOption) selectedOption = totalIndexes; + else selectedOption = (selectedOption == CONFIG_NEWCPUINDEX + 1 && !isN3DS) ? selectedOption - 2 : selectedOption - 1; break; case BUTTON_DOWN: - selectedOption = selectedOption == totalIndexes ? 0 : selectedOption + 1; + if(selectedOption == totalIndexes) selectedOption = 0; + else selectedOption = (selectedOption == CONFIG_NEWCPUINDEX - 1 && !isN3DS) ? selectedOption + 2 : selectedOption + 1; break; case BUTTON_LEFT: selectedOption = 0; @@ -213,7 +218,7 @@ void configMenu(bool oldPinStatus) drawCharacter(selected, 10 + multiOptions[selectedOption].posXs[oldEnabled] * SPACING_X, multiOptions[selectedOption].posY, COLOR_BLACK); multiOptions[selectedOption].enabled = (oldEnabled == 3 || !multiOptions[selectedOption].posXs[oldEnabled + 1]) ? 0 : oldEnabled + 1; - if(selectedOption == 1) updateBrightness(multiOptions[1].enabled); + if(selectedOption == CONFIG_BRIGHTNESSINDEX) updateBrightness(multiOptions[CONFIG_BRIGHTNESSINDEX].enabled); } else { diff --git a/source/config.h b/source/config.h index c57414bc..41388002 100644 --- a/source/config.h +++ b/source/config.h @@ -32,13 +32,16 @@ #define CONFIG_VERSIONMAJOR 1 #define CONFIG_VERSIONMINOR 3 +#define CONFIG_BRIGHTNESSINDEX 1 +#define CONFIG_NEWCPUINDEX 3 + #define BOOTCFG_NAND BOOTCONFIG(0, 7) #define BOOTCFG_FIRM BOOTCONFIG(3, 1) #define BOOTCFG_A9LH BOOTCONFIG(4, 1) #define BOOTCFG_NOFORCEFLAG BOOTCONFIG(5, 1) #define BOOTCFG_SAFEMODE BOOTCONFIG(6, 1) #define CONFIG_DEFAULTEMU MULTICONFIG(0) -#define CONFIG_BRIGHTNESS MULTICONFIG(1) +#define CONFIG_BRIGHTNESS MULTICONFIG(CONFIG_BRIGHTNESSINDEX) #define CONFIG_PIN MULTICONFIG(2) #define CONFIG_AUTOBOOTSYS CONFIG(0) #define CONFIG_USESYSFIRM CONFIG(1) @@ -66,6 +69,7 @@ typedef enum ConfigurationStatus } ConfigurationStatus; extern CfgData configData; +extern bool isN3DS; bool readConfig(void); void writeConfig(ConfigurationStatus needConfig, u32 configTemp); diff --git a/source/patches.h b/source/patches.h index 4f63d11c..42660ab4 100644 --- a/source/patches.h +++ b/source/patches.h @@ -51,8 +51,6 @@ typedef struct __attribute__((packed)) u32 config; } CFWInfo; -extern bool isN3DS; - #ifdef DEV extern bool isDevUnit; #endif