Revert "hoc-clk: add live vdd2, live boost clock and basic pwm dimming"

This reverts commit 15b7df8ef1.
This commit is contained in:
souldbminersmwc
2025-11-09 16:14:52 -05:00
parent 22ec140738
commit 21a3f953d7
3804 changed files with 435 additions and 570162 deletions

View File

@@ -1,75 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#include <stratosphere/lr/lr_i_add_on_content_location_resolver.hpp>
namespace ams::lr {
class AddOnContentLocationResolver {
NON_COPYABLE(AddOnContentLocationResolver);
private:
sf::SharedPointer<IAddOnContentLocationResolver> m_interface;
public:
AddOnContentLocationResolver() : m_interface(nullptr) { /* ... */ }
explicit AddOnContentLocationResolver(sf::SharedPointer<IAddOnContentLocationResolver> intf) : m_interface(intf) { /* ... */ }
AddOnContentLocationResolver(AddOnContentLocationResolver &&rhs) {
m_interface = std::move(rhs.m_interface);
}
AddOnContentLocationResolver &operator=(AddOnContentLocationResolver &&rhs) {
AddOnContentLocationResolver(std::move(rhs)).Swap(*this);
return *this;
}
void Swap(AddOnContentLocationResolver &rhs) {
std::swap(m_interface, rhs.m_interface);
}
public:
/* Actual commands. */
Result ResolveAddOnContentPath(Path *out, ncm::DataId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveAddOnContentPath(out, id));
}
Result RegisterAddOnContentStorage(ncm::DataId id, ncm::ApplicationId application_id, ncm::StorageId storage_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_RETURN(m_interface->RegisterAddOnContentStorage(id, application_id, storage_id));
} else {
R_RETURN(m_interface->RegisterAddOnContentStorageDeprecated(id, storage_id));
}
}
Result UnregisterAllAddOnContentPath() {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->UnregisterAllAddOnContentPath());
}
Result RefreshApplicationAddOnContent(const ncm::ApplicationId *ids, size_t num_ids) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->RefreshApplicationAddOnContent(sf::InArray<ncm::ApplicationId>(ids, num_ids)));
}
Result UnregisterApplicationAddOnContent(ncm::ApplicationId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->UnregisterApplicationAddOnContent(id));
}
};
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#include <stratosphere/lr/lr_location_resolver.hpp>
#include <stratosphere/lr/lr_add_on_content_location_resolver.hpp>
#include <stratosphere/lr/lr_registered_location_resolver.hpp>
namespace ams::lr {
/* Management. */
void Initialize();
void Finalize();
/* Service API. */
Result OpenLocationResolver(LocationResolver *out, ncm::StorageId storage_id);
Result OpenRegisteredLocationResolver(RegisteredLocationResolver *out);
Result OpenAddOnContentLocationResolver(AddOnContentLocationResolver *out);
Result RefreshLocationResolver(ncm::StorageId storage_id);
}

View File

@@ -1,32 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#define AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveAddOnContentPath, (sf::Out<lr::Path> out, ncm::DataId id), (out, id), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorageDeprecated, (ncm::DataId id, ncm::StorageId storage_id), (id, storage_id), hos::Version_2_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorage, (ncm::DataId id, ncm::ApplicationId application_id, ncm::StorageId storage_id), (id, application_id, storage_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterAllAddOnContentPath, (), (), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 3, Result, RefreshApplicationAddOnContent, (const sf::InArray<ncm::ApplicationId> &ids), (ids), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 4, Result, UnregisterApplicationAddOnContent, (ncm::ApplicationId id), (id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 5, Result, GetRegisteredAddOnContentPaths, (sf::Out<lr::PathByMapAlias> out, sf::Out<lr::PathByMapAlias> out2, ncm::DataId id), (out, out2, id), hos::Version_15_0_0) \
AMS_SF_METHOD_INFO(C, H, 6, Result, RegisterAddOnContentPath, (ncm::DataId id, ncm::ApplicationId application_id, const lr::PathByMapAlias &path), (id, application_id, path), hos::Version_15_0_0) \
AMS_SF_METHOD_INFO(C, H, 7, Result, RegisterAddOnContentPaths, (ncm::DataId id, ncm::ApplicationId application_id, const lr::PathByMapAlias &path, const lr::PathByMapAlias &path2), (id, application_id, path, path2), hos::Version_15_0_0)
AMS_SF_DEFINE_INTERFACE(ams::lr, IAddOnContentLocationResolver, AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO, 0x77617E39)

