From 09fc4926105a0bf47df88659b9189f018fc05f8b Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Sun, 23 Jan 2022 00:40:08 +0100 Subject: [PATCH] Step 5: Scare the init bugs away Seriously though why the fuck was this the issue --- source/config.c | 39 -------------------------------------- source/config.h | 24 ++--------------------- source/fs/menus/filemenu.c | 2 -- source/main.c | 11 +++++++---- 4 files changed, 9 insertions(+), 67 deletions(-) delete mode 100644 source/config.c diff --git a/source/config.c b/source/config.c deleted file mode 100644 index f3a2b3d..0000000 --- a/source/config.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018-2020 CTCaer - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include - -#include "config.h" -#include - -extern hekate_config h_cfg; - -void set_default_configuration() -{ - h_cfg.autoboot = 0; - h_cfg.autoboot_list = 0; - h_cfg.bootwait = 3; - h_cfg.backlight = 100; - h_cfg.autohosoff = 0; - h_cfg.autonogc = 1; - h_cfg.updater2p = 0; - h_cfg.bootprotect = 0; - h_cfg.errors = 0; - h_cfg.rcm_patched = fuse_check_patched_rcm(); - h_cfg.emummc_force_disable = false; - h_cfg.t210b01 = hw_get_chip_id() == GP_HIDREV_MAJOR_T210B01; -} diff --git a/source/config.h b/source/config.h index a90e458..6c59b27 100644 --- a/source/config.h +++ b/source/config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 CTCaer + * Copyright (c) 2018-2021 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -17,35 +17,15 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ -#include +#include typedef struct _hekate_config { - // Non-volatile config. - u32 autoboot; - u32 autoboot_list; - u32 bootwait; - u32 backlight; - u32 autohosoff; - u32 autonogc; - u32 updater2p; - u32 bootprotect; // Global temporary config. bool t210b01; - bool se_keygen_done; - bool sept_run; - bool aes_slots_new; bool emummc_force_disable; bool rcm_patched; u32 errors; } hekate_config; -void set_default_configuration(); -int create_config_entry(); -void config_autoboot(); -void config_bootdelay(); -void config_backlight(); -void config_auto_hos_poweroff(); -void config_nogc(); - #endif /* _CONFIG_H_ */ diff --git a/source/fs/menus/filemenu.c b/source/fs/menus/filemenu.c index bd08f0e..4e463b0 100644 --- a/source/fs/menus/filemenu.c +++ b/source/fs/menus/filemenu.c @@ -71,7 +71,6 @@ void DeleteFile(char *path, FSEntry_t entry){ } void RunScriptString(char *str, u32 size){ - return; TConf.scriptCWD = "sd:/"; gfx_clearscreen(); ParserRet_t ret = parseScript(str, size); @@ -86,7 +85,6 @@ void RunScriptString(char *str, u32 size){ } void RunScript(char *path, FSEntry_t entry){ - return; char *thing = CombinePaths(path, entry.name); u32 size; char *script = sd_file_read(thing, &size); diff --git a/source/main.c b/source/main.c index e27284e..e238885 100644 --- a/source/main.c +++ b/source/main.c @@ -221,8 +221,13 @@ void ipl_main() uart_wait_idle(DEBUG_UART_PORT, UART_TX_IDLE); #endif - // Set bootloader's default configuration. - set_default_configuration(); + // Set hekate's default configuration + h_cfg.errors = 0; + h_cfg.rcm_patched = fuse_check_patched_rcm(); + h_cfg.emummc_force_disable = false; + h_cfg.t210b01 = !!(hw_get_chip_id() == GP_HIDREV_MAJOR_T210B01); + + display_init(); // Mount SD Card. h_cfg.errors |= !sd_mount() ? ERR_SD_BOOT_EN : 0; @@ -235,8 +240,6 @@ void ipl_main() h_cfg.errors |= ERR_LIBSYS_MTC; minerva_change_freq(FREQ_1600); - display_init(); - u32 *fb = display_init_framebuffer_pitch(); gfx_init_ctxt(fb, 720, 1280, 720);