Merge pull request #847 from lioncash/ncm

service: Add ncm services
This commit is contained in:
bunnei 2018-07-28 10:46:09 -07:00 committed by GitHub
commit 458fdda700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 0 deletions

View File

@ -178,6 +178,7 @@ void FileBackend::Write(const Entry& entry) {
SUB(Service, LM) \ SUB(Service, LM) \
SUB(Service, Mii) \ SUB(Service, Mii) \
SUB(Service, MM) \ SUB(Service, MM) \
SUB(Service, NCM) \
SUB(Service, NFC) \ SUB(Service, NFC) \
SUB(Service, NFP) \ SUB(Service, NFP) \
SUB(Service, NIFM) \ SUB(Service, NIFM) \

View File

@ -65,6 +65,7 @@ enum class Class : ClassType {
Service_LM, ///< The LM (Logger) service Service_LM, ///< The LM (Logger) service
Service_Mii, ///< The Mii service Service_Mii, ///< The Mii service
Service_MM, ///< The MM (Multimedia) service Service_MM, ///< The MM (Multimedia) service
Service_NCM, ///< The NCM service
Service_NFC, ///< The NFC (Near-field communication) service Service_NFC, ///< The NFC (Near-field communication) service
Service_NFP, ///< The NFP service Service_NFP, ///< The NFP service
Service_NIFM, ///< The NIFM (Network interface) service Service_NIFM, ///< The NIFM (Network interface) service

View File

@ -182,6 +182,8 @@ add_library(core STATIC
hle/service/mii/mii.h hle/service/mii/mii.h
hle/service/mm/mm_u.cpp hle/service/mm/mm_u.cpp
hle/service/mm/mm_u.h hle/service/mm/mm_u.h
hle/service/ncm/ncm.cpp
hle/service/ncm/ncm.h
hle/service/nfc/nfc.cpp hle/service/nfc/nfc.cpp
hle/service/nfc/nfc.h hle/service/nfc/nfc.h
hle/service/nfp/nfp.cpp hle/service/nfp/nfp.cpp

View File

@ -0,0 +1,59 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include "core/hle/service/ncm/ncm.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"
namespace Service::NCM {
class LocationResolver final : public ServiceFramework<LocationResolver> {
public:
explicit LocationResolver() : ServiceFramework{"lr"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "OpenLocationResolver"},
{1, nullptr, "OpenRegisteredLocationResolver"},
{2, nullptr, "RefreshLocationResolver"},
{3, nullptr, "OpenAddOnContentLocationResolver"},
};
// clang-format on
RegisterHandlers(functions);
}
};
class NCM final : public ServiceFramework<NCM> {
public:
explicit NCM() : ServiceFramework{"ncm"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "CreateContentStorage"},
{1, nullptr, "CreateContentMetaDatabase"},
{2, nullptr, "VerifyContentStorage"},
{3, nullptr, "VerifyContentMetaDatabase"},
{4, nullptr, "OpenContentStorage"},
{5, nullptr, "OpenContentMetaDatabase"},
{6, nullptr, "CloseContentStorageForcibly"},
{7, nullptr, "CloseContentMetaDatabaseForcibly"},
{8, nullptr, "CleanupContentMetaDatabase"},
{9, nullptr, "OpenContentStorage2"},
{10, nullptr, "CloseContentStorage"},
{11, nullptr, "OpenContentMetaDatabase2"},
{12, nullptr, "CloseContentMetaDatabase"},
};
// clang-format on
RegisterHandlers(functions);
}
};
void InstallInterfaces(SM::ServiceManager& sm) {
std::make_shared<LocationResolver>()->InstallAsService(sm);
std::make_shared<NCM>()->InstallAsService(sm);
}
} // namespace Service::NCM

View File

@ -0,0 +1,15 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
namespace Service::SM {
class ServiceManager;
}
namespace Service::NCM {
void InstallInterfaces(SM::ServiceManager& sm);
} // namespace Service::NCM

View File

@ -36,6 +36,7 @@
#include "core/hle/service/lm/lm.h" #include "core/hle/service/lm/lm.h"
#include "core/hle/service/mii/mii.h" #include "core/hle/service/mii/mii.h"
#include "core/hle/service/mm/mm_u.h" #include "core/hle/service/mm/mm_u.h"
#include "core/hle/service/ncm/ncm.h"
#include "core/hle/service/nfc/nfc.h" #include "core/hle/service/nfc/nfc.h"
#include "core/hle/service/nfp/nfp.h" #include "core/hle/service/nfp/nfp.h"
#include "core/hle/service/nifm/nifm.h" #include "core/hle/service/nifm/nifm.h"
@ -214,6 +215,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
LM::InstallInterfaces(*sm); LM::InstallInterfaces(*sm);
Mii::InstallInterfaces(*sm); Mii::InstallInterfaces(*sm);
MM::InstallInterfaces(*sm); MM::InstallInterfaces(*sm);
NCM::InstallInterfaces(*sm);
NFC::InstallInterfaces(*sm); NFC::InstallInterfaces(*sm);
NFP::InstallInterfaces(*sm); NFP::InstallInterfaces(*sm);
NIFM::InstallInterfaces(*sm); NIFM::InstallInterfaces(*sm);