mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
htc: configure usage via system setting
This commit is contained in:
parent
0ec54ed492
commit
ce149f996c
4 changed files with 21 additions and 4 deletions
|
@ -52,6 +52,9 @@
|
||||||
; Controls whether dns.mitm logs to the sd card for debugging
|
; Controls whether dns.mitm logs to the sd card for debugging
|
||||||
; 0 = Disabled, 1 = Enabled
|
; 0 = Disabled, 1 = Enabled
|
||||||
; enable_dns_mitm_debug_log = u8!0x0
|
; enable_dns_mitm_debug_log = u8!0x0
|
||||||
|
; Controls whether htc is enabled
|
||||||
|
; 0 = Disabled, 1 = Enabled
|
||||||
|
; enable_htc = u8!0x0
|
||||||
[hbloader]
|
[hbloader]
|
||||||
; Controls the size of the homebrew heap when running as applet.
|
; Controls the size of the homebrew heap when running as applet.
|
||||||
; If set to zero, all available applet memory is used as heap.
|
; If set to zero, all available applet memory is used as heap.
|
||||||
|
|
|
@ -34,7 +34,6 @@ namespace ams::boot2 {
|
||||||
constexpr size_t NumPreSdCardLaunchPrograms = util::size(PreSdCardLaunchPrograms);
|
constexpr size_t NumPreSdCardLaunchPrograms = util::size(PreSdCardLaunchPrograms);
|
||||||
|
|
||||||
constexpr ncm::SystemProgramId AdditionalLaunchPrograms[] = {
|
constexpr ncm::SystemProgramId AdditionalLaunchPrograms[] = {
|
||||||
ncm::SystemProgramId::Htc, /* htc */ /* TODO: should we do boot!use_htc_gen2, with default to on in custom settings? */
|
|
||||||
ncm::SystemProgramId::Am, /* am */
|
ncm::SystemProgramId::Am, /* am */
|
||||||
ncm::SystemProgramId::NvServices, /* nvservices */
|
ncm::SystemProgramId::NvServices, /* nvservices */
|
||||||
ncm::SystemProgramId::NvnFlinger, /* nvnflinger */
|
ncm::SystemProgramId::NvnFlinger, /* nvnflinger */
|
||||||
|
@ -80,7 +79,6 @@ namespace ams::boot2 {
|
||||||
constexpr size_t NumAdditionalLaunchPrograms = util::size(AdditionalLaunchPrograms);
|
constexpr size_t NumAdditionalLaunchPrograms = util::size(AdditionalLaunchPrograms);
|
||||||
|
|
||||||
constexpr ncm::SystemProgramId AdditionalMaintenanceLaunchPrograms[] = {
|
constexpr ncm::SystemProgramId AdditionalMaintenanceLaunchPrograms[] = {
|
||||||
ncm::SystemProgramId::Htc, /* htc */
|
|
||||||
ncm::SystemProgramId::Am, /* am */
|
ncm::SystemProgramId::Am, /* am */
|
||||||
ncm::SystemProgramId::NvServices, /* nvservices */
|
ncm::SystemProgramId::NvServices, /* nvservices */
|
||||||
ncm::SystemProgramId::NvnFlinger, /* nvnflinger */
|
ncm::SystemProgramId::NvnFlinger, /* nvnflinger */
|
||||||
|
@ -188,6 +186,12 @@ namespace ams::boot2 {
|
||||||
return force_maintenance != 0;
|
return force_maintenance != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsHtcEnabled() {
|
||||||
|
u8 enable_htc = 1;
|
||||||
|
settings::fwdbg::GetSettingsItemValue(&enable_htc, sizeof(enable_htc), "atmosphere", "enable_htc");
|
||||||
|
return enable_htc != 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool IsMaintenanceMode() {
|
bool IsMaintenanceMode() {
|
||||||
/* Contact set:sys, retrieve boot!force_maintenance. */
|
/* Contact set:sys, retrieve boot!force_maintenance. */
|
||||||
if (IsForceMaintenance()) {
|
if (IsForceMaintenance()) {
|
||||||
|
@ -379,6 +383,13 @@ namespace ams::boot2 {
|
||||||
/* Check for and forward declare non-atmosphere mitm modules. */
|
/* Check for and forward declare non-atmosphere mitm modules. */
|
||||||
DetectAndDeclareFutureMitms();
|
DetectAndDeclareFutureMitms();
|
||||||
|
|
||||||
|
/* Device whether to launch tma or htc. */
|
||||||
|
if (IsHtcEnabled()) {
|
||||||
|
LaunchProgram(nullptr, ncm::ProgramLocation::Make(ncm::SystemProgramId::Htc, ncm::StorageId::None), 0);
|
||||||
|
} else {
|
||||||
|
LaunchProgram(nullptr, ncm::ProgramLocation::Make(ncm::SystemProgramId::Tma, ncm::StorageId::None), 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Launch additional programs. */
|
/* Launch additional programs. */
|
||||||
if (maintenance) {
|
if (maintenance) {
|
||||||
LaunchList(AdditionalMaintenanceLaunchPrograms, NumAdditionalMaintenanceLaunchPrograms);
|
LaunchList(AdditionalMaintenanceLaunchPrograms, NumAdditionalMaintenanceLaunchPrograms);
|
||||||
|
|
|
@ -30,8 +30,6 @@ namespace ams::htcs::impl {
|
||||||
public:
|
public:
|
||||||
HtcsService(mem::StandardAllocator *allocator, htc::server::driver::IDriver *drv, htc::server::rpc::RpcClient *rc, rpc::DataChannelManager *dcm)
|
HtcsService(mem::StandardAllocator *allocator, htc::server::driver::IDriver *drv, htc::server::rpc::RpcClient *rc, rpc::DataChannelManager *dcm)
|
||||||
: m_allocator(allocator), m_driver(drv), m_rpc_client(rc), m_data_channel_manager(dcm) { /* ... */ }
|
: m_allocator(allocator), m_driver(drv), m_rpc_client(rc), m_data_channel_manager(dcm) { /* ... */ }
|
||||||
public:
|
|
||||||
/* TODO */
|
|
||||||
public:
|
public:
|
||||||
Result CreateSocket(s32 *out_err, s32 *out_desc, bool enable_disconnection_emulation);
|
Result CreateSocket(s32 *out_err, s32 *out_desc, bool enable_disconnection_emulation);
|
||||||
Result DestroySocket(s32 desc);
|
Result DestroySocket(s32 desc);
|
||||||
|
|
|
@ -362,6 +362,11 @@ namespace ams::settings::fwdbg {
|
||||||
/* 0 = Disabled, 1 = Enabled */
|
/* 0 = Disabled, 1 = Enabled */
|
||||||
R_ABORT_UNLESS(ParseSettingsItemValue("atmosphere", "enable_dns_mitm_debug_log", "u8!0x0"));
|
R_ABORT_UNLESS(ParseSettingsItemValue("atmosphere", "enable_dns_mitm_debug_log", "u8!0x0"));
|
||||||
|
|
||||||
|
/* Controls whether htc is enabled. */
|
||||||
|
/* TODO: Change this to default 1 when tma2 is ready for inclusion in atmosphere releases. */
|
||||||
|
/* 0 = Disabled, 1 = Enabled */
|
||||||
|
R_ABORT_UNLESS(ParseSettingsItemValue("atmosphere", "enable_htc", "u8!0x0"));
|
||||||
|
|
||||||
/* Hbloader custom settings. */
|
/* Hbloader custom settings. */
|
||||||
|
|
||||||
/* Controls the size of the homebrew heap when running as applet. */
|
/* Controls the size of the homebrew heap when running as applet. */
|
||||||
|
|
Loading…
Reference in a new issue