implement settings for two new exosphere flags

This commit is contained in:
HookedBehemoth 2020-04-26 20:57:03 +02:00
parent a4c90aeff3
commit 81b6a3a6f1
4 changed files with 40 additions and 4 deletions

View file

@ -68,6 +68,8 @@ typedef struct _launch_ctxt_t
bool atmosphere;
bool exo_no_user_exceptions;
bool exo_user_pmu;
bool exo_blank_prodinfo;
bool exo_allow_writing_to_cal_sysmmc;
bool fss0_enable_experimental;
bool emuMMC;

View file

@ -211,6 +211,26 @@ static int _config_exo_user_pmu_access(launch_ctxt_t *ctxt, const char *value)
return 1;
}
static int _config_exo_blank_prodinfo(launch_ctxt_t *ctxt, const char *value)
{
if (*value == '1')
{
DPRINTF("Enabled prodinfo blanking\n");
ctxt->exo_blank_prodinfo = true;
}
return 1;
}
static int _config_exo_allow_cal_write(launch_ctxt_t *ctxt, const char *value)
{
if (*value == '1')
{
DPRINTF("Enabled writing to cal on sysMMC\n");
ctxt->exo_allow_writing_to_cal_sysmmc = true;
}
return 1;
}
static int _config_fss(launch_ctxt_t *ctxt, const char *value)
{
LIST_FOREACH_ENTRY(ini_kv_t, kv, &ctxt->cfg->kvs, link)
@ -243,6 +263,8 @@ static const cfg_handler_t _config_handlers[] = {
{ "atmosphere", _config_atmosphere },
{ "nouserexceptions", _config_dis_exo_user_exceptions },
{ "userpmu", _config_exo_user_pmu_access },
{ "blankprodinfo", _config_exo_blank_prodinfo },
{ "allowcalwrite", _config_exo_allow_cal_write },
{ "fss0", _config_fss },
{ NULL, NULL },
};

View file

@ -133,10 +133,12 @@ typedef struct _atm_fatal_error_ctx
// Exosphère mailbox defines.
#define EXO_CFG_ADDR 0x8000F000
#define EXO_MAGIC_VAL 0x304F5845
#define EXO_FLAG_DBG_PRIV (1 << 1)
#define EXO_FLAG_DBG_USER (1 << 2)
#define EXO_FLAG_NO_USER_EXC (1 << 3)
#define EXO_FLAG_USER_PMU (1 << 4)
#define EXO_FLAG_DBG_PRIV (1 << 1)
#define EXO_FLAG_DBG_USER (1 << 2)
#define EXO_FLAG_NO_USER_EXC (1 << 3)
#define EXO_FLAG_USER_PMU (1 << 4)
#define EXO_FLAG_BLANK_PRODINFO (1 << 5)
#define EXO_FLAG_ALLOW_WRITING_TO_CAL_SYSMMC (1 << 6)
void config_exosphere(launch_ctxt_t *ctxt)
{
@ -180,6 +182,14 @@ void config_exosphere(launch_ctxt_t *ctxt)
if (ctxt->exo_user_pmu)
exoFlags |= EXO_FLAG_USER_PMU;
// Blank prodinfo.
if (ctxt->exo_blank_prodinfo)
exoFlags |= EXO_FLAG_BLANK_PRODINFO;
// Allow writing to cal on sysMMC.
if (ctxt->exo_allow_writing_to_cal_sysmmc)
exoFlags |= EXO_FLAG_ALLOW_WRITING_TO_CAL_SYSMMC;
// Set mailbox values.
exo_cfg->magic = EXO_MAGIC_VAL;

View file

@ -65,6 +65,8 @@ typedef struct _launch_ctxt_t
bool stock;
bool atmosphere;
bool exo_no_user_exceptions;
bool exo_blank_prodinfo;
bool exo_allow_writing_to_cal_sysmmc;
bool emuMMC;
ini_sec_t *cfg;