caps.cpp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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/caps/caps.h"
  6. #include "core/hle/service/service.h"
  7. #include "core/hle/service/sm/sm.h"
  8. namespace Service::Capture {
  9. class CAPS_A final : public ServiceFramework<CAPS_A> {
  10. public:
  11. explicit CAPS_A() : ServiceFramework{"caps:a"} {
  12. // clang-format off
  13. static const FunctionInfo functions[] = {
  14. {0, nullptr, "Unknown1"},
  15. {1, nullptr, "Unknown2"},
  16. {2, nullptr, "Unknown3"},
  17. {3, nullptr, "Unknown4"},
  18. {4, nullptr, "Unknown5"},
  19. {5, nullptr, "Unknown6"},
  20. {6, nullptr, "Unknown7"},
  21. {7, nullptr, "Unknown8"},
  22. {8, nullptr, "Unknown9"},
  23. {9, nullptr, "Unknown10"},
  24. {10, nullptr, "Unknown11"},
  25. {11, nullptr, "Unknown12"},
  26. {12, nullptr, "Unknown13"},
  27. {13, nullptr, "Unknown14"},
  28. {14, nullptr, "Unknown15"},
  29. {301, nullptr, "Unknown16"},
  30. {401, nullptr, "Unknown17"},
  31. {501, nullptr, "Unknown18"},
  32. {1001, nullptr, "Unknown19"},
  33. {1002, nullptr, "Unknown20"},
  34. {8001, nullptr, "Unknown21"},
  35. {8002, nullptr, "Unknown22"},
  36. {8011, nullptr, "Unknown23"},
  37. {8012, nullptr, "Unknown24"},
  38. {8021, nullptr, "Unknown25"},
  39. {10011, nullptr, "Unknown26"},
  40. };
  41. // clang-format on
  42. RegisterHandlers(functions);
  43. }
  44. };
  45. class CAPS_C final : public ServiceFramework<CAPS_C> {
  46. public:
  47. explicit CAPS_C() : ServiceFramework{"caps:c"} {
  48. // clang-format off
  49. static const FunctionInfo functions[] = {
  50. {2001, nullptr, "Unknown1"},
  51. {2002, nullptr, "Unknown2"},
  52. {2011, nullptr, "Unknown3"},
  53. {2012, nullptr, "Unknown4"},
  54. {2013, nullptr, "Unknown5"},
  55. {2014, nullptr, "Unknown6"},
  56. {2101, nullptr, "Unknown7"},
  57. {2102, nullptr, "Unknown8"},
  58. {2201, nullptr, "Unknown9"},
  59. {2301, nullptr, "Unknown10"},
  60. };
  61. // clang-format on
  62. RegisterHandlers(functions);
  63. }
  64. };
  65. class CAPS_SC final : public ServiceFramework<CAPS_SC> {
  66. public:
  67. explicit CAPS_SC() : ServiceFramework{"caps:sc"} {
  68. // clang-format off
  69. static const FunctionInfo functions[] = {
  70. {1, nullptr, "Unknown1"},
  71. {2, nullptr, "Unknown2"},
  72. {1001, nullptr, "Unknown3"},
  73. {1002, nullptr, "Unknown4"},
  74. {1003, nullptr, "Unknown5"},
  75. {1011, nullptr, "Unknown6"},
  76. {1012, nullptr, "Unknown7"},
  77. {1201, nullptr, "Unknown8"},
  78. {1202, nullptr, "Unknown9"},
  79. {1203, nullptr, "Unknown10"},
  80. };
  81. // clang-format on
  82. RegisterHandlers(functions);
  83. }
  84. };
  85. class CAPS_SS final : public ServiceFramework<CAPS_SS> {
  86. public:
  87. explicit CAPS_SS() : ServiceFramework{"caps:ss"} {
  88. // clang-format off
  89. static const FunctionInfo functions[] = {
  90. {201, nullptr, "Unknown1"},
  91. {202, nullptr, "Unknown2"},
  92. {203, nullptr, "Unknown3"},
  93. {204, nullptr, "Unknown4"},
  94. };
  95. // clang-format on
  96. RegisterHandlers(functions);
  97. }
  98. };
  99. class CAPS_SU final : public ServiceFramework<CAPS_SU> {
  100. public:
  101. explicit CAPS_SU() : ServiceFramework{"caps:su"} {
  102. // clang-format off
  103. static const FunctionInfo functions[] = {
  104. {201, nullptr, "SaveScreenShot"},
  105. {203, nullptr, "SaveScreenShotEx0"},
  106. };
  107. // clang-format on
  108. RegisterHandlers(functions);
  109. }
  110. };
  111. class CAPS_U final : public ServiceFramework<CAPS_U> {
  112. public:
  113. explicit CAPS_U() : ServiceFramework{"caps:u"} {
  114. // clang-format off
  115. static const FunctionInfo functions[] = {
  116. {102, nullptr, "GetAlbumFileListByAruid"},
  117. {103, nullptr, "DeleteAlbumFileByAruid"},
  118. {104, nullptr, "GetAlbumFileSizeByAruid"},
  119. {110, nullptr, "LoadAlbumScreenShotImageByAruid"},
  120. {120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"},
  121. {60002, nullptr, "OpenAccessorSessionForApplication"},
  122. };
  123. // clang-format on
  124. RegisterHandlers(functions);
  125. }
  126. };
  127. void InstallInterfaces(SM::ServiceManager& sm) {
  128. std::make_shared<CAPS_A>()->InstallAsService(sm);
  129. std::make_shared<CAPS_C>()->InstallAsService(sm);
  130. std::make_shared<CAPS_SC>()->InstallAsService(sm);
  131. std::make_shared<CAPS_SS>()->InstallAsService(sm);
  132. std::make_shared<CAPS_SU>()->InstallAsService(sm);
  133. std::make_shared<CAPS_U>()->InstallAsService(sm);
  134. }
  135. } // namespace Service::Capture