strat: update for latest libnx commit

This commit is contained in:
Michael Scire 2019-10-18 10:37:03 -07:00 committed by SciresM
parent e5d62025d3
commit fbb5730369
6 changed files with 17 additions and 13 deletions

View file

@ -46,6 +46,7 @@ extern "C" {
u32 __nx_applet_type = AppletType_None; u32 __nx_applet_type = AppletType_None;
/* TODO: Evaluate to what extent this can be reduced. */
#define INNER_HEAP_SIZE 0x200000 #define INNER_HEAP_SIZE 0x200000
size_t nx_inner_heap_size = INNER_HEAP_SIZE; size_t nx_inner_heap_size = INNER_HEAP_SIZE;
char nx_inner_heap[INNER_HEAP_SIZE]; char nx_inner_heap[INNER_HEAP_SIZE];

View file

@ -187,12 +187,14 @@ namespace sts::dmnt::cheat::impl {
/* Learn whether we should enable cheats by default. */ /* Learn whether we should enable cheats by default. */
{ {
u8 en; u64 size_out;
if (R_SUCCEEDED(setsysGetSettingsItemValue("atmosphere", "dmnt_cheats_enabled_by_default", &en, sizeof(en)))) { u8 en = 0;
if (R_SUCCEEDED(setsysGetSettingsItemValue("atmosphere", "dmnt_cheats_enabled_by_default", &en, sizeof(en), &size_out))) {
this->enable_cheats_by_default = (en != 0); this->enable_cheats_by_default = (en != 0);
} }
if (R_SUCCEEDED(setsysGetSettingsItemValue("atmosphere", "dmnt_always_save_cheat_toggles", &en, sizeof(en)))) { en = 0;
if (R_SUCCEEDED(setsysGetSettingsItemValue("atmosphere", "dmnt_always_save_cheat_toggles", &en, sizeof(en), &size_out))) {
this->always_save_cheat_toggles = (en != 0); this->always_save_cheat_toggles = (en != 0);
} }
} }

View file

@ -56,16 +56,17 @@ namespace sts::fatal::srv {
/* Get information from set. */ /* Get information from set. */
setsysGetSerialNumber(this->serial_number); setsysGetSerialNumber(this->serial_number);
setsysGetFirmwareVersion(&this->firmware_version); setsysGetFirmwareVersion(&this->firmware_version);
setsysGetFlag(SetSysFlag_Quest, &this->quest_flag); setsysGetQuestFlag(&this->quest_flag);
this->UpdateLanguageCode(); this->UpdateLanguageCode();
/* Read information from settings. */ /* Read information from settings. */
setsysGetSettingsItemValue("fatal", "transition_to_fatal", &this->transition_to_fatal, sizeof(this->transition_to_fatal)); u64 set_size_out;
setsysGetSettingsItemValue("fatal", "show_extra_info", &this->show_extra_info, sizeof(this->show_extra_info)); setsysGetSettingsItemValue("fatal", "transition_to_fatal", &this->transition_to_fatal, sizeof(this->transition_to_fatal), &set_size_out);
setsysGetSettingsItemValue("fatal", "quest_reboot_interval_second", &this->quest_reboot_interval_second, sizeof(this->quest_reboot_interval_second)); setsysGetSettingsItemValue("fatal", "show_extra_info", &this->show_extra_info, sizeof(this->show_extra_info), &set_size_out);
setsysGetSettingsItemValue("fatal", "quest_reboot_interval_second", &this->quest_reboot_interval_second, sizeof(this->quest_reboot_interval_second), &set_size_out);
/* Atmosphere extension for automatic reboot. */ /* Atmosphere extension for automatic reboot. */
if (R_SUCCEEDED(setsysGetSettingsItemValue("atmosphere", "fatal_auto_reboot_interval", &this->fatal_auto_reboot_interval, sizeof(this->fatal_auto_reboot_interval)))) { if (R_SUCCEEDED(setsysGetSettingsItemValue("atmosphere", "fatal_auto_reboot_interval", &this->fatal_auto_reboot_interval, sizeof(this->fatal_auto_reboot_interval), &set_size_out))) {
this->fatal_auto_reboot_enabled = this->fatal_auto_reboot_interval != 0; this->fatal_auto_reboot_enabled = this->fatal_auto_reboot_interval != 0;
} }

View file

@ -223,7 +223,7 @@ namespace sts::fatal::srv::font {
} }
Result InitializeSharedFont() { Result InitializeSharedFont() {
size_t total_fonts = 0; s32 total_fonts = 0;
R_TRY(plGetSharedFont(GetFatalConfig().GetLanguageCode(), g_fonts, PlSharedFontType_Total, &total_fonts)); R_TRY(plGetSharedFont(GetFatalConfig().GetLanguageCode(), g_fonts, PlSharedFontType_Total, &total_fonts));
R_TRY(plGetSharedFontByType(&g_font, PlSharedFontType_Standard)); R_TRY(plGetSharedFontByType(&g_font, PlSharedFontType_Standard));

View file

@ -28,7 +28,7 @@ namespace sts::fatal::srv {
} }
bool in_repair; bool in_repair;
return R_SUCCEEDED(setsysGetFlag(SetSysFlag_InRepairProcessEnable, &in_repair)) && in_repair; return R_SUCCEEDED(setsysGetInRepairProcessEnableFlag(&in_repair)) && in_repair;
} }
bool IsInRepairWithoutVolHeld() { bool IsInRepairWithoutVolHeld() {
@ -62,12 +62,12 @@ namespace sts::fatal::srv {
bool NeedsRunTimeReviser() { bool NeedsRunTimeReviser() {
/* Before firmware 5.0.0, this wasn't implemented. */ /* Before firmware 5.0.0, this wasn't implemented. */
if (hos::GetVersion() < hos::Version_300) { if (hos::GetVersion() < hos::Version_500) {
return false; return false;
} }
bool requires_time_reviser; bool requires_time_reviser;
return R_SUCCEEDED(setsysGetFlag(SetSysFlag_RequiresRunRepairTimeReviser, &requires_time_reviser)) && requires_time_reviser; return R_SUCCEEDED(setsysGetRequiresRunRepairTimeReviser(&requires_time_reviser)) && requires_time_reviser;
} }
bool IsTimeReviserCartridgeInserted() { bool IsTimeReviserCartridgeInserted() {

View file

@ -162,6 +162,7 @@ namespace sts::pm::impl {
for (size_t i = 0; i < MaxProcessInfos; i++) { for (size_t i = 0; i < MaxProcessInfos; i++) {
if (!this->process_info_allocated[i]) { if (!this->process_info_allocated[i]) {
this->process_info_allocated[i] = true; this->process_info_allocated[i] = true;
std::memset(&this->process_info_storages[i], 0, sizeof(this->process_info_storages[i]));
return GetPointer(this->process_info_storages[i]); return GetPointer(this->process_info_storages[i]);
} }
} }
@ -176,7 +177,6 @@ namespace sts::pm::impl {
STS_ASSERT(this->process_info_allocated[index]); STS_ASSERT(this->process_info_allocated[index]);
process_info->~ProcessInfo(); process_info->~ProcessInfo();
std::memset(process_info, 0, sizeof(*process_info));
this->process_info_allocated[index] = false; this->process_info_allocated[index] = false;
} }
}; };