summaryrefslogtreecommitdiff
path: root/src/core/hle/service/fs.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-27 16:18:56 -0400
committerGravatar bunnei2014-07-04 20:37:45 -0400
commit17a6148f9df406a6ca4bdca98777e0aaf21f582a (patch)
tree3763cf9417649428c81c7e9e0cb6abac251faa49 /src/core/hle/service/fs.cpp
parentAPT: Added stubbed ReceiveParameter and various cleanups. (diff)
downloadyuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar.gz
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar.xz
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.zip
FileSys: Added preliminary support for applications reading the RomFS archive.
Archive: Fixed brace ugliness for neobrain :) FS: Commented out unused local variables to prevent warnings. ...But keeping them here for future use. archive_romfs: Removed unused #include.
Diffstat (limited to 'src/core/hle/service/fs.cpp')
-rw-r--r--src/core/hle/service/fs.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/core/hle/service/fs.cpp b/src/core/hle/service/fs.cpp
index 3a5afaa3c..5eabf36ad 100644
--- a/src/core/hle/service/fs.cpp
+++ b/src/core/hle/service/fs.cpp
@@ -2,11 +2,12 @@
2// Licensed under GPLv2 2// Licensed under GPLv2
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5
6#include "common/common.h" 5#include "common/common.h"
7 6
7#include "core/loader/loader.h"
8#include "core/hle/hle.h" 8#include "core/hle/hle.h"
9#include "core/hle/service/fs.h" 9#include "core/hle/service/fs.h"
10#include "core/hle/kernel/archive.h"
10 11
11//////////////////////////////////////////////////////////////////////////////////////////////////// 12////////////////////////////////////////////////////////////////////////////////////////////////////
12// Namespace FS_User 13// Namespace FS_User
@@ -15,8 +16,34 @@ namespace FS_User {
15 16
16void Initialize(Service::Interface* self) { 17void Initialize(Service::Interface* self) {
17 u32* cmd_buff = Service::GetCommandBuffer(); 18 u32* cmd_buff = Service::GetCommandBuffer();
18 DEBUG_LOG(KERNEL, "called");
19 cmd_buff[1] = 0; // No error 19 cmd_buff[1] = 0; // No error
20 DEBUG_LOG(KERNEL, "called");
21}
22
23void OpenFileDirectly(Service::Interface* self) {
24 u32* cmd_buff = Service::GetCommandBuffer();
25
26 FileSys::Archive::IdCode arch_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]);
27
28 // TODO(bunnei): Properly implement use of these...
29 //u32 transaction = cmd_buff[1];
30 //u32 arch_lowpath_type = cmd_buff[3];
31 //u32 arch_lowpath_sz = cmd_buff[4];
32 //u32 file_lowpath_type = cmd_buff[5];
33 //u32 file_lowpath_sz = cmd_buff[6];
34 //u32 flags = cmd_buff[7];
35 //u32 attr = cmd_buff[8];
36 //u32 arch_lowpath_desc = cmd_buff[9];
37 //u32 arch_lowpath_ptr = cmd_buff[10];
38 //u32 file_lowpath_desc = cmd_buff[11];
39 //u32 file_lowpath_ptr = cmd_buff[12];
40
41 Handle handle = Kernel::OpenArchive(arch_id);
42 if (0 != handle) {
43 cmd_buff[1] = 0; // No error
44 cmd_buff[3] = handle;
45 }
46 DEBUG_LOG(KERNEL, "called");
20} 47}
21 48
22const Interface::FunctionInfo FunctionTable[] = { 49const Interface::FunctionInfo FunctionTable[] = {
@@ -24,7 +51,7 @@ const Interface::FunctionInfo FunctionTable[] = {
24 {0x040100C4, nullptr, "Control"}, 51 {0x040100C4, nullptr, "Control"},
25 {0x08010002, Initialize, "Initialize"}, 52 {0x08010002, Initialize, "Initialize"},
26 {0x080201C2, nullptr, "OpenFile"}, 53 {0x080201C2, nullptr, "OpenFile"},
27 {0x08030204, nullptr, "OpenFileDirectly"}, 54 {0x08030204, OpenFileDirectly, "OpenFileDirectly"},
28 {0x08040142, nullptr, "DeleteFile"}, 55 {0x08040142, nullptr, "DeleteFile"},
29 {0x08050244, nullptr, "RenameFile"}, 56 {0x08050244, nullptr, "RenameFile"},
30 {0x08060142, nullptr, "DeleteDirectory"}, 57 {0x08060142, nullptr, "DeleteDirectory"},