ncm.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <memory>
  5. #include "core/hle/service/ncm/ncm.h"
  6. #include "core/hle/service/service.h"
  7. #include "core/hle/service/sm/sm.h"
  8. namespace Service::NCM {
  9. class LocationResolver final : public ServiceFramework<LocationResolver> {
  10. public:
  11. explicit LocationResolver() : ServiceFramework{"lr"} {
  12. // clang-format off
  13. static const FunctionInfo functions[] = {
  14. {0, nullptr, "OpenLocationResolver"},
  15. {1, nullptr, "OpenRegisteredLocationResolver"},
  16. {2, nullptr, "RefreshLocationResolver"},
  17. {3, nullptr, "OpenAddOnContentLocationResolver"},
  18. };
  19. // clang-format on
  20. RegisterHandlers(functions);
  21. }
  22. };
  23. class NCM final : public ServiceFramework<NCM> {
  24. public:
  25. explicit NCM() : ServiceFramework{"ncm"} {
  26. // clang-format off
  27. static const FunctionInfo functions[] = {
  28. {0, nullptr, "CreateContentStorage"},
  29. {1, nullptr, "CreateContentMetaDatabase"},
  30. {2, nullptr, "VerifyContentStorage"},
  31. {3, nullptr, "VerifyContentMetaDatabase"},
  32. {4, nullptr, "OpenContentStorage"},
  33. {5, nullptr, "OpenContentMetaDatabase"},
  34. {6, nullptr, "CloseContentStorageForcibly"},
  35. {7, nullptr, "CloseContentMetaDatabaseForcibly"},
  36. {8, nullptr, "CleanupContentMetaDatabase"},
  37. {9, nullptr, "OpenContentStorage2"},
  38. {10, nullptr, "CloseContentStorage"},
  39. {11, nullptr, "OpenContentMetaDatabase2"},
  40. {12, nullptr, "CloseContentMetaDatabase"},
  41. };
  42. // clang-format on
  43. RegisterHandlers(functions);
  44. }
  45. };
  46. void InstallInterfaces(SM::ServiceManager& sm) {
  47. std::make_shared<LocationResolver>()->InstallAsService(sm);
  48. std::make_shared<NCM>()->InstallAsService(sm);
  49. }
  50. } // namespace Service::NCM