diff options
| -rw-r--r-- | src/core/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps.cpp | 158 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps.h | 71 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_a.cpp | 78 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_a.h | 21 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_c.cpp | 75 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_c.h | 21 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_sc.cpp | 40 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_sc.h | 21 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_ss.cpp | 26 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_ss.h | 21 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_su.cpp | 22 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_su.h | 21 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_u.cpp | 76 | ||||
| -rw-r--r-- | src/core/hle/service/caps/caps_u.h | 24 |
15 files changed, 536 insertions, 151 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index b31a0328c..e836bf396 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -287,6 +287,18 @@ add_library(core STATIC | |||
| 287 | hle/service/btm/btm.h | 287 | hle/service/btm/btm.h |
| 288 | hle/service/caps/caps.cpp | 288 | hle/service/caps/caps.cpp |
| 289 | hle/service/caps/caps.h | 289 | hle/service/caps/caps.h |
| 290 | hle/service/caps/caps_a.cpp | ||
| 291 | hle/service/caps/caps_a.h | ||
| 292 | hle/service/caps/caps_c.cpp | ||
| 293 | hle/service/caps/caps_c.h | ||
| 294 | hle/service/caps/caps_u.cpp | ||
| 295 | hle/service/caps/caps_u.h | ||
| 296 | hle/service/caps/caps_sc.cpp | ||
| 297 | hle/service/caps/caps_sc.h | ||
| 298 | hle/service/caps/caps_ss.cpp | ||
| 299 | hle/service/caps/caps_ss.h | ||
| 300 | hle/service/caps/caps_su.cpp | ||
| 301 | hle/service/caps/caps_su.h | ||
| 290 | hle/service/erpt/erpt.cpp | 302 | hle/service/erpt/erpt.cpp |
| 291 | hle/service/erpt/erpt.h | 303 | hle/service/erpt/erpt.h |
| 292 | hle/service/es/es.cpp | 304 | hle/service/es/es.cpp |
diff --git a/src/core/hle/service/caps/caps.cpp b/src/core/hle/service/caps/caps.cpp index 907f464ab..26c8a7081 100644 --- a/src/core/hle/service/caps/caps.cpp +++ b/src/core/hle/service/caps/caps.cpp | |||
| @@ -2,168 +2,24 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <memory> | ||
| 6 | |||
| 7 | #include "core/hle/service/caps/caps.h" | 5 | #include "core/hle/service/caps/caps.h" |
| 6 | #include "core/hle/service/caps/caps_a.h" | ||
| 7 | #include "core/hle/service/caps/caps_c.h" | ||
| 8 | #include "core/hle/service/caps/caps_sc.h" | ||
| 9 | #include "core/hle/service/caps/caps_ss.h" | ||
| 10 | #include "core/hle/service/caps/caps_su.h" | ||
| 11 | #include "core/hle/service/caps/caps_u.h" | ||
| 8 | #include "core/hle/service/service.h" | 12 | #include "core/hle/service/service.h" |
| 9 | #include "core/hle/service/sm/sm.h" | ||
| 10 | 13 | ||
| 11 | namespace Service::Capture { | 14 | namespace Service::Capture { |
| 12 | 15 | ||
| 13 | class CAPS_A final : public ServiceFramework<CAPS_A> { | ||
| 14 | public: | ||
| 15 | explicit CAPS_A() : ServiceFramework{"caps:a"} { | ||
| 16 | // clang-format off | ||
| 17 | static const FunctionInfo functions[] = { | ||
| 18 | {0, nullptr, "GetAlbumFileCount"}, | ||
| 19 | {1, nullptr, "GetAlbumFileList"}, | ||
| 20 | {2, nullptr, "LoadAlbumFile"}, | ||
| 21 | {3, nullptr, "DeleteAlbumFile"}, | ||
| 22 | {4, nullptr, "StorageCopyAlbumFile"}, | ||
| 23 | {5, nullptr, "IsAlbumMounted"}, | ||
| 24 | {6, nullptr, "GetAlbumUsage"}, | ||
| 25 | {7, nullptr, "GetAlbumFileSize"}, | ||
| 26 | {8, nullptr, "LoadAlbumFileThumbnail"}, | ||
| 27 | {9, nullptr, "LoadAlbumScreenShotImage"}, | ||
| 28 | {10, nullptr, "LoadAlbumScreenShotThumbnailImage"}, | ||
| 29 | {11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"}, | ||
| 30 | {12, nullptr, "Unknown12"}, | ||
| 31 | {13, nullptr, "Unknown13"}, | ||
| 32 | {14, nullptr, "Unknown14"}, | ||
| 33 | {15, nullptr, "Unknown15"}, | ||
| 34 | {16, nullptr, "Unknown16"}, | ||
| 35 | {17, nullptr, "Unknown17"}, | ||
| 36 | {18, nullptr, "Unknown18"}, | ||
| 37 | {202, nullptr, "SaveEditedScreenShot"}, | ||
| 38 | {301, nullptr, "GetLastThumbnail"}, | ||
| 39 | {401, nullptr, "GetAutoSavingStorage"}, | ||
| 40 | {501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"}, | ||
| 41 | {1001, nullptr, "Unknown1001"}, | ||
| 42 | {1002, nullptr, "Unknown1002"}, | ||
| 43 | {1003, nullptr, "Unknown1003"}, | ||
| 44 | {8001, nullptr, "ForceAlbumUnmounted"}, | ||
| 45 | {8002, nullptr, "ResetAlbumMountStatus"}, | ||
| 46 | {8011, nullptr, "RefreshAlbumCache"}, | ||
| 47 | {8012, nullptr, "GetAlbumCache"}, | ||
| 48 | {8013, nullptr, "Unknown8013"}, | ||
| 49 | {8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"}, | ||
| 50 | {10011, nullptr, "SetInternalErrorConversionEnabled"}, | ||
| 51 | {50000, nullptr, "Unknown50000"}, | ||
| 52 | {60002, nullptr, "Unknown60002"}, | ||
| 53 | }; | ||
| 54 | // clang-format on | ||
| 55 | |||
| 56 | RegisterHandlers(functions); | ||
| 57 | } | ||
| 58 | }; | ||
| 59 | |||
| 60 | class CAPS_C final : public ServiceFramework<CAPS_C> { | ||
| 61 | public: | ||
| 62 | explicit CAPS_C() : ServiceFramework{"caps:c"} { | ||
| 63 | // clang-format off | ||
| 64 | static const FunctionInfo functions[] = { | ||
| 65 | {33, nullptr, "Unknown33"}, | ||
| 66 | {2001, nullptr, "Unknown2001"}, | ||
| 67 | {2002, nullptr, "Unknown2002"}, | ||
| 68 | {2011, nullptr, "Unknown2011"}, | ||
| 69 | {2012, nullptr, "Unknown2012"}, | ||
| 70 | {2013, nullptr, "Unknown2013"}, | ||
| 71 | {2014, nullptr, "Unknown2014"}, | ||
| 72 | {2101, nullptr, "Unknown2101"}, | ||
| 73 | {2102, nullptr, "Unknown2102"}, | ||
| 74 | {2201, nullptr, "Unknown2201"}, | ||
| 75 | {2301, nullptr, "Unknown2301"}, | ||
| 76 | }; | ||
| 77 | // clang-format on | ||
| 78 | |||
| 79 | RegisterHandlers(functions); | ||
| 80 | } | ||
| 81 | }; | ||
| 82 | |||
| 83 | class CAPS_SC final : public ServiceFramework<CAPS_SC> { | ||
| 84 | public: | ||
| 85 | explicit CAPS_SC() : ServiceFramework{"caps:sc"} { | ||
| 86 | // clang-format off | ||
| 87 | static const FunctionInfo functions[] = { | ||
| 88 | {1, nullptr, "Unknown1"}, | ||
| 89 | {2, nullptr, "Unknown2"}, | ||
| 90 | {1001, nullptr, "Unknown3"}, | ||
| 91 | {1002, nullptr, "Unknown4"}, | ||
| 92 | {1003, nullptr, "Unknown5"}, | ||
| 93 | {1011, nullptr, "Unknown6"}, | ||
| 94 | {1012, nullptr, "Unknown7"}, | ||
| 95 | {1201, nullptr, "Unknown8"}, | ||
| 96 | {1202, nullptr, "Unknown9"}, | ||
| 97 | {1203, nullptr, "Unknown10"}, | ||
| 98 | }; | ||
| 99 | // clang-format on | ||
| 100 | |||
| 101 | RegisterHandlers(functions); | ||
| 102 | } | ||
| 103 | }; | ||
| 104 | |||
| 105 | class CAPS_SS final : public ServiceFramework<CAPS_SS> { | ||
| 106 | public: | ||
| 107 | explicit CAPS_SS() : ServiceFramework{"caps:ss"} { | ||
| 108 | // clang-format off | ||
| 109 | static const FunctionInfo functions[] = { | ||
| 110 | {201, nullptr, "Unknown1"}, | ||
| 111 | {202, nullptr, "Unknown2"}, | ||
| 112 | {203, nullptr, "Unknown3"}, | ||
| 113 | {204, nullptr, "Unknown4"}, | ||
| 114 | }; | ||
| 115 | // clang-format on | ||
| 116 | |||
| 117 | RegisterHandlers(functions); | ||
| 118 | } | ||
| 119 | }; | ||
| 120 | |||
| 121 | class CAPS_SU final : public ServiceFramework<CAPS_SU> { | ||
| 122 | public: | ||
| 123 | explicit CAPS_SU() : ServiceFramework{"caps:su"} { | ||
| 124 | // clang-format off | ||
| 125 | static const FunctionInfo functions[] = { | ||
| 126 | {201, nullptr, "SaveScreenShot"}, | ||
| 127 | {203, nullptr, "SaveScreenShotEx0"}, | ||
| 128 | }; | ||
| 129 | // clang-format on | ||
| 130 | |||
| 131 | RegisterHandlers(functions); | ||
| 132 | } | ||
| 133 | }; | ||
| 134 | |||
| 135 | class CAPS_U final : public ServiceFramework<CAPS_U> { | ||
| 136 | public: | ||
| 137 | explicit CAPS_U() : ServiceFramework{"caps:u"} { | ||
| 138 | // clang-format off | ||
| 139 | static const FunctionInfo functions[] = { | ||
| 140 | {32, nullptr, "SetShimLibraryVersion"}, | ||
| 141 | {102, nullptr, "GetAlbumFileListByAruid"}, | ||
| 142 | {103, nullptr, "DeleteAlbumFileByAruid"}, | ||
| 143 | {104, nullptr, "GetAlbumFileSizeByAruid"}, | ||
| 144 | {105, nullptr, "DeleteAlbumFileByAruidForDebug"}, | ||
| 145 | {110, nullptr, "LoadAlbumScreenShotImageByAruid"}, | ||
| 146 | {120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"}, | ||
| 147 | {130, nullptr, "PrecheckToCreateContentsByAruid"}, | ||
| 148 | {140, nullptr, "GetAlbumFileList1AafeAruidDeprecated"}, | ||
| 149 | {141, nullptr, "GetAlbumFileList2AafeUidAruidDeprecated"}, | ||
| 150 | {142, nullptr, "GetAlbumFileList3AaeAruid"}, | ||
| 151 | {143, nullptr, "GetAlbumFileList4AaeUidAruid"}, | ||
| 152 | {60002, nullptr, "OpenAccessorSessionForApplication"}, | ||
| 153 | }; | ||
| 154 | // clang-format on | ||
| 155 | |||
| 156 | RegisterHandlers(functions); | ||
| 157 | } | ||
| 158 | }; | ||
| 159 | |||
| 160 | void InstallInterfaces(SM::ServiceManager& sm) { | 16 | void InstallInterfaces(SM::ServiceManager& sm) { |
| 161 | std::make_shared<CAPS_A>()->InstallAsService(sm); | 17 | std::make_shared<CAPS_A>()->InstallAsService(sm); |
| 162 | std::make_shared<CAPS_C>()->InstallAsService(sm); | 18 | std::make_shared<CAPS_C>()->InstallAsService(sm); |
| 19 | std::make_shared<CAPS_U>()->InstallAsService(sm); | ||
| 163 | std::make_shared<CAPS_SC>()->InstallAsService(sm); | 20 | std::make_shared<CAPS_SC>()->InstallAsService(sm); |
| 164 | std::make_shared<CAPS_SS>()->InstallAsService(sm); | 21 | std::make_shared<CAPS_SS>()->InstallAsService(sm); |
| 165 | std::make_shared<CAPS_SU>()->InstallAsService(sm); | 22 | std::make_shared<CAPS_SU>()->InstallAsService(sm); |
| 166 | std::make_shared<CAPS_U>()->InstallAsService(sm); | ||
| 167 | } | 23 | } |
| 168 | 24 | ||
| 169 | } // namespace Service::Capture | 25 | } // namespace Service::Capture |
diff --git a/src/core/hle/service/caps/caps.h b/src/core/hle/service/caps/caps.h index 471185dfa..fc70a4c27 100644 --- a/src/core/hle/service/caps/caps.h +++ b/src/core/hle/service/caps/caps.h | |||
| @@ -4,12 +4,83 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 7 | namespace Service::SM { | 9 | namespace Service::SM { |
| 8 | class ServiceManager; | 10 | class ServiceManager; |
| 9 | } | 11 | } |
| 10 | 12 | ||
| 11 | namespace Service::Capture { | 13 | namespace Service::Capture { |
| 12 | 14 | ||
| 15 | enum AlbumImageOrientation { | ||
| 16 | Orientation0 = 0, | ||
| 17 | Orientation1 = 1, | ||
| 18 | Orientation2 = 2, | ||
| 19 | Orientation3 = 3, | ||
| 20 | }; | ||
| 21 | |||
| 22 | enum AlbumReportOption { | ||
| 23 | Disable = 0, | ||
| 24 | Enable = 1, | ||
| 25 | }; | ||
| 26 | |||
| 27 | enum ContentType : u8 { | ||
| 28 | Screenshot = 0, | ||
| 29 | Movie = 1, | ||
| 30 | ExtraMovie = 3, | ||
| 31 | }; | ||
| 32 | |||
| 33 | enum AlbumStorage : u8 { | ||
| 34 | NAND = 0, | ||
| 35 | SD = 1, | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct AlbumFileDateTime { | ||
| 39 | u16 year; | ||
| 40 | u8 month; | ||
| 41 | u8 day; | ||
| 42 | u8 hour; | ||
| 43 | u8 minute; | ||
| 44 | u8 second; | ||
| 45 | u8 uid; | ||
| 46 | }; | ||
| 47 | |||
| 48 | struct AlbumEntry { | ||
| 49 | u64 size; | ||
| 50 | u64 application_id; | ||
| 51 | AlbumFileDateTime datetime; | ||
| 52 | AlbumStorage storage; | ||
| 53 | ContentType content; | ||
| 54 | u8 padding[6]; | ||
| 55 | }; | ||
| 56 | |||
| 57 | struct AlbumFileEntry { | ||
| 58 | u64 size; | ||
| 59 | u64 hash; | ||
| 60 | AlbumFileDateTime datetime; | ||
| 61 | AlbumStorage storage; | ||
| 62 | ContentType content; | ||
| 63 | u8 padding[5]; | ||
| 64 | u8 unknown; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct ApplicationAlbumEntry { | ||
| 68 | u64 size; | ||
| 69 | u64 hash; | ||
| 70 | AlbumFileDateTime datetime; | ||
| 71 | AlbumStorage storage; | ||
| 72 | ContentType content; | ||
| 73 | u8 padding[5]; | ||
| 74 | u8 unknown; | ||
| 75 | }; | ||
| 76 | |||
| 77 | struct ApplicationAlbumFileEntry { | ||
| 78 | ApplicationAlbumEntry entry; | ||
| 79 | AlbumFileDateTime datetime; | ||
| 80 | u64 unknown; | ||
| 81 | }; | ||
| 82 | |||
| 83 | /// Registers all Capture services with the specified service manager. | ||
| 13 | void InstallInterfaces(SM::ServiceManager& sm); | 84 | void InstallInterfaces(SM::ServiceManager& sm); |
| 14 | 85 | ||
| 15 | } // namespace Service::Capture | 86 | } // namespace Service::Capture |
diff --git a/src/core/hle/service/caps/caps_a.cpp b/src/core/hle/service/caps/caps_a.cpp new file mode 100644 index 000000000..88a3fdc05 --- /dev/null +++ b/src/core/hle/service/caps/caps_a.cpp | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/caps/caps_a.h" | ||
| 6 | |||
| 7 | namespace Service::Capture { | ||
| 8 | |||
| 9 | class IAlbumAccessorSession final : public ServiceFramework<IAlbumAccessorSession> { | ||
| 10 | public: | ||
| 11 | explicit IAlbumAccessorSession() : ServiceFramework{"IAlbumAccessorSession"} { | ||
| 12 | // clang-format off | ||
| 13 | static const FunctionInfo functions[] = { | ||
| 14 | {2001, nullptr, "OpenAlbumMovieReadStream"}, | ||
| 15 | {2002, nullptr, "CloseAlbumMovieReadStream"}, | ||
| 16 | {2003, nullptr, "GetAlbumMovieReadStreamMovieDataSize"}, | ||
| 17 | {2004, nullptr, "ReadMovieDataFromAlbumMovieReadStream"}, | ||
| 18 | {2005, nullptr, "GetAlbumMovieReadStreamBrokenReason"}, | ||
| 19 | {2006, nullptr, "GetAlbumMovieReadStreamImageDataSize"}, | ||
| 20 | {2007, nullptr, "ReadImageDataFromAlbumMovieReadStream"}, | ||
| 21 | {2008, nullptr, "ReadFileAttributeFromAlbumMovieReadStream"}, | ||
| 22 | }; | ||
| 23 | // clang-format on | ||
| 24 | |||
| 25 | RegisterHandlers(functions); | ||
| 26 | } | ||
| 27 | }; | ||
| 28 | |||
| 29 | CAPS_A::CAPS_A() : ServiceFramework("caps:a") { | ||
| 30 | // clang-format off | ||
| 31 | static const FunctionInfo functions[] = { | ||
| 32 | {0, nullptr, "GetAlbumFileCount"}, | ||
| 33 | {1, nullptr, "GetAlbumFileList"}, | ||
| 34 | {2, nullptr, "LoadAlbumFile"}, | ||
| 35 | {3, nullptr, "DeleteAlbumFile"}, | ||
| 36 | {4, nullptr, "StorageCopyAlbumFile"}, | ||
| 37 | {5, nullptr, "IsAlbumMounted"}, | ||
| 38 | {6, nullptr, "GetAlbumUsage"}, | ||
| 39 | {7, nullptr, "GetAlbumFileSize"}, | ||
| 40 | {8, nullptr, "LoadAlbumFileThumbnail"}, | ||
| 41 | {9, nullptr, "LoadAlbumScreenShotImage"}, | ||
| 42 | {10, nullptr, "LoadAlbumScreenShotThumbnailImage"}, | ||
| 43 | {11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"}, | ||
| 44 | {12, nullptr, "LoadAlbumScreenShotImageEx"}, | ||
| 45 | {13, nullptr, "LoadAlbumScreenShotThumbnailImageEx"}, | ||
| 46 | {14, nullptr, "LoadAlbumScreenShotImageEx0"}, | ||
| 47 | {15, nullptr, "GetAlbumUsage3"}, | ||
| 48 | {16, nullptr, "GetAlbumMountResult"}, | ||
| 49 | {17, nullptr, "GetAlbumUsage16"}, | ||
| 50 | {18, nullptr, "Unknown18"}, | ||
| 51 | {100, nullptr, "GetAlbumFileCountEx0"}, | ||
| 52 | {101, nullptr, "GetAlbumFileListEx0"}, | ||
| 53 | {202, nullptr, "SaveEditedScreenShot"}, | ||
| 54 | {301, nullptr, "GetLastThumbnail"}, | ||
| 55 | {302, nullptr, "GetLastOverlayMovieThumbnail"}, | ||
| 56 | {401, nullptr, "GetAutoSavingStorage"}, | ||
| 57 | {501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"}, | ||
| 58 | {1001, nullptr, "LoadAlbumScreenShotThumbnailImageEx0"}, | ||
| 59 | {1002, nullptr, "LoadAlbumScreenShotImageEx1"}, | ||
| 60 | {1003, nullptr, "LoadAlbumScreenShotThumbnailImageEx1"}, | ||
| 61 | {8001, nullptr, "ForceAlbumUnmounted"}, | ||
| 62 | {8002, nullptr, "ResetAlbumMountStatus"}, | ||
| 63 | {8011, nullptr, "RefreshAlbumCache"}, | ||
| 64 | {8012, nullptr, "GetAlbumCache"}, | ||
| 65 | {8013, nullptr, "GetAlbumCacheEx"}, | ||
| 66 | {8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"}, | ||
| 67 | {10011, nullptr, "SetInternalErrorConversionEnabled"}, | ||
| 68 | {50000, nullptr, "LoadMakerNoteInfoForDebug"}, | ||
| 69 | {60002, nullptr, "OpenAccessorSession"}, | ||
| 70 | }; | ||
| 71 | // clang-format on | ||
| 72 | |||
| 73 | RegisterHandlers(functions); | ||
| 74 | } | ||
| 75 | |||
| 76 | CAPS_A::~CAPS_A() = default; | ||
| 77 | |||
| 78 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_a.h b/src/core/hle/service/caps/caps_a.h new file mode 100644 index 000000000..8de832491 --- /dev/null +++ b/src/core/hle/service/caps/caps_a.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Kernel { | ||
| 10 | class HLERequestContext; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Service::Capture { | ||
| 14 | |||
| 15 | class CAPS_A final : public ServiceFramework<CAPS_A> { | ||
| 16 | public: | ||
| 17 | explicit CAPS_A(); | ||
| 18 | ~CAPS_A() override; | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_c.cpp b/src/core/hle/service/caps/caps_c.cpp new file mode 100644 index 000000000..ea6452ffa --- /dev/null +++ b/src/core/hle/service/caps/caps_c.cpp | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/caps/caps_c.h" | ||
| 6 | |||
| 7 | namespace Service::Capture { | ||
| 8 | |||
| 9 | class IAlbumControlSession final : public ServiceFramework<IAlbumControlSession> { | ||
| 10 | public: | ||
| 11 | explicit IAlbumControlSession() : ServiceFramework{"IAlbumControlSession"} { | ||
| 12 | // clang-format off | ||
| 13 | static const FunctionInfo functions[] = { | ||
| 14 | {2001, nullptr, "OpenAlbumMovieReadStream"}, | ||
| 15 | {2002, nullptr, "CloseAlbumMovieReadStream"}, | ||
| 16 | {2003, nullptr, "GetAlbumMovieReadStreamMovieDataSize"}, | ||
| 17 | {2004, nullptr, "ReadMovieDataFromAlbumMovieReadStream"}, | ||
| 18 | {2005, nullptr, "GetAlbumMovieReadStreamBrokenReason"}, | ||
| 19 | {2006, nullptr, "GetAlbumMovieReadStreamImageDataSize"}, | ||
| 20 | {2007, nullptr, "ReadImageDataFromAlbumMovieReadStream"}, | ||
| 21 | {2008, nullptr, "ReadFileAttributeFromAlbumMovieReadStream"}, | ||
| 22 | {2401, nullptr, "OpenAlbumMovieWriteStream"}, | ||
| 23 | {2402, nullptr, "FinishAlbumMovieWriteStream"}, | ||
| 24 | {2403, nullptr, "CommitAlbumMovieWriteStream"}, | ||
| 25 | {2404, nullptr, "DiscardAlbumMovieWriteStream"}, | ||
| 26 | {2405, nullptr, "DiscardAlbumMovieWriteStreamNoDelete"}, | ||
| 27 | {2406, nullptr, "CommitAlbumMovieWriteStreamEx"}, | ||
| 28 | {2411, nullptr, "StartAlbumMovieWriteStreamDataSection"}, | ||
| 29 | {2412, nullptr, "EndAlbumMovieWriteStreamDataSection"}, | ||
| 30 | {2413, nullptr, "StartAlbumMovieWriteStreamMetaSection"}, | ||
| 31 | {2414, nullptr, "EndAlbumMovieWriteStreamMetaSection"}, | ||
| 32 | {2421, nullptr, "ReadDataFromAlbumMovieWriteStream"}, | ||
| 33 | {2422, nullptr, "WriteDataToAlbumMovieWriteStream"}, | ||
| 34 | {2424, nullptr, "WriteMetaToAlbumMovieWriteStream"}, | ||
| 35 | {2431, nullptr, "GetAlbumMovieWriteStreamBrokenReason"}, | ||
| 36 | {2433, nullptr, "GetAlbumMovieWriteStreamDataSize"}, | ||
| 37 | {2434, nullptr, "SetAlbumMovieWriteStreamDataSize"}, | ||
| 38 | }; | ||
| 39 | // clang-format on | ||
| 40 | |||
| 41 | RegisterHandlers(functions); | ||
| 42 | } | ||
| 43 | }; | ||
| 44 | |||
| 45 | CAPS_C::CAPS_C() : ServiceFramework("caps:c") { | ||
| 46 | // clang-format off | ||
| 47 | static const FunctionInfo functions[] = { | ||
| 48 | {1, nullptr, "CaptureRawImage"}, | ||
| 49 | {2, nullptr, "CaptureRawImageWithTimeout"}, | ||
| 50 | {33, nullptr, "Unknown33"}, | ||
| 51 | {1001, nullptr, "RequestTakingScreenShot"}, | ||
| 52 | {1002, nullptr, "RequestTakingScreenShotWithTimeout"}, | ||
| 53 | {1011, nullptr, "NotifyTakingScreenShotRefused"}, | ||
| 54 | {2001, nullptr, "NotifyAlbumStorageIsAvailable"}, | ||
| 55 | {2002, nullptr, "NotifyAlbumStorageIsUnavailable"}, | ||
| 56 | {2011, nullptr, "RegisterAppletResourceUserId"}, | ||
| 57 | {2012, nullptr, "UnregisterAppletResourceUserId"}, | ||
| 58 | {2013, nullptr, "GetApplicationIdFromAruid"}, | ||
| 59 | {2014, nullptr, "CheckApplicationIdRegistered"}, | ||
| 60 | {2101, nullptr, "GenerateCurrentAlbumFileId"}, | ||
| 61 | {2102, nullptr, "GenerateApplicationAlbumEntry"}, | ||
| 62 | {2201, nullptr, "SaveAlbumScreenShotFile"}, | ||
| 63 | {2202, nullptr, "SaveAlbumScreenShotFileEx"}, | ||
| 64 | {2301, nullptr, "SetOverlayScreenShotThumbnailData"}, | ||
| 65 | {2302, nullptr, "SetOverlayMovieThumbnailData"}, | ||
| 66 | {60001, nullptr, "OpenControlSession"}, | ||
| 67 | }; | ||
| 68 | // clang-format on | ||
| 69 | |||
| 70 | RegisterHandlers(functions); | ||
| 71 | } | ||
| 72 | |||
| 73 | CAPS_C::~CAPS_C() = default; | ||
| 74 | |||
| 75 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_c.h b/src/core/hle/service/caps/caps_c.h new file mode 100644 index 000000000..d07cdb441 --- /dev/null +++ b/src/core/hle/service/caps/caps_c.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Kernel { | ||
| 10 | class HLERequestContext; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Service::Capture { | ||
| 14 | |||
| 15 | class CAPS_C final : public ServiceFramework<CAPS_C> { | ||
| 16 | public: | ||
| 17 | explicit CAPS_C(); | ||
| 18 | ~CAPS_C() override; | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_sc.cpp b/src/core/hle/service/caps/caps_sc.cpp new file mode 100644 index 000000000..d01a8a58e --- /dev/null +++ b/src/core/hle/service/caps/caps_sc.cpp | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/caps/caps_sc.h" | ||
| 6 | |||
| 7 | namespace Service::Capture { | ||
| 8 | |||
| 9 | CAPS_SC::CAPS_SC() : ServiceFramework("caps:sc") { | ||
| 10 | // clang-format off | ||
| 11 | static const FunctionInfo functions[] = { | ||
| 12 | {1, nullptr, "CaptureRawImage"}, | ||
| 13 | {2, nullptr, "CaptureRawImageWithTimeout"}, | ||
| 14 | {3, nullptr, "AttachSharedBuffer"}, | ||
| 15 | {5, nullptr, "CaptureRawImageToAttachedSharedBuffer"}, | ||
| 16 | {210, nullptr, "Unknown210"}, | ||
| 17 | {1001, nullptr, "RequestTakingScreenShot"}, | ||
| 18 | {1002, nullptr, "RequestTakingScreenShotWithTimeout"}, | ||
| 19 | {1003, nullptr, "RequestTakingScreenShotEx"}, | ||
| 20 | {1004, nullptr, "RequestTakingScreenShotEx1"}, | ||
| 21 | {1009, nullptr, "CancelTakingScreenShot"}, | ||
| 22 | {1010, nullptr, "SetTakingScreenShotCancelState"}, | ||
| 23 | {1011, nullptr, "NotifyTakingScreenShotRefused"}, | ||
| 24 | {1012, nullptr, "NotifyTakingScreenShotFailed"}, | ||
| 25 | {1101, nullptr, "SetupOverlayMovieThumbnail"}, | ||
| 26 | {1106, nullptr, "Unknown1106"}, | ||
| 27 | {1107, nullptr, "Unknown1107"}, | ||
| 28 | {1201, nullptr, "OpenRawScreenShotReadStream"}, | ||
| 29 | {1202, nullptr, "CloseRawScreenShotReadStream"}, | ||
| 30 | {1203, nullptr, "ReadRawScreenShotReadStream"}, | ||
| 31 | {1204, nullptr, "Unknown1204"}, | ||
| 32 | }; | ||
| 33 | // clang-format on | ||
| 34 | |||
| 35 | RegisterHandlers(functions); | ||
| 36 | } | ||
| 37 | |||
| 38 | CAPS_SC::~CAPS_SC() = default; | ||
| 39 | |||
| 40 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_sc.h b/src/core/hle/service/caps/caps_sc.h new file mode 100644 index 000000000..9ba372f7a --- /dev/null +++ b/src/core/hle/service/caps/caps_sc.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Kernel { | ||
| 10 | class HLERequestContext; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Service::Capture { | ||
| 14 | |||
| 15 | class CAPS_SC final : public ServiceFramework<CAPS_SC> { | ||
| 16 | public: | ||
| 17 | explicit CAPS_SC(); | ||
| 18 | ~CAPS_SC() override; | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_ss.cpp b/src/core/hle/service/caps/caps_ss.cpp new file mode 100644 index 000000000..eaa3a7494 --- /dev/null +++ b/src/core/hle/service/caps/caps_ss.cpp | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/caps/caps_ss.h" | ||
| 6 | |||
| 7 | namespace Service::Capture { | ||
| 8 | |||
| 9 | CAPS_SS::CAPS_SS() : ServiceFramework("caps:ss") { | ||
| 10 | // clang-format off | ||
| 11 | static const FunctionInfo functions[] = { | ||
| 12 | {201, nullptr, "SaveScreenShot"}, | ||
| 13 | {202, nullptr, "SaveEditedScreenShot"}, | ||
| 14 | {203, nullptr, "SaveScreenShotEx0"}, | ||
| 15 | {204, nullptr, "SaveEditedScreenShotEx0"}, | ||
| 16 | {206, nullptr, "Unknown206"}, | ||
| 17 | {208, nullptr, "SaveScreenShotOfMovieEx1"}, | ||
| 18 | }; | ||
| 19 | // clang-format on | ||
| 20 | |||
| 21 | RegisterHandlers(functions); | ||
| 22 | } | ||
| 23 | |||
| 24 | CAPS_SS::~CAPS_SS() = default; | ||
| 25 | |||
| 26 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_ss.h b/src/core/hle/service/caps/caps_ss.h new file mode 100644 index 000000000..e258a6925 --- /dev/null +++ b/src/core/hle/service/caps/caps_ss.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Kernel { | ||
| 10 | class HLERequestContext; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Service::Capture { | ||
| 14 | |||
| 15 | class CAPS_SS final : public ServiceFramework<CAPS_SS> { | ||
| 16 | public: | ||
| 17 | explicit CAPS_SS(); | ||
| 18 | ~CAPS_SS() override; | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_su.cpp b/src/core/hle/service/caps/caps_su.cpp new file mode 100644 index 000000000..2b4c2d808 --- /dev/null +++ b/src/core/hle/service/caps/caps_su.cpp | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/caps/caps_su.h" | ||
| 6 | |||
| 7 | namespace Service::Capture { | ||
| 8 | |||
| 9 | CAPS_SU::CAPS_SU() : ServiceFramework("caps:su") { | ||
| 10 | // clang-format off | ||
| 11 | static const FunctionInfo functions[] = { | ||
| 12 | {201, nullptr, "SaveScreenShot"}, | ||
| 13 | {203, nullptr, "SaveScreenShotEx0"}, | ||
| 14 | }; | ||
| 15 | // clang-format on | ||
| 16 | |||
| 17 | RegisterHandlers(functions); | ||
| 18 | } | ||
| 19 | |||
| 20 | CAPS_SU::~CAPS_SU() = default; | ||
| 21 | |||
| 22 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_su.h b/src/core/hle/service/caps/caps_su.h new file mode 100644 index 000000000..cb11f7c9a --- /dev/null +++ b/src/core/hle/service/caps/caps_su.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Kernel { | ||
| 10 | class HLERequestContext; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Service::Capture { | ||
| 14 | |||
| 15 | class CAPS_SU final : public ServiceFramework<CAPS_SU> { | ||
| 16 | public: | ||
| 17 | explicit CAPS_SU(); | ||
| 18 | ~CAPS_SU() override; | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_u.cpp b/src/core/hle/service/caps/caps_u.cpp new file mode 100644 index 000000000..78bab6ed8 --- /dev/null +++ b/src/core/hle/service/caps/caps_u.cpp | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/logging/log.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | ||
| 7 | #include "core/hle/service/caps/caps.h" | ||
| 8 | #include "core/hle/service/caps/caps_u.h" | ||
| 9 | |||
| 10 | namespace Service::Capture { | ||
| 11 | |||
| 12 | class IAlbumAccessorApplicationSession final | ||
| 13 | : public ServiceFramework<IAlbumAccessorApplicationSession> { | ||
| 14 | public: | ||
| 15 | explicit IAlbumAccessorApplicationSession() | ||
| 16 | : ServiceFramework{"IAlbumAccessorApplicationSession"} { | ||
| 17 | // clang-format off | ||
| 18 | static const FunctionInfo functions[] = { | ||
| 19 | {2001, nullptr, "OpenAlbumMovieReadStream"}, | ||
| 20 | {2002, nullptr, "CloseAlbumMovieReadStream"}, | ||
| 21 | {2003, nullptr, "GetAlbumMovieReadStreamMovieDataSize"}, | ||
| 22 | {2004, nullptr, "ReadMovieDataFromAlbumMovieReadStream"}, | ||
| 23 | {2005, nullptr, "GetAlbumMovieReadStreamBrokenReason"}, | ||
| 24 | }; | ||
| 25 | // clang-format on | ||
| 26 | |||
| 27 | RegisterHandlers(functions); | ||
| 28 | } | ||
| 29 | }; | ||
| 30 | |||
| 31 | CAPS_U::CAPS_U() : ServiceFramework("caps:u") { | ||
| 32 | // clang-format off | ||
| 33 | static const FunctionInfo functions[] = { | ||
| 34 | {31, nullptr, "GetShimLibraryVersion"}, | ||
| 35 | {32, nullptr, "SetShimLibraryVersion"}, | ||
| 36 | {102, &CAPS_U::GetAlbumContentsFileListForApplication, "GetAlbumContentsFileListForApplication"}, | ||
| 37 | {103, nullptr, "DeleteAlbumContentsFileForApplication"}, | ||
| 38 | {104, nullptr, "GetAlbumContentsFileSizeForApplication"}, | ||
| 39 | {105, nullptr, "DeleteAlbumFileByAruidForDebug"}, | ||
| 40 | {110, nullptr, "LoadAlbumContentsFileScreenShotImageForApplication"}, | ||
| 41 | {120, nullptr, "LoadAlbumContentsFileThumbnailImageForApplication"}, | ||
| 42 | {130, nullptr, "PrecheckToCreateContentsForApplication"}, | ||
| 43 | {140, nullptr, "GetAlbumFileList1AafeAruidDeprecated"}, | ||
| 44 | {141, nullptr, "GetAlbumFileList2AafeUidAruidDeprecated"}, | ||
| 45 | {142, nullptr, "GetAlbumFileList3AaeAruid"}, | ||
| 46 | {143, nullptr, "GetAlbumFileList4AaeUidAruid"}, | ||
| 47 | {60002, nullptr, "OpenAccessorSessionForApplication"}, | ||
| 48 | }; | ||
| 49 | // clang-format on | ||
| 50 | |||
| 51 | RegisterHandlers(functions); | ||
| 52 | } | ||
| 53 | |||
| 54 | CAPS_U::~CAPS_U() = default; | ||
| 55 | |||
| 56 | void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& ctx) { | ||
| 57 | // Takes a type-0x6 output buffer containing an array of ApplicationAlbumFileEntry, a PID, an | ||
| 58 | // u8 ContentType, two s64s, and an u64 AppletResourceUserId. Returns an output u64 for total | ||
| 59 | // output entries (which is copied to a s32 by official SW). | ||
| 60 | IPC::RequestParser rp{ctx}; | ||
| 61 | [[maybe_unused]] const auto application_album_file_entries = rp.PopRaw<std::array<u8, 0x30>>(); | ||
| 62 | const auto pid = rp.Pop<s32>(); | ||
| 63 | const auto content_type = rp.PopRaw<ContentType>(); | ||
| 64 | [[maybe_unused]] const auto start_datetime = rp.PopRaw<AlbumFileDateTime>(); | ||
| 65 | [[maybe_unused]] const auto end_datetime = rp.PopRaw<AlbumFileDateTime>(); | ||
| 66 | const auto applet_resource_user_id = rp.Pop<u64>(); | ||
| 67 | LOG_WARNING(Service_Capture, | ||
| 68 | "(STUBBED) called. pid={}, content_type={}, applet_resource_user_id={}", pid, | ||
| 69 | content_type, applet_resource_user_id); | ||
| 70 | |||
| 71 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 72 | rb.Push(RESULT_SUCCESS); | ||
| 73 | rb.Push<s32>(0); | ||
| 74 | } | ||
| 75 | |||
| 76 | } // namespace Service::Capture | ||
diff --git a/src/core/hle/service/caps/caps_u.h b/src/core/hle/service/caps/caps_u.h new file mode 100644 index 000000000..e6e0716ff --- /dev/null +++ b/src/core/hle/service/caps/caps_u.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | // Copyright 2020 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Kernel { | ||
| 10 | class HLERequestContext; | ||
| 11 | } | ||
| 12 | |||
| 13 | namespace Service::Capture { | ||
| 14 | |||
| 15 | class CAPS_U final : public ServiceFramework<CAPS_U> { | ||
| 16 | public: | ||
| 17 | explicit CAPS_U(); | ||
| 18 | ~CAPS_U() override; | ||
| 19 | |||
| 20 | private: | ||
| 21 | void GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& ctx); | ||
| 22 | }; | ||
| 23 | |||
| 24 | } // namespace Service::Capture | ||