1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Enable -Wunused-variable

This commit is contained in:
Nekotekina 2021-01-12 13:01:06 +03:00
parent 631d7d0ce7
commit db8e6fe7a7
62 changed files with 167 additions and 183 deletions

View File

@ -542,7 +542,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
} }
case 0x80: case 0x80:
{ {
switch (auto mod_code = get_modRM_reg(code, 0)) switch (get_modRM_reg(code, 0))
{ {
//case 0: out_op = X64OP_ADD; break; // TODO: strange info in instruction manual //case 0: out_op = X64OP_ADD; break; // TODO: strange info in instruction manual
case 1: out_op = X64OP_OR; break; case 1: out_op = X64OP_OR; break;
@ -561,7 +561,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
} }
case 0x81: case 0x81:
{ {
switch (auto mod_code = get_modRM_reg(code, 0)) switch (get_modRM_reg(code, 0))
{ {
case 0: out_op = X64OP_ADD; break; case 0: out_op = X64OP_ADD; break;
case 1: out_op = X64OP_OR; break; case 1: out_op = X64OP_OR; break;
@ -580,7 +580,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
} }
case 0x83: case 0x83:
{ {
switch (auto mod_code = get_modRM_reg(code, 0)) switch (get_modRM_reg(code, 0))
{ {
case 0: out_op = X64OP_ADD; break; case 0: out_op = X64OP_ADD; break;
case 1: out_op = X64OP_OR; break; case 1: out_op = X64OP_OR; break;
@ -721,7 +721,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
const u8 vopm = op1 == 0xc5 ? 1 : op2 & 0x1f; const u8 vopm = op1 == 0xc5 ? 1 : op2 & 0x1f;
const u8 vop1 = op1 == 0xc5 ? op3 : code[2]; const u8 vop1 = op1 == 0xc5 ? op3 : code[2];
const u8 vlen = (opx & 0x4) ? 32 : 16; const u8 vlen = (opx & 0x4) ? 32 : 16;
const u8 vreg = (~opx >> 3) & 0xf; //const u8 vreg = (~opx >> 3) & 0xf;
out_length += op1 == 0xc5 ? 2 : 3; out_length += op1 == 0xc5 ? 2 : 3;
code += op1 == 0xc5 ? 2 : 3; code += op1 == 0xc5 ? 2 : 3;
@ -782,7 +782,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
} }
case 0xf6: case 0xf6:
{ {
switch (auto mod_code = get_modRM_reg(code, 0)) switch (get_modRM_reg(code, 0))
{ {
case 0: out_op = X64OP_LOAD_TEST; break; case 0: out_op = X64OP_LOAD_TEST; break;
default: out_op = X64OP_NONE; break; // TODO... default: out_op = X64OP_NONE; break; // TODO...
@ -795,7 +795,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
} }
case 0xf7: case 0xf7:
{ {
switch (auto mod_code = get_modRM_reg(code, 0)) switch (get_modRM_reg(code, 0))
{ {
case 0: out_op = X64OP_LOAD_TEST; break; case 0: out_op = X64OP_LOAD_TEST; break;
default: out_op = X64OP_NONE; break; // TODO... default: out_op = X64OP_NONE; break; // TODO...
@ -2027,11 +2027,11 @@ u64 thread_base::finalize(thread_state result_state) noexcept
const u64 _self = m_thread; const u64 _self = m_thread;
// Set result state (errored or finalized) // Set result state (errored or finalized)
const bool ok = 0 == (3 & ~m_sync.fetch_op([&](u64& v) m_sync.fetch_op([&](u64& v)
{ {
v &= -4; v &= -4;
v |= static_cast<u32>(result_state); v |= static_cast<u32>(result_state);
})); });
// Signal waiting threads // Signal waiting threads
m_sync.notify_all(2); m_sync.notify_all(2);
@ -2069,7 +2069,7 @@ thread_base::native_entry thread_base::finalize(u64 _self) noexcept
{ {
s_pool_ctr |= s_stop_bit; s_pool_ctr |= s_stop_bit;
while (u64 remains = s_pool_ctr & ~s_stop_bit) while (/*u64 remains = */s_pool_ctr & ~s_stop_bit)
{ {
for (u32 i = 0; i < std::size(s_thread_pool); i++) for (u32 i = 0; i < std::size(s_thread_pool); i++)
{ {

View File

@ -464,7 +464,7 @@ static void ec_priv_to_pub(u8 *k, u8 *Q)
} }
#endif #endif
int ecdsa_set_curve(u8* p, u8* a, u8* b, u8* N, u8* Gx, u8* Gy) int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy)
{ {
memcpy(ec_p, p, 20); memcpy(ec_p, p, 20);
memcpy(ec_a, a, 20); memcpy(ec_a, a, 20);
@ -481,14 +481,14 @@ int ecdsa_set_curve(u8* p, u8* a, u8* b, u8* N, u8* Gx, u8* Gy)
return 0; return 0;
} }
void ecdsa_set_pub(u8 *Q) void ecdsa_set_pub(const u8* Q)
{ {
memcpy(ec_Q.x, Q, 20); memcpy(ec_Q.x, Q, 20);
memcpy(ec_Q.y, Q+20, 20); memcpy(ec_Q.y, Q+20, 20);
point_to_mon(&ec_Q); point_to_mon(&ec_Q);
} }
void ecdsa_set_priv(u8 *k) void ecdsa_set_priv(const u8* k)
{ {
memcpy(ec_k, k, sizeof ec_k); memcpy(ec_k, k, sizeof ec_k);
} }

View File

@ -7,7 +7,7 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
int ecdsa_set_curve(unsigned char *p, unsigned char *a, unsigned char *b, unsigned char *N, unsigned char *Gx, unsigned char *Gy); int ecdsa_set_curve(const unsigned char *p, const unsigned char *a, const unsigned char *b, const unsigned char *N, const unsigned char *Gx, const unsigned char *Gy);
void ecdsa_set_pub(unsigned char *Q); void ecdsa_set_pub(const unsigned char *Q);
void ecdsa_set_priv(unsigned char *k); void ecdsa_set_priv(const unsigned char *k);
int ecdsa_verify(unsigned char *hash, unsigned char *R, unsigned char *S); int ecdsa_verify(unsigned char *hash, unsigned char *R, unsigned char *S);

View File

@ -33,147 +33,147 @@ struct SELF_KEY
SELF_KEY(u64 ver_start, u64 ver_end, u16 rev, u32 type, const std::string& e, const std::string& r, const std::string& pb, const std::string& pr, u32 ct); SELF_KEY(u64 ver_start, u64 ver_end, u16 rev, u32 type, const std::string& e, const std::string& r, const std::string& pb, const std::string& pr, u32 ct);
}; };
static u8 PKG_AES_KEY_IDU[0x10] = { constexpr u8 PKG_AES_KEY_IDU[0x10] = {
0x5d, 0xb9, 0x11, 0xe6, 0xb7, 0xe5, 0x0a, 0x7d, 0x32, 0x15, 0x38, 0xfd, 0x7c, 0x66, 0xf1, 0x7b 0x5d, 0xb9, 0x11, 0xe6, 0xb7, 0xe5, 0x0a, 0x7d, 0x32, 0x15, 0x38, 0xfd, 0x7c, 0x66, 0xf1, 0x7b
}; };
static u8 PKG_AES_KEY[0x10] = { constexpr u8 PKG_AES_KEY[0x10] = {
0x2e, 0x7b, 0x71, 0xd7, 0xc9, 0xc9, 0xa1, 0x4e, 0xa3, 0x22, 0x1f, 0x18, 0x88, 0x28, 0xb8, 0xf8 0x2e, 0x7b, 0x71, 0xd7, 0xc9, 0xc9, 0xa1, 0x4e, 0xa3, 0x22, 0x1f, 0x18, 0x88, 0x28, 0xb8, 0xf8
}; };
static u8 PKG_AES_KEY2[0x10] = { constexpr u8 PKG_AES_KEY2[0x10] = {
0x07, 0xf2, 0xc6, 0x82, 0x90, 0xb5, 0x0d, 0x2c, 0x33, 0x81, 0x8d, 0x70, 0x9b, 0x60, 0xe6, 0x2b 0x07, 0xf2, 0xc6, 0x82, 0x90, 0xb5, 0x0d, 0x2c, 0x33, 0x81, 0x8d, 0x70, 0x9b, 0x60, 0xe6, 0x2b
}; };
static u8 PKG_AES_KEY_VITA_1[0x10] = { constexpr u8 PKG_AES_KEY_VITA_1[0x10] = {
0xE3, 0x1A, 0x70, 0xC9, 0xCE, 0x1D, 0xD7, 0x2B, 0xF3, 0xC0, 0x62, 0x29, 0x63, 0xF2, 0xEC, 0xCB 0xE3, 0x1A, 0x70, 0xC9, 0xCE, 0x1D, 0xD7, 0x2B, 0xF3, 0xC0, 0x62, 0x29, 0x63, 0xF2, 0xEC, 0xCB
}; };
static u8 PKG_AES_KEY_VITA_2[0x10] = { constexpr u8 PKG_AES_KEY_VITA_2[0x10] = {
0x42, 0x3A, 0xCA, 0x3A, 0x2B, 0xD5, 0x64, 0x9F, 0x96, 0x86, 0xAB, 0xAD, 0x6F, 0xD8, 0x80, 0x1F 0x42, 0x3A, 0xCA, 0x3A, 0x2B, 0xD5, 0x64, 0x9F, 0x96, 0x86, 0xAB, 0xAD, 0x6F, 0xD8, 0x80, 0x1F
}; };
static u8 PKG_AES_KEY_VITA_3[0x10] = { constexpr u8 PKG_AES_KEY_VITA_3[0x10] = {
0xAF, 0x07, 0xFD, 0x59, 0x65, 0x25, 0x27, 0xBA, 0xF1, 0x33, 0x89, 0x66, 0x8B, 0x17, 0xD9, 0xEA 0xAF, 0x07, 0xFD, 0x59, 0x65, 0x25, 0x27, 0xBA, 0xF1, 0x33, 0x89, 0x66, 0x8B, 0x17, 0xD9, 0xEA
}; };
static u8 NP_IDPS[0x10] = { constexpr u8 NP_IDPS[0x10] = {
0x5E, 0x06, 0xE0, 0x4F, 0xD9, 0x4A, 0x71, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 0x5E, 0x06, 0xE0, 0x4F, 0xD9, 0x4A, 0x71, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
}; };
static u8 NP_KLIC_FREE[0x10] = { constexpr u8 NP_KLIC_FREE[0x10] = {
0x72, 0xF9, 0x90, 0x78, 0x8F, 0x9C, 0xFF, 0x74, 0x57, 0x25, 0xF0, 0x8E, 0x4C, 0x12, 0x83, 0x87 0x72, 0xF9, 0x90, 0x78, 0x8F, 0x9C, 0xFF, 0x74, 0x57, 0x25, 0xF0, 0x8E, 0x4C, 0x12, 0x83, 0x87
}; };
static u8 NP_OMAC_KEY_2[0x10] = { constexpr u8 NP_OMAC_KEY_2[0x10] = {
0x6B, 0xA5, 0x29, 0x76, 0xEF, 0xDA, 0x16, 0xEF, 0x3C, 0x33, 0x9F, 0xB2, 0x97, 0x1E, 0x25, 0x6B 0x6B, 0xA5, 0x29, 0x76, 0xEF, 0xDA, 0x16, 0xEF, 0x3C, 0x33, 0x9F, 0xB2, 0x97, 0x1E, 0x25, 0x6B
}; };
static u8 NP_OMAC_KEY_3[0x10] = { constexpr u8 NP_OMAC_KEY_3[0x10] = {
0x9B, 0x51, 0x5F, 0xEA, 0xCF, 0x75, 0x06, 0x49, 0x81, 0xAA, 0x60, 0x4D, 0x91, 0xA5, 0x4E, 0x97 0x9B, 0x51, 0x5F, 0xEA, 0xCF, 0x75, 0x06, 0x49, 0x81, 0xAA, 0x60, 0x4D, 0x91, 0xA5, 0x4E, 0x97
}; };
static u8 NP_KLIC_KEY[0x10] = { constexpr u8 NP_KLIC_KEY[0x10] = {
0xF2, 0xFB, 0xCA, 0x7A, 0x75, 0xB0, 0x4E, 0xDC, 0x13, 0x90, 0x63, 0x8C, 0xCD, 0xFD, 0xD1, 0xEE 0xF2, 0xFB, 0xCA, 0x7A, 0x75, 0xB0, 0x4E, 0xDC, 0x13, 0x90, 0x63, 0x8C, 0xCD, 0xFD, 0xD1, 0xEE
}; };
static u8 NP_RIF_KEY[0x10] = { constexpr u8 NP_RIF_KEY[0x10] = {
0xDA, 0x7D, 0x4B, 0x5E, 0x49, 0x9A, 0x4F, 0x53, 0xB1, 0xC1, 0xA1, 0x4A, 0x74, 0x84, 0x44, 0x3B 0xDA, 0x7D, 0x4B, 0x5E, 0x49, 0x9A, 0x4F, 0x53, 0xB1, 0xC1, 0xA1, 0x4A, 0x74, 0x84, 0x44, 0x3B
}; };
// PSP Minis // PSP Minis
static u8 NP_PSP_KEY_1[0x10] = { constexpr u8 NP_PSP_KEY_1[0x10] = {
0x2A, 0x6A, 0xFB, 0xCF, 0x43, 0xD1, 0x57, 0x9F, 0x7D, 0x73, 0x87, 0x41, 0xA1, 0x3B, 0xD4, 0x2E 0x2A, 0x6A, 0xFB, 0xCF, 0x43, 0xD1, 0x57, 0x9F, 0x7D, 0x73, 0x87, 0x41, 0xA1, 0x3B, 0xD4, 0x2E
}; };
// PSP Remasters // PSP Remasters
static u8 NP_PSP_KEY_2[0x10] = { constexpr u8 NP_PSP_KEY_2[0x10] = {
0x0D, 0xB8, 0x57, 0x32, 0x36, 0x6C, 0xD7, 0x34, 0xFC, 0x87, 0x9E, 0x74, 0x33, 0x43, 0xBB, 0x4F 0x0D, 0xB8, 0x57, 0x32, 0x36, 0x6C, 0xD7, 0x34, 0xFC, 0x87, 0x9E, 0x74, 0x33, 0x43, 0xBB, 0x4F
}; };
static u8 NP_PSX_KEY[0x10] = { constexpr u8 NP_PSX_KEY[0x10] = {
0x52, 0xC0, 0xB5, 0xCA, 0x76, 0xD6, 0x13, 0x4B, 0xB4, 0x5F, 0xC6, 0x6C, 0xA6, 0x37, 0xF2, 0xC1 0x52, 0xC0, 0xB5, 0xCA, 0x76, 0xD6, 0x13, 0x4B, 0xB4, 0x5F, 0xC6, 0x6C, 0xA6, 0x37, 0xF2, 0xC1
}; };
static u8 RAP_KEY[0x10] = { constexpr u8 RAP_KEY[0x10] = {
0x86, 0x9F, 0x77, 0x45, 0xC1, 0x3F, 0xD8, 0x90, 0xCC, 0xF2, 0x91, 0x88, 0xE3, 0xCC, 0x3E, 0xDF 0x86, 0x9F, 0x77, 0x45, 0xC1, 0x3F, 0xD8, 0x90, 0xCC, 0xF2, 0x91, 0x88, 0xE3, 0xCC, 0x3E, 0xDF
}; };
static u8 RAP_PBOX[0x10] = { constexpr u8 RAP_PBOX[0x10] = {
0x0C, 0x03, 0x06, 0x04, 0x01, 0x0B, 0x0F, 0x08, 0x02, 0x07, 0x00, 0x05, 0x0A, 0x0E, 0x0D, 0x09 0x0C, 0x03, 0x06, 0x04, 0x01, 0x0B, 0x0F, 0x08, 0x02, 0x07, 0x00, 0x05, 0x0A, 0x0E, 0x0D, 0x09
}; };
static u8 RAP_E1[0x10] = { constexpr u8 RAP_E1[0x10] = {
0xA9, 0x3E, 0x1F, 0xD6, 0x7C, 0x55, 0xA3, 0x29, 0xB7, 0x5F, 0xDD, 0xA6, 0x2A, 0x95, 0xC7, 0xA5 0xA9, 0x3E, 0x1F, 0xD6, 0x7C, 0x55, 0xA3, 0x29, 0xB7, 0x5F, 0xDD, 0xA6, 0x2A, 0x95, 0xC7, 0xA5
}; };
static u8 RAP_E2[0x10] = { constexpr u8 RAP_E2[0x10] = {
0x67, 0xD4, 0x5D, 0xA3, 0x29, 0x6D, 0x00, 0x6A, 0x4E, 0x7C, 0x53, 0x7B, 0xF5, 0x53, 0x8C, 0x74 0x67, 0xD4, 0x5D, 0xA3, 0x29, 0x6D, 0x00, 0x6A, 0x4E, 0x7C, 0x53, 0x7B, 0xF5, 0x53, 0x8C, 0x74
}; };
static u8 SDAT_KEY[0x10] = { constexpr u8 SDAT_KEY[0x10] = {
0x0D, 0x65, 0x5E, 0xF8, 0xE6, 0x74, 0xA9, 0x8A, 0xB8, 0x50, 0x5C, 0xFA, 0x7D, 0x01, 0x29, 0x33 0x0D, 0x65, 0x5E, 0xF8, 0xE6, 0x74, 0xA9, 0x8A, 0xB8, 0x50, 0x5C, 0xFA, 0x7D, 0x01, 0x29, 0x33
}; };
static u8 EDAT_KEY_0[0x10] = { constexpr u8 EDAT_KEY_0[0x10] = {
0xBE, 0x95, 0x9C, 0xA8, 0x30, 0x8D, 0xEF, 0xA2, 0xE5, 0xE1, 0x80, 0xC6, 0x37, 0x12, 0xA9, 0xAE 0xBE, 0x95, 0x9C, 0xA8, 0x30, 0x8D, 0xEF, 0xA2, 0xE5, 0xE1, 0x80, 0xC6, 0x37, 0x12, 0xA9, 0xAE
}; };
static u8 EDAT_HASH_0[0x10] = { constexpr u8 EDAT_HASH_0[0x10] = {
0xEF, 0xFE, 0x5B, 0xD1, 0x65, 0x2E, 0xEB, 0xC1, 0x19, 0x18, 0xCF, 0x7C, 0x04, 0xD4, 0xF0, 0x11 0xEF, 0xFE, 0x5B, 0xD1, 0x65, 0x2E, 0xEB, 0xC1, 0x19, 0x18, 0xCF, 0x7C, 0x04, 0xD4, 0xF0, 0x11
}; };
static u8 EDAT_KEY_1[0x10] = { constexpr u8 EDAT_KEY_1[0x10] = {
0x4C, 0xA9, 0xC1, 0x4B, 0x01, 0xC9, 0x53, 0x09, 0x96, 0x9B, 0xEC, 0x68, 0xAA, 0x0B, 0xC0, 0x81 0x4C, 0xA9, 0xC1, 0x4B, 0x01, 0xC9, 0x53, 0x09, 0x96, 0x9B, 0xEC, 0x68, 0xAA, 0x0B, 0xC0, 0x81
}; };
static u8 EDAT_HASH_1[0x10] = { constexpr u8 EDAT_HASH_1[0x10] = {
0x3D, 0x92, 0x69, 0x9B, 0x70, 0x5B, 0x07, 0x38, 0x54, 0xD8, 0xFC, 0xC6, 0xC7, 0x67, 0x27, 0x47 0x3D, 0x92, 0x69, 0x9B, 0x70, 0x5B, 0x07, 0x38, 0x54, 0xD8, 0xFC, 0xC6, 0xC7, 0x67, 0x27, 0x47
}; };
static u8 EDAT_IV[0x10] = { constexpr u8 EDAT_IV[0x10] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
static u8 VSH_CURVE_P[0x14] = { constexpr u8 VSH_CURVE_P[0x14] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
}; };
static u8 VSH_CURVE_A[0x14] = { constexpr u8 VSH_CURVE_A[0x14] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC
}; };
static u8 VSH_CURVE_B[0x14] = { constexpr u8 VSH_CURVE_B[0x14] = {
0xA6, 0x8B, 0xED, 0xC3, 0x34, 0x18, 0x02, 0x9C, 0x1D, 0x3C, 0xE3, 0x3B, 0x9A, 0x32, 0x1F, 0xCC, 0xBB, 0x9E, 0x0F, 0x0B 0xA6, 0x8B, 0xED, 0xC3, 0x34, 0x18, 0x02, 0x9C, 0x1D, 0x3C, 0xE3, 0x3B, 0x9A, 0x32, 0x1F, 0xCC, 0xBB, 0x9E, 0x0F, 0x0B
}; };
static u8 VSH_CURVE_N[0x15] = { constexpr u8 VSH_CURVE_N[0x15] = {
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xB5, 0xAE, 0x3C, 0x52, 0x3E, 0x63, 0x94, 0x4F, 0x21, 0x27 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xB5, 0xAE, 0x3C, 0x52, 0x3E, 0x63, 0x94, 0x4F, 0x21, 0x27
}; };
static u8 VSH_CURVE_GX[0x14] = { constexpr u8 VSH_CURVE_GX[0x14] = {
0x12, 0x8E, 0xC4, 0x25, 0x64, 0x87, 0xFD, 0x8F, 0xDF, 0x64, 0xE2, 0x43, 0x7B, 0xC0, 0xA1, 0xF6, 0xD5, 0xAF, 0xDE, 0x2C 0x12, 0x8E, 0xC4, 0x25, 0x64, 0x87, 0xFD, 0x8F, 0xDF, 0x64, 0xE2, 0x43, 0x7B, 0xC0, 0xA1, 0xF6, 0xD5, 0xAF, 0xDE, 0x2C
}; };
static u8 VSH_CURVE_GY[0x14] = { constexpr u8 VSH_CURVE_GY[0x14] = {
0x59, 0x58, 0x55, 0x7E, 0xB1, 0xDB, 0x00, 0x12, 0x60, 0x42, 0x55, 0x24, 0xDB, 0xC3, 0x79, 0xD5, 0xAC, 0x5F, 0x4A, 0xDF 0x59, 0x58, 0x55, 0x7E, 0xB1, 0xDB, 0x00, 0x12, 0x60, 0x42, 0x55, 0x24, 0xDB, 0xC3, 0x79, 0xD5, 0xAC, 0x5F, 0x4A, 0xDF
}; };
static u8 VSH_PUB[0x28] = { constexpr u8 VSH_PUB[0x28] = {
0x62, 0x27, 0xB0, 0x0A, 0x02, 0x85, 0x6F, 0xB0, 0x41, 0x08, 0x87, 0x67, 0x19, 0xE0, 0xA0, 0x18, 0x32, 0x91, 0xEE, 0xB9, 0x62, 0x27, 0xB0, 0x0A, 0x02, 0x85, 0x6F, 0xB0, 0x41, 0x08, 0x87, 0x67, 0x19, 0xE0, 0xA0, 0x18, 0x32, 0x91, 0xEE, 0xB9,
0x6E, 0x73, 0x6A, 0xBF, 0x81, 0xF7, 0x0E, 0xE9, 0x16, 0x1B, 0x0D, 0xDE, 0xB0, 0x26, 0x76, 0x1A, 0xFF, 0x7B, 0xC8, 0x5B 0x6E, 0x73, 0x6A, 0xBF, 0x81, 0xF7, 0x0E, 0xE9, 0x16, 0x1B, 0x0D, 0xDE, 0xB0, 0x26, 0x76, 0x1A, 0xFF, 0x7B, 0xC8, 0x5B
}; };
static u8 SCEPKG_RIV[0x10] = { constexpr u8 SCEPKG_RIV[0x10] = {
0x4A, 0xCE, 0xF0, 0x12, 0x24, 0xFB, 0xEE, 0xDF, 0x82, 0x45, 0xF8, 0xFF, 0x10, 0x21, 0x1E, 0x6E 0x4A, 0xCE, 0xF0, 0x12, 0x24, 0xFB, 0xEE, 0xDF, 0x82, 0x45, 0xF8, 0xFF, 0x10, 0x21, 0x1E, 0x6E
}; };
static u8 SCEPKG_ERK[0x20] = { constexpr u8 SCEPKG_ERK[0x20] = {
0xA9, 0x78, 0x18, 0xBD, 0x19, 0x3A, 0x67, 0xA1, 0x6F, 0xE8, 0x3A, 0x85, 0x5E, 0x1B, 0xE9, 0xFB, 0x56, 0x40, 0x93, 0x8D, 0xA9, 0x78, 0x18, 0xBD, 0x19, 0x3A, 0x67, 0xA1, 0x6F, 0xE8, 0x3A, 0x85, 0x5E, 0x1B, 0xE9, 0xFB, 0x56, 0x40, 0x93, 0x8D,
0x4D, 0xBC, 0xB2, 0xCB, 0x52, 0xC5, 0xA2, 0xF8, 0xB0, 0x2B, 0x10, 0x31 0x4D, 0xBC, 0xB2, 0xCB, 0x52, 0xC5, 0xA2, 0xF8, 0xB0, 0x2B, 0x10, 0x31
}; };
static u8 PUP_KEY[0x40] = { constexpr u8 PUP_KEY[0x40] = {
0xF4, 0x91, 0xAD, 0x94, 0xC6, 0x81, 0x10, 0x96, 0x91, 0x5F, 0xD5, 0xD2, 0x44, 0x81, 0xAE, 0xDC, 0xED, 0xED, 0xBE, 0x6B, 0xF4, 0x91, 0xAD, 0x94, 0xC6, 0x81, 0x10, 0x96, 0x91, 0x5F, 0xD5, 0xD2, 0x44, 0x81, 0xAE, 0xDC, 0xED, 0xED, 0xBE, 0x6B,
0xE5, 0x13, 0x72, 0x4D, 0xD8, 0xF7, 0xB6, 0x91, 0xE8, 0x8A, 0x38, 0xF4, 0xB5, 0x16, 0x2B, 0xFB, 0xEC, 0xBE, 0x3A, 0x62, 0xE5, 0x13, 0x72, 0x4D, 0xD8, 0xF7, 0xB6, 0x91, 0xE8, 0x8A, 0x38, 0xF4, 0xB5, 0x16, 0x2B, 0xFB, 0xEC, 0xBE, 0x3A, 0x62,
0x18, 0x5D, 0xD7, 0xC9, 0x4D, 0xA2, 0x22, 0x5A, 0xDA, 0x3F, 0xBF, 0xCE, 0x55, 0x5B, 0x9E, 0xA9, 0x64, 0x98, 0x29, 0xEB, 0x18, 0x5D, 0xD7, 0xC9, 0x4D, 0xA2, 0x22, 0x5A, 0xDA, 0x3F, 0xBF, 0xCE, 0x55, 0x5B, 0x9E, 0xA9, 0x64, 0x98, 0x29, 0xEB,

View File

@ -20,7 +20,7 @@ void generate_key(int crypto_mode, int version, unsigned char *key_final, unsign
case 0x10000000: case 0x10000000:
// Encrypted ERK. // Encrypted ERK.
// Decrypt the key with EDAT_KEY + EDAT_IV and copy the original IV. // Decrypt the key with EDAT_KEY + EDAT_IV and copy the original IV.
aescbc128_decrypt(version ? EDAT_KEY_1 : EDAT_KEY_0, EDAT_IV, key, key_final, 0x10); aescbc128_decrypt(const_cast<u8*>(version ? EDAT_KEY_1 : EDAT_KEY_0), const_cast<u8*>(EDAT_IV), key, key_final, 0x10);
memcpy(iv_final, iv, 0x10); memcpy(iv_final, iv, 0x10);
break; break;
case 0x20000000: case 0x20000000:
@ -46,7 +46,7 @@ void generate_hash(int hash_mode, int version, unsigned char *hash_final, unsign
case 0x10000000: case 0x10000000:
// Encrypted HASH. // Encrypted HASH.
// Decrypt the hash with EDAT_KEY + EDAT_IV. // Decrypt the hash with EDAT_KEY + EDAT_IV.
aescbc128_decrypt(version ? EDAT_KEY_1 : EDAT_KEY_0, EDAT_IV, hash, hash_final, 0x10); aescbc128_decrypt(const_cast<u8*>(version ? EDAT_KEY_1 : EDAT_KEY_0), const_cast<u8*>(EDAT_IV), hash, hash_final, 0x10);
break; break;
case 0x20000000: case 0x20000000:
// Default HASH. // Default HASH.
@ -602,9 +602,9 @@ int validate_npd_hashes(const char* file_name, const u8* klicensee, NPD_HEADER *
// Hash with NPDRM_OMAC_KEY_3 and compare with title_hash. // Hash with NPDRM_OMAC_KEY_3 and compare with title_hash.
// Try to ignore case sensivity with file extension // Try to ignore case sensivity with file extension
title_hash_result = title_hash_result =
cmac_hash_compare(NP_OMAC_KEY_3, 0x10, buf.get(), buf_len, npd->title_hash, 0x10) || cmac_hash_compare(const_cast<u8*>(NP_OMAC_KEY_3), 0x10, buf.get(), buf_len, npd->title_hash, 0x10) ||
cmac_hash_compare(NP_OMAC_KEY_3, 0x10, buf_lower.get(), buf_len, npd->title_hash, 0x10) || cmac_hash_compare(const_cast<u8*>(NP_OMAC_KEY_3), 0x10, buf_lower.get(), buf_len, npd->title_hash, 0x10) ||
cmac_hash_compare(NP_OMAC_KEY_3, 0x10, buf_upper.get(), buf_len, npd->title_hash, 0x10); cmac_hash_compare(const_cast<u8*>(NP_OMAC_KEY_3), 0x10, buf_upper.get(), buf_len, npd->title_hash, 0x10);
if (verbose) if (verbose)
{ {

View File

@ -258,7 +258,7 @@ thread_local cpu_thread* g_tls_current_cpu_thread = nullptr;
static atomic_t<u64, 64> s_cpu_counter{0}; static atomic_t<u64, 64> s_cpu_counter{0};
// List of posted tasks for suspend_all // List of posted tasks for suspend_all
static atomic_t<cpu_thread::suspend_work*> s_cpu_work[128]{}; //static atomic_t<cpu_thread::suspend_work*> s_cpu_work[128]{};
// Linked list of pushed tasks for suspend_all // Linked list of pushed tasks for suspend_all
static atomic_t<cpu_thread::suspend_work*> s_pushed{}; static atomic_t<cpu_thread::suspend_work*> s_pushed{};

View File

@ -2809,7 +2809,6 @@ public:
const auto data0 = a.eval(m_ir); const auto data0 = a.eval(m_ir);
const auto data1 = b.eval(m_ir); const auto data1 = b.eval(m_ir);
const auto index = c.eval(m_ir); const auto index = c.eval(m_ir);
const auto zeros = llvm::ConstantAggregateZero::get(get_type<u8[16]>());
if (auto c = llvm::dyn_cast<llvm::Constant>(index)) if (auto c = llvm::dyn_cast<llvm::Constant>(index))
{ {

View File

@ -347,7 +347,6 @@ u64 audio_ringbuffer::update()
void audio_port::tag(s32 offset) void audio_port::tag(s32 offset)
{ {
auto port_pos = position(offset);
auto port_buf = get_vm_ptr(offset); auto port_buf = get_vm_ptr(offset);
// This tag will be used to make sure that the game has finished writing the audio for the next audio period // This tag will be used to make sure that the game has finished writing the audio for the next audio period
@ -381,7 +380,6 @@ std::tuple<u32, u32, u32, u32> cell_audio_thread::count_port_buffer_tags()
active++; active++;
auto port_buf = port.get_vm_ptr(); auto port_buf = port.get_vm_ptr();
u32 port_pos = port.position();
// Find the last tag that has been touched // Find the last tag that has been touched
const u32 tag_first_pos = port.num_channels == 2 ? PORT_BUFFER_TAG_FIRST_2CH : port.num_channels == 6 ? PORT_BUFFER_TAG_FIRST_6CH : PORT_BUFFER_TAG_FIRST_8CH; const u32 tag_first_pos = port.num_channels == 2 ? PORT_BUFFER_TAG_FIRST_2CH : port.num_channels == 6 ? PORT_BUFFER_TAG_FIRST_6CH : PORT_BUFFER_TAG_FIRST_8CH;
@ -614,7 +612,7 @@ void cell_audio_thread::operator()()
m_dynamic_period = 0; m_dynamic_period = 0;
u32 untouched_expected = 0; u32 untouched_expected = 0;
u32 in_progress_expected = 0; //u32 in_progress_expected = 0;
// Main cellAudio loop // Main cellAudio loop
while (thread_ctrl::state() != thread_state::aborting) while (thread_ctrl::state() != thread_state::aborting)
@ -893,7 +891,7 @@ void cell_audio_thread::mix(float *out_buffer, s32 offset)
if (port.state != audio_port_state::started) continue; if (port.state != audio_port_state::started) continue;
auto buf = port.get_vm_ptr(offset); auto buf = port.get_vm_ptr(offset);
static const float k = 1.f;
static constexpr float minus_3db = 0.707f; // value taken from https://www.dolby.com/us/en/technologies/a-guide-to-dolby-metadata.pdf static constexpr float minus_3db = 0.707f; // value taken from https://www.dolby.com/us/en/technologies/a-guide-to-dolby-metadata.pdf
float m = master_volume; float m = master_volume;

View File

@ -226,11 +226,11 @@ public:
DemuxerStream stream = {}; DemuxerStream stream = {};
ElementaryStream* esALL[96]{}; ElementaryStream* esALL[96]{};
ElementaryStream** esAVC = &esALL[0]; // AVC (max 16 minus M2V count) ElementaryStream** esAVC = &esALL[0]; // AVC (max 16 minus M2V count)
ElementaryStream** esM2V = &esALL[16]; // M2V (max 16 minus AVC count) //ElementaryStream** esM2V = &esALL[16]; // M2V (max 16 minus AVC count)
ElementaryStream** esDATA = &esALL[32]; // user data (max 16) //ElementaryStream** esDATA = &esALL[32]; // user data (max 16)
ElementaryStream** esATX = &esALL[48]; // ATRAC3+ (max 16) ElementaryStream** esATX = &esALL[48]; // ATRAC3+ (max 16)
ElementaryStream** esAC3 = &esALL[64]; // AC3 (max 16) //ElementaryStream** esAC3 = &esALL[64]; // AC3 (max 16)
ElementaryStream** esPCM = &esALL[80]; // LPCM (max 16) //ElementaryStream** esPCM = &esALL[80]; // LPCM (max 16)
u32 cb_add = 0; u32 cb_add = 0;

View File

@ -602,8 +602,6 @@ void cellGcmSetSecondVFrequency(u32 freq)
{ {
cellGcmSys.warning("cellGcmSetSecondVFrequency(level=%d)", freq); cellGcmSys.warning("cellGcmSetSecondVFrequency(level=%d)", freq);
const auto render = rsx::get_current_renderer();
switch (freq) switch (freq)
{ {
case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ: case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ:
@ -1104,8 +1102,6 @@ error_code GcmUnmapIoAddress(ppu_thread& ppu, gcm_config* cfg, u32 io)
return error; return error;
} }
const auto render = rsx::get_current_renderer();
for (u32 i = 0; i < size; i++) for (u32 i = 0; i < size; i++)
{ {
cfg->offsetTable.ioAddress[ea + i] = 0xFFFF; cfg->offsetTable.ioAddress[ea + i] = 0xFFFF;

View File

@ -106,7 +106,6 @@ error_code cellGifDecReadHeader(PMainHandle mainHandle, PSubHandle subHandle, PI
cellGifDec.warning("cellGifDecReadHeader(mainHandle=*0x%x, subHandle=*0x%x, info=*0x%x)", mainHandle, subHandle, info); cellGifDec.warning("cellGifDecReadHeader(mainHandle=*0x%x, subHandle=*0x%x, info=*0x%x)", mainHandle, subHandle, info);
const u32& fd = subHandle->fd; const u32& fd = subHandle->fd;
const u64& fileSize = subHandle->fileSize;
CellGifDecInfo& current_info = subHandle->info; CellGifDecInfo& current_info = subHandle->info;
// Write the header to buffer // Write the header to buffer

View File

@ -258,7 +258,7 @@ s32 _ConvertStr(s32 src_code, const void *src, s32 src_len, s32 dst_code, void *
char buf[16]; char buf[16];
while (srcLen > 0) while (srcLen > 0)
{ {
char *bufPtr = buf; //char *bufPtr = buf;
usz bufLeft = sizeof(buf); usz bufLeft = sizeof(buf);
usz ictd = iconv(ict, const_cast<char**>(reinterpret_cast<const char**>(&src)), &srcLen, reinterpret_cast<char**>(&dst), &bufLeft); usz ictd = iconv(ict, const_cast<char**>(reinterpret_cast<const char**>(&src)), &srcLen, reinterpret_cast<char**>(&dst), &bufLeft);
*dst_len += sizeof(buf) - bufLeft; *dst_len += sizeof(buf) - bufLeft;
@ -301,7 +301,7 @@ s32 _L10nConvertChar(s32 src_code, const void *src, s32 src_len, s32 dst_code, v
s32 _L10nConvertCharNoResult(s32 src_code, const void *src, s32 src_len, s32 dst_code, vm::ptr<void> dst) s32 _L10nConvertCharNoResult(s32 src_code, const void *src, s32 src_len, s32 dst_code, vm::ptr<void> dst)
{ {
s32 dstLen = 0x7FFFFFFF; s32 dstLen = 0x7FFFFFFF;
s32 result = _ConvertStr(src_code, src, src_len, dst_code, dst.get_ptr(), &dstLen, true); [[maybe_unused]] s32 result = _ConvertStr(src_code, src, src_len, dst_code, dst.get_ptr(), &dstLen, true);
return dstLen; return dstLen;
} }

View File

@ -445,7 +445,6 @@ error_code cellGameUpdateCheckStartAsyncEx(vm::cptr<CellGameUpdateParam> param,
error_code cellGameUpdateCheckFinishAsyncEx(vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> userdata) error_code cellGameUpdateCheckFinishAsyncEx(vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> userdata)
{ {
cellNetCtl.todo("cellGameUpdateCheckFinishAsyncEx(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata); cellNetCtl.todo("cellGameUpdateCheckFinishAsyncEx(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata);
const s32 PROCESSING_COMPLETE = 5;
sysutil_register_cb([=](ppu_thread& ppu) -> s32 sysutil_register_cb([=](ppu_thread& ppu) -> s32
{ {
cb_func(ppu, vm::make_var(CellGameUpdateResult{CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK}), userdata); cb_func(ppu, vm::make_var(CellGameUpdateResult{CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK}), userdata);

View File

@ -765,8 +765,6 @@ error_code cellPadSetPortSetting(u32 port_no, u32 port_setting)
if (!config->max_connect) if (!config->max_connect)
return CELL_PAD_ERROR_UNINITIALIZED; return CELL_PAD_ERROR_UNINITIALIZED;
const auto handler = pad::get_current_handler();
if (port_no >= CELL_MAX_PADS) if (port_no >= CELL_MAX_PADS)
return CELL_PAD_ERROR_INVALID_PARAMETER; return CELL_PAD_ERROR_INVALID_PARAMETER;

View File

@ -1338,7 +1338,7 @@ error_code cellRtcSetCurrentTick(vm::cptr<CellRtcTick> pTick)
return CELL_RTC_ERROR_INVALID_POINTER; return CELL_RTC_ERROR_INVALID_POINTER;
} }
u64 tmp = pTick->tick + 0xff23400100d44000; //u64 tmp = pTick->tick + 0xff23400100d44000;
if (!(0xdcbffeff2bbfff < pTick->tick)) if (!(0xdcbffeff2bbfff < pTick->tick))
{ {
return CELL_RTC_ERROR_INVALID_ARG; return CELL_RTC_ERROR_INVALID_ARG;

View File

@ -839,7 +839,7 @@ error_code cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 str
ensure(f.read(buf, size) == size); ensure(f.read(buf, size) == size);
u32 sp_ = vm::alloc(sizeof(CellPamfReader), vm::main); u32 sp_ = vm::alloc(sizeof(CellPamfReader), vm::main);
auto sp = vm::ptr<CellPamfReader>::make(sp_); auto sp = vm::ptr<CellPamfReader>::make(sp_);
u32 reader = cellPamfReaderInitialize(sp, bufPtr, size, 0); [[maybe_unused]] u32 err = cellPamfReaderInitialize(sp, bufPtr, size, 0);
descriptor->buffer = buffer; descriptor->buffer = buffer;
descriptor->sp_ = sp_; descriptor->sp_ = sp_;

View File

@ -301,7 +301,7 @@ static error_code display_callback_result_error_message(ppu_thread& ppu, const C
lv2_obj::sleep(ppu); lv2_obj::sleep(ppu);
// Get user confirmation by opening a blocking dialog (return value should be irrelevant here) // Get user confirmation by opening a blocking dialog (return value should be irrelevant here)
error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, use_invalid_message ? result.invalidMsg : vm::make_str(msg)); [[maybe_unused]] error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, use_invalid_message ? result.invalidMsg : vm::make_str(msg));
// Reschedule after a blocking dialog returns // Reschedule after a blocking dialog returns
if (ppu.check_state()) if (ppu.check_state())
@ -1454,7 +1454,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
return {CELL_SAVEDATA_ERROR_PARAM, "50"}; return {CELL_SAVEDATA_ERROR_PARAM, "50"};
} }
switch (const u32 mode = statSet->reCreateMode & CELL_SAVEDATA_RECREATE_MASK) switch (statSet->reCreateMode & CELL_SAVEDATA_RECREATE_MASK)
{ {
case CELL_SAVEDATA_RECREATE_NO: case CELL_SAVEDATA_RECREATE_NO:
{ {
@ -1767,7 +1767,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
} }
// Read from memory file to vm // Read from memory file to vm
const u64 sr = file->second.seek(fileSet->fileOffset); file->second.seek(fileSet->fileOffset);
const u64 rr = lv2_file::op_read(file->second, fileSet->fileBuf, fileSet->fileSize); const u64 rr = lv2_file::op_read(file->second, fileSet->fileBuf, fileSet->fileSize);
fileGet->excSize = ::narrow<u32>(rr); fileGet->excSize = ::narrow<u32>(rr);
break; break;
@ -1849,7 +1849,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
} }
// Write to memory file normally // Write to memory file normally
const u64 sr = file.seek(fileSet->fileOffset); file.seek(fileSet->fileOffset);
const u64 wr = lv2_file::op_write(file, fileSet->fileBuf, fileSet->fileSize); const u64 wr = lv2_file::op_write(file, fileSet->fileBuf, fileSet->fileSize);
fileGet->excSize = ::narrow<u32>(wr); fileGet->excSize = ::narrow<u32>(wr);
all_times.erase(file_path); all_times.erase(file_path);

View File

@ -323,7 +323,7 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo
auto found = content_map->find(hash); auto found = content_map->find(hash);
if (found == content_map->end()) // content isn't yet being tracked if (found == content_map->end()) // content isn't yet being tracked
{ {
auto ext_offset = item.name.find_last_of('.'); // used later if no "Title" found //auto ext_offset = item.name.find_last_of('.'); // used later if no "Title" found
std::shared_ptr<search_content_t> curr_find = std::make_shared<search_content_t>(); std::shared_ptr<search_content_t> curr_find = std::make_shared<search_content_t>();
if (item_path.length() > CELL_SEARCH_PATH_LEN_MAX) if (item_path.length() > CELL_SEARCH_PATH_LEN_MAX)

View File

@ -517,7 +517,7 @@ s32 _spurs::create_lv2_eq(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, vm::ptr<u32
return rc; return rc;
} }
if (s32 rc = _spurs::attach_lv2_eq(ppu, spurs, *queueId, port, 1, true)) if (_spurs::attach_lv2_eq(ppu, spurs, *queueId, port, 1, true))
{ {
sys_event_queue_destroy(ppu, *queueId, SYS_EVENT_QUEUE_DESTROY_FORCE); sys_event_queue_destroy(ppu, *queueId, SYS_EVENT_QUEUE_DESTROY_FORCE);
} }
@ -898,9 +898,9 @@ s32 _spurs::create_event_helper(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 p
return rc; return rc;
} }
if (s32 rc = sys_event_port_create(ppu, spurs.ptr(&CellSpurs::eventPort), SYS_EVENT_PORT_LOCAL, SYS_EVENT_PORT_NO_NAME)) if (sys_event_port_create(ppu, spurs.ptr(&CellSpurs::eventPort), SYS_EVENT_PORT_LOCAL, SYS_EVENT_PORT_NO_NAME))
{ {
if (s32 rc2 = _spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) if (_spurs::detach_lv2_eq(spurs, spurs->spuPort, true))
{ {
return CELL_SPURS_CORE_ERROR_AGAIN; return CELL_SPURS_CORE_ERROR_AGAIN;
} }
@ -909,11 +909,11 @@ s32 _spurs::create_event_helper(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 p
return CELL_SPURS_CORE_ERROR_AGAIN; return CELL_SPURS_CORE_ERROR_AGAIN;
} }
if (s32 rc = sys_event_port_connect_local(ppu, spurs->eventPort, spurs->eventQueue)) if (sys_event_port_connect_local(ppu, spurs->eventPort, spurs->eventQueue))
{ {
sys_event_port_destroy(ppu, spurs->eventPort); sys_event_port_destroy(ppu, spurs->eventPort);
if (s32 rc2 = _spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) if (_spurs::detach_lv2_eq(spurs, spurs->spuPort, true))
{ {
return CELL_SPURS_CORE_ERROR_STAT; return CELL_SPURS_CORE_ERROR_STAT;
} }
@ -939,7 +939,7 @@ s32 _spurs::create_event_helper(ppu_thread& ppu, vm::ptr<CellSpurs> spurs, u32 p
sys_event_port_disconnect(ppu, spurs->eventPort); sys_event_port_disconnect(ppu, spurs->eventPort);
sys_event_port_destroy(ppu, spurs->eventPort); sys_event_port_destroy(ppu, spurs->eventPort);
if (s32 rc = _spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) if (_spurs::detach_lv2_eq(spurs, spurs->spuPort, true))
{ {
return CELL_SPURS_CORE_ERROR_STAT; return CELL_SPURS_CORE_ERROR_STAT;
} }
@ -4631,7 +4631,6 @@ s32 cellSpursJoinJobChain(ppu_thread& ppu, vm::ptr<CellSpursJobChain> jobChain)
return CELL_SPURS_JOB_ERROR_ALIGN; return CELL_SPURS_JOB_ERROR_ALIGN;
const u32 wid = jobChain->workloadId; const u32 wid = jobChain->workloadId;
const auto spurs = +jobChain->spurs;
if (wid >= CELL_SPURS_MAX_WORKLOAD2) if (wid >= CELL_SPURS_MAX_WORKLOAD2)
return CELL_SPURS_JOB_ERROR_INVAL; return CELL_SPURS_JOB_ERROR_INVAL;

View File

@ -743,7 +743,7 @@ bool spursKernelEntry(spu_thread& spu)
bool spursSysServiceEntry(spu_thread& spu) bool spursSysServiceEntry(spu_thread& spu)
{ {
const auto ctxt = spu._ptr<SpursKernelContext>(spu.gpr[3]._u32[3]); const auto ctxt = spu._ptr<SpursKernelContext>(spu.gpr[3]._u32[3]);
auto arg = spu.gpr[4]._u64[1]; //auto arg = spu.gpr[4]._u64[1];
auto pollStatus = spu.gpr[5]._u32[3]; auto pollStatus = spu.gpr[5]._u32[3];
{ {
@ -2059,11 +2059,11 @@ s32 spursTasksetLoadElf(spu_thread& spu, u32* entryPoint, u32* lowestLoadAddr, u
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool spursJobChainEntry(spu_thread& spu) bool spursJobChainEntry(spu_thread& spu)
{ {
const auto ctxt = spu._ptr<SpursJobChainContext>(0x4a00); //const auto ctxt = spu._ptr<SpursJobChainContext>(0x4a00);
auto kernelCtxt = spu._ptr<SpursKernelContext>(spu.gpr[3]._u32[3]); //auto kernelCtxt = spu._ptr<SpursKernelContext>(spu.gpr[3]._u32[3]);
auto arg = spu.gpr[4]._u64[1]; //auto arg = spu.gpr[4]._u64[1];
auto pollStatus = spu.gpr[5]._u32[3]; //auto pollStatus = spu.gpr[5]._u32[3];
// TODO // TODO
return false; return false;

View File

@ -681,7 +681,7 @@ error_code cellSyncQueueSize(vm::ptr<CellSyncQueue> queue)
return CELL_SYNC_ERROR_ALIGN; return CELL_SYNC_ERROR_ALIGN;
} }
const u32 depth = queue->check_depth(); queue->check_depth();
return not_an_error(queue->ctrl.load().count & 0xffffff); return not_an_error(queue->ctrl.load().count & 0xffffff);
} }
@ -700,7 +700,7 @@ error_code cellSyncQueueClear(ppu_thread& ppu, vm::ptr<CellSyncQueue> queue)
return CELL_SYNC_ERROR_ALIGN; return CELL_SYNC_ERROR_ALIGN;
} }
const u32 depth = queue->check_depth(); queue->check_depth();
while (!queue->ctrl.atomic_op(&CellSyncQueue::try_clear_begin_1)) while (!queue->ctrl.atomic_op(&CellSyncQueue::try_clear_begin_1))
{ {

View File

@ -461,7 +461,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
{ {
cellVdec.warning("cellVdecQueryAttr: AVC (profile=%d)", profile); cellVdec.warning("cellVdecQueryAttr: AVC (profile=%d)", profile);
const vm::ptr<CellVdecAvcSpecificInfo> sinfo = vm::cast(spec_addr); //const vm::ptr<CellVdecAvcSpecificInfo> sinfo = vm::cast(spec_addr);
// TODO: sinfo // TODO: sinfo
@ -557,7 +557,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
{ {
cellVdec.warning("cellVdecQueryAttr: DivX (profile=%d)", profile); cellVdec.warning("cellVdecQueryAttr: DivX (profile=%d)", profile);
const vm::ptr<CellVdecDivxSpecificInfo2> sinfo = vm::cast(spec_addr); //const vm::ptr<CellVdecDivxSpecificInfo2> sinfo = vm::cast(spec_addr);
// TODO: sinfo // TODO: sinfo

View File

@ -97,7 +97,6 @@ error_code sceNpCommerce2Term()
error_code sceNpCommerce2CreateCtx(u32 version, vm::cptr<SceNpId> npId, vm::ptr<SceNpCommerce2Handler> handler, vm::ptr<void> arg, vm::ptr<u32> ctx_id) error_code sceNpCommerce2CreateCtx(u32 version, vm::cptr<SceNpId> npId, vm::ptr<SceNpCommerce2Handler> handler, vm::ptr<void> arg, vm::ptr<u32> ctx_id)
{ {
sceNpCommerce2.warning("sceNpCommerce2CreateCtx(version=%d, npId=*0x%x, handler=*0x%x, arg=*0x%x, ctx_id=*0x%x)", version, npId, handler, arg, ctx_id); sceNpCommerce2.warning("sceNpCommerce2CreateCtx(version=%d, npId=*0x%x, handler=*0x%x, arg=*0x%x, ctx_id=*0x%x)", version, npId, handler, arg, ctx_id);
const auto nph = g_fxo->get<named_thread<np_handler>>();
*ctx_id = create_commerce2_context(version, npId, handler, arg); *ctx_id = create_commerce2_context(version, npId, handler, arg);
@ -107,10 +106,9 @@ error_code sceNpCommerce2CreateCtx(u32 version, vm::cptr<SceNpId> npId, vm::ptr<
s32 sceNpCommerce2DestroyCtx(u32 ctx_id) s32 sceNpCommerce2DestroyCtx(u32 ctx_id)
{ {
sceNpCommerce2.warning("sceNpCommerce2DestroyCtx(ctx_id=%d)", ctx_id); sceNpCommerce2.warning("sceNpCommerce2DestroyCtx(ctx_id=%d)", ctx_id);
const auto nph = g_fxo->get<named_thread<np_handler>>();
destroy_commerce2_context(ctx_id); destroy_commerce2_context(ctx_id);
return CELL_OK; return CELL_OK;
} }
@ -118,13 +116,12 @@ s32 sceNpCommerce2EmptyStoreCheckStart(u32 ctx_id, s32 store_check_type, vm::cpt
{ {
sceNpCommerce2.warning("sceNpCommerce2EmptyStoreCheckStart(ctx_id=%d, store_check_type=%d, target_id=*0x%x(%s))", ctx_id, store_check_type, target_id, target_id); sceNpCommerce2.warning("sceNpCommerce2EmptyStoreCheckStart(ctx_id=%d, store_check_type=%d, target_id=*0x%x(%s))", ctx_id, store_check_type, target_id, target_id);
const auto nph = g_fxo->get<named_thread<np_handler>>();
const auto ctx = get_commerce2_context(ctx_id); const auto ctx = get_commerce2_context(ctx_id);
if (ctx->context_callback) if (ctx->context_callback)
{ {
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 { sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32
{
ctx->context_callback(cb_ppu, ctx_id, 0, SCE_NP_COMMERCE2_EVENT_EMPTY_STORE_CHECK_DONE, 0, ctx->context_callback_param); ctx->context_callback(cb_ppu, ctx_id, 0, SCE_NP_COMMERCE2_EVENT_EMPTY_STORE_CHECK_DONE, 0, ctx->context_callback_param);
return 0; return 0;
}); });
@ -149,13 +146,13 @@ s32 sceNpCommerce2EmptyStoreCheckFinish(u32 ctx_id, vm::ptr<s32> is_empty)
s32 sceNpCommerce2CreateSessionStart(u32 ctx_id) s32 sceNpCommerce2CreateSessionStart(u32 ctx_id)
{ {
sceNpCommerce2.warning("sceNpCommerce2CreateSessionStart(ctx_id=%d)", ctx_id); sceNpCommerce2.warning("sceNpCommerce2CreateSessionStart(ctx_id=%d)", ctx_id);
const auto nph = g_fxo->get<named_thread<np_handler>>();
const auto ctx = get_commerce2_context(ctx_id); const auto ctx = get_commerce2_context(ctx_id);
if (ctx->context_callback) if (ctx->context_callback)
{ {
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 { sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32
{
ctx->context_callback(cb_ppu, ctx_id, 0, SCE_NP_COMMERCE2_EVENT_CREATE_SESSION_DONE, 0, ctx->context_callback_param); ctx->context_callback(cb_ppu, ctx_id, 0, SCE_NP_COMMERCE2_EVENT_CREATE_SESSION_DONE, 0, ctx->context_callback_param);
return 0; return 0;
}); });

View File

@ -666,8 +666,8 @@ void ppu_module::analyse(u32 lib_toc, u32 entry)
const u32 _toc = ptr[1]; const u32 _toc = ptr[1];
// Rough Table of Contents borders // Rough Table of Contents borders
const u32 _toc_begin = _toc - 0x8000; //const u32 _toc_begin = _toc - 0x8000;
const u32 _toc_end = _toc + 0x8000; //const u32 _toc_end = _toc + 0x8000;
// TODO: improve TOC constraints // TODO: improve TOC constraints
if (_toc % 4 || !vm::check_addr(_toc) || _toc >= 0x40000000 || (_toc >= start && _toc < end)) if (_toc % 4 || !vm::check_addr(_toc) || _toc >= 0x40000000 || (_toc >= start && _toc < end))

View File

@ -626,7 +626,7 @@ static auto ppu_load_imports(std::vector<ppu_reloc>& relocs, ppu_linkage_info* l
} }
// Static module // Static module
const auto _sm = ppu_module_manager::get_module(module_name); //const auto _sm = ppu_module_manager::get_module(module_name);
// Module linkage // Module linkage
auto& mlink = link->modules[module_name]; auto& mlink = link->modules[module_name];
@ -820,7 +820,7 @@ std::shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, const std::stri
{ {
const u32 mem_size = ::narrow<u32>(prog.p_memsz); const u32 mem_size = ::narrow<u32>(prog.p_memsz);
const u32 file_size = ::narrow<u32>(prog.p_filesz); const u32 file_size = ::narrow<u32>(prog.p_filesz);
const u32 init_addr = ::narrow<u32>(prog.p_vaddr); //const u32 init_addr = ::narrow<u32>(prog.p_vaddr);
// Alloc segment memory // Alloc segment memory
const u32 addr = vm::alloc(mem_size, vm::main); const u32 addr = vm::alloc(mem_size, vm::main);
@ -892,7 +892,7 @@ std::shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, const std::stri
// Do relocations // Do relocations
for (auto& prog : elf.progs) for (auto& prog : elf.progs)
{ {
switch (const u32 p_type = prog.p_type) switch (prog.p_type)
{ {
case 0x700000a4: case 0x700000a4:
{ {
@ -1161,7 +1161,8 @@ void ppu_load_exec(const ppu_exec_object& elf)
const u32 addr = _seg.addr = vm::cast(prog.p_vaddr); const u32 addr = _seg.addr = vm::cast(prog.p_vaddr);
const u32 size = _seg.size = ::narrow<u32>(prog.p_memsz); const u32 size = _seg.size = ::narrow<u32>(prog.p_memsz);
const u32 type = _seg.type = prog.p_type; const u32 type = _seg.type = prog.p_type;
const u32 flag = _seg.flags = prog.p_flags;
_seg.flags = prog.p_flags;
_seg.filesz = ::narrow<u32>(prog.p_filesz); _seg.filesz = ::narrow<u32>(prog.p_filesz);
// Hash big-endian values // Hash big-endian values
@ -1210,8 +1211,9 @@ void ppu_load_exec(const ppu_exec_object& elf)
ppu_segment _sec; ppu_segment _sec;
const u32 addr = _sec.addr = vm::cast(s.sh_addr); const u32 addr = _sec.addr = vm::cast(s.sh_addr);
const u32 size = _sec.size = vm::cast(s.sh_size); const u32 size = _sec.size = vm::cast(s.sh_size);
const u32 type = _sec.type = s.sh_type;
const u32 flag = _sec.flags = static_cast<u32>(s.sh_flags & 7); _sec.type = s.sh_type;
_sec.flags = static_cast<u32>(s.sh_flags & 7);
_sec.filesz = 0; _sec.filesz = 0;
if (addr && size) if (addr && size)
@ -1666,7 +1668,8 @@ std::shared_ptr<lv2_overlay> ppu_load_overlay(const ppu_exec_object& elf, const
const u32 addr = _seg.addr = vm::cast(prog.p_vaddr); const u32 addr = _seg.addr = vm::cast(prog.p_vaddr);
const u32 size = _seg.size = ::narrow<u32>(prog.p_memsz); const u32 size = _seg.size = ::narrow<u32>(prog.p_memsz);
const u32 type = _seg.type = prog.p_type; const u32 type = _seg.type = prog.p_type;
const u32 flag = _seg.flags = prog.p_flags;
_seg.flags = prog.p_flags;
_seg.filesz = ::narrow<u32>(prog.p_filesz); _seg.filesz = ::narrow<u32>(prog.p_filesz);
// Hash big-endian values // Hash big-endian values
@ -1708,8 +1711,9 @@ std::shared_ptr<lv2_overlay> ppu_load_overlay(const ppu_exec_object& elf, const
ppu_segment _sec; ppu_segment _sec;
const u32 addr = _sec.addr = vm::cast(s.sh_addr); const u32 addr = _sec.addr = vm::cast(s.sh_addr);
const u32 size = _sec.size = vm::cast(s.sh_size); const u32 size = _sec.size = vm::cast(s.sh_size);
const u32 type = _sec.type = s.sh_type;
const u32 flag = _sec.flags = static_cast<u32>(s.sh_flags & 7); _sec.type = s.sh_type;
_sec.flags = static_cast<u32>(s.sh_flags & 7);
_sec.filesz = 0; _sec.filesz = 0;
if (addr && size) if (addr && size)

View File

@ -1817,7 +1817,7 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value)
addr &= -128; addr &= -128;
// Cache line data // Cache line data
auto& cline_data = vm::_ref<spu_rdata_t>(addr); //auto& cline_data = vm::_ref<spu_rdata_t>(addr);
data += 0; data += 0;
rsx::reservation_lock rsx_lock(addr, 128); rsx::reservation_lock rsx_lock(addr, 128);
@ -2015,7 +2015,7 @@ extern void ppu_initialize(const ppu_module& info)
for (u64 index = 0; index < 1024; index++) for (u64 index = 0; index < 1024; index++)
{ {
if (auto sc = ppu_get_syscall(index)) if (ppu_get_syscall(index))
{ {
link_table.emplace(fmt::format("%s", ppu_syscall_code(index)), reinterpret_cast<u64>(ppu_execute_syscall)); link_table.emplace(fmt::format("%s", ppu_syscall_code(index)), reinterpret_cast<u64>(ppu_execute_syscall));
link_table.emplace(fmt::format("syscall_%u", index), reinterpret_cast<u64>(ppu_execute_syscall)); link_table.emplace(fmt::format("syscall_%u", index), reinterpret_cast<u64>(ppu_execute_syscall));

View File

@ -380,7 +380,7 @@ Value* PPUTranslator::RegLoad(Value*& local)
void PPUTranslator::RegStore(llvm::Value* value, llvm::Value*& local) void PPUTranslator::RegStore(llvm::Value* value, llvm::Value*& local)
{ {
const auto glb = RegInit(local); RegInit(local);
local = value; local = value;
} }
@ -4712,7 +4712,7 @@ void PPUTranslator::SetFPCC(Value* lt, Value* gt, Value* eq, Value* un, bool set
void PPUTranslator::SetFPRF(Value* value, bool set_cr) void PPUTranslator::SetFPRF(Value* value, bool set_cr)
{ {
const bool is32 = //const bool is32 =
value->getType()->isFloatTy() ? true : value->getType()->isFloatTy() ? true :
value->getType()->isDoubleTy() ? false : ensure(false); value->getType()->isDoubleTy() ? false : ensure(false);

View File

@ -56,7 +56,7 @@ std::pair<bool, v128> SPUDisAsm::try_get_const_value(u32 reg, u32 pc) const
continue; continue;
} }
const auto flag = s_spu_iflag.decode(opcode); //const auto flag = s_spu_iflag.decode(opcode);
// TODO: It detects spurious register modifications // TODO: It detects spurious register modifications
if (u32 dst = type & spu_itype::_quadrop ? +op0.rt4 : +op0.rt; dst == reg) if (u32 dst = type & spu_itype::_quadrop ? +op0.rt4 : +op0.rt; dst == reg)

View File

@ -8941,7 +8941,7 @@ struct spu_llvm
if (!(spu.state.load() & (cpu_flag::wait + cpu_flag::stop + cpu_flag::dbg_global_pause))) if (!(spu.state.load() & (cpu_flag::wait + cpu_flag::stop + cpu_flag::dbg_global_pause)))
{ {
const auto found = std::as_const(samples).find(spu.block_hash); const auto found = std::as_const(samples).find(name);
if (found != std::as_const(samples).end()) if (found != std::as_const(samples).end())
{ {

View File

@ -205,7 +205,7 @@ struct lv2_file::file_view : fs::file_base
u64 read(void* buffer, u64 size) override u64 read(void* buffer, u64 size) override
{ {
const u64 old_pos = m_file->file.pos(); const u64 old_pos = m_file->file.pos();
const u64 new_pos = m_file->file.seek(m_off + m_pos); m_file->file.seek(m_off + m_pos);
const u64 result = m_file->file.read(buffer, size); const u64 result = m_file->file.read(buffer, size);
ensure(old_pos == m_file->file.seek(old_pos)); ensure(old_pos == m_file->file.seek(old_pos));
@ -1300,7 +1300,7 @@ error_code sys_fs_fcntl(ppu_thread& ppu, u32 fd, u32 op, vm::ptr<void> _arg, u32
} }
const u64 old_pos = file->file.pos(); const u64 old_pos = file->file.pos();
const u64 new_pos = file->file.seek(arg->offset); file->file.seek(arg->offset);
arg->out_size = op == 0x8000000a arg->out_size = op == 0x8000000a
? file->op_read(arg->buf, arg->size) ? file->op_read(arg->buf, arg->size)

View File

@ -1055,7 +1055,7 @@ struct network_thread
{ {
bs_t<lv2_socket::poll> events{}; bs_t<lv2_socket::poll> events{};
lv2_socket& sock = *socklist[i]; [[maybe_unused]] lv2_socket& sock = *socklist[i];
if (fds[i].revents & (POLLIN | POLLHUP) && socklist[i]->events.test_and_reset(lv2_socket::poll::read)) if (fds[i].revents & (POLLIN | POLLHUP) && socklist[i]->events.test_and_reset(lv2_socket::poll::read))
events += lv2_socket::poll::read; events += lv2_socket::poll::read;

View File

@ -599,7 +599,7 @@ error_code sys_rsx_context_attribute(u32 context_id, u32 package_id, u64 a3, u64
const u32 pitch = (((a5 >> 32) & 0xFFFFFFFF) >> 8) * 0x100; const u32 pitch = (((a5 >> 32) & 0xFFFFFFFF) >> 8) * 0x100;
const u32 comp = ((a5 & 0xFFFFFFFF) >> 26) & 0xF; const u32 comp = ((a5 & 0xFFFFFFFF) >> 26) & 0xF;
const u32 base = (a5 & 0xFFFFFFFF) & 0x7FF; const u32 base = (a5 & 0xFFFFFFFF) & 0x7FF;
const u32 bank = (((a4 >> 32) & 0xFFFFFFFF) >> 4) & 0xF; //const u32 bank = (((a4 >> 32) & 0xFFFFFFFF) >> 4) & 0xF;
const bool bound = ((a4 >> 32) & 0x3) != 0; const bool bound = ((a4 >> 32) & 0x3) != 0;
const auto range = utils::address_range::start_length(offset, size); const auto range = utils::address_range::start_length(offset, size);

View File

@ -80,7 +80,7 @@ void sys_spu_image::load(const fs::file& stream)
const u32 mem_size = nsegs * sizeof(sys_spu_segment) + ::size32(stream); const u32 mem_size = nsegs * sizeof(sys_spu_segment) + ::size32(stream);
const vm::ptr<sys_spu_segment> segs = vm::cast(vm::alloc(mem_size, vm::main)); const vm::ptr<sys_spu_segment> segs = vm::cast(vm::alloc(mem_size, vm::main));
const u32 entry = obj.header.e_entry; //const u32 entry = obj.header.e_entry;
const u32 src = (segs + nsegs).addr(); const u32 src = (segs + nsegs).addr();

View File

@ -1112,10 +1112,8 @@ namespace vm
{ {
auto fill64 = [](u8* ptr, u64 data, usz count) auto fill64 = [](u8* ptr, u64 data, usz count)
{ {
u64* target = reinterpret_cast<u64*>(ptr);
#ifdef _MSC_VER #ifdef _MSC_VER
__stosq(target, data, count); __stosq(reinterpret_cast<u64*>(ptr), data, count);
#else #else
__asm__ ("mov %0, %%rdi; mov %1, %%rax; mov %2, %%rcx; rep stosq;" __asm__ ("mov %0, %%rdi; mov %1, %%rax; mov %2, %%rcx; rep stosq;"
: :

View File

@ -415,7 +415,7 @@ namespace vm
}; };
// Null pointer convertible to any vm::ptr* type // Null pointer convertible to any vm::ptr* type
static null_t null; constexpr null_t null{};
} }
template<typename T1, typename AT1, typename T2, typename AT2> template<typename T1, typename AT1, typename T2, typename AT2>

View File

@ -268,7 +268,7 @@ namespace rsx
// i realize these are a slight copy pasta of the rsx_method implementations but its kinda unavoidable currently // i realize these are a slight copy pasta of the rsx_method implementations but its kinda unavoidable currently
void capture_image_in(thread* rsx, frame_capture_data::replay_command& replay_command) void capture_image_in(thread* rsx, frame_capture_data::replay_command& replay_command)
{ {
const rsx::blit_engine::transfer_operation operation = method_registers.blit_engine_operation(); //const rsx::blit_engine::transfer_operation operation = method_registers.blit_engine_operation();
const u16 clip_w = std::min(method_registers.blit_engine_output_width(), method_registers.blit_engine_clip_width()); const u16 clip_w = std::min(method_registers.blit_engine_output_width(), method_registers.blit_engine_clip_width());
const u16 clip_h = std::min(method_registers.blit_engine_output_height(), method_registers.blit_engine_clip_height()); const u16 clip_h = std::min(method_registers.blit_engine_output_height(), method_registers.blit_engine_clip_height());
@ -276,8 +276,8 @@ namespace rsx
const u16 in_w = method_registers.blit_engine_input_width(); const u16 in_w = method_registers.blit_engine_input_width();
const u16 in_h = method_registers.blit_engine_input_height(); const u16 in_h = method_registers.blit_engine_input_height();
const blit_engine::transfer_origin in_origin = method_registers.blit_engine_input_origin(); //const blit_engine::transfer_origin in_origin = method_registers.blit_engine_input_origin();
const blit_engine::transfer_interpolator in_inter = method_registers.blit_engine_input_inter(); //const blit_engine::transfer_interpolator in_inter = method_registers.blit_engine_input_inter();
const rsx::blit_engine::transfer_source_format src_color_format = method_registers.blit_engine_src_color_format(); const rsx::blit_engine::transfer_source_format src_color_format = method_registers.blit_engine_src_color_format();
const f32 in_x = std::floor(method_registers.blit_engine_in_x()); const f32 in_x = std::floor(method_registers.blit_engine_in_x());
@ -319,7 +319,7 @@ namespace rsx
s32 in_pitch = method_registers.nv0039_input_pitch(); s32 in_pitch = method_registers.nv0039_input_pitch();
const u32 line_length = method_registers.nv0039_line_length(); const u32 line_length = method_registers.nv0039_line_length();
const u32 line_count = method_registers.nv0039_line_count(); const u32 line_count = method_registers.nv0039_line_count();
const u8 in_format = method_registers.nv0039_input_format(); //const u8 in_format = method_registers.nv0039_input_format();
u32 src_offset = method_registers.nv0039_input_offset(); u32 src_offset = method_registers.nv0039_input_offset();
u32 src_dma = method_registers.nv0039_input_location(); u32 src_dma = method_registers.nv0039_input_location();

View File

@ -349,7 +349,7 @@ namespace
const u8 attribute_sz = min_block_size >> 2; const u8 attribute_sz = min_block_size >> 2;
for (u32 n = 0; n < remainder; ++n) for (u32 n = 0; n < remainder; ++n)
{ {
auto src_ptr2 = reinterpret_cast<const be_t<u32>*>(src_ptr); //auto src_ptr2 = reinterpret_cast<const be_t<u32>*>(src_ptr);
auto dst_ptr2 = reinterpret_cast<u32*>(dst_ptr); auto dst_ptr2 = reinterpret_cast<u32*>(dst_ptr);
for (u32 v = 0; v < attribute_sz; ++v) for (u32 v = 0; v < attribute_sz; ++v)
@ -415,8 +415,8 @@ namespace
const u8 attribute_sz = min_block_size >> 1; const u8 attribute_sz = min_block_size >> 1;
for (u32 n = 0; n < remainder; ++n) for (u32 n = 0; n < remainder; ++n)
{ {
auto src_ptr2 = reinterpret_cast<const be_t<u16>*>(src_ptr); //auto src_ptr2 = reinterpret_cast<const be_t<u16>*>(src_ptr);
auto dst_ptr2 = reinterpret_cast<u16*>(dst_ptr); //auto dst_ptr2 = reinterpret_cast<u16*>(dst_ptr);
for (u32 v = 0; v < attribute_sz; ++v) for (u32 v = 0; v < attribute_sz; ++v)
dst_ptr[v] = src_ptr[v]; dst_ptr[v] = src_ptr[v];
@ -1048,7 +1048,6 @@ namespace
ensure((dst.size() >= 3 * (src.size() - 2))); ensure((dst.size() >= 3 * (src.size() - 2)));
u32 dst_idx = 0; u32 dst_idx = 0;
u32 src_idx = 0;
bool needs_anchor = true; bool needs_anchor = true;
T anchor = invalid_index; T anchor = invalid_index;

View File

@ -13,7 +13,7 @@ usz vertex_program_utils::get_vertex_program_ucode_hash(const RSXVertexProgram &
usz hash = 0xCBF29CE484222325ULL; usz hash = 0xCBF29CE484222325ULL;
const void* instbuffer = program.data.data(); const void* instbuffer = program.data.data();
usz instIndex = 0; usz instIndex = 0;
bool end = false;
for (unsigned i = 0; i < program.data.size() / 4; i++) for (unsigned i = 0; i < program.data.size() / 4; i++)
{ {
if (program.instruction_mask[i]) if (program.instruction_mask[i])
@ -33,8 +33,8 @@ usz vertex_program_utils::get_vertex_program_ucode_hash(const RSXVertexProgram &
vertex_program_utils::vertex_program_metadata vertex_program_utils::analyse_vertex_program(const u32* data, u32 entry, RSXVertexProgram& dst_prog) vertex_program_utils::vertex_program_metadata vertex_program_utils::analyse_vertex_program(const u32* data, u32 entry, RSXVertexProgram& dst_prog)
{ {
vertex_program_utils::vertex_program_metadata result{}; vertex_program_utils::vertex_program_metadata result{};
u32 last_instruction_address = 0; //u32 last_instruction_address = 0;
u32 first_instruction_address = entry; //u32 first_instruction_address = entry;
std::stack<u32> call_stack; std::stack<u32> call_stack;
std::pair<u32, u32> instruction_range = { UINT32_MAX, 0 }; std::pair<u32, u32> instruction_range = { UINT32_MAX, 0 };

View File

@ -2656,7 +2656,7 @@ namespace rsx
typeless_info.src_context = texture_upload_context::framebuffer_storage; typeless_info.src_context = texture_upload_context::framebuffer_storage;
} }
const auto src_is_depth_format = helpers::is_gcm_depth_format(typeless_info.src_gcm_format); //const auto src_is_depth_format = helpers::is_gcm_depth_format(typeless_info.src_gcm_format);
const auto preferred_dst_format = helpers::get_sized_blit_format(dst_is_argb8, false, is_format_convert); const auto preferred_dst_format = helpers::get_sized_blit_format(dst_is_argb8, false, is_format_convert);
if (cached_dest && !use_null_region) if (cached_dest && !use_null_region)

View File

@ -408,8 +408,8 @@ namespace rsx
}; };
u32 current_address = attr.address; u32 current_address = attr.address;
u16 current_src_offset = 0; //u16 current_src_offset = 0;
u16 current_dst_offset = 0; //u16 current_dst_offset = 0;
u32 slice_size = (attr.pitch * attr.slice_h); u32 slice_size = (attr.pitch * attr.slice_h);
out.reserve(count); out.reserve(count);

View File

@ -6,7 +6,7 @@
namespace namespace
{ {
static constexpr std::array<const char*, 16> s_reg_table = [[maybe_unused]] constexpr std::array<const char*, 16> s_reg_table =
{ {
"in_pos_buffer", "in_weight_buffer", "in_normal_buffer", "in_pos_buffer", "in_weight_buffer", "in_normal_buffer",
"in_diff_color_buffer", "in_spec_color_buffer", "in_diff_color_buffer", "in_spec_color_buffer",

View File

@ -205,7 +205,7 @@ union SRC2
}; };
}; };
static const char* rsx_fp_input_attr_regs[] = constexpr const char* rsx_fp_input_attr_regs[] =
{ {
"WPOS", "COL0", "COL1", "FOGC", "TEX0", "WPOS", "COL0", "COL1", "FOGC", "TEX0",
"TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5",

View File

@ -889,8 +889,8 @@ namespace rsx
// Force aligned indices as realhw // Force aligned indices as realhw
const u32 address = (0 - type_size) & get_address(rsx::method_registers.index_array_address(), rsx::method_registers.index_array_location()); const u32 address = (0 - type_size) & get_address(rsx::method_registers.index_array_address(), rsx::method_registers.index_array_location());
const bool is_primitive_restart_enabled = rsx::method_registers.restart_index_enabled(); //const bool is_primitive_restart_enabled = rsx::method_registers.restart_index_enabled();
const u32 primitive_restart_index = rsx::method_registers.restart_index(); //const u32 primitive_restart_index = rsx::method_registers.restart_index();
const u32 first = draw_indexed_clause.min_index(); const u32 first = draw_indexed_clause.min_index();
const u32 count = draw_indexed_clause.get_elements_count(); const u32 count = draw_indexed_clause.get_elements_count();
@ -1011,8 +1011,8 @@ namespace rsx
return; return;
} }
const u16 clip_x = rsx::method_registers.surface_clip_origin_x(); //const u16 clip_x = rsx::method_registers.surface_clip_origin_x();
const u16 clip_y = rsx::method_registers.surface_clip_origin_y(); //const u16 clip_y = rsx::method_registers.surface_clip_origin_y();
layout.color_addresses = get_color_surface_addresses(); layout.color_addresses = get_color_surface_addresses();
layout.zeta_address = get_zeta_surface_address(); layout.zeta_address = get_zeta_surface_address();
@ -1857,7 +1857,7 @@ namespace rsx
texture_control |= (1 << texture_control_bits::ALPHAKILL); texture_control |= (1 << texture_control_bits::ALPHAKILL);
} }
const u32 texaddr = rsx::get_address(tex.offset(), tex.location()); //const u32 texaddr = rsx::get_address(tex.offset(), tex.location());
const u32 raw_format = tex.format(); const u32 raw_format = tex.format();
const u32 format = raw_format & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN); const u32 format = raw_format & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN);

View File

@ -12,7 +12,7 @@ namespace vk
{ {
static constexpr usz s_dma_block_length = 0x01000000; static constexpr usz s_dma_block_length = 0x01000000;
static constexpr u32 s_dma_block_mask = 0xFF000000; static constexpr u32 s_dma_block_mask = 0xFF000000;
static constexpr u32 s_dma_offset_mask = 0x00FFFFFF; //static constexpr u32 s_dma_offset_mask = 0x00FFFFFF;
static constexpr u32 s_page_size = 16384; static constexpr u32 s_page_size = 16384;
static constexpr u32 s_page_align = s_page_size - 1; static constexpr u32 s_page_align = s_page_size - 1;

View File

@ -1059,7 +1059,7 @@ void VKGSRender::clear_surface(u32 mask)
if (!framebuffer_status_valid) return; if (!framebuffer_status_valid) return;
float depth_clear = 1.f; //float depth_clear = 1.f;
u32 stencil_clear = 0; u32 stencil_clear = 0;
u32 depth_stencil_mask = 0; u32 depth_stencil_mask = 0;
@ -2333,7 +2333,7 @@ void VKGSRender::get_occlusion_query_result(rsx::reports::occlusion_query_info*
for (const auto occlusion_id : data.indices) for (const auto occlusion_id : data.indices)
{ {
// We only need one hit // We only need one hit
if (auto value = m_occlusion_query_manager->get_query_result(occlusion_id)) if (m_occlusion_query_manager->get_query_result(occlusion_id))
{ {
query->result = 1; query->result = 1;
break; break;

View File

@ -42,6 +42,7 @@ private:
#pragma GCC diagnostic ignored "-Wall" #pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wextra" #pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif #endif
#include "3rdparty/GPUOpen/include/vk_mem_alloc.h" #include "3rdparty/GPUOpen/include/vk_mem_alloc.h"
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -495,7 +495,7 @@ namespace vk
std::unique_ptr<vk::viewable_image> find_temporary_image(VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps) std::unique_ptr<vk::viewable_image> find_temporary_image(VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps)
{ {
const auto current_frame = vk::get_current_frame_id(); //const auto current_frame = vk::get_current_frame_id();
for (auto &e : m_temporary_storage) for (auto &e : m_temporary_storage)
{ {
if (e.can_reuse && e.matches(format, w, h, d, mipmaps, 0)) if (e.can_reuse && e.matches(format, w, h, d, mipmaps, 0))
@ -511,7 +511,7 @@ namespace vk
std::unique_ptr<vk::viewable_image> find_temporary_cubemap(VkFormat format, u16 size) std::unique_ptr<vk::viewable_image> find_temporary_cubemap(VkFormat format, u16 size)
{ {
const auto current_frame = vk::get_current_frame_id(); //const auto current_frame = vk::get_current_frame_id();
for (auto &e : m_temporary_storage) for (auto &e : m_temporary_storage)
{ {
if (e.can_reuse && e.matches(format, size, size, 1, 1, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)) if (e.can_reuse && e.matches(format, size, size, 1, 1, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT))

View File

@ -842,7 +842,7 @@ namespace rsx
storage_type* find_vertex_range(uptr local_addr, upload_format fmt, u32 data_length) override storage_type* find_vertex_range(uptr local_addr, upload_format fmt, u32 data_length) override
{ {
const auto data_end = local_addr + data_length; //const auto data_end = local_addr + data_length;
for (auto &v : vertex_ranges[local_addr]) for (auto &v : vertex_ranges[local_addr])
{ {

View File

@ -93,19 +93,19 @@ namespace rsx
namespace constants namespace constants
{ {
static std::array<const char*, 16> fragment_texture_names = constexpr std::array<const char*, 16> fragment_texture_names =
{ {
"tex0", "tex1", "tex2", "tex3", "tex4", "tex5", "tex6", "tex7", "tex0", "tex1", "tex2", "tex3", "tex4", "tex5", "tex6", "tex7",
"tex8", "tex9", "tex10", "tex11", "tex12", "tex13", "tex14", "tex15", "tex8", "tex9", "tex10", "tex11", "tex12", "tex13", "tex14", "tex15",
}; };
static std::array<const char*, 4> vertex_texture_names = constexpr std::array<const char*, 4> vertex_texture_names =
{ {
"vtex0", "vtex1", "vtex2", "vtex3", "vtex0", "vtex1", "vtex2", "vtex3",
}; };
// Local RSX memory base (known as constant) // Local RSX memory base (known as constant)
static constexpr u32 local_mem_base = 0xC0000000; constexpr u32 local_mem_base = 0xC0000000;
} }
/** /**

View File

@ -1640,7 +1640,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
sys_log.notice("Elf path: %s", argv[0]); sys_log.notice("Elf path: %s", argv[0]);
} }
const auto _main = g_fxo->init<ppu_module>(); g_fxo->init<ppu_module>();
ppu_load_exec(ppu_exec); ppu_load_exec(ppu_exec);

View File

@ -469,7 +469,7 @@ std::string vfs::escape(std::string_view name, bool escape_slash)
case char2{u8""[0]}: case char2{u8""[0]}:
{ {
// Escape full-width characters 0xFF01..0xFF5e with (0xFF01) // Escape full-width characters 0xFF01..0xFF5e with (0xFF01)
switch (char2 c2 = get_char(i + 1)) switch (get_char(i + 1))
{ {
case char2{u8""[1]}: case char2{u8""[1]}:
{ {
@ -533,7 +533,7 @@ std::string vfs::unescape(std::string_view name)
{ {
case char2{u8""[0]}: case char2{u8""[0]}:
{ {
switch (char2 c2 = get_char(i + 1)) switch (get_char(i + 1))
{ {
case char2{u8""[1]}: case char2{u8""[1]}:
{ {

View File

@ -6,8 +6,8 @@ LOG_CHANNEL(ds4_log, "DS4");
namespace namespace
{ {
const auto THREAD_SLEEP = 1ms; //ds4 has new data every ~4ms, //const auto THREAD_SLEEP = 1ms; //ds4 has new data every ~4ms,
const auto THREAD_SLEEP_INACTIVE = 100ms; //const auto THREAD_SLEEP_INACTIVE = 100ms;
const u32 DS4_ACC_RES_PER_G = 8192; const u32 DS4_ACC_RES_PER_G = 8192;
const u32 DS4_GYRO_RES_PER_DEG_S = 16; // technically this could be 1024, but keeping it at 16 keeps us within 16 bits of precision const u32 DS4_GYRO_RES_PER_DEG_S = 16; // technically this could be 1024, but keeping it at 16 keeps us within 16 bits of precision

View File

@ -6,11 +6,11 @@ LOG_CHANNEL(dualsense_log, "DualSense");
namespace namespace
{ {
const auto THREAD_SLEEP = 1ms; //const auto THREAD_SLEEP = 1ms;
const auto THREAD_SLEEP_INACTIVE = 100ms; //const auto THREAD_SLEEP_INACTIVE = 100ms;
const u32 DUALSENSE_ACC_RES_PER_G = 8192; //const u32 DUALSENSE_ACC_RES_PER_G = 8192;
const u32 DUALSENSE_GYRO_RES_PER_DEG_S = 1024; //const u32 DUALSENSE_GYRO_RES_PER_DEG_S = 1024;
const u32 DUALSENSE_BLUETOOTH_REPORT_SIZE = 78; const u32 DUALSENSE_BLUETOOTH_REPORT_SIZE = 78;
const u32 DUALSENSE_USB_REPORT_SIZE = 48; const u32 DUALSENSE_USB_REPORT_SIZE = 48;

View File

@ -33,7 +33,6 @@ else()
add_compile_options(-Werror=return-type) add_compile_options(-Werror=return-type)
#TODO Clean the code so these are removed #TODO Clean the code so these are removed
add_compile_options(-Wno-unused-variable)
add_compile_options(-Wno-unused-function) add_compile_options(-Wno-unused-function)
add_compile_options(-Wno-attributes) add_compile_options(-Wno-attributes)

View File

@ -238,7 +238,7 @@ QCoreApplication* createApplication(int& argc, char* argv[])
if (i_rounding_2) if (i_rounding_2)
{ {
const auto arg_val = argv[i_rounding_2]; const auto arg_val = argv[i_rounding_2];
const auto arg_len = std::strlen(arg_val); //const auto arg_len = std::strlen(arg_val);
s64 rounding_val_cli = 0; s64 rounding_val_cli = 0;
if (!cfg::try_to_int64(&rounding_val_cli, arg_val, static_cast<int>(Qt::HighDpiScaleFactorRoundingPolicy::Unset), static_cast<int>(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough))) if (!cfg::try_to_int64(&rounding_val_cli, arg_val, static_cast<int>(Qt::HighDpiScaleFactorRoundingPolicy::Unset), static_cast<int>(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough)))

View File

@ -33,7 +33,7 @@ bool custom_table_widget_item::operator<(const QTableWidgetItem& other) const
const QVariant::Type type_l = data_l.type(); const QVariant::Type type_l = data_l.type();
const QVariant::Type type_r = data_r.type(); const QVariant::Type type_r = data_r.type();
assert(type_l == type_r); ensure(type_l == type_r);
switch (type_l) switch (type_l)
{ {

View File

@ -405,7 +405,7 @@ void debugger_frame::UpdateUnitList()
return; return;
} }
const int old_size = m_choice_units->count(); //const int old_size = m_choice_units->count();
QVariant old_cpu = m_choice_units->currentData(); QVariant old_cpu = m_choice_units->currentData();
const auto on_select = [&](u32 id, cpu_thread& cpu) const auto on_select = [&](u32 id, cpu_thread& cpu)
@ -542,7 +542,7 @@ void debugger_frame::ShowGotoAddressDialog()
{ {
expression_input->setValidator(new QRegExpValidator(QRegExp("^(0[xX])?0*[a-fA-F0-9]{0,5}$"))); expression_input->setValidator(new QRegExpValidator(QRegExp("^(0[xX])?0*[a-fA-F0-9]{0,5}$")));
} }
// Ok/Cancel // Ok/Cancel
QPushButton* button_ok = new QPushButton(tr("OK")); QPushButton* button_ok = new QPushButton(tr("OK"));
QPushButton* button_cancel = new QPushButton(tr("Cancel")); QPushButton* button_cancel = new QPushButton(tr("Cancel"));

View File

@ -197,7 +197,7 @@ void kernel_explorer::Update()
return; return;
} }
static const usz additional_size = 6; //static const usz additional_size = 6;
const std::unordered_map<u32, QString> tree_item_names = const std::unordered_map<u32, QString> tree_item_names =
{ {

View File

@ -1030,9 +1030,9 @@ void main_window::SaveWindowState()
void main_window::RepaintThumbnailIcons() void main_window::RepaintThumbnailIcons()
{ {
const QColor new_color = gui::utils::get_label_color("thumbnail_icon_color"); [[maybe_unused]] const QColor new_color = gui::utils::get_label_color("thumbnail_icon_color");
const auto icon = [&new_color](const QString& path) [[maybe_unused]] const auto icon = [&new_color](const QString& path)
{ {
return gui::utils::get_colorized_icon(QPixmap::fromImage(gui::utils::get_opaque_image_area(path)), Qt::black, new_color); return gui::utils::get_colorized_icon(QPixmap::fromImage(gui::utils::get_opaque_image_area(path)), Qt::black, new_color);
}; };

View File

@ -6,7 +6,7 @@
static const int TROPHY_TIMEOUT_MS = 7500; static const int TROPHY_TIMEOUT_MS = 7500;
constexpr auto qstr = QString::fromStdString; //constexpr auto qstr = QString::fromStdString;
trophy_notification_frame::trophy_notification_frame(const std::vector<uchar>& imgBuffer, const SceNpTrophyDetails& trophy, int height) : QWidget() trophy_notification_frame::trophy_notification_frame(const std::vector<uchar>& imgBuffer, const SceNpTrophyDetails& trophy, int height) : QWidget()
{ {

View File

@ -943,8 +943,6 @@ void root_info::slot_free(uptr iptr, atomic_t<u16>* slot, u32 tls_slot) noexcept
{ {
const auto begin = reinterpret_cast<uptr>(std::begin(s_hashtable)); const auto begin = reinterpret_cast<uptr>(std::begin(s_hashtable));
const auto end = reinterpret_cast<uptr>(std::end(s_hashtable));
const auto ptr = reinterpret_cast<uptr>(slot) - begin; const auto ptr = reinterpret_cast<uptr>(slot) - begin;
if (ptr >= sizeof(s_hashtable)) if (ptr >= sizeof(s_hashtable))

View File

@ -90,7 +90,7 @@ namespace utils
return nullptr; return nullptr;
} }
const auto orig_size = size; [[maybe_unused]] const auto orig_size = size;
if (!use_addr) if (!use_addr)
{ {