Merge remote-tracking branch 'upstream/master' into nx

# Conflicts:
#	src/core/CMakeLists.txt
#	src/core/arm/dynarmic/arm_dynarmic.cpp
#	src/core/arm/dyncom/arm_dyncom.cpp
#	src/core/hle/kernel/process.cpp
#	src/core/hle/kernel/thread.cpp
#	src/core/hle/kernel/thread.h
#	src/core/hle/kernel/vm_manager.cpp
#	src/core/loader/3dsx.cpp
#	src/core/loader/elf.cpp
#	src/core/loader/ncch.cpp
#	src/core/memory.cpp
#	src/core/memory.h
#	src/core/memory_setup.h
This commit is contained in:
bunnei 2017-10-09 23:56:20 -04:00
commit b1d5db1cf6
241 changed files with 20955 additions and 2730 deletions

View file

@ -24,6 +24,7 @@
#pragma once
#include <array>
#include <cstdint>
#ifdef _MSC_VER
@ -50,6 +51,9 @@ typedef double f64; ///< 64-bit floating point
typedef u64 VAddr; ///< Represents a pointer in the userspace virtual address space.
typedef u64 PAddr; ///< Represents a pointer in the ARM11 physical address space.
using u128 = std::array<std::uint64_t, 2>;
static_assert(sizeof(u128) == 16, "u128 must be 128 bits wide");
// An inheritable class to disallow the copy constructor and operator= functions
class NonCopyable {
protected:

View file

@ -30,6 +30,11 @@ public:
return {xyz * other.w + other.xyz * w + Cross(xyz, other.xyz),
w * other.w - Dot(xyz, other.xyz)};
}
Quaternion<T> Normalized() const {
T length = std::sqrt(xyz.Length2() + w * w);
return {xyz / length, w / length};
}
};
template <typename T>

View file

@ -8,6 +8,7 @@
#define GIT_BRANCH "@GIT_BRANCH@"
#define GIT_DESC "@GIT_DESC@"
#define BUILD_NAME "@REPO_NAME@"
#define BUILD_DATE "@BUILD_DATE@"
namespace Common {
@ -15,6 +16,7 @@ const char g_scm_rev[] = GIT_REV;
const char g_scm_branch[] = GIT_BRANCH;
const char g_scm_desc[] = GIT_DESC;
const char g_build_name[] = BUILD_NAME;
const char g_build_date[] = BUILD_DATE;
} // namespace

View file

@ -10,5 +10,6 @@ extern const char g_scm_rev[];
extern const char g_scm_branch[];
extern const char g_scm_desc[];
extern const char g_build_name[];
extern const char g_build_date[];
} // namespace

View file

@ -117,7 +117,7 @@ std::string StringFromFormat(const char* format, ...) {
}
// For Debugging. Read out an u8 array.
std::string ArrayToString(const u8* data, u32 size, int line_len, bool spaces) {
std::string ArrayToString(const u8* data, size_t size, int line_len, bool spaces) {
std::ostringstream oss;
oss << std::setfill('0') << std::hex;

View file

@ -33,7 +33,7 @@ inline void CharArrayFromFormat(char (&out)[Count], const char* format, ...) {
}
// Good
std::string ArrayToString(const u8* data, u32 size, int line_len = 20, bool spaces = true);
std::string ArrayToString(const u8* data, size_t size, int line_len = 20, bool spaces = true);
std::string StripSpaces(const std::string& s);
std::string StripQuotes(const std::string& s);

View file

@ -90,8 +90,9 @@ public:
x -= other.x;
y -= other.y;
}
template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type>
Vec2<decltype(-T{})> operator-() const {
template <typename U = T>
Vec2<std::enable_if_t<std::is_signed<U>::value, U>> operator-() const {
return MakeVec(-x, -y);
}
Vec2<decltype(T{} * T{})> operator*(const Vec2& other) const {
@ -103,8 +104,7 @@ public:
}
template <typename V>
void operator*=(const V& f) {
x *= f;
y *= f;
*this = *this * f;
}
template <typename V>
Vec2<decltype(T{} / V{})> operator/(const V& f) const {
@ -247,8 +247,9 @@ public:
y -= other.y;
z -= other.z;
}
template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type>
Vec3<decltype(-T{})> operator-() const {
template <typename U = T>
Vec3<std::enable_if_t<std::is_signed<U>::value, U>> operator-() const {
return MakeVec(-x, -y, -z);
}
Vec3<decltype(T{} * T{})> operator*(const Vec3& other) const {
@ -260,9 +261,7 @@ public:
}
template <typename V>
void operator*=(const V& f) {
x *= f;
y *= f;
z *= f;
*this = *this * f;
}
template <typename V>
Vec3<decltype(T{} / V{})> operator/(const V& f) const {
@ -462,8 +461,9 @@ public:
z -= other.z;
w -= other.w;
}
template <typename Q = T, class = typename std::enable_if<std::is_signed<Q>::value>::type>
Vec4<decltype(-T{})> operator-() const {
template <typename U = T>
Vec4<std::enable_if_t<std::is_signed<U>::value, U>> operator-() const {
return MakeVec(-x, -y, -z, -w);
}
Vec4<decltype(T{} * T{})> operator*(const Vec4& other) const {
@ -475,10 +475,7 @@ public:
}
template <typename V>
void operator*=(const V& f) {
x *= f;
y *= f;
z *= f;
w *= f;
*this = *this * f;
}
template <typename V>
Vec4<decltype(T{} / V{})> operator/(const V& f) const {
@ -721,4 +718,4 @@ static inline Vec4<T> MakeVec(const T& x, const Vec3<T>& yzw) {
return MakeVec(x, yzw[0], yzw[1], yzw[2]);
}
} // namespace
} // namespace Math