Split BEType.h to util/v128.hpp and util/to_endian.hpp

This commit is contained in:
Nekotekina
2020-12-13 16:34:45 +03:00
parent 62fdcf50ea
commit e321765c54
68 changed files with 195 additions and 171 deletions
-1
View File
@@ -1,7 +1,6 @@
#include "File.h"
#include "mutex.h"
#include "StrFmt.h"
#include "BEType.h"
#include "Crypto/sha1.h"
#include <unordered_map>
+2 -1
View File
@@ -1,8 +1,9 @@
#include "StrFmt.h"
#include "BEType.h"
#include "StrUtil.h"
#include "cfmt.h"
#include "util/endian.hpp"
#include "util/logs.hpp"
#include "util/v128.hpp"
#include <algorithm>
#include <string_view>
+11
View File
@@ -119,6 +119,17 @@ struct fmt_unveil<b8, void>
}
};
template <typename T, bool Se, std::size_t Align>
struct fmt_unveil<se_t<T, Se, Align>, void>
{
using type = typename fmt_unveil<T>::type;
static inline auto get(const se_t<T, Se, Align>& arg)
{
return fmt_unveil<T>::get(arg);
}
};
// String type format provider, also type classifier (format() called if an argument is formatted as "%s")
template <typename T, typename = void>
struct fmt_class_string
+2 -2
View File
@@ -1296,7 +1296,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no
if (op != X64OP_LOAD_BE)
{
value = se_storage<u32>::swap(value);
value = stx::se_storage<u32>::swap(value);
}
if (op == X64OP_LOAD_CMP)
@@ -1338,7 +1338,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no
}
u32 val32 = static_cast<u32>(reg_value);
if (!thread->write_reg(addr, op == X64OP_STORE ? se_storage<u32>::swap(val32) : val32))
if (!thread->write_reg(addr, op == X64OP_STORE ? stx::se_storage<u32>::swap(val32) : val32))
{
return false;
}
+3
View File
@@ -4,6 +4,9 @@
#include "version.h"
#include "Emu/System.h"
#include "util/types.hpp"
#include "util/endian.hpp"
LOG_CHANNEL(patch_log, "PAT");
namespace config_key
+2 -2
View File
@@ -1,10 +1,10 @@
#pragma once
#include "BEType.h"
#include <vector>
#include <string>
#include <unordered_map>
#include "util/types.hpp"
#include "util/yaml.hpp"
namespace patch_key
@@ -53,7 +53,7 @@ public:
f64 double_value;
} value { 0 };
};
using patch_app_versions = std::unordered_map<std::string /*app_version*/, bool /*enabled*/>;
using patch_serials = std::unordered_map<std::string /*serial*/, patch_app_versions>;
using patch_titles = std::unordered_map<std::string /*serial*/, patch_serials>;
+2
View File
@@ -5,6 +5,8 @@
#include "Utilities/mutex.h"
#include <cmath>
#include "util/v128.hpp"
LOG_CHANNEL(edat_log, "EDAT");
// Static variables are being modified concurrently in ec.cpp, for now use a mutex
+2 -1
View File
@@ -4,9 +4,10 @@
#include "utils.h"
#include "Utilities/BEType.h"
#include "Utilities/File.h"
#include "util/v128.hpp"
constexpr u32 SDAT_FLAG = 0x01000000;
constexpr u32 EDAT_COMPRESSED_FLAG = 0x00000001;
constexpr u32 EDAT_FLAG_0x02 = 0x00000002;
+1 -2
View File
@@ -1,6 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
#include <sstream>
#include <iomanip>
@@ -96,7 +95,7 @@ struct PKGExtHeader
be_t<u32> ext_hdr_size; // Extended header size. ex: 0x40
be_t<u32> ext_data_size; // ex: 0x180
be_t<u32> main_and_ext_headers_hmac_offset; // ex: 0x100
be_t<u32> metadata_header_hmac_offset; // ex: 0x360, 0x390, 0x490
be_t<u32> metadata_header_hmac_offset; // ex: 0x360, 0x390, 0x490
be_t<u64> tail_offset; // tail size seams to be always 0x1A0
be_t<u32> padding1;
be_t<u32> pkg_key_id; // Id of the AES key used for decryption. PSP = 0x1, PSVita = 0xC0000002, PSM = 0xC0000004
+2 -1
View File
@@ -3,13 +3,14 @@
#include "sha1.h"
#include "utils.h"
#include "unself.h"
#include "Utilities/BEType.h"
#include "Emu/VFS.h"
#include "Emu/System.h"
#include <algorithm>
#include <zlib.h>
#include "util/v128.hpp"
inline u8 Read8(const fs::file& f)
{
u8 ret;
+2 -1
View File
@@ -26,7 +26,6 @@
#include "util/types.hpp"
#include "Utilities/StrFmt.h"
#include "Utilities/BEType.h"
#include "Utilities/BitField.h"
#include "util/logs.hpp"
#include "Utilities/JIT.h"
@@ -38,6 +37,8 @@
#include <array>
#include <vector>
#include "util/v128.hpp"
enum class i2 : char
{
};
+1 -1
View File
@@ -174,7 +174,7 @@ struct audio_port
return addr.addr() + position(offset) * buf_size();
}
to_be_t<float>* get_vm_ptr(s32 offset = 0) const
be_t<f32>* get_vm_ptr(s32 offset = 0) const
{
return vm::_ptr<f32>(buf_addr(offset));
}
+2 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include "Utilities/BEType.h"
#include "util/types.hpp"
#include "util/endian.hpp"
// Error codes
enum CellAudioInError
-2
View File
@@ -1,7 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
static const float CELL_GEM_SPHERE_RADIUS_MM = 22.5f;
// Error codes
-2
View File
@@ -1,7 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
//Return Codes
enum CellJpgDecError : u32
{
-1
View File
@@ -1,6 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
#include "Emu/Io/Keyboard.h"
enum CellKbError : u32
-1
View File
@@ -1,6 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
#include "Utilities/Thread.h"
#include "3rdparty/OpenAL/include/alext.h"
-2
View File
@@ -1,7 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
enum CellMouseError : u32
{
CELL_MOUSE_ERROR_FATAL = 0x80121201,
-1
View File
@@ -1,6 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
#include <array>
enum CellPadError : u32
-2
View File
@@ -1,7 +1,5 @@
#pragma once
#include "Utilities/BEType.h"
enum CellRescError : u32
{
CELL_RESC_ERROR_NOT_INITIALIZED = 0x80210301,

Some files were not shown because too many files have changed in this diff Show More