Add in NCCH, TMD and SMDH from Citra (to get game title)

This commit is contained in:
zhupengfei
2019-09-27 22:11:27 +08:00
parent d55af0108e
commit 895cbb272c
15 changed files with 1328 additions and 6 deletions
+1
View File
@@ -1,4 +1,5 @@
add_library(common STATIC
alignment.h
assert.h
bit_field.h
common_funcs.h
+22
View File
@@ -0,0 +1,22 @@
// This file is under the public domain.
#pragma once
#include <cstddef>
#include <type_traits>
namespace Common {
template <typename T>
constexpr T AlignUp(T value, std::size_t size) {
static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
return static_cast<T>(value + (size - value % size) % size);
}
template <typename T>
constexpr T AlignDown(T value, std::size_t size) {
static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
return static_cast<T>(value - value % size);
}
} // namespace Common
+1
View File
@@ -870,6 +870,7 @@ u64 IOFile::Tell() const {
if (IsOpen())
return ftello(m_file);
LOG_ERROR(Core, "File is not open");
return -1;
}