summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/caps/caps.cpp
blob: 907f464ab1a5da79a618a500122dc87abe416913 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// 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/caps/caps.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"

namespace Service::Capture {

class CAPS_A final : public ServiceFramework<CAPS_A> {
public:
    explicit CAPS_A() : ServiceFramework{"caps:a"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {0, nullptr, "GetAlbumFileCount"},
            {1, nullptr, "GetAlbumFileList"},
            {2, nullptr, "LoadAlbumFile"},
            {3, nullptr, "DeleteAlbumFile"},
            {4, nullptr, "StorageCopyAlbumFile"},
            {5, nullptr, "IsAlbumMounted"},
            {6, nullptr, "GetAlbumUsage"},
            {7, nullptr, "GetAlbumFileSize"},
            {8, nullptr, "LoadAlbumFileThumbnail"},
            {9, nullptr, "LoadAlbumScreenShotImage"},
            {10, nullptr, "LoadAlbumScreenShotThumbnailImage"},
            {11, nullptr, "GetAlbumEntryFromApplicationAlbumEntry"},
            {12, nullptr, "Unknown12"},
            {13, nullptr, "Unknown13"},
            {14, nullptr, "Unknown14"},
            {15, nullptr, "Unknown15"},
            {16, nullptr, "Unknown16"},
            {17, nullptr, "Unknown17"},
            {18, nullptr, "Unknown18"},
            {202, nullptr, "SaveEditedScreenShot"},
            {301, nullptr, "GetLastThumbnail"},
            {401, nullptr, "GetAutoSavingStorage"},
            {501, nullptr, "GetRequiredStorageSpaceSizeToCopyAll"},
            {1001, nullptr, "Unknown1001"},
            {1002, nullptr, "Unknown1002"},
            {1003, nullptr, "Unknown1003"},
            {8001, nullptr, "ForceAlbumUnmounted"},
            {8002, nullptr, "ResetAlbumMountStatus"},
            {8011, nullptr, "RefreshAlbumCache"},
            {8012, nullptr, "GetAlbumCache"},
            {8013, nullptr, "Unknown8013"},
            {8021, nullptr, "GetAlbumEntryFromApplicationAlbumEntryAruid"},
            {10011, nullptr, "SetInternalErrorConversionEnabled"},
            {50000, nullptr, "Unknown50000"},
            {60002, nullptr, "Unknown60002"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

class CAPS_C final : public ServiceFramework<CAPS_C> {
public:
    explicit CAPS_C() : ServiceFramework{"caps:c"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {33, nullptr, "Unknown33"},
            {2001, nullptr, "Unknown2001"},
            {2002, nullptr, "Unknown2002"},
            {2011, nullptr, "Unknown2011"},
            {2012, nullptr, "Unknown2012"},
            {2013, nullptr, "Unknown2013"},
            {2014, nullptr, "Unknown2014"},
            {2101, nullptr, "Unknown2101"},
            {2102, nullptr, "Unknown2102"},
            {2201, nullptr, "Unknown2201"},
            {2301, nullptr, "Unknown2301"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

class CAPS_SC final : public ServiceFramework<CAPS_SC> {
public:
    explicit CAPS_SC() : ServiceFramework{"caps:sc"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {1, nullptr, "Unknown1"},
            {2, nullptr, "Unknown2"},
            {1001, nullptr, "Unknown3"},
            {1002, nullptr, "Unknown4"},
            {1003, nullptr, "Unknown5"},
            {1011, nullptr, "Unknown6"},
            {1012, nullptr, "Unknown7"},
            {1201, nullptr, "Unknown8"},
            {1202, nullptr, "Unknown9"},
            {1203, nullptr, "Unknown10"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

class CAPS_SS final : public ServiceFramework<CAPS_SS> {
public:
    explicit CAPS_SS() : ServiceFramework{"caps:ss"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {201, nullptr, "Unknown1"},
            {202, nullptr, "Unknown2"},
            {203, nullptr, "Unknown3"},
            {204, nullptr, "Unknown4"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

class CAPS_SU final : public ServiceFramework<CAPS_SU> {
public:
    explicit CAPS_SU() : ServiceFramework{"caps:su"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {201, nullptr, "SaveScreenShot"},
            {203, nullptr, "SaveScreenShotEx0"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

class CAPS_U final : public ServiceFramework<CAPS_U> {
public:
    explicit CAPS_U() : ServiceFramework{"caps:u"} {
        // clang-format off
        static const FunctionInfo functions[] = {
            {32, nullptr, "SetShimLibraryVersion"},
            {102, nullptr, "GetAlbumFileListByAruid"},
            {103, nullptr, "DeleteAlbumFileByAruid"},
            {104, nullptr, "GetAlbumFileSizeByAruid"},
            {105, nullptr, "DeleteAlbumFileByAruidForDebug"},
            {110, nullptr, "LoadAlbumScreenShotImageByAruid"},
            {120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"},
            {130, nullptr, "PrecheckToCreateContentsByAruid"},
            {140, nullptr, "GetAlbumFileList1AafeAruidDeprecated"},
            {141, nullptr, "GetAlbumFileList2AafeUidAruidDeprecated"},
            {142, nullptr, "GetAlbumFileList3AaeAruid"},
            {143, nullptr, "GetAlbumFileList4AaeUidAruid"},
            {60002, nullptr, "OpenAccessorSessionForApplication"},
        };
        // clang-format on

        RegisterHandlers(functions);
    }
};

void InstallInterfaces(SM::ServiceManager& sm) {
    std::make_shared<CAPS_A>()->InstallAsService(sm);
    std::make_shared<CAPS_C>()->InstallAsService(sm);
    std::make_shared<CAPS_SC>()->InstallAsService(sm);
    std::make_shared<CAPS_SS>()->InstallAsService(sm);
    std::make_shared<CAPS_SU>()->InstallAsService(sm);
    std::make_shared<CAPS_U>()->InstallAsService(sm);
}

} // namespace Service::Capture