committed by
Liam
21 changed files with 195 additions and 188 deletions
-
8src/core/core.cpp
-
3src/core/file_sys/bis_factory.cpp
-
39src/core/file_sys/directory.h
-
33src/core/file_sys/fs_directory.h
-
39src/core/file_sys/fs_filesystem.h
-
23src/core/file_sys/mode.h
-
27src/core/file_sys/vfs/vfs.cpp
-
11src/core/file_sys/vfs/vfs.h
-
51src/core/file_sys/vfs/vfs_real.cpp
-
25src/core/file_sys/vfs/vfs_real.h
-
6src/core/hle/service/am/applets/applet_web_browser.cpp
-
30src/core/hle/service/filesystem/filesystem.cpp
-
15src/core/hle/service/filesystem/filesystem.h
-
26src/core/hle/service/filesystem/fsp/fs_i_directory.cpp
-
7src/core/hle/service/filesystem/fsp/fs_i_directory.h
-
1src/core/hle/service/filesystem/fsp/fs_i_file.h
-
10src/core/hle/service/filesystem/fsp/fs_i_filesystem.cpp
-
8src/core/hle/service/filesystem/fsp/fsp_srv.cpp
-
2src/frontend_common/content_manager.h
-
4src/yuzu/game_list_worker.cpp
-
15src/yuzu/main.cpp
@ -1,39 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include <cstddef> |
|||
#include "common/common_funcs.h" |
|||
#include "common/common_types.h" |
|||
|
|||
//////////////////////////////////////////////////////////////////////////////////////////////////// |
|||
// FileSys namespace |
|||
|
|||
namespace FileSys { |
|||
|
|||
enum class EntryType : u8 { |
|||
Directory = 0, |
|||
File = 1, |
|||
}; |
|||
|
|||
// Structure of a directory entry, from |
|||
// http://switchbrew.org/index.php?title=Filesystem_services#DirectoryEntry |
|||
struct Entry { |
|||
Entry(std::string_view view, EntryType entry_type, u64 entry_size) |
|||
: type{entry_type}, file_size{entry_size} { |
|||
const std::size_t copy_size = view.copy(filename, std::size(filename) - 1); |
|||
filename[copy_size] = '\0'; |
|||
} |
|||
|
|||
char filename[0x301]; |
|||
INSERT_PADDING_BYTES(3); |
|||
EntryType type; |
|||
INSERT_PADDING_BYTES(3); |
|||
u64 file_size; |
|||
}; |
|||
static_assert(sizeof(Entry) == 0x310, "Directory Entry struct isn't exactly 0x310 bytes long!"); |
|||
static_assert(offsetof(Entry, type) == 0x304, "Wrong offset for type in Entry."); |
|||
static_assert(offsetof(Entry, file_size) == 0x308, "Wrong offset for file_size in Entry."); |
|||
|
|||
} // namespace FileSys |
|||
@ -0,0 +1,33 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
namespace FileSys { |
|||
|
|||
constexpr inline size_t EntryNameLengthMax = 0x300; |
|||
|
|||
struct DirectoryEntry { |
|||
DirectoryEntry(std::string_view view, s8 entry_type, u64 entry_size) |
|||
: type{entry_type}, file_size{static_cast<s64>(entry_size)} { |
|||
const std::size_t copy_size = view.copy(name, std::size(name) - 1); |
|||
name[copy_size] = '\0'; |
|||
} |
|||
|
|||
char name[EntryNameLengthMax + 1]; |
|||
INSERT_PADDING_BYTES(3); |
|||
s8 type; |
|||
INSERT_PADDING_BYTES(3); |
|||
s64 file_size; |
|||
}; |
|||
|
|||
static_assert(sizeof(DirectoryEntry) == 0x310, |
|||
"Directory Entry struct isn't exactly 0x310 bytes long!"); |
|||
static_assert(offsetof(DirectoryEntry, type) == 0x304, "Wrong offset for type in Entry."); |
|||
static_assert(offsetof(DirectoryEntry, file_size) == 0x308, "Wrong offset for file_size in Entry."); |
|||
|
|||
struct DirectoryHandle { |
|||
void* handle; |
|||
}; |
|||
|
|||
} // namespace FileSys |
|||
@ -0,0 +1,39 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
namespace FileSys { |
|||
|
|||
enum class OpenMode : u32 { |
|||
Read = (1 << 0), |
|||
Write = (1 << 1), |
|||
AllowAppend = (1 << 2), |
|||
|
|||
ReadWrite = (Read | Write), |
|||
All = (ReadWrite | AllowAppend), |
|||
}; |
|||
DECLARE_ENUM_FLAG_OPERATORS(OpenMode) |
|||
|
|||
enum class OpenDirectoryMode : u64 { |
|||
Directory = (1 << 0), |
|||
File = (1 << 1), |
|||
|
|||
All = (Directory | File), |
|||
|
|||
/* TODO: Separate enum, like N? */ |
|||
_NotRequireFileSize = (1 << 31), |
|||
}; |
|||
DECLARE_ENUM_FLAG_OPERATORS(OpenDirectoryMode) |
|||
|
|||
enum class DirectoryEntryType : u8 { |
|||
Directory = 0, |
|||
File = 1, |
|||
}; |
|||
|
|||
enum class CreateOption : u8 { |
|||
None = (0 << 0), |
|||
BigFile = (1 << 0), |
|||
}; |
|||
|
|||
} // namespace FileSys |
|||
@ -1,23 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "common/common_funcs.h" |
|||
#include "common/common_types.h" |
|||
|
|||
namespace FileSys { |
|||
|
|||
enum class Mode : u32 { |
|||
Read = 1 << 0, |
|||
Write = 1 << 1, |
|||
ReadWrite = Read | Write, |
|||
Append = 1 << 2, |
|||
ReadAppend = Read | Append, |
|||
WriteAppend = Write | Append, |
|||
All = ReadWrite | Append, |
|||
}; |
|||
|
|||
DECLARE_ENUM_FLAG_OPERATORS(Mode) |
|||
|
|||
} // namespace FileSys |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue