Various bugfixes

This commit is contained in:
ctcaer@gmail.com
2019-06-30 03:15:46 +03:00
parent c5ab4d6abd
commit 8101fd3f7f
23 changed files with 189 additions and 186 deletions

View File

@@ -28,8 +28,8 @@
#include "../utils/util.h"
extern hekate_config h_cfg;
extern int sd_mount();
extern int sd_unmount();
extern bool sd_mount();
extern void sd_unmount();
void set_default_configuration()
{
@@ -41,8 +41,8 @@ void set_default_configuration()
h_cfg.sbar_time_keeping = 0;
h_cfg.backlight = 100;
h_cfg.autohosoff = 0;
h_cfg.errors = 0;
h_cfg.autonogc = 1;
h_cfg.errors = 0;
h_cfg.sept_run = EMC(EMC_SCRATCH0) & EMC_SEPT_RUN;
h_cfg.rcm_patched = true;
h_cfg.sd_timeoff = 0;
@@ -154,6 +154,9 @@ int create_config_entry()
return 0;
}
#pragma GCC push_options
#pragma GCC optimize ("Os")
static void _save_config()
{
gfx_clear_grey(0x1B);
@@ -455,10 +458,10 @@ void config_verification()
ments[1].type = MENT_CHGLINE;
memcpy(vr_text, " None (Fastest - Unsafe)", 35);
memcpy(vr_text + 64, " Sparse (Fast - Safe)", 33);
memcpy(vr_text + 128, " Full (Slow - Safer)", 34);
memcpy(vr_text + 192, " Full w/ hashfiles (Slow - Safest)", 35);
memcpy(vr_text, " Disable (Fastest - Unsafe)", 28);
memcpy(vr_text + 64, " Sparse (Fast - Safe)", 23);
memcpy(vr_text + 128, " Full (Slow - Safe)", 23);
memcpy(vr_text + 192, " Full (w/ hashfile)", 23);
for (u32 i = 0; i < 4; i++)
{
@@ -652,3 +655,5 @@ void config_nogc()
return;
btn_wait();
}
#pragma GCC pop_options

View File

@@ -26,9 +26,18 @@ static char *_strdup(char *str)
{
if (!str)
return NULL;
// Remove starting space.
if (str[0] == ' ' && strlen(str))
str++;
char *res = (char *)malloc(strlen(str) + 1);
strcpy(res, str);
// Remove trailing space.
if (res[strlen(res) - 1] == ' ' && strlen(res))
res[strlen(res) - 1] = 0;
return res;
}