set.mitm: add setting for controlling DebugModeFlag for am

This commit is contained in:
Michael Scire
2020-12-14 15:56:04 -08:00
parent 4ff026224e
commit 1ca373cd71
4 changed files with 24 additions and 1 deletions

View File

@@ -122,4 +122,16 @@ namespace ams::mitm::settings {
return ResultSuccess();
}
Result SetSysMitmService::GetDebugModeFlag(sf::Out<bool> out) {
/* If we're not processing for am, just return the real flag value. */
R_UNLESS(this->client_info.program_id == ncm::SystemProgramId::Am, sm::mitm::ResultShouldForwardToSession());
/* Retrieve the user configuration. */
u8 en = 0;
settings::fwdbg::GetSettingsItemValue(std::addressof(en), sizeof(en), "atmosphere", "enable_am_debug_mode");
out.SetValue(en != 0);
return ResultSuccess();
}
}