summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/fs.cpp
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-06-27 22:18:56 +0200
committerbunnei <bunneidev@gmail.com>2014-07-05 02:37:45 +0200
commit17a6148f9df406a6ca4bdca98777e0aaf21f582a (patch)
tree3763cf9417649428c81c7e9e0cb6abac251faa49 /src/core/hle/service/fs.cpp
parentAPT: Added stubbed ReceiveParameter and various cleanups. (diff)
downloadyuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar.gz
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar.bz2
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar.lz
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar.xz
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.tar.zst
yuzu-17a6148f9df406a6ca4bdca98777e0aaf21f582a.zip
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 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-
#include "common/common.h"
+#include "core/loader/loader.h"
#include "core/hle/hle.h"
#include "core/hle/service/fs.h"
+#include "core/hle/kernel/archive.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace FS_User
@@ -15,8 +16,34 @@ namespace FS_User {
void Initialize(Service::Interface* self) {
u32* cmd_buff = Service::GetCommandBuffer();
- DEBUG_LOG(KERNEL, "called");
cmd_buff[1] = 0; // No error
+ DEBUG_LOG(KERNEL, "called");
+}
+
+void OpenFileDirectly(Service::Interface* self) {
+ u32* cmd_buff = Service::GetCommandBuffer();
+
+ FileSys::Archive::IdCode arch_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]);
+
+ // TODO(bunnei): Properly implement use of these...
+ //u32 transaction = cmd_buff[1];
+ //u32 arch_lowpath_type = cmd_buff[3];
+ //u32 arch_lowpath_sz = cmd_buff[4];
+ //u32 file_lowpath_type = cmd_buff[5];
+ //u32 file_lowpath_sz = cmd_buff[6];
+ //u32 flags = cmd_buff[7];
+ //u32 attr = cmd_buff[8];
+ //u32 arch_lowpath_desc = cmd_buff[9];
+ //u32 arch_lowpath_ptr = cmd_buff[10];
+ //u32 file_lowpath_desc = cmd_buff[11];
+ //u32 file_lowpath_ptr = cmd_buff[12];
+
+ Handle handle = Kernel::OpenArchive(arch_id);
+ if (0 != handle) {
+ cmd_buff[1] = 0; // No error
+ cmd_buff[3] = handle;
+ }
+ DEBUG_LOG(KERNEL, "called");
}
const Interface::FunctionInfo FunctionTable[] = {
@@ -24,7 +51,7 @@ const Interface::FunctionInfo FunctionTable[] = {
{0x040100C4, nullptr, "Control"},
{0x08010002, Initialize, "Initialize"},
{0x080201C2, nullptr, "OpenFile"},
- {0x08030204, nullptr, "OpenFileDirectly"},
+ {0x08030204, OpenFileDirectly, "OpenFileDirectly"},
{0x08040142, nullptr, "DeleteFile"},
{0x08050244, nullptr, "RenameFile"},
{0x08060142, nullptr, "DeleteDirectory"},