mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-24 06:20:09 +00:00
Core: pass down Core::System reference to all services (#4272)
* Core: pass down Core::System reference to all services This has to be done at once due to unified interface used by HLE/LLE switcher * apt: eliminate Core::System::GetInstance * gpu_gsp: eliminate Core::System::GetInstance in service * hid: eliminate Core::System::GetInstance * nwm: eliminate Core::System::GetInstance * err_f: eliminate Core::System::GetInstance
This commit is contained in:
parent
008242c5f3
commit
b163502744
@ -194,7 +194,7 @@ System::ResultStatus System::Init(EmuWindow& emu_window, u32 system_mode) {
|
||||
|
||||
HW::Init();
|
||||
Kernel::Init(system_mode);
|
||||
Service::Init(service_manager);
|
||||
Service::Init(*this, service_manager);
|
||||
GDBStub::Init();
|
||||
|
||||
ResultStatus result = VideoCore::Init(emu_window);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
@ -171,7 +172,8 @@ void Module::Interface::SetClientVersion(Kernel::HLERequestContext& ctx) {
|
||||
Module::Interface::Interface(std::shared_ptr<Module> ac, const char* name, u32 max_session)
|
||||
: ServiceFramework(name, max_session), ac(std::move(ac)) {}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto ac = std::make_shared<Module>();
|
||||
std::make_shared<AC_I>(ac)->InstallAsService(service_manager);
|
||||
std::make_shared<AC_U>(ac)->InstallAsService(service_manager);
|
||||
|
@ -9,6 +9,10 @@
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class Event;
|
||||
}
|
||||
@ -152,6 +156,6 @@ protected:
|
||||
Kernel::SharedPtr<Kernel::Event> disconnect_event;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::AC
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/act/act.h"
|
||||
#include "core/hle/service/act/act_a.h"
|
||||
#include "core/hle/service/act/act_u.h"
|
||||
@ -13,7 +14,8 @@ Module::Interface::Interface(std::shared_ptr<Module> act, const char* name)
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto act = std::make_shared<Module>();
|
||||
std::make_shared<ACT_A>(act)->InstallAsService(service_manager);
|
||||
std::make_shared<ACT_U>(act)->InstallAsService(service_manager);
|
||||
|
@ -6,6 +6,10 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::ACT {
|
||||
|
||||
/// Initializes all ACT services
|
||||
@ -21,6 +25,6 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::ACT
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "common/file_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/errors.h"
|
||||
#include "core/file_sys/ncch_container.h"
|
||||
#include "core/file_sys/title_metadata.h"
|
||||
@ -1462,7 +1463,8 @@ Module::Module() {
|
||||
|
||||
Module::~Module() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto am = std::make_shared<Module>();
|
||||
std::make_shared<AM_APP>(am)->InstallAsService(service_manager);
|
||||
std::make_shared<AM_NET>(am)->InstallAsService(service_manager);
|
||||
|
@ -16,6 +16,10 @@
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::FS {
|
||||
enum class MediaType : u32;
|
||||
}
|
||||
@ -574,6 +578,6 @@ private:
|
||||
Kernel::SharedPtr<Kernel::Mutex> system_updater_mutex;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::AM
|
||||
|
@ -182,7 +182,8 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
|
||||
|
||||
// Log in telemetry if the game uses the shared font
|
||||
Core::Telemetry().AddField(Telemetry::FieldType::Session, "RequiresSharedFont", true);
|
||||
apt->system.TelemetrySession().AddField(Telemetry::FieldType::Session, "RequiresSharedFont",
|
||||
true);
|
||||
|
||||
if (!apt->shared_font_loaded) {
|
||||
// On real 3DS, font loading happens on booting. However, we load it on demand to coordinate
|
||||
@ -197,8 +198,7 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(-1); // TODO: Find the right error code
|
||||
rb.Push<u32>(0);
|
||||
rb.PushCopyObjects<Kernel::Object>(nullptr);
|
||||
Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorSystemFiles,
|
||||
"Shared fonts");
|
||||
apt->system.SetStatus(Core::System::ResultStatus::ErrorSystemFiles, "Shared fonts");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -544,7 +544,7 @@ void Module::Interface::CloseApplication(Kernel::HLERequestContext& ctx) {
|
||||
|
||||
LOG_DEBUG(Service_APT, "called");
|
||||
|
||||
Core::System::GetInstance().RequestShutdown();
|
||||
apt->system.RequestShutdown();
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
@ -584,11 +584,11 @@ void Module::Interface::DoApplicationJump(Kernel::HLERequestContext& ctx) {
|
||||
|
||||
if (application_reset_prepared) {
|
||||
// Reset system
|
||||
Core::System::GetInstance().RequestReset();
|
||||
apt->system.RequestReset();
|
||||
} else {
|
||||
// After the jump, the application should shutdown
|
||||
// TODO: Actually implement the jump
|
||||
Core::System::GetInstance().RequestShutdown();
|
||||
apt->system.RequestShutdown();
|
||||
}
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
@ -843,7 +843,7 @@ Module::Interface::Interface(std::shared_ptr<Module> apt, const char* name, u32
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
Module::Module() {
|
||||
Module::Module(Core::System& system) : system(system) {
|
||||
applet_manager = std::make_shared<AppletManager>();
|
||||
|
||||
using Kernel::MemoryPermission;
|
||||
@ -857,8 +857,9 @@ Module::Module() {
|
||||
|
||||
Module::~Module() {}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
auto apt = std::make_shared<Module>();
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto apt = std::make_shared<Module>(system);
|
||||
std::make_shared<APT_U>(apt)->InstallAsService(service_manager);
|
||||
std::make_shared<APT_S>(apt)->InstallAsService(service_manager);
|
||||
std::make_shared<APT_A>(apt)->InstallAsService(service_manager);
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class Mutex;
|
||||
class SharedMemory;
|
||||
@ -52,7 +56,7 @@ enum class ScreencapPostPermission : u32 {
|
||||
|
||||
class Module final {
|
||||
public:
|
||||
Module();
|
||||
explicit Module(Core::System& system);
|
||||
~Module();
|
||||
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
@ -582,6 +586,8 @@ private:
|
||||
bool LoadSharedFont();
|
||||
bool LoadLegacySharedFont();
|
||||
|
||||
Core::System& system;
|
||||
|
||||
/// Handle to shared memory region designated to for shared system font
|
||||
Kernel::SharedPtr<Kernel::SharedMemory> shared_font_mem;
|
||||
bool shared_font_loaded = false;
|
||||
@ -602,6 +608,6 @@ private:
|
||||
std::shared_ptr<AppletManager> applet_manager;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::APT
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/boss/boss.h"
|
||||
@ -908,7 +909,8 @@ Module::Module() {
|
||||
task_finish_event = Event::Create(Kernel::ResetType::OneShot, "BOSS::task_finish_event");
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto boss = std::make_shared<Module>();
|
||||
std::make_shared<BOSS_P>(boss)->InstallAsService(service_manager);
|
||||
std::make_shared<BOSS_U>(boss)->InstallAsService(service_manager);
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::BOSS {
|
||||
|
||||
class Module final {
|
||||
@ -960,6 +964,6 @@ private:
|
||||
Kernel::SharedPtr<Kernel::Event> task_finish_event;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::BOSS
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <algorithm>
|
||||
#include "common/bit_set.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/frontend/camera/factory.h"
|
||||
#include "core/hle/ipc.h"
|
||||
@ -1054,7 +1055,8 @@ void ReloadCameraDevices() {
|
||||
cam->ReloadCameraDevices();
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto cam = std::make_shared<Module>();
|
||||
current_cam = cam;
|
||||
|
||||
|
@ -13,6 +13,10 @@
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Camera {
|
||||
class CameraInterface;
|
||||
}
|
||||
@ -782,6 +786,6 @@ private:
|
||||
/// Reload camera devices. Used when input configuration changed
|
||||
void ReloadCameraDevices();
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::CAM
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "common/file_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/archive_systemsavedata.h"
|
||||
#include "core/file_sys/directory_backend.h"
|
||||
#include "core/file_sys/errors.h"
|
||||
@ -1430,7 +1431,8 @@ Module::Module() {
|
||||
|
||||
Module::~Module() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto cecd = std::make_shared<Module>();
|
||||
std::make_shared<CECD_NDM>(cecd)->InstallAsService(service_manager);
|
||||
std::make_shared<CECD_S>(cecd)->InstallAsService(service_manager);
|
||||
|
@ -15,6 +15,10 @@ class ArchiveBackend;
|
||||
class FileBackend;
|
||||
} // namespace FileSys
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::CECD {
|
||||
|
||||
class Module final {
|
||||
@ -609,6 +613,6 @@ private:
|
||||
};
|
||||
|
||||
/// Initialize CECD service(s)
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::CECD
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/archive_systemsavedata.h"
|
||||
#include "core/file_sys/errors.h"
|
||||
#include "core/file_sys/file_backend.h"
|
||||
@ -721,7 +722,8 @@ u64 Module::GetConsoleUniqueId() {
|
||||
return console_id_le;
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto cfg = std::make_shared<Module>();
|
||||
std::make_shared<CFG_I>(cfg)->InstallAsService(service_manager);
|
||||
std::make_shared<CFG_S>(cfg)->InstallAsService(service_manager);
|
||||
|
@ -15,6 +15,10 @@ namespace FileSys {
|
||||
class ArchiveBackend;
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::CFG {
|
||||
|
||||
enum SystemModel {
|
||||
@ -407,7 +411,7 @@ private:
|
||||
u32 preferred_region_code = 0;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
std::shared_ptr<Module> GetCurrentModule();
|
||||
|
||||
} // namespace Service::CFG
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/alignment.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/csnd/csnd_snd.h"
|
||||
@ -193,7 +194,8 @@ CSND_SND::CSND_SND() : ServiceFramework("csnd:SND", 4) {
|
||||
RegisterHandlers(functions);
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<CSND_SND>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,10 @@
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::CSND {
|
||||
|
||||
class CSND_SND final : public ServiceFramework<CSND_SND> {
|
||||
@ -178,6 +182,6 @@ private:
|
||||
};
|
||||
|
||||
/// Initializes the CSND_SND Service
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::CSND
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/dlp/dlp.h"
|
||||
#include "core/hle/service/dlp/dlp_clnt.h"
|
||||
#include "core/hle/service/dlp/dlp_fkcl.h"
|
||||
@ -9,7 +10,8 @@
|
||||
|
||||
namespace Service::DLP {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<DLP_CLNT>()->InstallAsService(service_manager);
|
||||
std::make_shared<DLP_FKCL>()->InstallAsService(service_manager);
|
||||
std::make_shared<DLP_SRVR>()->InstallAsService(service_manager);
|
||||
|
@ -6,9 +6,13 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::DLP {
|
||||
|
||||
/// Initializes the DLP services.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::DLP
|
||||
|
@ -399,7 +399,8 @@ DSP_DSP::~DSP_DSP() {
|
||||
pipes = {};
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto dsp = std::make_shared<DSP_DSP>();
|
||||
dsp->InstallAsService(service_manager);
|
||||
Core::DSP().SetServiceToInterrupt(std::move(dsp));
|
||||
|
@ -9,6 +9,10 @@
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::DSP {
|
||||
|
||||
class DSP_DSP final : public ServiceFramework<DSP_DSP> {
|
||||
@ -250,6 +254,6 @@ private:
|
||||
std::array<Kernel::SharedPtr<Kernel::Event>, AudioCore::num_dsp_pipe> pipes = {{}};
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::DSP
|
||||
|
@ -154,7 +154,7 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) {
|
||||
LOG_CRITICAL(Service_ERR, "Fatal error");
|
||||
const ErrInfo errinfo = rp.PopRaw<ErrInfo>();
|
||||
LOG_CRITICAL(Service_ERR, "Fatal error type: {}", GetErrType(errinfo.errinfo_common.specifier));
|
||||
Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorUnknown);
|
||||
system.SetStatus(Core::System::ResultStatus::ErrorUnknown);
|
||||
|
||||
// Generic Info
|
||||
LogGenericInfo(errinfo.errinfo_common);
|
||||
@ -232,7 +232,7 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
ERR_F::ERR_F() : ServiceFramework("err:f", 1) {
|
||||
ERR_F::ERR_F(Core::System& system) : ServiceFramework("err:f", 1), system(system) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0x00010800, &ERR_F::ThrowFatalError, "ThrowFatalError"},
|
||||
{0x00020042, nullptr, "SetUserString"},
|
||||
@ -242,8 +242,8 @@ ERR_F::ERR_F() : ServiceFramework("err:f", 1) {
|
||||
|
||||
ERR_F::~ERR_F() = default;
|
||||
|
||||
void InstallInterfaces() {
|
||||
auto errf = std::make_shared<ERR_F>();
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto errf = std::make_shared<ERR_F>(system);
|
||||
errf->InstallAsNamedPort();
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,10 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
@ -15,7 +19,7 @@ namespace Service::ERR {
|
||||
/// Interface to "err:f" service
|
||||
class ERR_F final : public ServiceFramework<ERR_F> {
|
||||
public:
|
||||
ERR_F();
|
||||
explicit ERR_F(Core::System& system);
|
||||
~ERR_F();
|
||||
|
||||
private:
|
||||
@ -28,8 +32,10 @@ private:
|
||||
* 1 : Result code
|
||||
*/
|
||||
void ThrowFatalError(Kernel::HLERequestContext& ctx);
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
void InstallInterfaces();
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::ERR
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/frd/frd.h"
|
||||
@ -149,7 +150,8 @@ void Module::Interface::SetClientSdkVersion(Kernel::HLERequestContext& ctx) {
|
||||
Module::Module() = default;
|
||||
Module::~Module() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto frd = std::make_shared<Module>();
|
||||
std::make_shared<FRD_U>(frd)->InstallAsService(service_manager);
|
||||
std::make_shared<FRD_A>(frd)->InstallAsService(service_manager);
|
||||
|
@ -8,6 +8,10 @@
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::FRD {
|
||||
|
||||
struct FriendKey {
|
||||
@ -135,6 +139,6 @@ private:
|
||||
MyPresence my_presence = {};
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::FRD
|
||||
|
@ -853,7 +853,8 @@ FS_USER::FS_USER() : ServiceFramework("fs:USER", 30) {
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<FS_USER>()->InstallAsService(service_manager);
|
||||
}
|
||||
} // namespace Service::FS
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::FS {
|
||||
|
||||
class FS_USER final : public ServiceFramework<FS_USER> {
|
||||
@ -517,6 +521,6 @@ private:
|
||||
u32 priority = -1; ///< For SetPriority and GetPriority service functions
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::FS
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <vector>
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
#include "core/hle/service/gsp/gsp.h"
|
||||
@ -23,8 +24,9 @@ void SignalInterrupt(InterruptId interrupt_id) {
|
||||
return gpu->SignalInterrupt(interrupt_id);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
auto gpu = std::make_shared<GSP_GPU>();
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto gpu = std::make_shared<GSP_GPU>(system);
|
||||
gpu->InstallAsService(service_manager);
|
||||
gsp_gpu = gpu;
|
||||
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include "core/hle/service/gsp/gsp_gpu.h"
|
||||
#include "core/hle/service/gsp/gsp_lcd.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::GSP {
|
||||
/**
|
||||
* Retrieves the framebuffer info stored in the GSP shared memory for the
|
||||
@ -27,5 +31,5 @@ FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index);
|
||||
*/
|
||||
void SignalInterrupt(InterruptId interrupt_id);
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
} // namespace Service::GSP
|
||||
|
@ -731,7 +731,7 @@ void GSP_GPU::SetLedForceOff(Kernel::HLERequestContext& ctx) {
|
||||
|
||||
u8 state = rp.Pop<u8>();
|
||||
|
||||
Core::System::GetInstance().GetSharedPageHandler()->Set3DLed(state);
|
||||
system.GetSharedPageHandler()->Set3DLed(state);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
@ -749,7 +749,7 @@ SessionData* GSP_GPU::FindRegisteredThreadData(u32 thread_id) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GSP_GPU::GSP_GPU() : ServiceFramework("gsp::Gpu", 2) {
|
||||
GSP_GPU::GSP_GPU(Core::System& system) : ServiceFramework("gsp::Gpu", 2), system(system) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0x00010082, &GSP_GPU::WriteHWRegs, "WriteHWRegs"},
|
||||
{0x00020084, &GSP_GPU::WriteHWRegsWithMask, "WriteHWRegsWithMask"},
|
||||
|
@ -13,6 +13,10 @@
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class SharedMemory;
|
||||
} // namespace Kernel
|
||||
@ -192,7 +196,7 @@ struct SessionData : public Kernel::SessionRequestHandler::SessionDataBase {
|
||||
|
||||
class GSP_GPU final : public ServiceFramework<GSP_GPU, SessionData> {
|
||||
public:
|
||||
GSP_GPU();
|
||||
explicit GSP_GPU(Core::System& system);
|
||||
~GSP_GPU() = default;
|
||||
|
||||
void ClientDisconnected(Kernel::SharedPtr<Kernel::ServerSession> server_session) override;
|
||||
@ -399,6 +403,8 @@ private:
|
||||
/// Returns the session data for the specified registered thread id, or nullptr if not found.
|
||||
SessionData* FindRegisteredThreadData(u32 thread_id);
|
||||
|
||||
Core::System& system;
|
||||
|
||||
/// GSP shared memory
|
||||
Kernel::SharedPtr<Kernel::SharedMemory> shared_memory;
|
||||
|
||||
|
@ -219,7 +219,7 @@ void Module::UpdateGyroscopeCallback(u64 userdata, s64 cycles_late) {
|
||||
|
||||
Math::Vec3<float> gyro;
|
||||
std::tie(std::ignore, gyro) = motion_device->GetStatus();
|
||||
double stretch = Core::System::GetInstance().perf_stats.GetLastFrameTimeScale();
|
||||
double stretch = system.perf_stats.GetLastFrameTimeScale();
|
||||
gyro *= gyroscope_coef * static_cast<float>(stretch);
|
||||
gyroscope_entry.x = static_cast<s16>(gyro.x);
|
||||
gyroscope_entry.y = static_cast<s16>(gyro.y);
|
||||
@ -354,7 +354,7 @@ void Module::Interface::GetSoundVolume(Kernel::HLERequestContext& ctx) {
|
||||
Module::Interface::Interface(std::shared_ptr<Module> hid, const char* name, u32 max_session)
|
||||
: ServiceFramework(name, max_session), hid(std::move(hid)) {}
|
||||
|
||||
Module::Module() {
|
||||
Module::Module(Core::System& system) : system(system) {
|
||||
using namespace Kernel;
|
||||
|
||||
shared_mem =
|
||||
@ -393,8 +393,9 @@ void ReloadInputDevices() {
|
||||
hid->ReloadInputDevices();
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
auto hid = std::make_shared<Module>();
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto hid = std::make_shared<Module>(system);
|
||||
std::make_shared<User>(hid)->InstallAsService(service_manager);
|
||||
std::make_shared<Spvr>(hid)->InstallAsService(service_manager);
|
||||
current_module = hid;
|
||||
|
@ -18,6 +18,10 @@
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/settings.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class Event;
|
||||
class SharedMemory;
|
||||
@ -198,7 +202,7 @@ DirectionState GetStickDirectionState(s16 circle_pad_x, s16 circle_pad_y);
|
||||
|
||||
class Module final {
|
||||
public:
|
||||
Module();
|
||||
explicit Module(Core::System& system);
|
||||
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
@ -299,6 +303,8 @@ private:
|
||||
void UpdateAccelerometerCallback(u64 userdata, s64 cycles_late);
|
||||
void UpdateGyroscopeCallback(u64 userdata, s64 cycles_late);
|
||||
|
||||
Core::System& system;
|
||||
|
||||
// Handle to shared memory region designated to HID_User service
|
||||
Kernel::SharedPtr<Kernel::SharedMemory> shared_mem;
|
||||
|
||||
@ -329,7 +335,7 @@ private:
|
||||
std::unique_ptr<Input::TouchDevice> touch_device;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
/// Reload input devices. Used when input configuration changed
|
||||
void ReloadInputDevices();
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include <cryptopp/aes.h>
|
||||
#include <cryptopp/modes.h>
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/archive_ncch.h"
|
||||
#include "core/file_sys/file_backend.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
@ -581,7 +582,8 @@ HTTP_C::HTTP_C() : ServiceFramework("http:C", 32) {
|
||||
DecryptClCertA();
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<HTTP_C>()->InstallAsService(service_manager);
|
||||
}
|
||||
} // namespace Service::HTTP
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::HTTP {
|
||||
|
||||
enum class RequestMethod : u8 {
|
||||
@ -262,6 +266,6 @@ private:
|
||||
} ClCertA;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::HTTP
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/ir/ir.h"
|
||||
#include "core/hle/service/ir/ir_rst.h"
|
||||
#include "core/hle/service/ir/ir_u.h"
|
||||
@ -22,7 +23,8 @@ void ReloadInputDevices() {
|
||||
ir_rst->ReloadInputDevices();
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<IR_U>()->InstallAsService(service_manager);
|
||||
|
||||
auto ir_user = std::make_shared<IR_USER>();
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace SM {
|
||||
class ServiceManager;
|
||||
}
|
||||
@ -13,6 +17,6 @@ namespace Service::IR {
|
||||
/// Reload input devices. Used when input configuration changed
|
||||
void ReloadInputDevices();
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::IR
|
||||
|
@ -586,7 +586,8 @@ RO::RO() : ServiceFramework("ldr:ro", 2) {
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<RO>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include "core/hle/service/ldr_ro/memory_synchronizer.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::LDR {
|
||||
|
||||
struct ClientSlot : public Kernel::SessionRequestHandler::SessionDataBase {
|
||||
@ -149,6 +153,6 @@ private:
|
||||
void Shutdown(Kernel::HLERequestContext& self);
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::LDR
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
@ -290,7 +291,8 @@ MIC_U::MIC_U() : ServiceFramework{"mic:u", 1}, impl{std::make_unique<Impl>()} {
|
||||
|
||||
MIC_U::~MIC_U() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<MIC_U>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,10 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::MIC {
|
||||
|
||||
class MIC_U final : public ServiceFramework<MIC_U> {
|
||||
@ -186,6 +190,6 @@ private:
|
||||
std::unique_ptr<Impl> impl;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::MIC
|
||||
|
@ -2,12 +2,14 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/mvd/mvd.h"
|
||||
#include "core/hle/service/mvd/mvd_std.h"
|
||||
|
||||
namespace Service::MVD {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<MVD_STD>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,13 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::MVD {
|
||||
|
||||
/// Initializes all MVD services.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::MVD
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/ndm/ndm_u.h"
|
||||
|
||||
@ -236,7 +237,8 @@ NDM_U::NDM_U() : ServiceFramework("ndm:u", 6) {
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<NDM_U>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include <array>
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::NDM {
|
||||
|
||||
class NDM_U final : public ServiceFramework<NDM_U> {
|
||||
@ -268,6 +272,6 @@ private:
|
||||
bool daemon_lock_enabled = false;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::NDM
|
||||
|
@ -3,13 +3,15 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/news/news_s.h"
|
||||
#include "core/hle/service/news/news_u.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::NEWS {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<NEWS_S>()->InstallAsService(service_manager);
|
||||
std::make_shared<NEWS_U>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
@ -4,8 +4,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::NEWS {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::NEWS
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/service/nfc/nfc.h"
|
||||
@ -148,7 +149,8 @@ Module::Module() {
|
||||
|
||||
Module::~Module() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto nfc = std::make_shared<Module>();
|
||||
std::make_shared<NFC_M>(nfc)->InstallAsService(service_manager);
|
||||
std::make_shared<NFC_U>(nfc)->InstallAsService(service_manager);
|
||||
|
@ -9,6 +9,10 @@
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class Event;
|
||||
} // namespace Kernel
|
||||
@ -174,6 +178,6 @@ private:
|
||||
CommunicationStatus nfc_status = CommunicationStatus::NfcInitialized;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::NFC
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/nim/nim.h"
|
||||
#include "core/hle/service/nim/nim_aoc.h"
|
||||
#include "core/hle/service/nim/nim_s.h"
|
||||
@ -9,7 +10,8 @@
|
||||
|
||||
namespace Service::NIM {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<NIM_AOC>()->InstallAsService(service_manager);
|
||||
std::make_shared<NIM_S>()->InstallAsService(service_manager);
|
||||
std::make_shared<NIM_U>()->InstallAsService(service_manager);
|
||||
|
@ -6,8 +6,12 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::NIM {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::NIM
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <cinttypes>
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/ns/ns.h"
|
||||
#include "core/hle/service/ns/ns_s.h"
|
||||
@ -30,7 +31,8 @@ Kernel::SharedPtr<Kernel::Process> LaunchTitle(FS::MediaType media_type, u64 tit
|
||||
return process;
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<NS_S>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -8,12 +8,16 @@
|
||||
#include "core/hle/service/fs/archive.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::NS {
|
||||
|
||||
/// Loads and launches the title identified by title_id in the specified media type.
|
||||
Kernel::SharedPtr<Kernel::Process> LaunchTitle(FS::MediaType media_type, u64 title_id);
|
||||
|
||||
/// Registers all NS services with the specified service manager.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::NS
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/nwm/nwm.h"
|
||||
#include "core/hle/service/nwm/nwm_cec.h"
|
||||
#include "core/hle/service/nwm/nwm_ext.h"
|
||||
@ -13,14 +14,15 @@
|
||||
|
||||
namespace Service::NWM {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<NWM_CEC>()->InstallAsService(service_manager);
|
||||
std::make_shared<NWM_EXT>()->InstallAsService(service_manager);
|
||||
std::make_shared<NWM_INF>()->InstallAsService(service_manager);
|
||||
std::make_shared<NWM_SAP>()->InstallAsService(service_manager);
|
||||
std::make_shared<NWM_SOC>()->InstallAsService(service_manager);
|
||||
std::make_shared<NWM_TST>()->InstallAsService(service_manager);
|
||||
std::make_shared<NWM_UDS>()->InstallAsService(service_manager);
|
||||
std::make_shared<NWM_UDS>(system)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
@ -6,9 +6,13 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::NWM {
|
||||
|
||||
/// Initialize all NWM services
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
@ -1283,7 +1283,7 @@ static void BeaconBroadcastCallback(u64 userdata, s64 cycles_late) {
|
||||
beacon_broadcast_event, 0);
|
||||
}
|
||||
|
||||
NWM_UDS::NWM_UDS() : ServiceFramework("nwm::UDS") {
|
||||
NWM_UDS::NWM_UDS(Core::System& system) : ServiceFramework("nwm::UDS") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0x000102C2, nullptr, "Initialize (deprecated)"},
|
||||
{0x00020000, nullptr, "Scrap"},
|
||||
@ -1334,9 +1334,8 @@ NWM_UDS::NWM_UDS() : ServiceFramework("nwm::UDS") {
|
||||
}
|
||||
}
|
||||
|
||||
Core::System::GetInstance().GetSharedPageHandler()->SetMacAddress(mac);
|
||||
Core::System::GetInstance().GetSharedPageHandler()->SetWifiLinkLevel(
|
||||
SharedPage::WifiLinkLevel::BEST);
|
||||
system.GetSharedPageHandler()->SetMacAddress(mac);
|
||||
system.GetSharedPageHandler()->SetWifiLinkLevel(SharedPage::WifiLinkLevel::BEST);
|
||||
}
|
||||
|
||||
NWM_UDS::~NWM_UDS() {
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include "common/swap.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
// Local-WLAN service
|
||||
|
||||
namespace Service::NWM {
|
||||
@ -98,7 +102,7 @@ enum class TagId : u8 {
|
||||
|
||||
class NWM_UDS final : public ServiceFramework<NWM_UDS> {
|
||||
public:
|
||||
NWM_UDS();
|
||||
explicit NWM_UDS(Core::System& system);
|
||||
~NWM_UDS();
|
||||
|
||||
private:
|
||||
|
@ -2,13 +2,15 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/pm/pm.h"
|
||||
#include "core/hle/service/pm/pm_app.h"
|
||||
#include "core/hle/service/pm/pm_dbg.h"
|
||||
|
||||
namespace Service::PM {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<PM_APP>()->InstallAsService(service_manager);
|
||||
std::make_shared<PM_DBG>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
@ -6,9 +6,13 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::PM {
|
||||
|
||||
/// Initializes the PM services.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::PM
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/ps/ps_ps.h"
|
||||
|
||||
@ -32,7 +33,8 @@ PS_PS::PS_PS() : ServiceFramework("ps:ps", DefaultMaxSessions) {
|
||||
RegisterHandlers(functions);
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<PS_PS>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,10 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::PS {
|
||||
|
||||
class PS_PS final : public ServiceFramework<PS_PS> {
|
||||
@ -224,6 +228,6 @@ private:
|
||||
};
|
||||
|
||||
/// Initializes the PS_PS Service
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::PS
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "common/common_paths.h"
|
||||
#include "common/file_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/archive_extsavedata.h"
|
||||
#include "core/file_sys/errors.h"
|
||||
#include "core/file_sys/file_backend.h"
|
||||
@ -226,7 +227,8 @@ void Module::SetPlayCoins(u16 play_coins) {
|
||||
Module::Interface::Interface(std::shared_ptr<Module> ptm, const char* name, u32 max_session)
|
||||
: ServiceFramework(name, max_session), ptm(std::move(ptm)) {}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto ptm = std::make_shared<Module>();
|
||||
std::make_shared<PTM_Gets>(ptm)->InstallAsService(service_manager);
|
||||
std::make_shared<PTM_Play>(ptm)->InstallAsService(service_manager);
|
||||
|
@ -9,6 +9,10 @@
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::PTM {
|
||||
|
||||
/// Charge levels used by PTM functions
|
||||
@ -140,6 +144,6 @@ private:
|
||||
bool pedometer_is_counting = false;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::PTM
|
||||
|
@ -2,12 +2,14 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/pxi/dev.h"
|
||||
#include "core/hle/service/pxi/pxi.h"
|
||||
|
||||
namespace Service::PXI {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<DEV>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,13 @@
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::PXI {
|
||||
|
||||
/// Registers all PXI services with the specified service manager.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::PXI
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/qtm/qtm.h"
|
||||
#include "core/hle/service/qtm/qtm_c.h"
|
||||
#include "core/hle/service/qtm/qtm_s.h"
|
||||
@ -10,7 +11,8 @@
|
||||
|
||||
namespace Service::QTM {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<QTM_C>()->InstallAsService(service_manager);
|
||||
std::make_shared<QTM_S>()->InstallAsService(service_manager);
|
||||
std::make_shared<QTM_SP>()->InstallAsService(service_manager);
|
||||
|
@ -5,10 +5,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::QTM {
|
||||
|
||||
/// Initializes all QTM services.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::QTM
|
||||
|
@ -69,15 +69,15 @@ const std::array<ServiceModuleInfo, 40> service_module_map{
|
||||
{"LDR", 0x00040130'00003702, LDR::InstallInterfaces},
|
||||
{"PXI", 0x00040130'00001402, PXI::InstallInterfaces},
|
||||
|
||||
{"ERR", 0x00040030'00008A02, [](SM::ServiceManager& sm) { ERR::InstallInterfaces(); }},
|
||||
{"ERR", 0x00040030'00008A02, ERR::InstallInterfaces},
|
||||
{"AC", 0x00040130'00002402, AC::InstallInterfaces},
|
||||
{"ACT", 0x00040130'00003802, ACT::InstallInterfaces},
|
||||
{"AM", 0x00040130'00001502, AM::InstallInterfaces},
|
||||
{"BOSS", 0x00040130'00003402, BOSS::InstallInterfaces},
|
||||
{"CAM", 0x00040130'00001602,
|
||||
[](SM::ServiceManager& sm) {
|
||||
CAM::InstallInterfaces(sm);
|
||||
Y2R::InstallInterfaces(sm);
|
||||
[](Core::System& system) {
|
||||
CAM::InstallInterfaces(system);
|
||||
Y2R::InstallInterfaces(system);
|
||||
}},
|
||||
{"CECD", 0x00040130'00002602, CECD::InstallInterfaces},
|
||||
{"CFG", 0x00040130'00001702, CFG::InstallInterfaces},
|
||||
@ -94,9 +94,9 @@ const std::array<ServiceModuleInfo, 40> service_module_map{
|
||||
{"NFC", 0x00040130'00004002, NFC::InstallInterfaces},
|
||||
{"NIM", 0x00040130'00002C02, NIM::InstallInterfaces},
|
||||
{"NS", 0x00040130'00008002,
|
||||
[](SM::ServiceManager& sm) {
|
||||
NS::InstallInterfaces(sm);
|
||||
APT::InstallInterfaces(sm);
|
||||
[](Core::System& system) {
|
||||
NS::InstallInterfaces(system);
|
||||
APT::InstallInterfaces(system);
|
||||
}},
|
||||
{"NWM", 0x00040130'00002D02, NWM::InstallInterfaces},
|
||||
{"PTM", 0x00040130'00002202, PTM::InstallInterfaces},
|
||||
@ -235,13 +235,13 @@ static bool AttemptLLE(const ServiceModuleInfo& service_module) {
|
||||
}
|
||||
|
||||
/// Initialize ServiceManager
|
||||
void Init(std::shared_ptr<SM::ServiceManager>& sm) {
|
||||
void Init(Core::System& core, std::shared_ptr<SM::ServiceManager>& sm) {
|
||||
FS::ArchiveInit();
|
||||
SM::ServiceManager::InstallInterfaces(sm);
|
||||
|
||||
for (const auto& service_module : service_module_map) {
|
||||
if (!AttemptLLE(service_module) && service_module.init_function != nullptr)
|
||||
service_module.init_function(*sm);
|
||||
service_module.init_function(core);
|
||||
}
|
||||
LOG_DEBUG(Service, "initialized OK");
|
||||
}
|
||||
|
@ -15,8 +15,9 @@
|
||||
#include "core/hle/kernel/object.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Namespace Service
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class ClientPort;
|
||||
@ -183,7 +184,7 @@ private:
|
||||
};
|
||||
|
||||
/// Initialize ServiceManager
|
||||
void Init(std::shared_ptr<SM::ServiceManager>& sm);
|
||||
void Init(Core::System& system, std::shared_ptr<SM::ServiceManager>& sm);
|
||||
|
||||
/// Shutdown ServiceManager
|
||||
void Shutdown();
|
||||
@ -194,7 +195,7 @@ extern std::unordered_map<std::string, Kernel::SharedPtr<Kernel::ClientPort>> g_
|
||||
struct ServiceModuleInfo {
|
||||
std::string name;
|
||||
u64 title_id;
|
||||
std::function<void(SM::ServiceManager&)> init_function;
|
||||
std::function<void(Core::System&)> init_function;
|
||||
};
|
||||
|
||||
extern const std::array<ServiceModuleInfo, 40> service_module_map;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
#include "core/hle/result.h"
|
||||
@ -909,7 +910,8 @@ SOC_U::~SOC_U() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<SOC_U>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include <unordered_map>
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::SOC {
|
||||
|
||||
/// Holds information about a particular socket
|
||||
@ -48,6 +52,6 @@ private:
|
||||
std::unordered_map<u32, SocketHolder> open_sockets;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::SOC
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/ssl_c.h"
|
||||
@ -86,7 +87,8 @@ SSL_C::SSL_C() : ServiceFramework("ssl:C") {
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<SSL_C>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include <random>
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::SSL {
|
||||
|
||||
class SSL_C final : public ServiceFramework<SSL_C> {
|
||||
@ -21,6 +25,6 @@ private:
|
||||
std::mt19937 rand_gen;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::SSL
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <cstring>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
@ -686,7 +687,8 @@ Y2R_U::Y2R_U() : ServiceFramework("y2r:u", 1) {
|
||||
|
||||
Y2R_U::~Y2R_U() = default;
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
std::make_shared<Y2R_U>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class Event;
|
||||
}
|
||||
@ -298,6 +302,6 @@ private:
|
||||
bool spacial_dithering_enabled = false;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::Y2R
|
||||
|
Loading…
Reference in New Issue
Block a user