View File

@@ -1,50 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#define AMS_LR_I_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveProgramPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, RedirectProgramPath, (const lr::Path &path, ncm::ProgramId id), (path, id)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, ResolveApplicationControlPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
AMS_SF_METHOD_INFO(C, H, 3, Result, ResolveApplicationHtmlDocumentPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, ResolveDataPath, (sf::Out<lr::Path> out, ncm::DataId id), (out, id)) \
AMS_SF_METHOD_INFO(C, H, 5, Result, RedirectApplicationControlPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 5, Result, RedirectApplicationControlPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 6, Result, RedirectApplicationHtmlDocumentPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 6, Result, RedirectApplicationHtmlDocumentPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 7, Result, ResolveApplicationLegalInformationPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
AMS_SF_METHOD_INFO(C, H, 8, Result, RedirectApplicationLegalInformationPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 8, Result, RedirectApplicationLegalInformationPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 9, Result, Refresh, (), ()) \
AMS_SF_METHOD_INFO(C, H, 10, Result, RedirectApplicationProgramPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_5_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 10, Result, RedirectApplicationProgramPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 11, Result, ClearApplicationRedirectionDeprecated, (), (), hos::Version_5_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 11, Result, ClearApplicationRedirection, (const sf::InArray<ncm::ProgramId> &excluding_ids), (excluding_ids), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 12, Result, EraseProgramRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 13, Result, EraseApplicationControlRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 14, Result, EraseApplicationHtmlDocumentRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 15, Result, EraseApplicationLegalInformationRedirection, (ncm::ProgramId id), (id), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 16, Result, ResolveProgramPathForDebug, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 17, Result, RedirectProgramPathForDebug, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 18, Result, RedirectApplicationProgramPathForDebugDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_7_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 18, Result, RedirectApplicationProgramPathForDebug, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 19, Result, EraseProgramRedirectionForDebug, (ncm::ProgramId id), (id), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 20, Result, Disable, (), (), hos::Version_15_0_0)
AMS_SF_DEFINE_INTERFACE(ams::lr, ILocationResolver, AMS_LR_I_LOCATION_RESOLVER_INTERFACE_INFO, 0xB36C8B0E)

View File

@@ -1,30 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#include <stratosphere/lr/lr_i_location_resolver.hpp>
#include <stratosphere/lr/lr_i_add_on_content_location_resolver.hpp>
#include <stratosphere/lr/lr_i_registered_location_resolver.hpp>
#define AMS_LR_I_LOCATION_RESOLVER_MANAGER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenLocationResolver, (sf::Out<ams::sf::SharedPointer<lr::ILocationResolver>> out, ncm::StorageId storage_id), (out, storage_id)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, OpenRegisteredLocationResolver, (sf::Out<ams::sf::SharedPointer<lr::IRegisteredLocationResolver>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, RefreshLocationResolver, (ncm::StorageId storage_id), (storage_id)) \
AMS_SF_METHOD_INFO(C, H, 3, Result, OpenAddOnContentLocationResolver, (sf::Out<ams::sf::SharedPointer<lr::IAddOnContentLocationResolver>> out), (out), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 4, Result, SetEnabled, (const ams::sf::InMapAliasArray<ncm::StorageId> &storages), (storages), hos::Version_15_0_0)
AMS_SF_DEFINE_INTERFACE(ams::lr, ILocationResolverManager, AMS_LR_I_LOCATION_RESOLVER_MANAGER_INTERFACE_INFO, 0xB2950191)

View File

@@ -1,36 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#define AMS_LR_I_REGISTERED_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveProgramPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterProgramPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterProgramPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterProgramPath, (ncm::ProgramId id), (id)) \
AMS_SF_METHOD_INFO(C, H, 3, Result, RedirectProgramPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_1_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 3, Result, RedirectProgramPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 4, Result, ResolveHtmlDocumentPath, (sf::Out<lr::Path> out, ncm::ProgramId id), (out, id), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 5, Result, RegisterHtmlDocumentPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_2_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 5, Result, RegisterHtmlDocumentPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 6, Result, UnregisterHtmlDocumentPath, (ncm::ProgramId id), (id), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 7, Result, RedirectHtmlDocumentPathDeprecated, (const lr::Path &path, ncm::ProgramId id), (path, id), hos::Version_2_0_0, hos::Version_8_1_1) \
AMS_SF_METHOD_INFO(C, H, 7, Result, RedirectHtmlDocumentPath, (const lr::Path &path, ncm::ProgramId id, ncm::ProgramId owner_id), (path, id, owner_id), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 8, Result, Refresh, (), (), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 9, Result, RefreshExcluding, (const sf::InArray<ncm::ProgramId> &ids), (ids), hos::Version_9_0_0)
AMS_SF_DEFINE_INTERFACE(ams::lr, IRegisteredLocationResolver, AMS_LR_I_REGISTERED_LOCATION_RESOLVER_INTERFACE_INFO, 0x35346AC9)

View File

@@ -1,180 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#include <stratosphere/lr/lr_i_location_resolver.hpp>
namespace ams::lr {
class LocationResolver {
NON_COPYABLE(LocationResolver);
private:
sf::SharedPointer<ILocationResolver> m_interface;
public:
LocationResolver() : m_interface(nullptr) { /* ... */ }
explicit LocationResolver(sf::SharedPointer<ILocationResolver> intf) : m_interface(intf) { /* ... */ }
LocationResolver(LocationResolver &&rhs) {
m_interface = std::move(rhs.m_interface);
}
LocationResolver &operator=(LocationResolver &&rhs) {
LocationResolver(std::move(rhs)).swap(*this);
return *this;
}
void swap(LocationResolver &rhs) {
std::swap(m_interface, rhs.m_interface);
}
public:
Result ResolveProgramPath(Path *out, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveProgramPath(out, id));
}
void RedirectProgramPath(const Path &path, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_ABORT_UNLESS(m_interface->RedirectProgramPath(path, id));
}
Result ResolveApplicationControlPath(Path *out, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveApplicationControlPath(out, id));
}
Result ResolveApplicationHtmlDocumentPath(Path *out, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveApplicationHtmlDocumentPath(out, id));
}
Result ResolveDataPath(Path *out, ncm::DataId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveDataPath(out, id));
}
void RedirectApplicationControlPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_ABORT_UNLESS(m_interface->RedirectApplicationControlPath(path, id, owner_id));
} else {
R_ABORT_UNLESS(m_interface->RedirectApplicationControlPathDeprecated(path, id));
}
}
void RedirectApplicationHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_ABORT_UNLESS(m_interface->RedirectApplicationHtmlDocumentPath(path, id, owner_id));
} else {
R_ABORT_UNLESS(m_interface->RedirectApplicationHtmlDocumentPathDeprecated(path, id));
}
}
Result ResolveApplicationLegalInformationPath(Path *out, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveApplicationLegalInformationPath(out, id));
}
void RedirectApplicationLegalInformationPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_ABORT_UNLESS(m_interface->RedirectApplicationLegalInformationPath(path, id, owner_id));
} else {
R_ABORT_UNLESS(m_interface->RedirectApplicationLegalInformationPathDeprecated(path, id));
}
}
Result Refresh() {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->Refresh());
}
void RedirectApplicationProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_ABORT_UNLESS(m_interface->RedirectApplicationProgramPath(path, id, owner_id));
} else {
R_ABORT_UNLESS(m_interface->RedirectApplicationProgramPathDeprecated(path, id));
}
}
Result ClearApplicationRedirection() {
AMS_ASSERT(m_interface != nullptr);
AMS_ASSERT(hos::GetVersion() < hos::Version_9_0_0);
R_RETURN(this->ClearApplicationRedirection(nullptr, 0));
}
Result ClearApplicationRedirection(const ncm::ProgramId *excluding_ids, size_t num_ids) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_RETURN(m_interface->ClearApplicationRedirection(sf::InArray<ncm::ProgramId>(excluding_ids, num_ids)));
} else {
R_RETURN(m_interface->ClearApplicationRedirectionDeprecated());
}
}
Result EraseProgramRedirection(ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->EraseProgramRedirection(id));
}
Result EraseApplicationControlRedirection(ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->EraseApplicationControlRedirection(id));
}
Result EraseApplicationHtmlDocumentRedirection(ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->EraseApplicationHtmlDocumentRedirection(id));
}
Result EraseApplicationLegalInformationRedirection(ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->EraseApplicationLegalInformationRedirection(id));
}
Result ResolveProgramPathForDebug(Path *out, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveProgramPathForDebug(out, id));
}
void RedirectProgramPathForDebug(const Path &path, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_ABORT_UNLESS(m_interface->RedirectProgramPathForDebug(path, id));
}
void RedirectApplicationProgramPathForDebug(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_ABORT_UNLESS(m_interface->RedirectApplicationProgramPathForDebug(path, id, owner_id));
} else {
R_ABORT_UNLESS(m_interface->RedirectApplicationProgramPathForDebugDeprecated(path, id));
}
}
Result EraseProgramRedirectionForDebug(ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->EraseProgramRedirectionForDebug(id));
}
Result Disable() {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->Disable());
}
};
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#include <stratosphere/lr/lr_i_location_resolver_manager.hpp>
#include <stratosphere/ncm/ncm_bounded_map.hpp>
namespace ams::lr {
class LocationResolverManagerImpl {
private:
static constexpr size_t ResolverCountMax = 5;
private:
/* Resolver storage. */
ncm::BoundedMap<ncm::StorageId, sf::SharedPointer<ILocationResolver>, ResolverCountMax> m_location_resolvers{};
ncm::BoundedMap<ncm::StorageId, bool, ResolverCountMax> m_location_resolvers_enabled{};
bool m_default_enabled = true;
sf::SharedPointer<IRegisteredLocationResolver> m_registered_location_resolver = nullptr;
sf::SharedPointer<IAddOnContentLocationResolver> m_add_on_content_location_resolver = nullptr;
os::SdkMutex m_mutex{};
public:
/* Actual commands. */
Result OpenLocationResolver(sf::Out<sf::SharedPointer<ILocationResolver>> out, ncm::StorageId storage_id);
Result OpenRegisteredLocationResolver(sf::Out<sf::SharedPointer<IRegisteredLocationResolver>> out);
Result RefreshLocationResolver(ncm::StorageId storage_id);
Result OpenAddOnContentLocationResolver(sf::Out<sf::SharedPointer<IAddOnContentLocationResolver>> out);
Result SetEnabled(const sf::InMapAliasArray<ncm::StorageId> &storages);
};
static_assert(IsILocationResolverManager<LocationResolverManagerImpl>);
}

