aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar bunnei <ericbunnie@gmail.com>2014-06-27 16:18:56 -0400
committerGravatar bunnei <bunneidev@gmail.com>2014-07-04 20:37:45 -0400
commit17a6148f9df406a6ca4bdca98777e0aaf21f582a (patch)
tree3763cf9417649428c81c7e9e0cb6abac251faa49 /src/core/hle/service
parent82702fedb831c98479be7c4ea2caae920302efa6 (diff)
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')
-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 3a5afaa3..5eabf36a 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"},