Currently requires rebooting to fully apply; largely waiting on libctr11, since refactoring will be largely made pointless when it is released.
// Pause for A key on each step.
#define OPTION_TRACE 7
-// Freed up options due to code changes.
-// 9, 10
-
// Dim background for readability.
#define OPTION_DIM_MODE 8
// Accent color in menus.
#define OPTION_ACCENT_COLOR 9
+// Screeninit brightness
+#define OPTION_BRIGHTNESS 10
+
// Enable L2 cache.
#define OPTION_LOADER_CPU_L2 11
int c = fmount();
+ if (c) {
+ // Failed to mount SD. Bomb out.
+ // TODO - What the hell does one even do in this situation?
+ // Spin until the card is available to mount, maybe?
+ abort("Failed to mount SD card.\n");
+ }
+
+ if (argc >= 1 && argc < 2) {
+ // Valid argc passed.
+ fprintf(stderr, "Chainloaded. Path: %s\n", argv[0]);
+ }
+
+ set_font(PATH_TERMFONT); // Read the font before all else.
+
+ load_config(); // Load configuration.
+
screen_mode(0); // Use RGBA8 mode.
clear_bg();
ctr_screen_enable_backlight(CTR_SCREEN_BOTH);
- set_font(PATH_TERMFONT);
-
install_interrupts(); // Get some free debug info.
- if (c) {
- // Failed to mount SD. Bomb out.
- abort("Failed to mount SD card.\n");
- }
-
- if (argc >= 1 && argc < 2) {
- // Valid argc passed.
- fprintf(stderr, "Chainloaded. Path: %s\n", argv[0]);
- }
-
- load_config(); // Load configuration.
-
if (CFG_BOOTENV == 7) {
fprintf(stderr, "Rebooted from AGB, disabling EmuNAND.\n");
config.options[OPTION_EMUNAND] = 0;
{ OPTION_ACCENT_COLOR, "Accent color", "Changes the accent color in menus.", ranged_val, 1, 7},
+ { OPTION_BRIGHTNESS, "Brightness", "Changes the screeninit brightness in menu. WIP, only takes effect on reboot (this will change.)", ranged_val, 0, 3},
+
// space
{ 0, "", "", not_option, 0, 0 },
// Patches.
memcpy(&(config.magic), CONFIG_MAGIC, 4);
config.config_ver = config_version;
config.options[OPTION_ACCENT_COLOR] = 2;
+ config.options[OPTION_BRIGHTNESS] = 3;
if (!(conf_handle = fopen(PATH_CONFIG, "w")))
abort("Failed to open config for write?\n");
if (PDN_GPU_CNT == 1)
screenInitAddress[2] = 0; // Do a full init.
- screenInitAddress[3] = 0xFF; // Brightness
+ // FIXME - God awful syntactical hack.
+ screenInitAddress[3] = ("\x40\x8F\xC0\xFF")[config.options[OPTION_BRIGHTNESS]];
+
screenInitAddress[4] = mode; // Mode
*a11_entry = (uint32_t)screenInitAddress;