summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/fssystem/fs_types.h
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-08-11 03:34:43 +0200
committerLiam <byteslice@airmail.cc>2023-08-15 23:47:25 +0200
commit86f6b6b7b2d930e8203114332b04a5c49a780b06 (patch)
treebf7ff58b0a36051d3c3489a40999d80357c570d0 /src/core/file_sys/fssystem/fs_types.h
parentMerge pull request #11287 from liamwhite/replaced-bytes (diff)
downloadyuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.gz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.bz2
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.lz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.xz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.zst
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.zip
Diffstat (limited to 'src/core/file_sys/fssystem/fs_types.h')
-rw-r--r--src/core/file_sys/fssystem/fs_types.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/file_sys/fssystem/fs_types.h b/src/core/file_sys/fssystem/fs_types.h
new file mode 100644
index 000000000..43aeaf447
--- /dev/null
+++ b/src/core/file_sys/fssystem/fs_types.h
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "common/common_funcs.h"
+
+namespace FileSys {
+
+struct Int64 {
+ u32 low;
+ u32 high;
+
+ constexpr void Set(s64 v) {
+ this->low = static_cast<u32>((v & static_cast<u64>(0x00000000FFFFFFFFULL)) >> 0);
+ this->high = static_cast<u32>((v & static_cast<u64>(0xFFFFFFFF00000000ULL)) >> 32);
+ }
+
+ constexpr s64 Get() const {
+ return (static_cast<s64>(this->high) << 32) | (static_cast<s64>(this->low));
+ }
+
+ constexpr Int64& operator=(s64 v) {
+ this->Set(v);
+ return *this;
+ }
+
+ constexpr operator s64() const {
+ return this->Get();
+ }
+};
+
+struct HashSalt {
+ static constexpr size_t Size = 32;
+
+ std::array<u8, Size> value;
+};
+static_assert(std::is_trivial_v<HashSalt>);
+static_assert(sizeof(HashSalt) == HashSalt::Size);
+
+constexpr inline size_t IntegrityMinLayerCount = 2;
+constexpr inline size_t IntegrityMaxLayerCount = 7;
+constexpr inline size_t IntegrityLayerCountSave = 5;
+constexpr inline size_t IntegrityLayerCountSaveDataMeta = 4;
+
+} // namespace FileSys