View File

@@ -1,113 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/lr/lr_types.hpp>
#include <stratosphere/lr/lr_i_registered_location_resolver.hpp>
namespace ams::lr {
class RegisteredLocationResolver {
NON_COPYABLE(RegisteredLocationResolver);
private:
sf::SharedPointer<IRegisteredLocationResolver> m_interface;
public:
RegisteredLocationResolver() : m_interface(nullptr) { /* ... */ }
explicit RegisteredLocationResolver(sf::SharedPointer<IRegisteredLocationResolver> intf) : m_interface(intf) { /* ... */ }
RegisteredLocationResolver(RegisteredLocationResolver &&rhs) {
m_interface = std::move(rhs.m_interface);
}
RegisteredLocationResolver &operator=(RegisteredLocationResolver &&rhs) {
RegisteredLocationResolver(std::move(rhs)).Swap(*this);
return *this;
}
void Swap(RegisteredLocationResolver &rhs) {
std::swap(m_interface, rhs.m_interface);
}
public:
/* Actual commands. */
Result ResolveProgramPath(Path *out, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveProgramPath(out, id));
}
Result RegisterProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_RETURN(m_interface->RegisterProgramPath(path, id, owner_id));
} else {
R_RETURN(m_interface->RegisterProgramPathDeprecated(path, id));
}
}
Result UnregisterProgramPath(ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->UnregisterProgramPath(id));
}
void RedirectProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_ABORT_UNLESS(m_interface->RedirectProgramPath(path, id, owner_id));
} else {
R_ABORT_UNLESS(m_interface->RedirectProgramPathDeprecated(path, id));
}
}
Result ResolveHtmlDocumentPath(Path *out, ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->ResolveHtmlDocumentPath(out, id));
}
Result RegisterHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_RETURN(m_interface->RegisterHtmlDocumentPath(path, id, owner_id));
} else {
R_RETURN(m_interface->RegisterHtmlDocumentPathDeprecated(path, id));
}
}
Result UnregisterHtmlDocumentPath(ncm::ProgramId id) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->UnregisterHtmlDocumentPath(id));
}
void RedirectHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
AMS_ASSERT(m_interface != nullptr);
if (hos::GetVersion() >= hos::Version_9_0_0) {
R_ABORT_UNLESS(m_interface->RedirectHtmlDocumentPath(path, id, owner_id));
} else {
R_ABORT_UNLESS(m_interface->RedirectHtmlDocumentPathDeprecated(path, id));
}
}
Result Refresh() {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->Refresh());
}
Result RefreshExcluding(const ncm::ProgramId *excluding_ids, size_t num_ids) {
AMS_ASSERT(m_interface != nullptr);
R_RETURN(m_interface->RefreshExcluding(sf::InArray<ncm::ProgramId>(excluding_ids, num_ids)));
}
};
}

View File

@@ -1,65 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours.hpp>
#include <stratosphere/fs/fs_directory.hpp>
#include <stratosphere/sf/sf_buffer_tags.hpp>
namespace ams::lr {
struct alignas(4) Path : ams::sf::LargeData {
char str[fs::EntryNameLengthMax];
static constexpr Path Encode(const char *p) {
Path path = {};
/* Copy C string to path, terminating when a null byte is found. */
for (size_t i = 0; i < sizeof(path) - 1; i++) {
path.str[i] = p[i];
if (p[i] == '\x00') {
break;
}
}
return path;
}
constexpr inline size_t GetLength() const {
/* Determine length from the first null byte occurence. */
size_t len = 0;
for (size_t i = 0; i < sizeof(this->str) - 1 && this->str[i] != '\x00'; i++) {
len++;
}
return len;
}
constexpr inline bool IsValid() const {
/* Determine validity by presence of a terminating null byte. */
for (size_t i = 0; i < sizeof(this->str); i++) {
if (this->str[i] == '\x00') {
return true;
}
}
return false;
}
};
static_assert(util::is_pod<Path>::value && sizeof(Path) == fs::EntryNameLengthMax);
struct PathByMapAlias : public Path, ams::sf::PrefersMapAliasTransferMode{};
static_assert(util::is_pod<PathByMapAlias>::value);
static_assert(sizeof(PathByMapAlias) == sizeof(Path));
}