diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/fs/archive.cpp | 12 | ||||
-rw-r--r-- | src/core/hle/service/fs/archive.h | 13 | ||||
-rw-r--r-- | src/core/hle/service/fs/fs_user.cpp | 12 |
3 files changed, 25 insertions, 12 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 4e275cb13..6c0df67c3 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -2,29 +2,35 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <cstddef> +#include <system_error> +#include <type_traits> #include <memory> #include <unordered_map> +#include <utility> #include <boost/container/flat_map.hpp> +#include "common/assert.h" #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/make_unique.h" -#include "common/math_util.h" #include "core/file_sys/archive_backend.h" #include "core/file_sys/archive_extsavedata.h" -#include "core/file_sys/archive_romfs.h" #include "core/file_sys/archive_savedata.h" #include "core/file_sys/archive_savedatacheck.h" #include "core/file_sys/archive_sdmc.h" #include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/directory_backend.h" +#include "core/file_sys/file_backend.h" +#include "core/hle/hle.h" #include "core/hle/service/service.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/fs_user.h" #include "core/hle/result.h" +#include "core/memory.h" // Specializes std::hash for ArchiveIdCode, so that we can use it in std::unordered_map. // Workaroung for libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970 @@ -110,7 +116,7 @@ ResultVal<bool> File::SyncRequest() { u32 address = cmd_buff[6]; LOG_TRACE(Service_FS, "Write %s %s: offset=0x%llx length=%d address=0x%x, flush=0x%x", GetTypeName().c_str(), GetName().c_str(), offset, length, address, flush); - cmd_buff[2] = static_cast<u32>(backend->Write(offset, length, flush, Memory::GetPointer(address))); + cmd_buff[2] = static_cast<u32>(backend->Write(offset, length, flush != 0, Memory::GetPointer(address))); break; } diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 357b6b096..f61125953 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -4,22 +4,25 @@ #pragma once +#include <memory> +#include <string> + #include "common/common_types.h" #include "core/file_sys/archive_backend.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/session.h" #include "core/hle/result.h" +namespace FileSys { +class DirectoryBackend; +class FileBackend; +} + /// The unique system identifier hash, also known as ID0 extern const std::string SYSTEM_ID; /// The scrambled SD card CID, also known as ID1 extern const std::string SDCARD_ID; -namespace Kernel { - class Session; -} - namespace Service { namespace FS { diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 0ad44e55e..ae52083f9 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -115,7 +115,8 @@ static void OpenFileDirectly(Service::Interface* self) { ResultVal<ArchiveHandle> archive_handle = OpenArchive(archive_id, archive_path); if (archive_handle.Failed()) { - LOG_ERROR(Service_FS, "failed to get a handle for archive"); + LOG_ERROR(Service_FS, "failed to get a handle for archive archive_id=0x%08X archive_path=%s", + archive_id, archive_path.DebugStr().c_str()); cmd_buff[1] = archive_handle.Code().raw; cmd_buff[3] = 0; return; @@ -128,7 +129,8 @@ static void OpenFileDirectly(Service::Interface* self) { cmd_buff[3] = Kernel::g_handle_table.Create(*file_res).MoveFrom(); } else { cmd_buff[3] = 0; - LOG_ERROR(Service_FS, "failed to get a handle for file %s", file_path.DebugStr().c_str()); + LOG_ERROR(Service_FS, "failed to get a handle for file %s mode=%u attributes=%d", + file_path.DebugStr().c_str(), mode.hex, attributes); } } @@ -347,7 +349,8 @@ static void OpenDirectory(Service::Interface* self) { if (dir_res.Succeeded()) { cmd_buff[3] = Kernel::g_handle_table.Create(*dir_res).MoveFrom(); } else { - LOG_ERROR(Service_FS, "failed to get a handle for directory"); + LOG_ERROR(Service_FS, "failed to get a handle for directory type=%d size=%d data=%s", + dirname_type, dirname_size, dir_path.DebugStr().c_str()); } } @@ -382,7 +385,8 @@ static void OpenArchive(Service::Interface* self) { cmd_buff[3] = (*handle >> 32) & 0xFFFFFFFF; } else { cmd_buff[2] = cmd_buff[3] = 0; - LOG_ERROR(Service_FS, "failed to get a handle for archive"); + LOG_ERROR(Service_FS, "failed to get a handle for archive archive_id=0x%08X archive_path=%s", + archive_id, archive_path.DebugStr().c_str()); } } |