summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/core.vcxproj2
-rw-r--r--src/core/core.vcxproj.filters6
-rw-r--r--src/core/hle/service/fs.cpp121
-rw-r--r--src/core/hle/service/fs.h31
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 164 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 204c5d45a..978e956dc 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -39,6 +39,7 @@ set(SRCS core.cpp
39 hle/kernel/mutex.cpp 39 hle/kernel/mutex.cpp
40 hle/kernel/thread.cpp 40 hle/kernel/thread.cpp
41 hle/service/apt.cpp 41 hle/service/apt.cpp
42 hle/service/fs.cpp
42 hle/service/gsp.cpp 43 hle/service/gsp.cpp
43 hle/service/hid.cpp 44 hle/service/hid.cpp
44 hle/service/ndm.cpp 45 hle/service/ndm.cpp
@@ -85,6 +86,7 @@ set(HEADERS core.h
85 hle/kernel/thread.h 86 hle/kernel/thread.h
86 hle/function_wrappers.h 87 hle/function_wrappers.h
87 hle/service/apt.h 88 hle/service/apt.h
89 hle/service/fs.h
88 hle/service/gsp.h 90 hle/service/gsp.h
89 hle/service/hid.h 91 hle/service/hid.h
90 hle/service/service.h 92 hle/service/service.h
diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj
index 85ac50818..63efe7c4d 100644
--- a/src/core/core.vcxproj
+++ b/src/core/core.vcxproj
@@ -171,6 +171,7 @@
171 <ClCompile Include="hle\kernel\mutex.cpp" /> 171 <ClCompile Include="hle\kernel\mutex.cpp" />
172 <ClCompile Include="hle\kernel\thread.cpp" /> 172 <ClCompile Include="hle\kernel\thread.cpp" />
173 <ClCompile Include="hle\service\apt.cpp" /> 173 <ClCompile Include="hle\service\apt.cpp" />
174 <ClCompile Include="hle\service\fs.cpp" />
174 <ClCompile Include="hle\service\gsp.cpp" /> 175 <ClCompile Include="hle\service\gsp.cpp" />
175 <ClCompile Include="hle\service\hid.cpp" /> 176 <ClCompile Include="hle\service\hid.cpp" />
176 <ClCompile Include="hle\service\ndm.cpp" /> 177 <ClCompile Include="hle\service\ndm.cpp" />
@@ -221,6 +222,7 @@
221 <ClInclude Include="hle\kernel\mutex.h" /> 222 <ClInclude Include="hle\kernel\mutex.h" />
222 <ClInclude Include="hle\kernel\thread.h" /> 223 <ClInclude Include="hle\kernel\thread.h" />
223 <ClInclude Include="hle\service\apt.h" /> 224 <ClInclude Include="hle\service\apt.h" />
225 <ClInclude Include="hle\service\fs.h" />
224 <ClInclude Include="hle\service\gsp.h" /> 226 <ClInclude Include="hle\service\gsp.h" />
225 <ClInclude Include="hle\service\hid.h" /> 227 <ClInclude Include="hle\service\hid.h" />
226 <ClInclude Include="hle\service\ndm.h" /> 228 <ClInclude Include="hle\service\ndm.h" />
diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters
index 37c550d56..39a3cdc4b 100644
--- a/src/core/core.vcxproj.filters
+++ b/src/core/core.vcxproj.filters
@@ -173,6 +173,9 @@
173 <ClCompile Include="hle\kernel\archive.cpp"> 173 <ClCompile Include="hle\kernel\archive.cpp">
174 <Filter>hle\kernel</Filter> 174 <Filter>hle\kernel</Filter>
175 </ClCompile> 175 </ClCompile>
176 <ClCompile Include="hle\service\fs.cpp">
177 <Filter>hle\service</Filter>
178 </ClCompile>
176 </ItemGroup> 179 </ItemGroup>
177 <ItemGroup> 180 <ItemGroup>
178 <ClInclude Include="arm\disassembler\arm_disasm.h"> 181 <ClInclude Include="arm\disassembler\arm_disasm.h">
@@ -308,6 +311,9 @@
308 <ClInclude Include="hle\kernel\archive.h"> 311 <ClInclude Include="hle\kernel\archive.h">
309 <Filter>hle\kernel</Filter> 312 <Filter>hle\kernel</Filter>
310 </ClInclude> 313 </ClInclude>
314 <ClInclude Include="hle\service\fs.h">
315 <Filter>hle\service</Filter>
316 </ClInclude>
311 </ItemGroup> 317 </ItemGroup>
312 <ItemGroup> 318 <ItemGroup>
313 <Text Include="CMakeLists.txt" /> 319 <Text Include="CMakeLists.txt" />
diff --git a/src/core/hle/service/fs.cpp b/src/core/hle/service/fs.cpp
new file mode 100644
index 000000000..3a5afaa3c
--- /dev/null
+++ b/src/core/hle/service/fs.cpp
@@ -0,0 +1,121 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5
6#include "common/common.h"
7
8#include "core/hle/hle.h"
9#include "core/hle/service/fs.h"
10
11////////////////////////////////////////////////////////////////////////////////////////////////////
12// Namespace FS_User
13
14namespace FS_User {
15
16void Initialize(Service::Interface* self) {
17 u32* cmd_buff = Service::GetCommandBuffer();
18 DEBUG_LOG(KERNEL, "called");
19 cmd_buff[1] = 0; // No error
20}
21
22const Interface::FunctionInfo FunctionTable[] = {
23 {0x000100C6, nullptr, "Dummy1"},
24 {0x040100C4, nullptr, "Control"},
25 {0x08010002, Initialize, "Initialize"},
26 {0x080201C2, nullptr, "OpenFile"},
27 {0x08030204, nullptr, "OpenFileDirectly"},
28 {0x08040142, nullptr, "DeleteFile"},
29 {0x08050244, nullptr, "RenameFile"},
30 {0x08060142, nullptr, "DeleteDirectory"},
31 {0x08070142, nullptr, "DeleteDirectoryRecursively"},
32 {0x08080202, nullptr, "CreateFile"},
33 {0x08090182, nullptr, "CreateDirectory"},
34 {0x080A0244, nullptr, "RenameDirectory"},
35 {0x080B0102, nullptr, "OpenDirectory"},
36 {0x080C00C2, nullptr, "OpenArchive"},
37 {0x080D0144, nullptr, "ControlArchive"},
38 {0x080E0080, nullptr, "CloseArchive"},
39 {0x080F0180, nullptr, "FormatThisUserSaveData"},
40 {0x08100200, nullptr, "CreateSystemSaveData"},
41 {0x08110040, nullptr, "DeleteSystemSaveData"},
42 {0x08120080, nullptr, "GetFreeBytes"},
43 {0x08130000, nullptr, "GetCardType"},
44 {0x08140000, nullptr, "GetSdmcArchiveResource"},
45 {0x08150000, nullptr, "GetNandArchiveResource"},
46 {0x08160000, nullptr, "GetSdmcFatfsErro"},
47 {0x08170000, nullptr, "IsSdmcDetected"},
48 {0x08180000, nullptr, "IsSdmcWritable"},
49 {0x08190042, nullptr, "GetSdmcCid"},
50 {0x081A0042, nullptr, "GetNandCid"},
51 {0x081B0000, nullptr, "GetSdmcSpeedInfo"},
52 {0x081C0000, nullptr, "GetNandSpeedInfo"},
53 {0x081D0042, nullptr, "GetSdmcLog"},
54 {0x081E0042, nullptr, "GetNandLog"},
55 {0x081F0000, nullptr, "ClearSdmcLog"},
56 {0x08200000, nullptr, "ClearNandLog"},
57 {0x08210000, nullptr, "CardSlotIsInserted"},
58 {0x08220000, nullptr, "CardSlotPowerOn"},
59 {0x08230000, nullptr, "CardSlotPowerOff"},
60 {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"},
61 {0x08250040, nullptr, "CardNorDirectCommand"},
62 {0x08260080, nullptr, "CardNorDirectCommandWithAddress"},
63 {0x08270082, nullptr, "CardNorDirectRead"},
64 {0x082800C2, nullptr, "CardNorDirectReadWithAddress"},
65 {0x08290082, nullptr, "CardNorDirectWrite"},
66 {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"},
67 {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"},
68 {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"},
69 {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"},
70 {0x082E0040, nullptr, "GetProductInfo"},
71 {0x082F0040, nullptr, "GetProgramLaunchInfo"},
72 {0x08300182, nullptr, "CreateExtSaveData"},
73 {0x08310180, nullptr, "CreateSharedExtSaveData"},
74 {0x08320102, nullptr, "ReadExtSaveDataIcon"},
75 {0x08330082, nullptr, "EnumerateExtSaveData"},
76 {0x08340082, nullptr, "EnumerateSharedExtSaveData"},
77 {0x08350080, nullptr, "DeleteExtSaveData"},
78 {0x08360080, nullptr, "DeleteSharedExtSaveData"},
79 {0x08370040, nullptr, "SetCardSpiBaudRate"},
80 {0x08380040, nullptr, "SetCardSpiBusMode"},
81 {0x08390000, nullptr, "SendInitializeInfoTo9"},
82 {0x083A0100, nullptr, "GetSpecialContentIndex"},
83 {0x083B00C2, nullptr, "GetLegacyRomHeader"},
84 {0x083C00C2, nullptr, "GetLegacyBannerData"},
85 {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"},
86 {0x083E00C2, nullptr, "QueryTotalQuotaSize"},
87 {0x083F00C0, nullptr, "GetExtDataBlockSize"},
88 {0x08400040, nullptr, "AbnegateAccessRight"},
89 {0x08410000, nullptr, "DeleteSdmcRoot"},
90 {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"},
91 {0x08430000, nullptr, "InitializeCtrFileSystem"},
92 {0x08440000, nullptr, "CreateSeed"},
93 {0x084500C2, nullptr, "GetFormatInfo"},
94 {0x08460102, nullptr, "GetLegacyRomHeader2"},
95 {0x08470180, nullptr, "FormatCtrCardUserSaveData"},
96 {0x08480042, nullptr, "GetSdmcCtrRootPath"},
97 {0x08490040, nullptr, "GetArchiveResource"},
98 {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"},
99 {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"},
100 {0x084C0242, nullptr, "FormatSaveData"},
101 {0x084D0102, nullptr, "GetLegacySubBannerData"},
102 {0x084E0342, nullptr, "UpdateSha256Context"},
103 {0x084F0102, nullptr, "ReadSpecialFile"},
104 {0x08500040, nullptr, "GetSpecialFileSize"},
105 {0x08580000, nullptr, "GetMovableSedHashedKeyYRandomData"},
106 {0x08610042, nullptr, "InitializeWithSdkVersion"},
107 {0x08620040, nullptr, "SetPriority"},
108 {0x08630000, nullptr, "GetPriority"},
109};
110
111////////////////////////////////////////////////////////////////////////////////////////////////////
112// Interface class
113
114Interface::Interface() {
115 Register(FunctionTable, ARRAY_SIZE(FunctionTable));
116}
117
118Interface::~Interface() {
119}
120
121} // namespace
diff --git a/src/core/hle/service/fs.h b/src/core/hle/service/fs.h
new file mode 100644
index 000000000..34b0610ad
--- /dev/null
+++ b/src/core/hle/service/fs.h
@@ -0,0 +1,31 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9////////////////////////////////////////////////////////////////////////////////////////////////////
10// Namespace FS_User
11
12namespace FS_User {
13
14/// Interface to "fs:USER" service
15class Interface : public Service::Interface {
16public:
17
18 Interface();
19
20 ~Interface();
21
22 /**
23 * Gets the string port name used by CTROS for the service
24 * @return Port name of service
25 */
26 const char *GetPortName() const {
27 return "Ufs:";
28 }
29};
30
31} // namespace
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 4a1ac857e..d3af2768a 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -10,6 +10,7 @@
10 10
11#include "core/hle/service/service.h" 11#include "core/hle/service/service.h"
12#include "core/hle/service/apt.h" 12#include "core/hle/service/apt.h"
13#include "core/hle/service/fs.h"
13#include "core/hle/service/gsp.h" 14#include "core/hle/service/gsp.h"
14#include "core/hle/service/hid.h" 15#include "core/hle/service/hid.h"
15#include "core/hle/service/ndm.h" 16#include "core/hle/service/ndm.h"
@@ -71,6 +72,7 @@ void Init() {
71 72
72 g_manager->AddService(new SRV::Interface); 73 g_manager->AddService(new SRV::Interface);
73 g_manager->AddService(new APT_U::Interface); 74 g_manager->AddService(new APT_U::Interface);
75 g_manager->AddService(new FS_User::Interface);
74 g_manager->AddService(new GSP_GPU::Interface); 76 g_manager->AddService(new GSP_GPU::Interface);
75 g_manager->AddService(new HID_User::Interface); 77 g_manager->AddService(new HID_User::Interface);
76 g_manager->AddService(new NDM_U::Interface); 78 g_manager->AddService(new NDM_U::Interface);