diff --git a/Utilities/Array.h b/Utilities/Array.h index ad5e715d7d..0855fdbdc7 100644 --- a/Utilities/Array.h +++ b/Utilities/Array.h @@ -1,228 +1,5 @@ #pragma once -template class Array -{ -protected: - u32 m_count; - T* m_array; - -public: - Array() - : m_count(0) - , m_array(NULL) - { - } - - ~Array() - { - Clear(); - } - - inline bool RemoveAt(const u32 from, const u32 count = 1) - { - if(!GetCount()) return false; - const u32 to = from + count; - if(to > GetCount()) return false; - - for(u32 i=0; i= m_count) return false; - - _InsertRoomEnd(size); - memmove(m_array + pos + size, m_array + pos, sizeof(T) * (m_count - size - pos)); - - return true; - } - - inline bool Move(const u32 pos, T* data) - { - if(!InsertRoom(pos, 1)) return false; - - memcpy(m_array + pos, data, sizeof(T)); - free(data); - - return true; - } - - inline u32 Move(T* data) - { - _InsertRoomEnd(1); - - memcpy(m_array + GetCount() - 1, data, sizeof(T)); - free(data); - - return m_count - 1; - } - - inline bool Add(const u32 pos, T*& data) - { - if(!InsertRoom(pos, 1)) return false; - - memcpy(m_array + pos, data, sizeof(T)); - free(data); - data = m_array + pos; - - return true; - } - - inline u32 Add(T*& data) - { - _InsertRoomEnd(1); - - memcpy(m_array + GetCount() - 1, data, sizeof(T)); - free(data); - data = m_array + GetCount() - 1; - - return m_count - 1; - } - - inline bool AddCpy(const u32 pos, const T* data, u32 count = 1) - { - if(!InsertRoom(pos, count)) return false; - - for(u32 i=0; i= GetCount()) return *new T(); - return m_array[num]; - } - - u32 GetCount() const { return m_count; } - - void SetCount(const u32 count, bool memzero = true) - { - if(m_count >= count) return; - - _InsertRoomEnd(count - m_count); - - if(memzero) memset(m_array + m_count - count, 0, sizeof(T) * (m_count - count)); - } - - void Reserve(const u32 count) - { - SetCount(GetCount() + count); - } - - void AppendFrom(const Array& src) - { - if(!src.GetCount()) return; - - Reserve(src.GetCount()); - - memcpy(m_array, &src[0], GetCount() * sizeof(T)); - } - - void CopyFrom(const Array& src) - { - Clear(); - - AppendFrom(src); - } - - inline T* GetPtr() { return m_array; } - inline const T* GetPtr() const { return m_array; } - - T& operator[](u32 num) const { return m_array[num]; } - - T* operator + (u32 right) const - { - return m_array + right; - } - - T* operator ->() - { - return m_array; - } - -protected: - void _InsertRoomEnd(const u32 size) - { - if(!size) return; - - m_array = m_count ? (T*)realloc(m_array, sizeof(T) * (m_count + size)) : (T*)malloc(sizeof(T) * size); - m_count += size; - } -}; - -template struct Stack : public Array -{ - Stack() : Array() - { - } - - ~Stack() - { - Array::Clear(); - } - - void Push(const T data) { Array::AddCpy(data); } - - T Pop() - { - const u32 pos = Array::GetCount() - 1; - - const T ret = Array::Get(pos); - Array::RemoveAt(pos); - - return ret; - } -}; - template class SizedStack { T m_ptr[size]; @@ -278,106 +55,6 @@ public: } }; -template class ArrayF -{ - u32 m_count; - T** m_array; - -public: - ArrayF() - : m_count(0) - , m_array(NULL) - { - } - - virtual ~ArrayF() - { - Clear(); - } - - inline bool RemoveFAt(const u32 from, const u32 count = 1) - { - if(from + count > m_count) return false; - - memmove(&m_array[from], &m_array[from+count], (m_count-(from+count)) * sizeof(T**)); - - m_count -= count; - return true; - } - - inline bool RemoveAt(const u32 from, const u32 count = 1) - { - if(from + count > m_count) return false; - - for(uint i = from; i < from + count; ++i) - { - free(m_array[i]); - } - - return RemoveFAt(from, count); - } - - inline u32 Add(T& data) - { - return Add(&data); - } - - inline u32 Add(T* data) - { - if(!m_array) - { - m_array = (T**)malloc(sizeof(T*)); - } - else - { - m_array = (T**)realloc(m_array, sizeof(T*) * (m_count + 1)); - } - - m_array[m_count] = data; - return m_count++; - } - - inline void ClearF() - { - if(m_count == 0) return; - - m_count = 0; - m_array = NULL; - } - - inline void Clear() - { - if(m_count == 0) return; - - m_count = 0; - safe_free(m_array); - } - - inline T& Get(const u64 num) - { - //if(m_count <= num) *m_array[0]; //TODO - return *m_array[num]; - } - - T** operator + (u32 right) const - { - return m_array + right; - } - - T* operator ->() - { - return *m_array; - } - - inline T** GetPtr() - { - return m_array; - } - - inline u32 GetCount() const { return m_count; } - T& operator[](u32 num) const { return *m_array[num]; } -}; - template struct ScopedPtr { private: diff --git a/Utilities/BEType.h b/Utilities/BEType.h index 02c47ed76d..853fd32dec 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -57,17 +57,18 @@ public: be_t() noexcept = default; #endif + be_t(const be_t& value) = default; be_t(const T& value) { FromLE(value); } template - be_t(const be_t& value) + explicit be_t(const be_t& value) { FromBE(value.ToBE()); } - + const T& ToBE() const { return m_data; @@ -126,11 +127,7 @@ public: return *this; } - be_t& operator = (const be_t& right) - { - m_data = right.m_data; - return *this; - } + be_t& operator = (const be_t& right) = default; template be_t& operator += (T1 right) { return *this = T(*this) + right; } template be_t& operator -= (T1 right) { return *this = T(*this) - right; } diff --git a/Utilities/GNU.h b/Utilities/GNU.h index e928c1ee6f..9d0ba8abb2 100644 --- a/Utilities/GNU.h +++ b/Utilities/GNU.h @@ -2,6 +2,9 @@ #if defined(__GNUG__) #include +#include +#include + #define _fpclass(x) std::fpclassify(x) #define __forceinline __attribute__((always_inline)) #define _byteswap_ushort(x) __builtin_bswap16(x) @@ -13,7 +16,8 @@ #define _CRT_ALIGN(x) __attribute__((aligned(x))) #define InterlockedCompareExchange(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val) #define InterlockedCompareExchange64(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val) -#define _aligned_malloc(size,alignment) aligned_alloc(alignment,size) -#define _aligned_free(pointer) free(pointer) +#define _aligned_malloc(size,alignment) memalign(alignment,size) +#define _aligned_free free #define DWORD int32_t #endif + diff --git a/Utilities/Thread.h b/Utilities/Thread.h index da04de0051..cba6bcbdf3 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -2,6 +2,7 @@ #include "Array.h" #include #include +#include #include #include #include @@ -73,7 +74,7 @@ template class MTPacketBuffer protected: volatile bool m_busy; volatile u32 m_put, m_get; - Array m_buffer; + std::vector m_buffer; u32 m_max_buffer_size; mutable std::recursive_mutex m_cs_main; @@ -98,7 +99,7 @@ public: { std::lock_guard lock(m_cs_main); m_put = m_get = 0; - m_buffer.Clear(); + m_buffer.clear(); m_busy = false; } diff --git a/rpcs3/AppConnector.cpp b/rpcs3/AppConnector.cpp index b38ccd67c8..212965ee2f 100644 --- a/rpcs3/AppConnector.cpp +++ b/rpcs3/AppConnector.cpp @@ -3,21 +3,21 @@ AppConnector::~AppConnector() { - for(uint i=0; i m_connect_arr; + std::vector m_connect_arr; public: ~AppConnector(); @@ -30,4 +30,4 @@ public: void Connect(int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject* userData = nullptr, wxEvtHandler* eventSink = nullptr); void Connect(int winid, int eventType, wxObjectEventFunction func, wxObject* userData = nullptr, wxEvtHandler* eventSink = nullptr); void Connect(int eventType, wxObjectEventFunction func, wxObject* userData = nullptr, wxEvtHandler* eventSink = nullptr); -}; \ No newline at end of file +}; diff --git a/rpcs3/Crypto/key_vault.cpp b/rpcs3/Crypto/key_vault.cpp index fbe56bb5d9..8565addb4d 100644 --- a/rpcs3/Crypto/key_vault.cpp +++ b/rpcs3/Crypto/key_vault.cpp @@ -7,665 +7,576 @@ KeyVault::KeyVault() void KeyVault::LoadSelfLV0Keys() { - sk_LV0_arr.Clear(); - sk_LV0_arr.Move( - new SELF_KEY(0x0000000000000000, 0x0000, KEY_LV0, + sk_LV0_arr.clear(); + sk_LV0_arr.emplace_back(0x0000000000000000, 0x0000, KEY_LV0, "CA7A24EC38BDB45B98CCD7D363EA2AF0C326E65081E0630CB9AB2D215865878A", "F9205F46F6021697E670F13DFA726212", "A8FD6DB24532D094EFA08CB41C9A72287D905C6B27B42BE4AB925AAF4AFFF34D41EEB54DD128700D", "001AD976FCDE86F5B8FF3E63EF3A7F94E861975BA3", - 0x33)); + 0x33); } void KeyVault::LoadSelfLDRKeys() { - sk_LDR_arr.Clear(); - sk_LDR_arr.Move( - new SELF_KEY(0x0000000000000000, 0x0000, KEY_LDR, + sk_LDR_arr.clear(); + sk_LDR_arr.emplace_back(0x0000000000000000, 0x0000, KEY_LDR, "C0CEFE84C227F75BD07A7EB846509F93B238E770DACB9FF4A388F812482BE21B", "47EE7454E4774CC9B8960C7B59F4C14D", "C2D4AAF319355019AF99D44E2B58CA29252C89123D11D6218F40B138CAB29B7101F3AEB72A975019", "00C5B2BFA1A413DD16F26D31C0F2ED4720DCFB0670", - 0x20)); + 0x20); } void KeyVault::LoadSelfLV1Keys() { - sk_LV1_arr.Clear(); - sk_LV1_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0000, KEY_LV1, + sk_LV1_arr.clear(); + sk_LV1_arr.emplace_back(0x0003003000000000, 0x0000, KEY_LV1, "B9F3F9E6107CFF2680A91E118C2403CF4A6F18F3C7EFD7D13D1AC4DB760BD222", "B43661B9A79BAD9D8E2B046469CDA1E7", "4C870BE86DDD996A92A3F7F404F33604244A1D02AB5B78BC9DAF030B78BE8867CF586171B7D45D20", "002CC736C7AD06D264E9AB663EB1F35F5DC159248C", - 0x33)); - sk_LV1_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0000, KEY_LV1, + 0x33); + sk_LV1_arr.emplace_back(0x0003004200000000, 0x0000, KEY_LV1, "B880593856C8C6D2037585626A12977F50DCFCF3F132D2C89AA6E670EAFC1646", "A79B05D4E37B8117A95E6E7C14FB640E", "7454C7CCBFC2F66C142D78A730A3A6F973CC0FB75A46FCBB390790138910A0CAC78E5E21F4DA3375", "00033A699FDD2DA6CDD6CCC03B2C6145F998706F74", - 0x34)); - sk_LV1_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0000, KEY_LV1, + 0x34); + sk_LV1_arr.emplace_back(0x0003005000000000, 0x0000, KEY_LV1, "1E8EEEA9E80A729F3FA52CF523B25941EA44B4155D94E5DADC5C5A77847620C7", "E034D31A80316960024D1B3D3164FDC3", "7E3A196f4A5879F3A7B091A2263F7C24E1716129B580566D308D9C2254B36AEE53DEF30EC85F8398", "005815D17125D04C33790321DE29EB6241365100B5", - 0x35)); - sk_LV1_arr.Move( - new SELF_KEY(0x0003005500000000, 0x0000, KEY_LV1, + 0x35); + sk_LV1_arr.emplace_back(0x0003005500000000, 0x0000, KEY_LV1, "53ABDF84BE08B0351B734F2B97D2BE1621BC6C889E4362E5C70F39D6C3ED9F23", "44E652661AC7584DBE08ECB810FB5FC0", "733198A7759BC07326755BC9773A8A17C8A7043C7BDAB83D88E230512E2EA3852D7DA4263A7E97F9", "004312C65347ACBE95CC306442FEFD0AF4C2935EB3", - 0x05)); - sk_LV1_arr.Move( - new SELF_KEY(0x0003005600000000, 0x0000, KEY_LV1, + 0x05); + sk_LV1_arr.emplace_back(0x0003005600000000, 0x0000, KEY_LV1, "48793EBDDA1AF65D737DA2FDA2DD104447A698F8A82CAAEE992831711BA94E83", "15DCF3C67147A45D09DE7521EECA07A1", "85A8868C320127F10B6598964C69221C086702021D31803520E21FDE4DBE827766BE41825CB7328C", "", - 0x07)); - sk_LV1_arr.Move( - new SELF_KEY(0x0003006100000000, 0x0000, KEY_LV1, + 0x07); + sk_LV1_arr.emplace_back(0x0003006100000000, 0x0000, KEY_LV1, "5FF17D836E2C4AD69476E2614F64BDD05B9115389A9A6D055B5B544B1C34E3D5", "DF0F50EC3C4743C5B17839D7B49F24A4", "1CDABE30833823F461CA534104115FFF60010B710631E435A7D915E82AE88EDE667264656CB7062E", "", - 0x05)); - sk_LV1_arr.Move( - new SELF_KEY(0x0003006600000000, 0x0000, KEY_LV1, + 0x05); + sk_LV1_arr.emplace_back(0x0003006600000000, 0x0000, KEY_LV1, "BD0621FA19383C3C72ECBC3B008F1CD55FFD7C3BB7510BF11AD0CF0FC2B70951", "569AF3745E1E02E3E288273CDE244CD8", "21E26F11C2D69478609DD1BD278CDFC940D90386455BA52FCD1FA7E27AC2AFA826C79A10193B625C", "", - 0x07)); - sk_LV1_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0000, KEY_LV1, + 0x07); + sk_LV1_arr.emplace_back(0x0003007400000000, 0x0000, KEY_LV1, "41A6E0039041E9D8AAF4EF2F2A2971248EDBD96A3985611ED7B4CE73EE4804FE", "C8C98D5A5CE23AF5607A352AECACB0DC", "4389664390265F96C1A882374C0F856364E33DB09BE124A4666F9A12F0DD9C811EDD55BA21ED0667", "", - 0x12)); - sk_LV1_arr.Move( - new SELF_KEY(0x0004001100000000, 0x0000, KEY_LV1, + 0x12); + sk_LV1_arr.emplace_back(0x0004001100000000, 0x0000, KEY_LV1, "557EDF6C063F3272B0D44EEC12F418DA774815B5415597CC5F75C21E048BAD74", "7144D7574937818517826227EF4AC0B4", "085D38DBF9B757329EB862107929909D32FA1DAE60641BF4AC25319D7650597EE977F8E810FEEA96", "", - 0x13)); - sk_LV1_arr.Move( - new SELF_KEY(0x0004005000000000, 0x0000, KEY_LV1, + 0x13); + sk_LV1_arr.emplace_back(0x0004005000000000, 0x0000, KEY_LV1, "10CEA04973FCCC12EC19924510822D8D4C41F657FD3D7E73F415A8D687421BCD", "ED8699562C6AC65204FA166257E7FCF4", "9AF86FC869C159FBB62F7D9674EE257ABF12E5A96D5875B4AA73C13C2BC13E2A4079F98B9B935EE2", "", - 0x14)); + 0x14); } void KeyVault::LoadSelfLV2Keys() { - sk_LV2_arr.Clear(); - sk_LV2_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0000, KEY_LV2, + sk_LV2_arr.clear(); + sk_LV2_arr.emplace_back(0x0003003000000000, 0x0000, KEY_LV2, "94303F69513572AB5AE17C8C2A1839D2C24C28F65389D3BBB11894CE23E0798F", "9769BFD187B90990AE5FEA4E110B9CF5", "AFAF5E96AF396CBB69071082C46A8F34A030E8EDB799E0A7BE00AA264DFF3AEBF7923920D559404D", "0070ABF9361B02291829D479F56AB248203CD3EB46", - 0x20)); - sk_LV2_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0000, KEY_LV2, + 0x20); + sk_LV2_arr.emplace_back(0x0003004200000000, 0x0000, KEY_LV2, "575B0A6C4B4F2760A03FE4189EBAF4D947279FD982B14070349098B08FF92C10", "411CB18F460CE50CAF2C426D8F0D93C8", "3FEE313954CB3039C321A7E33B97FFDEC8988A8B55759161B04DBF4731284E4A8191E3F17D32B0EA", "0073076441A08CD179E5FACE349B86DA58B5B7BA78", - 0x21)); - sk_LV2_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0000, KEY_LV2, + 0x21); + sk_LV2_arr.emplace_back(0x0003005000000000, 0x0000, KEY_LV2, "6DBD48D787C58803A8D724DA5ACF04FF8FCE91D7545D2322F2B7ABF57014AF68", "603A36213708520ED5D745DEC1325BA5", "5888CB83AC3CCA9610BC173C53141C0CA58B93719E744660CA8823D5EAEE8F9BF736997054E4B7E3", "0009EBC3DE442FA5FBF6C4F3D4F9EAB07778A142BD", - 0x22)); - sk_LV2_arr.Move( - new SELF_KEY(0x0003005500000000, 0x0000, KEY_LV2, + 0x22); + sk_LV2_arr.emplace_back(0x0003005500000000, 0x0000, KEY_LV2, "84015E90FA23139628A3C75CC09714E6427B527A82D18ABC3E91CD8D7DDAFF17", "5B240444D645F2038118F97FD5A145D5", "B266318245266B2D33641CD8A864066D077FAC60B7E27399099A70A683454B70F9888E7CC0C2BF72", "009D4CBA2BFB1A8330D3E20E59D281D476D231C73A", - 0x32)); - sk_LV2_arr.Move( - new SELF_KEY(0x0003005600000000, 0x0000, KEY_LV2, + 0x32); + sk_LV2_arr.emplace_back(0x0003005600000000, 0x0000, KEY_LV2, "EAE15444048EFDE7A831BFA9F5D96F047C9FCFF50723E292CF50F5417D81E359", "9CA9282DC7FA9F315EF3156D970B7CD4", "0D58938CB47598A6A672874F1768068F8B80D8D17014D2ABEBAC85E5B0993D9FB6F307DDC3DDA699", "", - 0x33)); - sk_LV2_arr.Move( - new SELF_KEY(0x0003006100000000, 0x0000, KEY_LV2, + 0x33); + sk_LV2_arr.emplace_back(0x0003006100000000, 0x0000, KEY_LV2, "88AD367EDEC2FEED3E2F99B1C685075C41BDEC90C84F526CAF588F89BBD1CBCC", "8D18E8E525230E63DE10291C9DD615BF", "86EED1D65E58890ABDA9ACA486A2BDDB9C0A529C2053FAE301F0F698EAF443DA0F60595A597A7027", "", - 0x32)); - sk_LV2_arr.Move( - new SELF_KEY(0x0003006600000000, 0x0000, KEY_LV2, + 0x32); + sk_LV2_arr.emplace_back(0x0003006600000000, 0x0000, KEY_LV2, "688D5FCAC6F4EA35AC6AC79B10506007286131EE038116DB8AA2C0B0340D9FB0", "75E0239D18B0B669EAE650972F99726B", "008E1C820AC567D1BFB8FE3CC6AD2E1845A1D1B19ED2E18B18CA34A8D28A83EC60C63859CDB3DACA", "", - 0x33)); - sk_LV2_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0000, KEY_LV2, + 0x33); + sk_LV2_arr.emplace_back(0x0003007400000000, 0x0000, KEY_LV2, "E81C5B04C29FB079A4A2687A39D4EA97BFB49D80EF546CEB292979A5F77A6254", "15058FA7F2CAD7C528B5F605F6444EB0", "438D0E5C1E7AFB18234DB6867472FF5F52B750F30C379C7DD1EE0FD23E417B3EA819CC01BAC480ED", "", - 0x11)); - sk_LV2_arr.Move( - new SELF_KEY(0x0004001100000000, 0x0000, KEY_LV2, + 0x11); + sk_LV2_arr.emplace_back(0x0004001100000000, 0x0000, KEY_LV2, "A1E4B86ED02BF7F1372A2C73FE02BC738907EB37CE3BA605FE783C999FAFDB97", "BBE7799B9A37CB272E386618FDFD4AEC", "5B31A8E2A663EBD673196E2E1022E0D64988C4E1BBFE5E474415883A3BA0D9C562A2BE9C30E9B4A8", "", - 0x07)); - sk_LV2_arr.Move( - new SELF_KEY(0x0004005000000000, 0x0000, KEY_LV2, + 0x07); + sk_LV2_arr.emplace_back(0x0004005000000000, 0x0000, KEY_LV2, "0CAF212B6FA53C0DA7E2C575ADF61DBE68F34A33433B1B891ABF5C4251406A03", "9B79374722AD888EB6A35A2DF25A8B3E", "1034A6F98AF6625CC3E3604B59B971CA617DF337538D2179EBB22F3BDC9D0C6DA56BA7DDFD205A50", "", - 0x14)); + 0x14); } void KeyVault::LoadSelfISOKeys() { - sk_ISO_arr.Clear(); - sk_ISO_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0001, KEY_ISO, + sk_ISO_arr.clear(); + sk_ISO_arr.emplace_back(0x0003003000000000, 0x0001, KEY_ISO, "8860D0CFF4D0DC688D3223321B96B59A777E6914961488E07048DAECB020ECA4", "C82D015D46CF152F1DD0C16F18B5B1E5", "733918D7C888130509346E6B4A8B6CAA357AB557E814E8122BF102C14A314BF9475B9D70EAF9EC29", "009BE892E122A5C943C1BB7403A67318AA9E1B286F", - 0x36)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0001, KEY_ISO, + 0x36); + sk_ISO_arr.emplace_back(0x0003004200000000, 0x0001, KEY_ISO, "101E27F3FA2FB53ACA924F783AD553162D56B975D05B81351A1111799F20254D", "8D2E9C6297B8AD252998458296AC773C", "138446EE0BDDA5638F97328C8956E6489CBBFE57C5961D40DD5C43BB4138F1C400A8B27204A5D625", "00849DBC57D3B92F01864E6E82EB4EF0EF6311E122", - 0x32)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0001, KEY_ISO, + 0x32); + sk_ISO_arr.emplace_back(0x0003005000000000, 0x0001, KEY_ISO, "3F2604FA27AEADFBE1AC69EB00BB16EF196C2193CBD62900FFD8C25041680843", "A414AC1DB7987E43777651B330B899E1", "1F4633AFDE18614D6CEF38A2FD6C4CCAC7B6EB8109D72CD066ECEBA0193EA3F43C37AE83179A4E5F", "0085B4B05DEBA7E6AD831653C974D95149803BB272", - 0x33)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003005500000000, 0x0001, KEY_ISO, + 0x33); + sk_ISO_arr.emplace_back(0x0003005500000000, 0x0001, KEY_ISO, "BDB74AA6E3BA2DC10B1BD7F17198399A158DBE1FA0BEA68C90FCACBE4D04BE37", "0207A479B1574F8E7F697528F05D5435", "917E1F1DC48A54EB5F10B38E7569BB5383628A7C906F0DCA62FDA33805C15FAB270016940A09DB58", "00294411363290975BA551336D3965D88AF029A17B", - 0x03)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003005600000000, 0x0001, KEY_ISO, + 0x03); + sk_ISO_arr.emplace_back(0x0003005600000000, 0x0001, KEY_ISO, "311C015F169F2A1E0757F7064B14C7C9F3A3FFEE015BD4E3A22401A2667857CE", "7BB8B3F5AC8E0890E3148AE5688C7350", "3F040EFA2335FED5670BA4D5C3AB2D9D0B4BA69D154A0062EA995A7D21DBAF0DC5A0DAD333D1C1DD", "", - 0x08)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003006100000000, 0x0001, KEY_ISO, + 0x08); + sk_ISO_arr.emplace_back(0x0003006100000000, 0x0001, KEY_ISO, "8474ADCA3B3244931EECEB9357841442442A1C4A4BCF4E498E6738950F4E4093", "FFF9CACCC4129125CAFB240F419E5F39", "098E1A53E59A95316B00D5A29C05FFEBAE41D1A8A386F9DA96F98858FD25E07BB7A3BC96A5D5B556", "", - 0x03)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003006600000000, 0x0001, KEY_ISO, + 0x03); + sk_ISO_arr.emplace_back(0x0003006600000000, 0x0001, KEY_ISO, "E6A21C599B75696C169EC02582BDA74A776134A6E05108EA701EC0CA2AC03592", "D292A7BD57C0BB2EABBCA1252FA9EDEF", "2ED078A13DC4617EB550AD06E228C83C142A2D588EB5E729402D18038A14842FD65B277DCAD225A5", "", - 0x08)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0001, KEY_ISO, + 0x08); + sk_ISO_arr.emplace_back(0x0003007400000000, 0x0001, KEY_ISO, "072D3A5C3BDB0D674DE209381432B20414BC9BDA0F583ECB94BD9A134176DD51", "8516A81F02CF938740498A406C880871", "5A778DEB5C4F12E8D48E06A2BBBBE3C90FA8C6C47DF9BDB5697FD4A8EB7941CE3F59A557E81C787D", "", - 0x21)); - sk_ISO_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0100, KEY_ISO, + 0x21); + sk_ISO_arr.emplace_back(0x0003007400000000, 0x0100, KEY_ISO, "786FAB8A0B89474A2CB80B3EA104CCCB9E13F66B45EC499BB31865D07C661EA8", "94662F13D99A9F5D211C979FFDF65FE3", "912C94C252B7799CEB45DFBB73EF7CAD9BCC0793A3331BBB79E3C47C0F5C782F698065A8D4DB0D8B", "", - 0x0E)); - sk_ISO_arr.Move( - new SELF_KEY(0x0004001100000000, 0x0001, KEY_ISO, + 0x0E); + sk_ISO_arr.emplace_back(0x0004001100000000, 0x0001, KEY_ISO, "4262657A3185D9480F82C8BD2F81766FCC2C8FD7DD5EBE8657B00B939E0C75BD", "4F1E3EF07D893A4714B1B3D5A4E50479", "4DBFCFA68B52F1D66E09AFA6C18EC65479EDBD027B6B8C6A5D85FE5C84D43EA40CEF1672078A0702", "", - 0x11)); - sk_ISO_arr.Move( - new SELF_KEY(0x0004001100000000, 0x0100, KEY_ISO, + 0x11); + sk_ISO_arr.emplace_back(0x0004001100000000, 0x0100, KEY_ISO, "16AA7D7C35399E2B1BFAF68CD19D7512A7855029C08BECC4CC3F035DF7F9C70B", "0E50DB6D937D262CB0499136852FCB80", "AEE2795BF295662A50DFAFE70D1B0B6F0A2EBB211E1323A275FC6E2D13BE4F2F10CA34784F4CF1EC", "", - 0x0F)); - sk_ISO_arr.Move( - new SELF_KEY(0x0004005000000000, 0x0001, KEY_ISO, + 0x0F); + sk_ISO_arr.emplace_back(0x0004005000000000, 0x0001, KEY_ISO, "63565DBE98C3B1A52AADC907C47130FE57A10734E84F22592670F86ED2B0A086", "953F6A99891B4739358F5363A00C08B9", "26BE7B02E7D65C6C21BF4063CDB8C0092FE1679D62FA1A8CCC284A1D21885473A959992537A06612", "", - 0x15)); - sk_ISO_arr.Move( - new SELF_KEY(0x0004005000000000, 0x0100, KEY_ISO, + 0x15); + sk_ISO_arr.emplace_back(0x0004005000000000, 0x0100, KEY_ISO, "B96EA32CB96EA32DB96EA32CB96EA32CB96EA32CB96EA32DB96EA32CB96EA32C", "B96EA32CB96EA32DB96EA32DB96EA32C", "2D7066E68C6AC3373B1346FD76FE7D18A207C811500E65D85DB57BC4A27AD78F59FD53F38F50E151", "0044AA25B4276D79B494A29CB8DE104642424F8EEF", - 0x02)); + 0x02); } void KeyVault::LoadSelfAPPKeys() { - sk_APP_arr.Clear(); - sk_APP_arr.Move( - new SELF_KEY(0x0000009200000000, 0x0000, KEY_APP, + sk_APP_arr.clear(); + sk_APP_arr.emplace_back(0x0000009200000000, 0x0000, KEY_APP, "95F50019E7A68E341FA72EFDF4D60ED376E25CF46BB48DFDD1F080259DC93F04", "4A0955D946DB70D691A640BB7FAECC4C", "6F8DF8EBD0A1D1DB08B30DD3A951E3F1F27E34030B42C729C55555232D61B834B8BDFFB07E54B343", "006C3E4CCB2C69A5AD7C6F60448E50C7F9184EEAF4", - 0x21)); - sk_APP_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0001, KEY_APP, + 0x21); + sk_APP_arr.emplace_back(0x0003003000000000, 0x0001, KEY_APP, "79481839C406A632BDB4AC093D73D99AE1587F24CE7E69192C1CD0010274A8AB", "6F0F25E1C8C4B7AE70DF968B04521DDA", "94D1B7378BAFF5DFED269240A7A364ED68446741622E50BC6079B6E606A2F8E0A4C56E5CFF836526", "003DE80167D2F0E9D30F2145144A558D1174F5410C", - 0x11)); - sk_APP_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0002, KEY_APP, + 0x11); + sk_APP_arr.emplace_back(0x0003003000000000, 0x0002, KEY_APP, "4F89BE98DDD43CAD343F5BA6B1A133B0A971566F770484AAC20B5DD1DC9FA06A", "90C127A9B43BA9D8E89FE6529E25206F", "8CA6905F46148D7D8D84D2AFCEAE61B41E6750FC22EA435DFA61FCE6F4F860EE4F54D9196CA5290E", "", - 0x13)); - sk_APP_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0003, KEY_APP, + 0x13); + sk_APP_arr.emplace_back(0x0003003000000000, 0x0003, KEY_APP, "C1E6A351FCED6A0636BFCB6801A0942DB7C28BDFC5E0A053A3F52F52FCE9754E", "E0908163F457576440466ACAA443AE7C", "50022D5D37C97905F898E78E7AA14A0B5CAAD5CE8190AE5629A10D6F0CF4173597B37A95A7545C92", "", - 0x0B)); - sk_APP_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0004, KEY_APP, + 0x0B); + sk_APP_arr.emplace_back(0x0003004200000000, 0x0004, KEY_APP, "838F5860CF97CDAD75B399CA44F4C214CDF951AC795298D71DF3C3B7E93AAEDA", "7FDBB2E924D182BB0D69844ADC4ECA5B", "1F140E8EF887DAB52F079A06E6915A6460B75CD256834A43FA7AF90C23067AF412EDAFE2C1778D69", "0074E922FDEE5DC4CDF22FC8D7986477F813400860", - 0x14)); - sk_APP_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0005, KEY_APP, + 0x14); + sk_APP_arr.emplace_back(0x0003004200000000, 0x0005, KEY_APP, "C109AB56593DE5BE8BA190578E7D8109346E86A11088B42C727E2B793FD64BDC", "15D3F191295C94B09B71EBDE088A187A", "B6BB0A84C649A90D97EBA55B555366F52381BB38A84C8BB71DA5A5A0949043C6DB249029A43156F7", "", - 0x15)); - sk_APP_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0006, KEY_APP, + 0x15); + sk_APP_arr.emplace_back(0x0003004200000000, 0x0006, KEY_APP, "6DFD7AFB470D2B2C955AB22264B1FF3C67F180983B26C01615DE9F2ECCBE7F41", "24BD1C19D2A8286B8ACE39E4A37801C2", "71F46AC33FF89DF589A100A7FB64CEAC244C9A0CBBC1FDCE80FB4BF8A0D2E66293309CB8EE8CFA95", "", - 0x2C)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0007, KEY_APP, + 0x2C); + sk_APP_arr.emplace_back(0x0003005000000000, 0x0007, KEY_APP, "945B99C0E69CAF0558C588B95FF41B232660ECB017741F3218C12F9DFDEEDE55", "1D5EFBE7C5D34AD60F9FBC46A5977FCE", "AB284CA549B2DE9AA5C903B75652F78D192F8F4A8F3CD99209415C0A84C5C9FD6BF3095C1C18FFCD", "002CF896D35DB871D0E6A252E799876A70D043C23E", - 0x15)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0008, KEY_APP, + 0x15); + sk_APP_arr.emplace_back(0x0003005000000000, 0x0008, KEY_APP, "2C9E8969EC44DFB6A8771DC7F7FDFBCCAF329EC3EC070900CABB23742A9A6E13", "5A4CEFD5A9C3C093D0B9352376D19405", "6E82F6B54A0E9DEBE4A8B3043EE3B24CD9BBB62B4416B0482582E419A2552E29AB4BEA0A4D7FA2D5", "", - 0x16)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0009, KEY_APP, + 0x16); + sk_APP_arr.emplace_back(0x0003005000000000, 0x0009, KEY_APP, "F69E4A2934F114D89F386CE766388366CDD210F1D8913E3B973257F1201D632B", "F4D535069301EE888CC2A852DB654461", "1D7B974D10E61C2ED087A0981535904677EC07E96260F89565FF7EBDA4EE035C2AA9BCBDD5893F99", "", - 0x2D)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005500000000, 0x000A, KEY_APP, + 0x2D); + sk_APP_arr.emplace_back(0x0003005500000000, 0x000A, KEY_APP, "29805302E7C92F204009161CA93F776A072141A8C46A108E571C46D473A176A3", "5D1FAB844107676ABCDFC25EAEBCB633", "09301B6436C85B53CB1585300A3F1AF9FB14DB7C30088C4642AD66D5C148B8995BB1A698A8C71827", "0010818ED8A666051C6198662C3D6DDE2CA4901DDC", - 0x25)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005500000000, 0x000B, KEY_APP, + 0x25); + sk_APP_arr.emplace_back(0x0003005500000000, 0x000B, KEY_APP, "A4C97402CC8A71BC7748661FE9CE7DF44DCE95D0D58938A59F47B9E9DBA7BFC3", "E4792F2B9DB30CB8D1596077A13FB3B5", "2733C889D289550FE00EAA5A47A34CEF0C1AF187610EB07BA35D2C09BB73C80B244EB4147700D1BF", "", - 0x26)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005500000000, 0x000C, KEY_APP, + 0x26); + sk_APP_arr.emplace_back(0x0003005500000000, 0x000C, KEY_APP, "9814EFFF67B7074D1B263BF85BDC8576CE9DEC914123971B169472A1BC2387FA", "D43B1FA8BE15714B3078C23908BB2BCA", "7D1986C6BEE6CE1E0C5893BD2DF203881F40D5056761CC3F1F2E9D9A378617A2DE40BA5F09844CEB", "", - 0x3D)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005600000000, 0x000D, KEY_APP, + 0x3D); + sk_APP_arr.emplace_back(0x0003005600000000, 0x000D, KEY_APP, "03B4C421E0C0DE708C0F0B71C24E3EE04306AE7383D8C5621394CCB99FF7A194", "5ADB9EAFE897B54CB1060D6885BE22CF", "71502ADB5783583AB88B2D5F23F419AF01C8B1E72FCA1E694AD49FE3266F1F9C61EFC6F29B351142", "", - 0x12)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005600000000, 0x000E, KEY_APP, + 0x12); + sk_APP_arr.emplace_back(0x0003005600000000, 0x000E, KEY_APP, "39A870173C226EB8A3EEE9CA6FB675E82039B2D0CCB22653BFCE4DB013BAEA03", "90266C98CBAA06C1BF145FF760EA1B45", "84DE5692809848E5ACBE25BE548F6981E3DB14735A5DDE1A0FD1F475866532B862B1AB6A004B7255", "", - 0x27)); - sk_APP_arr.Move( - new SELF_KEY(0x0003005600000000, 0x000F, KEY_APP, + 0x27); + sk_APP_arr.emplace_back(0x0003005600000000, 0x000F, KEY_APP, "FD52DFA7C6EEF5679628D12E267AA863B9365E6DB95470949CFD235B3FCA0F3B", "64F50296CF8CF49CD7C643572887DA0B", "0696D6CCBD7CF585EF5E00D547503C185D7421581BAD196E081723CD0A97FA40B2C0CD2492B0B5A1", "", - 0x3A)); - sk_APP_arr.Move( - new SELF_KEY(0x0003006100000000, 0x0010, KEY_APP, + 0x3A); + sk_APP_arr.emplace_back(0x0003006100000000, 0x0010, KEY_APP, "A5E51AD8F32FFBDE808972ACEE46397F2D3FE6BC823C8218EF875EE3A9B0584F", "7A203D5112F799979DF0E1B8B5B52AA4", "50597B7F680DD89F6594D9BDC0CBEE03666AB53647D0487F7F452FE2DD02694631EA755548C9E934", "", - 0x25)); - sk_APP_arr.Move( - new SELF_KEY(0x0003006100000000, 0x0011, KEY_APP, + 0x25); + sk_APP_arr.emplace_back(0x0003006100000000, 0x0011, KEY_APP, "0F8EAB8884A51D092D7250597388E3B8B75444AC138B9D36E5C7C5B8C3DF18FD", "97AF39C383E7EF1C98FA447C597EA8FE", "2FDA7A56AAEA65921C0284FF1942C6DE137370093D106034B59191951A5201B422D462F8726F852D", "", - 0x26)); - sk_APP_arr.Move( - new SELF_KEY(0x0003006600000000, 0x0013, KEY_APP, + 0x26); + sk_APP_arr.emplace_back(0x0003006600000000, 0x0013, KEY_APP, "DBF62D76FC81C8AC92372A9D631DDC9219F152C59C4B20BFF8F96B64AB065E94", "CB5DD4BE8CF115FFB25801BC6086E729", "B26FE6D3E3A1E766FAE79A8E6A7F48998E7FC1E4B0AD8745FF54C018C2A6CC7A0DD7525FAFEA4917", "", - 0x12)); - sk_APP_arr.Move( - new SELF_KEY(0x0003006600000000, 0x0014, KEY_APP, + 0x12); + sk_APP_arr.emplace_back(0x0003006600000000, 0x0014, KEY_APP, "491B0D72BB21ED115950379F4564CE784A4BFAABB00E8CB71294B192B7B9F88E", "F98843588FED8B0E62D7DDCB6F0CECF4", "04275E8838EF95BD013B223C3DF674540932F21B534C7ED2944B9104D938FEB03B824DDB866AB26E", "", - 0x27)); - sk_APP_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0016, KEY_APP, + 0x27); + sk_APP_arr.emplace_back(0x0003007400000000, 0x0016, KEY_APP, "A106692224F1E91E1C4EBAD4A25FBFF66B4B13E88D878E8CD072F23CD1C5BF7C", "62773C70BD749269C0AFD1F12E73909E", "566635D3E1DCEC47243AAD1628AE6B2CEB33463FC155E4635846CE33899C5E353DDFA47FEF5694AF", "", - 0x30)); - sk_APP_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0017, KEY_APP, + 0x30); + sk_APP_arr.emplace_back(0x0003007400000000, 0x0017, KEY_APP, "4E104DCE09BA878C75DA98D0B1636F0E5F058328D81419E2A3D22AB0256FDF46", "954A86C4629E116532304A740862EF85", "3B7B04C71CAE2B1199D57453C038BB1B541A05AD1B94167B0AB47A9B24CAECB9000CB21407009666", "", - 0x08)); - sk_APP_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0018, KEY_APP, + 0x08); + sk_APP_arr.emplace_back(0x0003007400000000, 0x0018, KEY_APP, "1F876AB252DDBCB70E74DC4A20CD8ED51E330E62490E652F862877E8D8D0F997", "BF8D6B1887FA88E6D85C2EDB2FBEC147", "64A04126D77BF6B4D686F6E8F87DD150A5B014BA922D2B694FFF4453E11239A6E0B58F1703C51494", "", - 0x11)); - sk_APP_arr.Move( - new SELF_KEY(0x0004001100000000, 0x0019, KEY_APP, + 0x11); + sk_APP_arr.emplace_back(0x0004001100000000, 0x0019, KEY_APP, "3236B9937174DF1DC12EC2DD8A318A0EA4D3ECDEA5DFB4AC1B8278447000C297", "6153DEE781B8ADDC6A439498B816DC46", "148DCA961E2738BAF84B2D1B6E2DA2ABD6A95F2C9571E54C6922F9ED9674F062B7F1BE5BD6FA5268", "", - 0x31)); - sk_APP_arr.Move( - new SELF_KEY(0x0004001100000000, 0x001A, KEY_APP, + 0x31); + sk_APP_arr.emplace_back(0x0004001100000000, 0x001A, KEY_APP, "5EFD1E9961462794E3B9EF2A4D0C1F46F642AAE053B5025504130590E66F19C9", "1AC8FA3B3C90F8FDE639515F91B58327", "BE4B1B513536960618BFEF12A713F6673881B02F9DC616191E823FC8337CCF99ADAA6172019C0C23", "", - 0x17)); - sk_APP_arr.Move( - new SELF_KEY(0x0004001100000000, 0x001B, KEY_APP, + 0x17); + sk_APP_arr.emplace_back(0x0004001100000000, 0x001B, KEY_APP, "66637570D1DEC098467DB207BAEA786861964D0964D4DBAF89E76F46955D181B", "9F7B5713A5ED59F6B35CD8F8A165D4B8", "4AB6FB1F6F0C3D9219923C1AC683137AB05DF667833CC6A5E8F590E4E28FE2EB180C7D5861117CFB", "", - 0x12)); - sk_APP_arr.Move( - new SELF_KEY(0x0004004600000000, 0x001C, KEY_APP, + 0x12); + sk_APP_arr.emplace_back(0x0004004600000000, 0x001C, KEY_APP, "CFF025375BA0079226BE01F4A31F346D79F62CFB643CA910E16CF60BD9092752", "FD40664E2EBBA01BF359B0DCDF543DA4", "36C1ACE6DD5CCC0006FDF3424750FAC515FC5CFA2C93EC53C6EC2BC421708D154E91F2E7EA54A893", "", - 0x09)); - sk_APP_arr.Move( - new SELF_KEY(0x0004004600000000, 0x001D, KEY_APP, + 0x09); + sk_APP_arr.emplace_back(0x0004004600000000, 0x001D, KEY_APP, "D202174EB65A62048F3674B59EF6FE72E1872962F3E1CD658DE8D7AF71DA1F3E", "ACB9945914EBB7B9A31ECE320AE09F2D", "430322887503CF52928FAAA410FD623C7321281C8825D95F5B47EF078EFCFC44454C3AB4F00BB879", "", - 0x1A)); + 0x1A); } void KeyVault::LoadSelfNPDRMKeys() { - sk_NPDRM_arr.Clear(); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0001000000000000, 0x0001, KEY_NPDRM, + sk_NPDRM_arr.clear(); + sk_NPDRM_arr.emplace_back(0x0001000000000000, 0x0001, KEY_NPDRM, "F9EDD0301F770FABBA8863D9897F0FEA6551B09431F61312654E28F43533EA6B", "A551CCB4A42C37A734A2B4F9657D5540", "B05F9DA5F9121EE4031467E74C505C29A8E29D1022379EDFF0500B9AE480B5DAB4578A4C61C5D6BF", "00040AB47509BED04BD96521AD1B365B86BF620A98", - 0x11)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0001000000000000, 0x0002, KEY_NPDRM, + 0x11); + sk_NPDRM_arr.emplace_back(0x0001000000000000, 0x0002, KEY_NPDRM, "8E737230C80E66AD0162EDDD32F1F774EE5E4E187449F19079437A508FCF9C86", "7AAECC60AD12AED90C348D8C11D2BED5", "05BF09CB6FD78050C78DE69CC316FF27C9F1ED66A45BFCE0A1E5A6749B19BD546BBB4602CF373440", "", - 0x0A)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0003, KEY_NPDRM, + 0x0A); + sk_NPDRM_arr.emplace_back(0x0003003000000000, 0x0003, KEY_NPDRM, "1B715B0C3E8DC4C1A5772EBA9C5D34F7CCFE5B82025D453F3167566497239664", "E31E206FBB8AEA27FAB0D9A2FFB6B62F", "3F51E59FC74D6618D34431FA67987FA11ABBFACC7111811473CD9988FE91C43FC74605E7B8CB732D", "", - 0x08)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0004, KEY_NPDRM, + 0x08); + sk_NPDRM_arr.emplace_back(0x0003004200000000, 0x0004, KEY_NPDRM, "BB4DBF66B744A33934172D9F8379A7A5EA74CB0F559BB95D0E7AECE91702B706", "ADF7B207A15AC601110E61DDFC210AF6", "9C327471BAFF1F877AE4FE29F4501AF5AD6A2C459F8622697F583EFCA2CA30ABB5CD45D1131CAB30", "00B61A91DF4AB6A9F142C326BA9592B5265DA88856", - 0x16)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0006, KEY_NPDRM, + 0x16); + sk_NPDRM_arr.emplace_back(0x0003004200000000, 0x0006, KEY_NPDRM, "8B4C52849765D2B5FA3D5628AFB17644D52B9FFEE235B4C0DB72A62867EAA020", "05719DF1B1D0306C03910ADDCE4AF887", "2A5D6C6908CA98FC4740D834C6400E6D6AD74CF0A712CF1E7DAE806E98605CC308F6A03658F2970E", "", - 0x29)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0007, KEY_NPDRM, + 0x29); + sk_NPDRM_arr.emplace_back(0x0003005000000000, 0x0007, KEY_NPDRM, "3946DFAA141718C7BE339A0D6C26301C76B568AEBC5CD52652F2E2E0297437C3", "E4897BE553AE025CDCBF2B15D1C9234E", "A13AFE8B63F897DA2D3DC3987B39389DC10BAD99DFB703838C4A0BC4E8BB44659C726CFD0CE60D0E", "009EF86907782A318D4CC3617EBACE2480E73A46F6", - 0x17)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0009, KEY_NPDRM, + 0x17); + sk_NPDRM_arr.emplace_back(0x0003005000000000, 0x0009, KEY_NPDRM, "0786F4B0CA5937F515BDCE188F569B2EF3109A4DA0780A7AA07BD89C3350810A", "04AD3C2F122A3B35E804850CAD142C6D", "A1FE61035DBBEA5A94D120D03C000D3B2F084B9F4AFA99A2D4A588DF92B8F36327CE9E47889A45D0", "", - 0x2A)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003005500000000, 0x000A, KEY_NPDRM, + 0x2A); + sk_NPDRM_arr.emplace_back(0x0003005500000000, 0x000A, KEY_NPDRM, "03C21AD78FBB6A3D425E9AAB1298F9FD70E29FD4E6E3A3C151205DA50C413DE4", "0A99D4D4F8301A88052D714AD2FB565E", "3995C390C9F7FBBAB124A1C14E70F9741A5E6BDF17A605D88239652C8EA7D5FC9F24B30546C1E44B", "009AC6B22A056BA9E0B6D1520F28A57A3135483F9F", - 0x27)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003005500000000, 0x000C, KEY_NPDRM, + 0x27); + sk_NPDRM_arr.emplace_back(0x0003005500000000, 0x000C, KEY_NPDRM, "357EBBEA265FAEC271182D571C6CD2F62CFA04D325588F213DB6B2E0ED166D92", "D26E6DD2B74CD78E866E742E5571B84F", "00DCF5391618604AB42C8CFF3DC304DF45341EBA4551293E9E2B68FFE2DF527FFA3BE8329E015E57", "", - 0x3A)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003005600000000, 0x000D, KEY_NPDRM, + 0x3A); + sk_NPDRM_arr.emplace_back(0x0003005600000000, 0x000D, KEY_NPDRM, "337A51416105B56E40D7CAF1B954CDAF4E7645F28379904F35F27E81CA7B6957", "8405C88E042280DBD794EC7E22B74002", "9BFF1CC7118D2393DE50D5CF44909860683411A532767BFDAC78622DB9E5456753FE422CBAFA1DA1", "", - 0x18)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003005600000000, 0x000F, KEY_NPDRM, + 0x18); + sk_NPDRM_arr.emplace_back(0x0003005600000000, 0x000F, KEY_NPDRM, "135C098CBE6A3E037EBE9F2BB9B30218DDE8D68217346F9AD33203352FBB3291", "4070C898C2EAAD1634A288AA547A35A8", "BBD7CCCB556C2EF0F908DC7810FAFC37F2E56B3DAA5F7FAF53A4944AA9B841F76AB091E16B231433", "", - 0x3B)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003006100000000, 0x0010, KEY_NPDRM, + 0x3B); + sk_NPDRM_arr.emplace_back(0x0003006100000000, 0x0010, KEY_NPDRM, "4B3CD10F6A6AA7D99F9B3A660C35ADE08EF01C2C336B9E46D1BB5678B4261A61", "C0F2AB86E6E0457552DB50D7219371C5", "64A5C60BC2AD18B8A237E4AA690647E12BF7A081523FAD4F29BE89ACAC72F7AB43C74EC9AFFDA213", "", - 0x27)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003006600000000, 0x0013, KEY_NPDRM, + 0x27); + sk_NPDRM_arr.emplace_back(0x0003006600000000, 0x0013, KEY_NPDRM, "265C93CF48562EC5D18773BEB7689B8AD10C5EB6D21421455DEBC4FB128CBF46", "8DEA5FF959682A9B98B688CEA1EF4A1D", "9D8DB5A880608DC69717991AFC3AD5C0215A5EE413328C2ABC8F35589E04432373DB2E2339EEF7C8", "", - 0x18)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0016, KEY_NPDRM, + 0x18); + sk_NPDRM_arr.emplace_back(0x0003007400000000, 0x0016, KEY_NPDRM, "7910340483E419E55F0D33E4EA5410EEEC3AF47814667ECA2AA9D75602B14D4B", "4AD981431B98DFD39B6388EDAD742A8E", "62DFE488E410B1B6B2F559E4CB932BCB78845AB623CC59FDF65168400FD76FA82ED1DC60E091D1D1", "", - 0x25)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0004001100000000, 0x0019, KEY_NPDRM, + 0x25); + sk_NPDRM_arr.emplace_back(0x0004001100000000, 0x0019, KEY_NPDRM, "FBDA75963FE690CFF35B7AA7B408CF631744EDEF5F7931A04D58FD6A921FFDB3", "F72C1D80FFDA2E3BF085F4133E6D2805", "637EAD34E7B85C723C627E68ABDD0419914EBED4008311731DD87FDDA2DAF71F856A70E14DA17B42", "", - 0x24)); - sk_NPDRM_arr.Move( - new SELF_KEY(0x0004004600000000, 0x001C, KEY_NPDRM, + 0x24); + sk_NPDRM_arr.emplace_back(0x0004004600000000, 0x001C, KEY_NPDRM, "8103EA9DB790578219C4CEDF0592B43064A7D98B601B6C7BC45108C4047AA80F", "246F4B8328BE6A2D394EDE20479247C5", "503172C9551308A87621ECEE90362D14889BFED2CF32B0B3E32A4F9FE527A41464B735E1ADBC6762", "", - 0x30)); + 0x30); } void KeyVault::LoadSelfUNK7Keys() { - sk_UNK7_arr.Clear(); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003003000000000, 0x0000, KEY_UNK7, + sk_UNK7_arr.clear(); + sk_UNK7_arr.emplace_back(0x0003003000000000, 0x0000, KEY_UNK7, "D91166973979EA8694476B011AC62C7E9F37DA26DE1E5C2EE3D66E42B8517085", "DC01280A6E46BC674B81A7E8801EBE6E", "A0FC44108236141BF3517A662B027AFC1AC513A05690496C754DEB7D43BDC41B80FD75C212624EE4", "", - 0x11)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003004200000000, 0x0000, KEY_UNK7, + 0x11); + sk_UNK7_arr.emplace_back(0x0003004200000000, 0x0000, KEY_UNK7, "B73111B0B00117E48DE5E2EE5E534C0F0EFFA4890BBB8CAD01EE0F848F91583E", "86F56F9E5DE513894874B8BA253334B1", "B0BA1A1AB9723BB4E87CED9637BE056066BC56E16572D43D0210A06411DBF8FEB8885CD912384AE5", "", - 0x12)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003005000000000, 0x0000, KEY_UNK7, + 0x12); + sk_UNK7_arr.emplace_back(0x0003005000000000, 0x0000, KEY_UNK7, "8E944267C02E69A4FE474B7F5FCD7974A4F936FF4355AEC4F80EFA123858D8F6", "908A75754E521EAC2F5A4889C6D7B72D", "91201DA7D79E8EE2563142ECBD646DA026C963AC09E760E5390FFE24DAE6864310ABE147F8204D0B", "", - 0x13)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003005500000000, 0x0000, KEY_UNK7, + 0x13); + sk_UNK7_arr.emplace_back(0x0003005500000000, 0x0000, KEY_UNK7, "BB31DF9A6F62C0DF853075FAA65134D9CE2240306C1731D1F7DA9B5329BD699F", "263057225873F83940A65C8C926AC3E4", "BC3A82A4F44C43A197070CD236FDC94FCC542D69A3E803E0AFF78D1F3DA19A79D2F61FAB5B94B437", "", - 0x23)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003005600000000, 0x0000, KEY_UNK7, + 0x23); + sk_UNK7_arr.emplace_back(0x0003005600000000, 0x0000, KEY_UNK7, "71AA75C70A255580E4AE9BDAA0B08828C53EAA713CD0713797F143B284C1589B", "9DED878CB6BA07121C0F50E7B172A8BF", "387FCDAEAFF1B59CFAF79CE6215A065ACEAFFAF4048A4F217E1FF5CE67C66EC3F089DB235E52F9D3", "", - 0x29)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003006100000000, 0x0000, KEY_UNK7, + 0x29); + sk_UNK7_arr.emplace_back(0x0003006100000000, 0x0000, KEY_UNK7, "F5D1DBC182F5083CD4EA37C431C7DAC73882C07F232D2699B1DD9FDDF1BF4195", "D3A7C3C91CBA014FCBCA6D5570DE13FF", "97CA8A9781F45E557E98F176EF794FCDA6B151EB3DFD1ABA12151E00AE59957C3B15628FC8875D28", "", - 0x23)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003006600000000, 0x0000, KEY_UNK7, + 0x23); + sk_UNK7_arr.emplace_back(0x0003006600000000, 0x0000, KEY_UNK7, "BF10F09590C0152F7EF749FF4B990122A4E8E5491DA49A2D931E72EEB990F860", "22C19C5522F7A782AFC547C2640F5BDE", "3233BA2B284189FB1687DF653002257A0925D8EB0C64EBBE8CC7DE87F548D107DE1FD3D1D285DB4F", "", - 0x29)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0003007400000000, 0x0000, KEY_UNK7, + 0x29); + sk_UNK7_arr.emplace_back(0x0003007400000000, 0x0000, KEY_UNK7, "F11DBD2C97B32AD37E55F8E743BC821D3E67630A6784D9A058DDD26313482F0F", "FC5FA12CA3D2D336C4B8B425D679DA55", "19E27EE90E33EDAB16B22E688B5F704E5C6EC1062070EBF43554CD03DFDAE16D684BB8B5574DBECA", "", - 0x15)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0004001100000000, 0x0000, KEY_UNK7, + 0x15); + sk_UNK7_arr.emplace_back(0x0004001100000000, 0x0000, KEY_UNK7, "751EE949CD3ADF50A469197494A1EC358409CCBE6E85217EBDE7A87D3FF1ABD8", "23AE4ADA4D3F798DC5ED98000337FF77", "1BABA87CD1AD705C462D4E7427B6DAF59A50383A348A15088F0EDFCF1ADF2B5C2B2D507B2A357D36", "", - 0x1A)); - sk_UNK7_arr.Move( - new SELF_KEY(0x0004004600000000, 0x0000, KEY_UNK7, + 0x1A); + sk_UNK7_arr.emplace_back(0x0004004600000000, 0x0000, KEY_UNK7, "46BD0891224E0CE13E2162921D4BB76193AEEE4416A729FCDD111C5536BF87C9", "BF036387CDB613C0AC88A6D9D2CC5316", "A14F6D5F9AD7EBB3B7A39A7C32F13E5DC3B0BA16BDC33D39FDDF88F4AEEA6CFEEB0C0796C917A952", "", - 0x0F)); + 0x0F); } SELF_KEY KeyVault::GetSelfLV0Key() @@ -682,7 +593,7 @@ SELF_KEY KeyVault::GetSelfLV1Key(u64 version) { SELF_KEY key(0, 0, 0, "", "", "", "", 0); - for(unsigned int i = 0; i < sk_LV1_arr.GetCount(); i++) + for(unsigned int i = 0; i < sk_LV1_arr.size(); i++) { if (sk_LV1_arr[i].version == version) { @@ -698,7 +609,7 @@ SELF_KEY KeyVault::GetSelfLV2Key(u64 version) { SELF_KEY key(0, 0, 0, "", "", "", "", 0); - for(unsigned int i = 0; i < sk_LV2_arr.GetCount(); i++) + for(unsigned int i = 0; i < sk_LV2_arr.size(); i++) { if (sk_LV2_arr[i].version == version) { @@ -714,7 +625,7 @@ SELF_KEY KeyVault::GetSelfISOKey(u16 revision, u64 version) { SELF_KEY key(0, 0, 0, "", "", "", "", 0); - for(unsigned int i = 0; i < sk_ISO_arr.GetCount(); i++) + for(unsigned int i = 0; i < sk_ISO_arr.size(); i++) { if ((sk_ISO_arr[i].version == version) && (sk_ISO_arr[i].revision == revision)) @@ -731,7 +642,7 @@ SELF_KEY KeyVault::GetSelfAPPKey(u16 revision) { SELF_KEY key(0, 0, 0, "", "", "", "", 0); - for(unsigned int i = 0; i < sk_APP_arr.GetCount(); i++) + for(unsigned int i = 0; i < sk_APP_arr.size(); i++) { if (sk_APP_arr[i].revision == revision) { @@ -747,7 +658,7 @@ SELF_KEY KeyVault::GetSelfUNK7Key(u64 version) { SELF_KEY key(0, 0, 0, "", "", "", "", 0); - for(unsigned int i = 0; i < sk_UNK7_arr.GetCount(); i++) + for(unsigned int i = 0; i < sk_UNK7_arr.size(); i++) { if (sk_UNK7_arr[i].version == version) { @@ -763,7 +674,7 @@ SELF_KEY KeyVault::GetSelfNPDRMKey(u16 revision) { SELF_KEY key(0, 0, 0, "", "", "", "", 0); - for(unsigned int i = 0; i < sk_NPDRM_arr.GetCount(); i++) + for(unsigned int i = 0; i < sk_NPDRM_arr.size(); i++) { if (sk_NPDRM_arr[i].revision == revision) { @@ -779,7 +690,7 @@ SELF_KEY KeyVault::FindSelfKey(u32 type, u16 revision, u64 version) { // Empty key. SELF_KEY key(0, 0, 0, "", "", "", "", 0); - + // Check SELF type. switch (type) { @@ -875,4 +786,5 @@ void rap_to_rif(unsigned char* rap, unsigned char* rif) } memcpy(rif, key, 0x10); -} \ No newline at end of file +} + diff --git a/rpcs3/Crypto/key_vault.h b/rpcs3/Crypto/key_vault.h index 3e6eef9e43..3f78228e9e 100644 --- a/rpcs3/Crypto/key_vault.h +++ b/rpcs3/Crypto/key_vault.h @@ -117,14 +117,14 @@ static u8 EDAT_IV[0x10] = { class KeyVault { - Array sk_LV0_arr; - Array sk_LV1_arr; - Array sk_LV2_arr; - Array sk_APP_arr; - Array sk_ISO_arr; - Array sk_LDR_arr; - Array sk_UNK7_arr; - Array sk_NPDRM_arr; + std::vector sk_LV0_arr; + std::vector sk_LV1_arr; + std::vector sk_LV2_arr; + std::vector sk_APP_arr; + std::vector sk_ISO_arr; + std::vector sk_LDR_arr; + std::vector sk_UNK7_arr; + std::vector sk_NPDRM_arr; u8 klicensee_key[0x10]; public: @@ -153,4 +153,4 @@ private: }; // RAP to RIF function. -void rap_to_rif(unsigned char* rap, unsigned char* rif); \ No newline at end of file +void rap_to_rif(unsigned char* rap, unsigned char* rif); diff --git a/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp index 72a38fa8fa..df8d0838ae 100644 --- a/rpcs3/Crypto/unself.cpp +++ b/rpcs3/Crypto/unself.cpp @@ -36,7 +36,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32) // Read ELF program headers. if (isElf32) { - phdr32_arr.Clear(); + phdr32_arr.clear(); if(elf32_hdr.e_phoff == 0 && elf32_hdr.e_phnum) { ConLog.Error("SELF: ELF program header offset is null!"); @@ -45,14 +45,13 @@ bool SELFDecrypter::LoadHeaders(bool isElf32) self_f.Seek(self_hdr.se_phdroff); for(u32 i = 0; i < elf32_hdr.e_phnum; ++i) { - Elf32_Phdr* phdr = new Elf32_Phdr(); - phdr->Load(self_f); - phdr32_arr.Move(phdr); + phdr32_arr.emplace_back(); + phdr32_arr.back().Load(self_f); } } else { - phdr64_arr.Clear(); + phdr64_arr.clear(); if(elf64_hdr.e_phoff == 0 && elf64_hdr.e_phnum) { ConLog.Error("SELF: ELF program header offset is null!"); @@ -61,22 +60,20 @@ bool SELFDecrypter::LoadHeaders(bool isElf32) self_f.Seek(self_hdr.se_phdroff); for(u32 i = 0; i < elf64_hdr.e_phnum; ++i) { - Elf64_Phdr* phdr = new Elf64_Phdr(); - phdr->Load(self_f); - phdr64_arr.Move(phdr); + phdr64_arr.emplace_back(); + phdr64_arr.back().Load(self_f); } } // Read section info. - secinfo_arr.Clear(); + secinfo_arr.clear(); self_f.Seek(self_hdr.se_secinfoff); for(u32 i = 0; i < ((isElf32) ? elf32_hdr.e_phnum : elf64_hdr.e_phnum); ++i) { - SectionInfo* sinfo = new SectionInfo(); - sinfo->Load(self_f); - secinfo_arr.Move(sinfo); + secinfo_arr.emplace_back(); + secinfo_arr.back().Load(self_f); } // Read SCE version info. @@ -84,22 +81,22 @@ bool SELFDecrypter::LoadHeaders(bool isElf32) scev_info.Load(self_f); // Read control info. - ctrlinfo_arr.Clear(); + ctrlinfo_arr.clear(); self_f.Seek(self_hdr.se_controloff); u32 i = 0; while(i < self_hdr.se_controlsize) { - ControlInfo* cinfo = new ControlInfo(); - cinfo->Load(self_f); - i += cinfo->size; - ctrlinfo_arr.Move(cinfo); + ctrlinfo_arr.emplace_back(); + ControlInfo &cinfo = ctrlinfo_arr.back(); + cinfo.Load(self_f); + i += cinfo.size; } // Read ELF section headers. if (isElf32) { - shdr32_arr.Clear(); + shdr32_arr.clear(); if(elf32_hdr.e_shoff == 0 && elf32_hdr.e_shnum) { ConLog.Warning("SELF: ELF section header offset is null!"); @@ -108,14 +105,13 @@ bool SELFDecrypter::LoadHeaders(bool isElf32) self_f.Seek(self_hdr.se_shdroff); for(u32 i = 0; i < elf32_hdr.e_shnum; ++i) { - Elf32_Shdr* shdr = new Elf32_Shdr(); - shdr->Load(self_f); - shdr32_arr.Move(shdr); + shdr32_arr.emplace_back(); + shdr32_arr.back().Load(self_f); } } else { - shdr64_arr.Clear(); + shdr64_arr.clear(); if(elf64_hdr.e_shoff == 0 && elf64_hdr.e_shnum) { ConLog.Warning("SELF: ELF section header offset is null!"); @@ -124,9 +120,8 @@ bool SELFDecrypter::LoadHeaders(bool isElf32) self_f.Seek(self_hdr.se_shdroff); for(u32 i = 0; i < elf64_hdr.e_shnum; ++i) { - Elf64_Shdr* shdr = new Elf64_Shdr(); - shdr->Load(self_f); - shdr64_arr.Move(shdr); + shdr64_arr.emplace_back(); + shdr64_arr.back().Load(self_f); } } @@ -153,12 +148,12 @@ void SELFDecrypter::ShowHeaders(bool isElf32) ConLog.Write("----------------------------------------------------"); ConLog.Write("ELF program headers"); ConLog.Write("----------------------------------------------------"); - for(unsigned int i = 0; i < ((isElf32) ? phdr32_arr.GetCount() : phdr64_arr.GetCount()); i++) + for(unsigned int i = 0; i < ((isElf32) ? phdr32_arr.size() : phdr64_arr.size()); i++) isElf32 ? phdr32_arr[i].Show() : phdr64_arr[i].Show(); ConLog.Write("----------------------------------------------------"); ConLog.Write("Section info"); ConLog.Write("----------------------------------------------------"); - for(unsigned int i = 0; i < secinfo_arr.GetCount(); i++) + for(unsigned int i = 0; i < secinfo_arr.size(); i++) secinfo_arr[i].Show(); ConLog.Write("----------------------------------------------------"); ConLog.Write("SCE version info"); @@ -167,12 +162,12 @@ void SELFDecrypter::ShowHeaders(bool isElf32) ConLog.Write("----------------------------------------------------"); ConLog.Write("Control info"); ConLog.Write("----------------------------------------------------"); - for(unsigned int i = 0; i < ctrlinfo_arr.GetCount(); i++) + for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++) ctrlinfo_arr[i].Show(); ConLog.Write("----------------------------------------------------"); ConLog.Write("ELF section headers"); ConLog.Write("----------------------------------------------------"); - for(unsigned int i = 0; i < ((isElf32) ? shdr32_arr.GetCount() : shdr64_arr.GetCount()); i++) + for(unsigned int i = 0; i < ((isElf32) ? shdr32_arr.size() : shdr64_arr.size()); i++) isElf32 ? shdr32_arr[i].Show() : shdr64_arr[i].Show(); ConLog.Write("----------------------------------------------------"); } @@ -185,7 +180,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size) u8 npdrm_iv[0x10]; // Parse the control info structures to find the NPDRM control info. - for(unsigned int i = 0; i < ctrlinfo_arr.GetCount(); i++) + for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++) { if (ctrlinfo_arr[i].type == 3) { @@ -307,12 +302,11 @@ bool SELFDecrypter::LoadMetadata() meta_hdr.Load(metadata_headers); // Load the metadata section headers. - meta_shdr.Clear(); + meta_shdr.clear(); for (unsigned int i = 0; i < meta_hdr.section_count; i++) { - MetadataSectionHeader* m_shdr = new MetadataSectionHeader(); - m_shdr->Load(metadata_headers + sizeof(meta_hdr) + sizeof(MetadataSectionHeader) * i); - meta_shdr.Move(m_shdr); + meta_shdr.emplace_back(); + meta_shdr.back().Load(metadata_headers + sizeof(meta_hdr) + sizeof(MetadataSectionHeader) * i); } // Copy the decrypted data keys. diff --git a/rpcs3/Crypto/unself.h b/rpcs3/Crypto/unself.h index 20a207d248..bd72125eac 100644 --- a/rpcs3/Crypto/unself.h +++ b/rpcs3/Crypto/unself.h @@ -463,23 +463,23 @@ class SELFDecrypter // ELF64 header and program header/section header arrays. Elf64_Ehdr elf64_hdr; - Array shdr64_arr; - Array phdr64_arr; + std::vector shdr64_arr; + std::vector phdr64_arr; // ELF32 header and program header/section header arrays. Elf32_Ehdr elf32_hdr; - Array shdr32_arr; - Array phdr32_arr; + std::vector shdr32_arr; + std::vector phdr32_arr; // Decryption info structs. - Array secinfo_arr; + std::vector secinfo_arr; SCEVersionInfo scev_info; - Array ctrlinfo_arr; + std::vector ctrlinfo_arr; // Metadata structs. MetadataInfo meta_info; MetadataHeader meta_hdr; - Array meta_shdr; + std::vector meta_shdr; // Internal data buffers. u8 *data_keys; diff --git a/rpcs3/Emu/Audio/cellAudio.h b/rpcs3/Emu/Audio/cellAudio.h index 709b8c3907..ff6e463065 100644 --- a/rpcs3/Emu/Audio/cellAudio.h +++ b/rpcs3/Emu/Audio/cellAudio.h @@ -98,7 +98,7 @@ struct AudioConfig //custom structure u32 m_port_in_use; u64 counter; u64 start_time; - Array m_keys; + std::vector m_keys; AudioConfig() : m_is_audio_initialized(false) diff --git a/rpcs3/Emu/CPU/CPUDecoder.h b/rpcs3/Emu/CPU/CPUDecoder.h index 4091e73146..082d92ac74 100644 --- a/rpcs3/Emu/CPU/CPUDecoder.h +++ b/rpcs3/Emu/CPU/CPUDecoder.h @@ -355,13 +355,13 @@ public: decode(op, code); } - u32 operator()(const Array& args) const + u32 operator()(const std::vector& args) const { return encode(args); } virtual void decode(TO* op, u32 code) const=0; - virtual u32 encode(const Array& args) const=0; + virtual u32 encode(const std::vector& args) const=0; }; template @@ -508,9 +508,9 @@ public: m_list.decode(op, opcode, code); } - virtual u32 encode(const Array& args) const + virtual u32 encode(const std::vector& args) const { - assert(args.GetCount() == InstrBase::m_args_count); + assert(args.size() == InstrBase::m_args_count); return m_list.encode(opcode); } @@ -547,9 +547,9 @@ public: m_list.decode(op, opcode, code); } - virtual u32 encode(const Array& args) const + virtual u32 encode(const std::vector& args) const { - assert(args.GetCount() == InstrBase::m_args_count); + assert(args.size() == InstrBase::m_args_count); return m_list.encode(opcode) | (*InstrBase::m_args[0])[args[0]]; } @@ -588,9 +588,9 @@ public: m_list.decode(op, opcode, code); } - virtual u32 encode(const Array& args) const + virtual u32 encode(const std::vector& args) const { - assert(args.GetCount() == InstrBase::m_args_count); + assert(args.size() == InstrBase::m_args_count); return m_list.encode(opcode) | (*InstrBase::m_args[0])[args[0]] | (*InstrBase::m_args[1])[args[1]]; } @@ -631,9 +631,9 @@ public: m_list.decode(op, opcode, code); } - virtual u32 encode(const Array& args) const + virtual u32 encode(const std::vector& args) const { - assert(args.GetCount() == InstrBase::m_args_count); + assert(args.size() == InstrBase::m_args_count); return m_list.encode(opcode) | (*InstrBase::m_args[0])[args[0]] | (*InstrBase::m_args[1])[args[1]] | (*InstrBase::m_args[2])[args[2]]; } @@ -676,9 +676,9 @@ public: m_list.decode(op, opcode, code); } - virtual u32 encode(const Array& args) const + virtual u32 encode(const std::vector& args) const { - assert(args.GetCount() == InstrBase::m_args_count); + assert(args.size() == InstrBase::m_args_count); return m_list.encode(opcode) | (*InstrBase::m_args[0])[args[0]] | (*InstrBase::m_args[1])[args[1]] | @@ -731,9 +731,9 @@ public: m_list.decode(op, opcode, code); } - virtual u32 encode(const Array& args) const + virtual u32 encode(const std::vector& args) const { - assert(args.GetCount() == InstrBase::m_args_count); + assert(args.size() == InstrBase::m_args_count); return m_list.encode(opcode) | (*InstrBase::m_args[0])[args[0]] | (*InstrBase::m_args[1])[args[1]] | @@ -790,9 +790,9 @@ public: m_list.decode(op, opcode, code); } - virtual u32 encode(const Array& args) const + virtual u32 encode(const std::vector& args) const { - assert(args.GetCount() == InstrBase::m_args_count); + assert(args.size() == InstrBase::m_args_count); return m_list.encode(opcode) | (*InstrBase::m_args[0])[args[0]] | (*InstrBase::m_args[1])[args[1]] | diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index a318257e37..80917856c8 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -298,11 +298,11 @@ void CPUThread::Task() { if (Ini.HLELogging.GetValue()) ConLog.Write("%s enter", CPUThread::GetFName().c_str()); - const Array& bp = Emu.GetBreakPoints(); + const std::vector& bp = Emu.GetBreakPoints(); try { - for(uint i=0; i m_call_stack; + std::vector m_call_stack; std::string CallStackToString() { std::string ret = "Call Stack:\n==========\n"; - for(uint i=0; i 0x%llx\n", m_call_stack[i].pc, m_call_stack[i].branch_pc); } @@ -212,21 +212,25 @@ public: void CallStackBranch(u64 pc) { - for(int i=m_call_stack.GetCount() - 1; i >= 0; --i) - { - if(CallStackGetNextPC(m_call_stack[i].pc) == pc) + //look if we're jumping back and if so pop the stack back to that position + auto res = std::find_if(m_call_stack.rbegin(), m_call_stack.rend(), + [&pc, this](CallStackItem &it) { - m_call_stack.RemoveAt(i, m_call_stack.GetCount() - i); - return; - } + return CallStackGetNextPC(it.pc) == pc; + }); + if (res != m_call_stack.rend()) + { + m_call_stack.erase((res + 1).base(), m_call_stack.end()); + return; } - + + //add a new entry otherwise CallStackItem new_item; - + new_item.branch_pc = pc; new_item.pc = PC; - - m_call_stack.Push(new_item); + + m_call_stack.push_back(new_item); } virtual u64 CallStackGetNextPC(u64 pc) diff --git a/rpcs3/Emu/CPU/CPUThreadManager.cpp b/rpcs3/Emu/CPU/CPUThreadManager.cpp index 48ced91638..5e3c50d4d1 100644 --- a/rpcs3/Emu/CPU/CPUThreadManager.cpp +++ b/rpcs3/Emu/CPU/CPUThreadManager.cpp @@ -18,7 +18,7 @@ CPUThreadManager::~CPUThreadManager() void CPUThreadManager::Close() { m_raw_spu_num = 0; - while(m_threads.GetCount()) RemoveThread(m_threads[0].GetId()); + while(m_threads.size()) RemoveThread(m_threads[0]->GetId()); } CPUThread& CPUThreadManager::AddThread(CPUThreadType type) @@ -38,7 +38,7 @@ CPUThread& CPUThreadManager::AddThread(CPUThreadType type) new_thread->SetId(Emu.GetIdManager().GetNewID(fmt::Format("%s Thread", new_thread->GetTypeString().c_str()), new_thread)); - m_threads.Add(new_thread); + m_threads.push_back(new_thread); #ifndef QT_UI wxGetApp().SendDbgCommand(DID_CREATE_THREAD, new_thread); #endif @@ -50,23 +50,23 @@ void CPUThreadManager::RemoveThread(const u32 id) { std::lock_guard lock(m_mtx_thread); - for(u32 i=0; im_wait_thread_id == id) { - m_threads[i].Wait(false); - m_threads[i].m_wait_thread_id = -1; + m_threads[i]->Wait(false); + m_threads[i]->m_wait_thread_id = -1; } - if(m_threads[i].GetId() != id) continue; + if(m_threads[i]->GetId() != id) continue; - CPUThread* thr = &m_threads[i]; + CPUThread* thr = m_threads[i]; #ifndef QT_UI wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr); #endif thr->Close(); - m_threads.RemoveFAt(i); + m_threads.erase(m_threads.begin()+ i); break; } @@ -80,10 +80,10 @@ s32 CPUThreadManager::GetThreadNumById(CPUThreadType type, u32 id) s32 num = 0; - for(u32 i=0; iGetId() == id) return num; + if(m_threads[i]->GetType() == type) num++; } return -1; @@ -104,8 +104,8 @@ void CPUThreadManager::Exec() { std::lock_guard lock(m_mtx_thread); - for(u32 i=0; iExec(); } } diff --git a/rpcs3/Emu/CPU/CPUThreadManager.h b/rpcs3/Emu/CPU/CPUThreadManager.h index 1dd312ecbf..c0595dc693 100644 --- a/rpcs3/Emu/CPU/CPUThreadManager.h +++ b/rpcs3/Emu/CPU/CPUThreadManager.h @@ -4,10 +4,9 @@ enum CPUThreadType : unsigned char; class CPUThreadManager { - ArrayF m_threads; + std::vector m_threads; std::mutex m_mtx_thread; wxSemaphore m_sem_task; - Stack m_delete_threads; u32 m_raw_spu_num; public: @@ -19,7 +18,7 @@ public: CPUThread& AddThread(CPUThreadType type); void RemoveThread(const u32 id); - ArrayF& GetThreads() { return m_threads; } + std::vector& GetThreads() { return m_threads; } s32 GetThreadNumById(CPUThreadType type, u32 id); CPUThread* GetThread(u32 id); diff --git a/rpcs3/Emu/Cell/PPCThread.h b/rpcs3/Emu/Cell/PPCThread.h index 5b6f91dee2..e7bc4ddbe1 100644 --- a/rpcs3/Emu/Cell/PPCThread.h +++ b/rpcs3/Emu/Cell/PPCThread.h @@ -7,7 +7,7 @@ class PPCThread : public CPUThread { protected: u64 m_args[4]; - Array m_argv_addr; + std::vector m_argv_addr; public: virtual void InitRegs()=0; @@ -30,4 +30,4 @@ protected: virtual void DoReset() override; }; -PPCThread* GetCurrentPPCThread(); \ No newline at end of file +PPCThread* GetCurrentPPCThread(); diff --git a/rpcs3/Emu/Cell/PPCThreadManager.cpp b/rpcs3/Emu/Cell/PPCThreadManager.cpp index c0d5bafce5..b829ef72e5 100644 --- a/rpcs3/Emu/Cell/PPCThreadManager.cpp +++ b/rpcs3/Emu/Cell/PPCThreadManager.cpp @@ -17,7 +17,7 @@ PPCThreadManager::~PPCThreadManager() void PPCThreadManager::Close() { - while(m_threads.GetCount()) RemoveThread(m_threads[0].GetId()); + while(m_threads.size()) RemoveThread(m_threads[0]->GetId()); } PPCThread& PPCThreadManager::AddThread(PPCThreadType type) @@ -36,7 +36,7 @@ PPCThread& PPCThreadManager::AddThread(PPCThreadType type) new_thread->SetId(Emu.GetIdManager().GetNewID(fmt::Format("%s Thread", name), new_thread)); - m_threads.Add(new_thread); + m_threads.push_back(new_thread); wxGetApp().SendDbgCommand(DID_CREATE_THREAD, new_thread); return *new_thread; @@ -46,17 +46,17 @@ void PPCThreadManager::RemoveThread(const u32 id) { std::lock_guard lock(m_mtx_thread); - for(u32 i=0; im_wait_thread_id == id) { - m_threads[i].Wait(false); - m_threads[i].m_wait_thread_id = -1; + m_threads[i]->Wait(false); + m_threads[i]->m_wait_thread_id = -1; } - if(m_threads[i].GetId() != id) continue; + if(m_threads[i]->GetId() != id) continue; - PPCThread* thr = &m_threads[i]; + PPCThread* thr = m_threads[i]; wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr); if(thr->IsAlive()) { @@ -69,7 +69,7 @@ void PPCThreadManager::RemoveThread(const u32 id) } - m_threads.RemoveFAt(i); + m_threads.erase(m_threads.begin() + i); i--; } @@ -81,10 +81,10 @@ s32 PPCThreadManager::GetThreadNumById(PPCThreadType type, u32 id) { s32 num = 0; - for(u32 i=0; iGetId() == id) return num; + if(m_threads[i]->GetType() == type) num++; } return -1; @@ -92,9 +92,9 @@ s32 PPCThreadManager::GetThreadNumById(PPCThreadType type, u32 id) PPCThread* PPCThreadManager::GetThread(u32 id) { - for(u32 i=0; iGetId() == id) return m_threads[i]; } return nullptr; @@ -102,9 +102,9 @@ PPCThread* PPCThreadManager::GetThread(u32 id) void PPCThreadManager::Exec() { - for(u32 i=0; iExec(); } } #endif diff --git a/rpcs3/Emu/Cell/PPCThreadManager.h b/rpcs3/Emu/Cell/PPCThreadManager.h index e1bea459cb..9bb650304c 100644 --- a/rpcs3/Emu/Cell/PPCThreadManager.h +++ b/rpcs3/Emu/Cell/PPCThreadManager.h @@ -13,10 +13,9 @@ class PPCThreadManager //IdManager m_threads_id; //ArrayF m_ppu_threads; //ArrayF m_spu_threads; - ArrayF m_threads; + std::vector m_threads; std::mutex m_mtx_thread; wxSemaphore m_sem_task; - Stack m_delete_threads; u32 m_raw_spu_num; public: @@ -28,7 +27,7 @@ public: PPCThread& AddThread(PPCThreadType type); void RemoveThread(const u32 id); - ArrayF& GetThreads() { return m_threads; } + std::vector& GetThreads() { return m_threads; } s32 GetThreadNumById(PPCThreadType type, u32 id); PPCThread* GetThread(u32 id); //IdManager& GetIDs() {return m_threads_id;} diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index 3cb0c0f0d4..6613a70109 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -2099,7 +2099,7 @@ private: if (Ini.HLELogging.GetValue()) { ConLog.Write("'%s' done with code[0x%llx]! #pc: 0x%llx", - g_static_funcs_list[CPU.GPR[11]].name, CPU.GPR[3], CPU.PC); + g_static_funcs_list[CPU.GPR[11]]->name, CPU.GPR[3], CPU.PC); } break; case 0x22: UNK("HyperCall LV1"); break; diff --git a/rpcs3/Emu/Cell/PPUProgramCompiler.cpp b/rpcs3/Emu/Cell/PPUProgramCompiler.cpp index 2f236bdd37..4120c81372 100644 --- a/rpcs3/Emu/Cell/PPUProgramCompiler.cpp +++ b/rpcs3/Emu/Cell/PPUProgramCompiler.cpp @@ -1455,9 +1455,9 @@ void CompilePPUProgram::Compile() u32 code; { - Array args; - args.SetCount(m_args.size()); - for(uint i=0; i args; + args.resize(m_args.size()); + for(uint i=0; i& bp = Emu.GetBreakPoints(); + const std::vector& bp = Emu.GetBreakPoints(); try { - for(uint i=0; i= group->list.GetCount() || !group->list[num]) + if (num >= group->list.size() || !group->list[num]) { ConLog.Error("DMAC::ProcessCmd(): SPU Thread Group MMIO Access (ea=0x%llx): invalid thread", ea); return false; diff --git a/rpcs3/Emu/DbgConsole.h b/rpcs3/Emu/DbgConsole.h index d432a4cbf2..c4417b3880 100644 --- a/rpcs3/Emu/DbgConsole.h +++ b/rpcs3/Emu/DbgConsole.h @@ -31,7 +31,7 @@ struct _DbgBuffer : public MTPacketBuffer { const u32 stext = data.m_text.length(); - m_buffer.Reserve(sizeof(int) + sizeof(u32) + stext); + m_buffer.resize(m_buffer.size() + sizeof(int) + sizeof(u32) + stext); u32 c_put = m_put; @@ -88,4 +88,4 @@ public: private: void OnQuit(wxCloseEvent& event); DECLARE_EVENT_TABLE(); -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index ee49e89f53..c3ae2dcd9c 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -19,9 +19,9 @@ void VFS::Mount(const std::string& ps3_path, const std::string& local_path, vfsD UnMount(ps3_path); device->SetPath(ps3_path, local_path); - m_devices.Add(device); + m_devices.push_back(device); - if(m_devices.GetCount() > 1) + if(m_devices.size() > 1) { //std::qsort(m_devices.GetPtr(), m_devices.GetCount(), sizeof(vfsDevice*), sort_devices); } @@ -29,12 +29,12 @@ void VFS::Mount(const std::string& ps3_path, const std::string& local_path, vfsD void VFS::UnMount(const std::string& ps3_path) { - for(u32 i=0; iGetPs3Path().compare(ps3_path)) { - delete &m_devices[i]; - m_devices.RemoveFAt(i); + delete m_devices[i]; + m_devices.erase(m_devices.begin() +i); return; } @@ -43,10 +43,10 @@ void VFS::UnMount(const std::string& ps3_path) void VFS::UnMountAll() { - for(u32 i=0; iCmpPs3Path(ps3_path); if(max_i < 0 || eq > max_eq) { @@ -226,8 +226,8 @@ vfsDevice* VFS::GetDevice(const std::string& ps3_path, std::string& path) const } if(max_i < 0) return nullptr; - path = vfsDevice::GetWinPath(m_devices[max_i].GetLocalPath(), ps3_path.substr(max_eq, ps3_path.length() - max_eq)); - return &m_devices[max_i]; + path = vfsDevice::GetWinPath(m_devices[max_i]->GetLocalPath(), ps3_path.substr(max_eq, ps3_path.length() - max_eq)); + return m_devices[max_i]; } vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path) const @@ -239,9 +239,9 @@ vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path) file_path.Normalize(); std::string mormalized_path = fmt::ToUTF8(file_path.GetFullPath()); - for(u32 i=0; iCmpLocalPath(mormalized_path); if(max_i < 0 || eq > max_eq) { @@ -252,8 +252,8 @@ vfsDevice* VFS::GetDeviceLocal(const std::string& local_path, std::string& path) if(max_i < 0) return nullptr; - path = vfsDevice::GetPs3Path(m_devices[max_i].GetPs3Path(), local_path.substr(max_eq, local_path.length() - max_eq)); - return &m_devices[max_i]; + path = vfsDevice::GetPs3Path(m_devices[max_i]->GetPs3Path(), local_path.substr(max_eq, local_path.length() - max_eq)); + return m_devices[max_i]; } void VFS::Init(const std::string& path) diff --git a/rpcs3/Emu/FS/VFS.h b/rpcs3/Emu/FS/VFS.h index f88a8321e0..b155f16b9d 100644 --- a/rpcs3/Emu/FS/VFS.h +++ b/rpcs3/Emu/FS/VFS.h @@ -41,7 +41,7 @@ struct VFSManagerEntry struct VFS { - ArrayF m_devices; + std::vector m_devices; void Mount(const std::string& ps3_path, const std::string& local_path, vfsDevice* device); void UnMount(const std::string& ps3_path); void UnMountAll(); @@ -62,4 +62,4 @@ struct VFS void Init(const std::string& path); void SaveLoadDevices(std::vector& res, bool is_load); -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/FS/vfsDir.cpp b/rpcs3/Emu/FS/vfsDir.cpp index e4989afa4a..5df20734a5 100644 --- a/rpcs3/Emu/FS/vfsDir.cpp +++ b/rpcs3/Emu/FS/vfsDir.cpp @@ -33,7 +33,7 @@ bool vfsDir::IsExists(const std::string& path) const return m_stream->IsExists(path); // Crash (Access violation reading location 0x0000000000000000) } -const Array& vfsDir::GetEntries() const +const std::vector& vfsDir::GetEntries() const { return m_stream->GetEntries(); } diff --git a/rpcs3/Emu/FS/vfsDir.h b/rpcs3/Emu/FS/vfsDir.h index 3db6d11388..09c8ee197d 100644 --- a/rpcs3/Emu/FS/vfsDir.h +++ b/rpcs3/Emu/FS/vfsDir.h @@ -13,7 +13,7 @@ public: virtual bool Open(const std::string& path) override; virtual bool IsOpened() const override; virtual bool IsExists(const std::string& path) const override; - virtual const Array& GetEntries() const override; + virtual const std::vector& GetEntries() const override; virtual void Close() override; virtual std::string GetPath() const override; @@ -22,4 +22,4 @@ public: virtual bool Rename(const std::string& from, const std::string& to) override; virtual bool Remove(const std::string& path) override; virtual const DirEntryInfo* Read() override; -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/FS/vfsDirBase.cpp b/rpcs3/Emu/FS/vfsDirBase.cpp index 6589c8b070..a7e212019e 100644 --- a/rpcs3/Emu/FS/vfsDirBase.cpp +++ b/rpcs3/Emu/FS/vfsDirBase.cpp @@ -34,7 +34,7 @@ bool vfsDirBase::IsExists(const std::string& path) const return wxDirExists(fmt::FromUTF8(path)); } -const Array& vfsDirBase::GetEntries() const +const std::vector& vfsDirBase::GetEntries() const { return m_entries; } @@ -42,7 +42,7 @@ const Array& vfsDirBase::GetEntries() const void vfsDirBase::Close() { m_cwd = ""; - m_entries.Clear(); + m_entries.clear(); } std::string vfsDirBase::GetPath() const @@ -52,8 +52,8 @@ std::string vfsDirBase::GetPath() const const DirEntryInfo* vfsDirBase::Read() { - if (m_pos >= m_entries.GetCount()) + if (m_pos >= m_entries.size()) return nullptr; return &m_entries[m_pos++]; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/FS/vfsDirBase.h b/rpcs3/Emu/FS/vfsDirBase.h index 00549c8e64..c888f60cab 100644 --- a/rpcs3/Emu/FS/vfsDirBase.h +++ b/rpcs3/Emu/FS/vfsDirBase.h @@ -31,7 +31,7 @@ class vfsDirBase { protected: std::string m_cwd; - Array m_entries; + std::vector m_entries; uint m_pos; vfsDevice* m_device; @@ -42,7 +42,7 @@ public: virtual bool Open(const std::string& path); virtual bool IsOpened() const; virtual bool IsExists(const std::string& path) const; - virtual const Array& GetEntries() const; + virtual const std::vector& GetEntries() const; virtual void Close(); virtual std::string GetPath() const; @@ -51,4 +51,4 @@ public: virtual bool Rename(const std::string& from, const std::string& to) = 0; virtual bool Remove(const std::string& path) = 0; virtual const DirEntryInfo* Read(); -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/FS/vfsLocalDir.cpp b/rpcs3/Emu/FS/vfsLocalDir.cpp index 676814fcfd..f7e0901807 100644 --- a/rpcs3/Emu/FS/vfsLocalDir.cpp +++ b/rpcs3/Emu/FS/vfsLocalDir.cpp @@ -24,7 +24,8 @@ bool vfsLocalDir::Open(const std::string& path) { wxString dir_path = fmt::FromUTF8(path) + name; - DirEntryInfo& info = m_entries[m_entries.Move(new DirEntryInfo())]; + m_entries.emplace_back(); + DirEntryInfo& info = m_entries.back(); info.name = fmt::ToUTF8(name); info.flags |= dir.Exists(dir_path) ? DirEntry_TypeDir : DirEntry_TypeFile; diff --git a/rpcs3/Emu/GS/GL/GLBuffers.cpp b/rpcs3/Emu/GS/GL/GLBuffers.cpp index b7ea6001c7..3b89ac2d53 100644 --- a/rpcs3/Emu/GS/GL/GLBuffers.cpp +++ b/rpcs3/Emu/GS/GL/GLBuffers.cpp @@ -20,7 +20,7 @@ void GLBufferObject::Create(GLuint type, u32 count) { if(IsCreated()) return; - m_id.InsertRoomEnd(count); + m_id.resize(count); glGenBuffers(count, &m_id[0]); m_type = type; } @@ -29,14 +29,14 @@ void GLBufferObject::Delete() { if(!IsCreated()) return; - glDeleteBuffers(m_id.GetCount(), &m_id[0]); - m_id.Clear(); + glDeleteBuffers(m_id.size(), &m_id[0]); + m_id.clear(); m_type = 0; } void GLBufferObject::Bind(u32 type, u32 num) { - assert(num < m_id.GetCount()); + assert(num < m_id.size()); glBindBuffer(type, m_id[num]); } @@ -75,7 +75,7 @@ void GLBufferObject::SetAttribPointer(int location, int size, int type, int poin bool GLBufferObject::IsCreated() const { - return m_id.GetCount() != 0; + return m_id.size() != 0; } GLvbo::GLvbo() @@ -135,20 +135,20 @@ GLrbo::~GLrbo() void GLrbo::Create(u32 count) { - if(m_id.GetCount() == count) + if(m_id.size() == count) { return; } Delete(); - m_id.SetCount(count); - glGenRenderbuffers(count, m_id.GetPtr()); + m_id.resize(count); + glGenRenderbuffers(count, m_id.data()); } void GLrbo::Bind(u32 num) const { - assert(num < m_id.GetCount()); + assert(num < m_id.size()); glBindRenderbuffer(GL_RENDERBUFFER, m_id[num]); } @@ -170,18 +170,18 @@ void GLrbo::Delete() return; } - glDeleteRenderbuffers(m_id.GetCount(), m_id.GetPtr()); - m_id.Clear(); + glDeleteRenderbuffers(m_id.size(), m_id.data()); + m_id.clear(); } bool GLrbo::IsCreated() const { - return m_id.GetCount(); + return m_id.size(); } u32 GLrbo::GetId(u32 num) const { - assert(num < m_id.GetCount()); + assert(num < m_id.size()); return m_id[num]; } diff --git a/rpcs3/Emu/GS/GL/GLBuffers.h b/rpcs3/Emu/GS/GL/GLBuffers.h index 6f66f8196d..dfd58a8595 100644 --- a/rpcs3/Emu/GS/GL/GLBuffers.h +++ b/rpcs3/Emu/GS/GL/GLBuffers.h @@ -4,7 +4,7 @@ struct GLBufferObject { protected: - Array m_id; + std::vector m_id; GLuint m_type; public: @@ -51,7 +51,7 @@ public: class GLrbo { protected: - Array m_id; + std::vector m_id; public: GLrbo(); @@ -88,4 +88,4 @@ public: static void Unbind(u32 type); void Delete(); bool IsCreated() const; -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp b/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp index 6b5addd742..fab7222de8 100644 --- a/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp @@ -229,7 +229,7 @@ std::string GLFragmentDecompilerThread::BuildCode() std::string p; - for(u32 i=0; i pixels; - pixels.SetCount(RSXThread::m_width * RSXThread::m_height * 4); + static std::vector pixels; + pixels.resize(RSXThread::m_width * RSXThread::m_height * 4); m_fbo.Bind(GL_READ_FRAMEBUFFER); - glReadPixels(0, 0, RSXThread::m_width, RSXThread::m_height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, pixels.GetPtr()); + glReadPixels(0, 0, RSXThread::m_width, RSXThread::m_height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, pixels.data()); - src_buffer = pixels.GetPtr(); + src_buffer = pixels.data(); width = RSXThread::m_width; height = RSXThread::m_height; } @@ -1199,9 +1199,9 @@ void GLGSRender::Flip() if(m_fbo.IsCreated()) m_fbo.Bind(); - for(uint i=0; iDraw(); } m_frame->Flip(m_context); diff --git a/rpcs3/Emu/GS/GL/GLGSRender.h b/rpcs3/Emu/GS/GL/GLGSRender.h index c0aee1dcb5..2fb189c4b0 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.h +++ b/rpcs3/Emu/GS/GL/GLGSRender.h @@ -540,8 +540,8 @@ class GLGSRender , public GSRender { private: - Array m_vdata; - ArrayF m_post_draw_objs; + std::vector m_vdata; + std::vector m_post_draw_objs; GLProgram m_program; int m_fp_buf_num; diff --git a/rpcs3/Emu/GS/GL/GLProgram.cpp b/rpcs3/Emu/GS/GL/GLProgram.cpp index 75d4087bd9..2ff48e5054 100644 --- a/rpcs3/Emu/GS/GL/GLProgram.cpp +++ b/rpcs3/Emu/GS/GL/GLProgram.cpp @@ -8,7 +8,7 @@ GLProgram::GLProgram() : id(0) int GLProgram::GetLocation(const std::string& name) { - for(u32 i=0; i m_locations; + std::vector m_locations; public: u32 id; @@ -25,4 +25,4 @@ public: void UnUse(); void SetTex(u32 index); void Delete(); -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp b/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp index a4d4a63e4f..37c7691569 100644 --- a/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp +++ b/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp @@ -3,9 +3,9 @@ int GLProgramBuffer::SearchFp(const RSXShaderProgram& rsx_fp, GLShaderProgram& gl_fp) { - for(u32 i=0; i fp_data; - Array vp_data; + std::vector fp_data; + std::vector vp_data; std::string fp_shader; std::string vp_shader; }; struct GLProgramBuffer { - Array m_buf; + std::vector m_buf; int SearchFp(const RSXShaderProgram& rsx_fp, GLShaderProgram& gl_fp); int SearchVp(const RSXVertexProgram& rsx_vp, GLVertexProgram& gl_vp); @@ -26,4 +26,4 @@ struct GLProgramBuffer void Add(GLProgram& prog, GLShaderProgram& gl_fp, RSXShaderProgram& rsx_fp, GLVertexProgram& gl_vp, RSXVertexProgram& rsx_vp); void Clear(); -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/GS/GL/GLShaderParam.h b/rpcs3/Emu/GS/GL/GLShaderParam.h index d1b4ad7f4b..f39846da44 100644 --- a/rpcs3/Emu/GS/GL/GLShaderParam.h +++ b/rpcs3/Emu/GS/GL/GLShaderParam.h @@ -31,7 +31,7 @@ struct GLParamType { const GLParamFlag flag; std::string type; - Array items; + std::vector items; GLParamType(const GLParamFlag _flag, const std::string& _type) : flag(_flag) @@ -41,7 +41,7 @@ struct GLParamType bool SearchName(const std::string& name) { - for(u32 i=0; i params; + std::vector params; GLParamType* SearchParam(const std::string& type) { - for(u32 i=0; iSearchName(name)) t->items.Move(new GLParamItem(name, -1, value)); + if(!t->SearchName(name)) t->items.emplace_back(name, -1, value); } else { - const u32 num = params.GetCount(); - params.Move(new GLParamType(flag, type)); - params[num].items.Move(new GLParamItem(name, -1, value)); + const u32 num = params.size(); + params.emplace_back(flag, type); + params[num].items.emplace_back(name, -1, value); } return name; @@ -128,15 +128,15 @@ struct GLParamArray if(t) { - if(!t->SearchName(name)) t->items.Move(new GLParamItem(name, location)); + if(!t->SearchName(name)) t->items.emplace_back(name, location); } else { - const u32 num = params.GetCount(); - params.Move(new GLParamType(flag, type)); - params[num].items.Move(new GLParamItem(name, location)); + const u32 num = params.size(); + params.emplace_back(flag, type); + params[num].items.emplace_back(name, location); } return name; } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/GS/GL/GLVertexProgram.cpp b/rpcs3/Emu/GS/GL/GLVertexProgram.cpp index 567f608618..1fd9cb87d1 100644 --- a/rpcs3/Emu/GS/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/GS/GL/GLVertexProgram.cpp @@ -248,15 +248,16 @@ std::string GLVertexDecompilerThread::GetFunc() u32 offset = (d2.iaddrh << 3) | d3.iaddrl; std::string name = fmt::Format("func%u", offset); - for(uint i=0; iname.compare(name) == 0) return name + "()"; } - uint idx = m_funcs.Add(new FuncInfo()); - m_funcs[idx].offset = offset; - m_funcs[idx].name = name; + m_funcs.push_back(new FuncInfo()); + uint idx = m_funcs.size()-1; + m_funcs[idx]->offset = offset; + m_funcs[idx]->name = name; return name + "()"; } @@ -280,9 +281,9 @@ std::string GLVertexDecompilerThread::BuildFuncBody(const FuncInfo& func) if(i != func.offset) { uint call_func = -1; - for(uint j=0; joffset == i) { call_func = j; break; @@ -291,7 +292,7 @@ std::string GLVertexDecompilerThread::BuildFuncBody(const FuncInfo& func) if(call_func != -1) { - result += '\t' + m_funcs[call_func].name + "();\n"; + result += '\t' + m_funcs[call_func]->name + "();\n"; break; } } @@ -306,26 +307,26 @@ std::string GLVertexDecompilerThread::BuildCode() { std::string p; - for(u32 i=0; i0; --i) + for(int i=m_funcs.size() - 1; i>0; --i) { - fp += fmt::Format("void %s();\n", m_funcs[i].name.c_str()); + fp += fmt::Format("void %s();\n", m_funcs[i]->name.c_str()); } std::string f; f += fmt::Format("void %s()\n{\n\tgl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n\t%s();\n\tgl_Position = gl_Position * scaleOffsetMat;\n}\n", - m_funcs[0].name.c_str(), m_funcs[1].name.c_str()); + m_funcs[0]->name.c_str(), m_funcs[1]->name.c_str()); - for(uint i=1; iname.c_str(), BuildFuncBody(*m_funcs[i]).c_str()); } static const std::string& prot = @@ -341,7 +342,7 @@ std::string GLVertexDecompilerThread::BuildCode() void GLVertexDecompilerThread::Task() { - m_parr.params.Clear(); + m_parr.params.clear(); for(u32 i=0, intsCount=0;;intsCount++) { @@ -426,7 +427,7 @@ void GLVertexDecompilerThread::Task() if(d3.end) { - if(i < m_data.GetCount()) + if(i < m_data.size()) ConLog.Error("Program end before buffer end."); break; @@ -436,7 +437,7 @@ void GLVertexDecompilerThread::Task() m_shader = BuildCode(); m_body.clear(); - m_funcs.RemoveAt(2, m_funcs.GetCount() - 2); + m_funcs = std::vector(m_funcs.begin(),m_funcs.begin()+3); } GLVertexProgram::GLVertexProgram() @@ -521,7 +522,7 @@ void GLVertexProgram::Compile() void GLVertexProgram::Delete() { - parr.params.Clear(); + parr.params.clear(); shader.clear(); if(id) diff --git a/rpcs3/Emu/GS/GL/GLVertexProgram.h b/rpcs3/Emu/GS/GL/GLVertexProgram.h index 4e9e49b489..38a333461e 100644 --- a/rpcs3/Emu/GS/GL/GLVertexProgram.h +++ b/rpcs3/Emu/GS/GL/GLVertexProgram.h @@ -135,25 +135,25 @@ struct GLVertexDecompilerThread : public ThreadBase std::vector m_body; - ArrayF m_funcs; + std::vector m_funcs; //wxString main; std::string& m_shader; - Array& m_data; + std::vector& m_data; GLParamArray& m_parr; - GLVertexDecompilerThread(Array& data, std::string& shader, GLParamArray& parr) + GLVertexDecompilerThread(std::vector& data, std::string& shader, GLParamArray& parr) : ThreadBase("Vertex Shader Decompiler Thread") , m_data(data) , m_shader(shader) , m_parr(parr) { - m_funcs.Add(new FuncInfo()); - m_funcs[0].offset = 0; - m_funcs[0].name = "main"; - m_funcs.Add(new FuncInfo()); - m_funcs[1].offset = 0; - m_funcs[1].name = "func0"; + m_funcs.push_back(new FuncInfo()); + m_funcs[0]->offset = 0; + m_funcs[0]->name = "main"; + m_funcs.push_back(new FuncInfo()); + m_funcs[1]->offset = 0; + m_funcs[1]->name = "func0"; //m_cur_func->body = "\tgl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n"; } diff --git a/rpcs3/Emu/GS/RSXThread.cpp b/rpcs3/Emu/GS/RSXThread.cpp index 56bebee980..c3fdca08de 100644 --- a/rpcs3/Emu/GS/RSXThread.cpp +++ b/rpcs3/Emu/GS/RSXThread.cpp @@ -36,7 +36,7 @@ void RSXVertexData::Reset() size = 0; type = 0; addr = 0; - data.ClearF(); + data.clear(); } void RSXVertexData::Load(u32 start, u32 count) @@ -45,7 +45,7 @@ void RSXVertexData::Load(u32 start, u32 count) const u32 tsize = GetTypeSize(); - data.SetCount((start + count) * tsize * size); + data.resize((start + count) * tsize * size); for(u32 i=start; i> 31); CMD_LOG("num=%d, addr=0x%x", index, addr); m_vertex_data[index].addr = addr; - m_vertex_data[index].data.ClearF(); + m_vertex_data[index].data.clear(); } break; @@ -592,8 +592,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 { case 0: { - int pos = m_indexed_array.m_data.GetCount(); - m_indexed_array.m_data.InsertRoomEnd(4); + int pos = m_indexed_array.m_data.size(); + m_indexed_array.m_data.resize(m_indexed_array.m_data.size() + 4); index = Memory.Read32(m_indexed_array.m_addr + i * 4); *(u32*)&m_indexed_array.m_data[pos] = index; //ConLog.Warning("index 4: %d", *(u32*)&m_indexed_array.m_data[pos]); @@ -602,8 +602,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 case 1: { - int pos = m_indexed_array.m_data.GetCount(); - m_indexed_array.m_data.InsertRoomEnd(2); + int pos = m_indexed_array.m_data.size(); + m_indexed_array.m_data.resize(m_indexed_array.m_data.size() + 2); index = Memory.Read16(m_indexed_array.m_addr + i * 2); //ConLog.Warning("index 2: %d", index); *(u16*)&m_indexed_array.m_data[pos] = index; @@ -684,7 +684,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 //ConLog.Warning("NV4097_SET_TRANSFORM_PROGRAM_LOAD: prog = %d", ARGS(0)); m_cur_vertex_prog = &m_vertex_progs[ARGS(0)]; - m_cur_vertex_prog->data.Clear(); + m_cur_vertex_prog->data.clear(); if(count == 2) { @@ -705,7 +705,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 break; } - for(u32 i=0; idata.AddCpy(ARGS(i)); + for(u32 i=0; idata.push_back(ARGS(i)); } break; @@ -745,7 +745,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 RSXTransformConstant c(id, (float&)x, (float&)y, (float&)z, (float&)w); CMD_LOG("SET_TRANSFORM_CONSTANT_LOAD[%d : %d] = (%f, %f, %f, %f)", i, id, c.x, c.y, c.z, c.w); - m_transform_constants.AddCpy(c); + m_transform_constants.push_back(c); } } break; @@ -1252,7 +1252,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 } //ConLog.Warning("NV308A_COLOR: [%d]: %f, %f, %f, %f", c.id, c.x, c.y, c.z, c.w); - m_fragment_constants.AddCpy(c); + m_fragment_constants.push_back(c); } break; @@ -1489,7 +1489,7 @@ void RSXThread::Begin(u32 draw_mode) m_draw_array_count = 0; m_draw_array_first = ~0; - if(Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount()) + if(Emu.GetCallbackManager().m_exit_callback.m_callbacks.size()) { //Emu.GetCallbackManager().m_exit_callback.Handle(0x0121, 0); } @@ -1499,14 +1499,14 @@ void RSXThread::End() { ExecCMD(); - if(Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount()) + if(Emu.GetCallbackManager().m_exit_callback.m_callbacks.size()) { //Emu.GetCallbackManager().m_exit_callback.Handle(0x0122, 0); } m_indexed_array.Reset(); - m_fragment_constants.Clear(); - m_transform_constants.Clear(); + m_fragment_constants.clear(); + m_transform_constants.clear(); m_cur_shader_prog_num = 0; //m_cur_shader_prog = nullptr; @@ -1562,7 +1562,7 @@ void RSXThread::Task() } if(cmd & CELL_GCM_METHOD_FLAG_CALL) { - m_call_stack.Push(get + 4); + m_call_stack.push(get + 4); u32 offs = cmd & ~CELL_GCM_METHOD_FLAG_CALL; u32 addr = Memory.RSXIOMem.GetStartAddr() + offs; //ConLog.Warning("rsx call(0x%x) #0x%x - 0x%x - 0x%x", offs, addr, cmd, get); @@ -1572,7 +1572,8 @@ void RSXThread::Task() if(cmd == CELL_GCM_METHOD_FLAG_RETURN) { //ConLog.Warning("rsx return!"); - u32 get = m_call_stack.Pop(); + u32 get = m_call_stack.top(); + m_call_stack.pop(); //ConLog.Warning("rsx return(0x%x)", get); m_ctrl->get = get; continue; diff --git a/rpcs3/Emu/GS/RSXThread.h b/rpcs3/Emu/GS/RSXThread.h index 318621b7b9..a840c03c49 100644 --- a/rpcs3/Emu/GS/RSXThread.h +++ b/rpcs3/Emu/GS/RSXThread.h @@ -5,6 +5,8 @@ #include "RSXFragmentProgram.h" #include "Emu/SysCalls/Callback.h" +#include + enum Method { CELL_GCM_METHOD_FLAG_NON_INCREMENT = 0x40000000, @@ -25,7 +27,7 @@ struct RSXVertexData u32 addr; u32 constant_count; - Array data; + std::vector data; RSXVertexData(); @@ -38,7 +40,7 @@ struct RSXVertexData struct RSXIndexArrayData { - Array m_data; + std::vector m_data; int m_type; u32 m_first; u32 m_count; @@ -59,7 +61,7 @@ struct RSXIndexArrayData m_addr = 0; index_min = ~0; index_max = 0; - m_data.Clear(); + m_data.clear(); } }; @@ -95,7 +97,7 @@ public: static const uint m_tiles_count = 15; protected: - Stack m_call_stack; + std::stack m_call_stack; CellGcmControl* m_ctrl; public: @@ -103,8 +105,8 @@ public: RSXTexture m_textures[m_textures_count]; RSXVertexData m_vertex_data[m_vertex_count]; RSXIndexArrayData m_indexed_array; - Array m_fragment_constants; - Array m_transform_constants; + std::vector m_fragment_constants; + std::vector m_transform_constants; u32 m_cur_shader_prog_num; RSXShaderProgram m_shader_progs[m_fragment_count]; diff --git a/rpcs3/Emu/GS/RSXVertexProgram.h b/rpcs3/Emu/GS/RSXVertexProgram.h index e655e78bee..e7b103a688 100644 --- a/rpcs3/Emu/GS/RSXVertexProgram.h +++ b/rpcs3/Emu/GS/RSXVertexProgram.h @@ -2,5 +2,5 @@ struct RSXVertexProgram { - Array data; -}; \ No newline at end of file + std::vector data; +}; diff --git a/rpcs3/Emu/Memory/DynamicMemoryBlockBase.inl b/rpcs3/Emu/Memory/DynamicMemoryBlockBase.inl index 33b80d2ecf..fb87f12d81 100644 --- a/rpcs3/Emu/Memory/DynamicMemoryBlockBase.inl +++ b/rpcs3/Emu/Memory/DynamicMemoryBlockBase.inl @@ -2,8 +2,8 @@ //DynamicMemoryBlockBase template DynamicMemoryBlockBase::DynamicMemoryBlockBase() - : PT() - , m_max_size(0) +: PT() +, m_max_size(0) { } @@ -14,7 +14,7 @@ const u32 DynamicMemoryBlockBase::GetUsedSize() const u32 size = 0; - for(u32 i=0; i::SetRange(const u64 start, const u32 siz MemoryBlock::SetRange(start, 0); const u32 page_count = m_max_size >> 12; - m_pages.SetCount(page_count); - m_locked.SetCount(page_count); - memset(m_pages.GetPtr(), 0, sizeof(u8*) * page_count); - memset(m_locked.GetPtr(), 0, sizeof(u8*) * page_count); + m_pages.resize(page_count); + m_locked.resize(page_count); + memset(m_pages.data(), 0, sizeof(u8*) * page_count); + memset(m_locked.data(), 0, sizeof(u8*) * page_count); return this; } @@ -66,11 +66,11 @@ void DynamicMemoryBlockBase::Delete() { std::lock_guard lock(m_lock); - m_allocated.Clear(); + m_allocated.clear(); m_max_size = 0; - m_pages.Clear(); - m_locked.Clear(); + m_pages.clear(); + m_locked.clear(); MemoryBlock::Delete(); } @@ -82,22 +82,22 @@ bool DynamicMemoryBlockBase::AllocFixed(u64 addr, u32 size) addr &= ~4095; // align start address - if(!IsInMyRange(addr, size)) + if (!IsInMyRange(addr, size)) { assert(0); return false; } - if(IsMyAddress(addr) || IsMyAddress(addr + size - 1)) + if (IsMyAddress(addr) || IsMyAddress(addr + size - 1)) { return false; } std::lock_guard lock(m_lock); - for(u32 i=0; i= m_allocated[i].addr && addr < m_allocated[i].addr + m_allocated[i].size) return false; + if (addr >= m_allocated[i].addr && addr < m_allocated[i].addr + m_allocated[i].size) return false; } AppendMem(addr, size); @@ -108,7 +108,9 @@ bool DynamicMemoryBlockBase::AllocFixed(u64 addr, u32 size) template void DynamicMemoryBlockBase::AppendMem(u64 addr, u32 size) /* private */ { - u8* pointer = (u8*)m_allocated[m_allocated.Move(new MemBlockInfo(addr, size))].mem; + //u8* pointer = (u8*)m_allocated[m_allocated.Move(new MemBlockInfo(addr, size))].mem; + m_allocated.emplace_back(addr, size); + u8* pointer = (u8*) m_allocated.back().mem; const u32 first = MemoryBlock::FixAddr(addr) >> 12; @@ -141,13 +143,13 @@ u64 DynamicMemoryBlockBase::AllocAlign(u32 size, u32 align) std::lock_guard lock(m_lock); - for(u64 addr = MemoryBlock::GetStartAddr(); addr <= MemoryBlock::GetEndAddr() - exsize;) + for (u64 addr = MemoryBlock::GetStartAddr(); addr <= MemoryBlock::GetEndAddr() - exsize;) { bool is_good_addr = true; - for(u32 i=0; i= m_allocated[i].addr && addr < m_allocated[i].addr + m_allocated[i].size) || + if ((addr >= m_allocated[i].addr && addr < m_allocated[i].addr + m_allocated[i].size) || (m_allocated[i].addr >= addr && m_allocated[i].addr < addr + exsize)) { is_good_addr = false; @@ -156,7 +158,7 @@ u64 DynamicMemoryBlockBase::AllocAlign(u32 size, u32 align) } } - if(!is_good_addr) continue; + if (!is_good_addr) continue; if (align) { @@ -182,7 +184,7 @@ bool DynamicMemoryBlockBase::Free(u64 addr) { std::lock_guard lock(m_lock); - for (u32 num = 0; num < m_allocated.GetCount(); num++) + for (u32 num = 0; num < m_allocated.size(); num++) { if (addr == m_allocated[num].addr) { @@ -205,13 +207,13 @@ bool DynamicMemoryBlockBase::Free(u64 addr) m_locked[i] = nullptr; } - m_allocated.RemoveAt(num); + m_allocated.erase(m_allocated.begin() + num); return true; } } ConLog.Error("DynamicMemoryBlock::Free(addr=0x%llx): failed", addr); - for (u32 i = 0; i < m_allocated.GetCount(); i++) + for (u32 i = 0; i < m_allocated.size(); i++) { ConLog.Write("*** Memory Block: addr = 0x%llx, size = 0x%x", m_allocated[i].addr, m_allocated[i].size); } @@ -223,7 +225,7 @@ u8* DynamicMemoryBlockBase::GetMem(u64 addr) const // lock-free, addr is fix { const u32 index = addr >> 12; - if (index < m_pages.GetCount()) + if (index < m_pages.size()) { if (u8* res = m_pages[index]) { @@ -243,7 +245,7 @@ bool DynamicMemoryBlockBase::IsLocked(u64 addr) // lock-free { const u32 index = MemoryBlock::FixAddr(addr) >> 12; - if (index < m_locked.GetCount()) + if (index < m_locked.size()) { if (m_locked[index]) return true; } @@ -259,13 +261,13 @@ bool DynamicMemoryBlockBase::Lock(u64 addr, u32 size) addr &= ~4095; // align start address - if(!IsInMyRange(addr, size)) + if (!IsInMyRange(addr, size)) { assert(0); return false; } - if(IsMyAddress(addr) || IsMyAddress(addr + size - 1)) + if (IsMyAddress(addr) || IsMyAddress(addr + size - 1)) { return false; } @@ -291,18 +293,18 @@ bool DynamicMemoryBlockBase::Lock(u64 addr, u32 size) template bool DynamicMemoryBlockBase::Unlock(u64 addr, u32 size) -{ +{ size = PAGE_4K(size); // align size addr &= ~4095; // align start address - if(!IsInMyRange(addr, size)) + if (!IsInMyRange(addr, size)) { assert(0); return false; } - if(IsMyAddress(addr) || IsMyAddress(addr + size - 1)) + if (IsMyAddress(addr) || IsMyAddress(addr + size - 1)) { return false; } diff --git a/rpcs3/Emu/Memory/Memory.cpp b/rpcs3/Emu/Memory/Memory.cpp index 234432aaab..b71bea4e6c 100644 --- a/rpcs3/Emu/Memory/Memory.cpp +++ b/rpcs3/Emu/Memory/Memory.cpp @@ -559,7 +559,7 @@ bool VirtualMemoryBlock::IsInMyRange(const u64 addr, const u32 size) bool VirtualMemoryBlock::IsMyAddress(const u64 addr) { - for(u32 i=0; i= m_mapped_memory[i].addr && addr < m_mapped_memory[i].addr + m_mapped_memory[i].size) { @@ -577,7 +577,7 @@ u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr) if(!IsInMyRange(addr, size) && (IsMyAddress(addr) || IsMyAddress(addr + size - 1))) return 0; - m_mapped_memory.Move(new VirtualMemInfo(addr, realaddr, size)); + m_mapped_memory.emplace_back(addr, realaddr, size); return addr; } else @@ -587,7 +587,7 @@ u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr) bool is_good_addr = true; // check if address is already mapped - for(u32 i=0; i= m_mapped_memory[i].addr && addr < m_mapped_memory[i].addr + m_mapped_memory[i].size) || (m_mapped_memory[i].addr >= addr && m_mapped_memory[i].addr < addr + size)) @@ -600,7 +600,7 @@ u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr) if(!is_good_addr) continue; - m_mapped_memory.Move(new VirtualMemInfo(addr, realaddr, size)); + m_mapped_memory.emplace_back(addr, realaddr, size); return addr; } @@ -611,12 +611,12 @@ u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr) u32 VirtualMemoryBlock::UnmapRealAddress(u64 realaddr) { - for(u32 i=0; i= m_mapped_memory[i].addr && addr < m_mapped_memory[i].addr + m_mapped_memory[i].size) { @@ -724,7 +724,7 @@ u64 VirtualMemoryBlock::getRealAddr(u64 addr) u64 VirtualMemoryBlock::getMappedAddress(u64 realAddress) { - for(u32 i=0; i= m_mapped_memory[i].realAddress && realAddress < m_mapped_memory[i].realAddress + m_mapped_memory[i].size) { @@ -737,7 +737,7 @@ u64 VirtualMemoryBlock::getMappedAddress(u64 realAddress) void VirtualMemoryBlock::Delete() { - m_mapped_memory.Clear(); + m_mapped_memory.clear(); MemoryBlock::Delete(); } @@ -763,4 +763,4 @@ bool VirtualMemoryBlock::Unreserve(u32 size) u32 VirtualMemoryBlock::GetResevedAmount() { return m_reserve_size; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/Memory/Memory.h b/rpcs3/Emu/Memory/Memory.h index e1535e8e82..7bb7729177 100644 --- a/rpcs3/Emu/Memory/Memory.h +++ b/rpcs3/Emu/Memory/Memory.h @@ -2,6 +2,8 @@ #include "MemoryBlock.h" #include +using std::nullptr_t; + enum MemoryType { Memory_PS3, @@ -488,7 +490,8 @@ public: u8* operator + (const u64 vaddr) { u8* ret = GetMemFromAddr(vaddr); - if(!ret) throw fmt::Format("GetMemFromAddr(0x%llx)", vaddr); + if(ret == nullptr) + throw fmt::Format("GetMemFromAddr(0x%x)", vaddr); return ret; } diff --git a/rpcs3/Emu/Memory/MemoryBlock.h b/rpcs3/Emu/Memory/MemoryBlock.h index 1e4bc16415..c47fa04ca1 100644 --- a/rpcs3/Emu/Memory/MemoryBlock.h +++ b/rpcs3/Emu/Memory/MemoryBlock.h @@ -20,7 +20,7 @@ struct MemInfo struct MemBlockInfo : public MemInfo { - void* mem; + void *mem; MemBlockInfo(u64 _addr, u32 _size) : MemInfo(_addr, PAGE_4K(_size)) @@ -31,13 +31,26 @@ struct MemBlockInfo : public MemInfo ConLog.Error("Not enought free memory."); assert(0); } - memset(mem, 0, size); } + MemBlockInfo(MemBlockInfo &other) = delete; + MemBlockInfo(MemBlockInfo &&other) : MemInfo(other.addr,other.size) ,mem(other.mem) + { + other.mem = nullptr; + } + MemBlockInfo& operator =(MemBlockInfo &other) = delete; + MemBlockInfo& operator =(MemBlockInfo &&other){ + this->addr = other.addr; + this->size = other.size; + this->mem = other.mem; + other.mem = nullptr; + return *this; + } + ~MemBlockInfo() { - _aligned_free(mem); + if(mem) _aligned_free(mem); mem = nullptr; } }; @@ -193,9 +206,9 @@ template class DynamicMemoryBlockBase : public PT { mutable std::mutex m_lock; - Array m_allocated; // allocation info - Array m_pages; // real addresses of every 4096 byte pages (array size should be fixed) - Array m_locked; // locked pages should be moved here + std::vector m_allocated; // allocation info + std::vector m_pages; // real addresses of every 4096 byte pages (array size should be fixed) + std::vector m_locked; // locked pages should be moved here u32 m_max_size; @@ -229,7 +242,7 @@ private: class VirtualMemoryBlock : public MemoryBlock { - Array m_mapped_memory; + std::vector m_mapped_memory; u32 m_reserve_size; public: @@ -283,3 +296,4 @@ public: typedef DynamicMemoryBlockBase DynamicMemoryBlock; typedef DynamicMemoryBlockBase DynamicMemoryBlockLE; + diff --git a/rpcs3/Emu/SysCalls/Callback.h b/rpcs3/Emu/SysCalls/Callback.h index a21709aee0..093fc13379 100644 --- a/rpcs3/Emu/SysCalls/Callback.h +++ b/rpcs3/Emu/SysCalls/Callback.h @@ -44,7 +44,7 @@ struct Callback3 : public Callback struct Callbacks { - Array m_callbacks; + std::vector m_callbacks; bool m_in_manager; Callbacks() : m_in_manager(false) @@ -58,11 +58,11 @@ struct Callbacks void Unregister(u32 slot) { - for(u32 i=0; i m_callbacks; + std::vector m_callbacks; Callbacks3 m_exit_callback; void Add(Callbacks& c) @@ -139,7 +141,7 @@ struct CallbackManager if(c.m_in_manager) return; c.m_in_manager = true; - m_callbacks.Add(c); + m_callbacks.push_back(&c); } void Init() @@ -149,12 +151,12 @@ struct CallbackManager void Clear() { - for(u32 i=0; im_callbacks.clear(); + m_callbacks[i]->m_in_manager = false; } - m_callbacks.ClearF(); + m_callbacks.clear(); } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index 6e2f6e2f93..3633b642cc 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -3,12 +3,13 @@ #include "SC_FUNC.h" #include + Module* g_modules[3][0xff] = {0}; uint g_max_module_id = 0; uint g_module_2_count = 0; -ArrayF g_modules_funcs_list; +std::vector g_modules_funcs_list; std::mutex g_funcs_lock; -ArrayF g_static_funcs_list; +std::vector g_static_funcs_list; struct ModuleInfo { @@ -132,9 +133,9 @@ struct _InitNullModules bool IsLoadedFunc(u32 id) { - for(u32 i=0; iid == id) { return true; } @@ -149,11 +150,11 @@ bool CallFunc(u32 num) { std::lock_guard lock(g_funcs_lock); - for(u32 i=0; iid == num) { - func = g_modules_funcs_list[i].func; + func = g_modules_funcs_list[i]->func; break; } } @@ -170,11 +171,11 @@ bool UnloadFunc(u32 id) { std::lock_guard lock(g_funcs_lock); - for(u32 i=0; iid == id) { - g_modules_funcs_list.RemoveFAt(i); + g_modules_funcs_list.erase(g_modules_funcs_list.begin() +i); return true; } @@ -202,7 +203,7 @@ void UnloadModules() } std::lock_guard lock(g_funcs_lock); - g_modules_funcs_list.Clear(); + g_modules_funcs_list.clear(); } Module* GetModuleByName(const std::string& name) @@ -331,13 +332,13 @@ void Module::Load() if(m_load_func) m_load_func(); - for(u32 i=0; i lock(g_funcs_lock); if(IsLoadedFunc(m_funcs_list[i].id)) continue; - g_modules_funcs_list.Add(m_funcs_list[i]); + g_modules_funcs_list.push_back(&m_funcs_list[i]); } SetLoaded(true); @@ -350,7 +351,7 @@ void Module::UnLoad() if(m_unload_func) m_unload_func(); - for(u32 i=0; im_name == GetName(); } + diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index 71a8e4c13c..c09c6d63f8 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -6,11 +6,6 @@ #define declCPU PPUThread& CPU = GetCurrentPPUThread -class func_caller -{ -public: - virtual void operator()() = 0; -}; //TODO struct ModuleFunc @@ -36,12 +31,12 @@ struct SFunc func_caller* func; void* ptr; char* name; - Array ops; + std::vector ops; u64 group; u32 found; }; -extern ArrayF g_static_funcs_list; +extern std::vector g_static_funcs_list; class Module { @@ -52,7 +47,7 @@ class Module void (*m_unload_func)(); public: - Array m_funcs_list; + std::vector m_funcs_list; Module(u16 id, const char* name); Module(const char* name, void (*init)(), void (*load)() = nullptr, void (*unload)() = nullptr); @@ -120,7 +115,7 @@ public: template __forceinline void Module::AddFunc(u32 id, T func) { - m_funcs_list.Move(new ModuleFunc(id, bind_func(func))); + m_funcs_list.emplace_back(id, bind_func(func)); } template @@ -129,7 +124,7 @@ __forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], char if (!ops[0]) return; SFunc* sf = new SFunc; - sf->ptr = func; + sf->ptr = (void *)func; sf->func = bind_func(func); sf->name = name; sf->group = *(u64*)group; @@ -145,9 +140,9 @@ __forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], char if (op.mask) op.crc &= op.mask; op.mask = re(op.mask); op.crc = re(op.crc); - sf->ops.AddCpy(op); + sf->ops.push_back(op); } - g_static_funcs_list.Add(sf); + g_static_funcs_list.push_back(sf); } bool IsLoadedFunc(u32 id); @@ -157,3 +152,4 @@ void UnloadModules(); u32 GetFuncNumById(u32 id); Module* GetModuleByName(const std::string& name); Module* GetModuleById(u16 id); + diff --git a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp index eeca7af654..a0418e3be5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp @@ -65,7 +65,7 @@ int cellAudioInit() } queue.Clear(); - Array keys; + std::vector keys; if(m_audio_out) { @@ -354,10 +354,10 @@ int cellAudioInit() index = (position + 1) % port.block; // write new value } // load keys: - keys.SetCount(m_config.m_keys.GetCount()); - memcpy(keys.GetPtr(), m_config.m_keys.GetPtr(), sizeof(u64) * keys.GetCount()); + keys.resize(m_config.m_keys.size()); + memcpy(keys.data(), m_config.m_keys.data(), sizeof(u64) * keys.size()); } - for (u32 i = 0; i < keys.GetCount(); i++) + for (u32 i = 0; i < keys.size(); i++) { // TODO: check event source Emu.GetEventManager().SendEvent(keys[i], 0x10103000e010e07, 0, 0, 0); @@ -402,7 +402,7 @@ abort: m_config.m_is_audio_initialized = false; - m_config.m_keys.Clear(); + m_config.m_keys.clear(); for (u32 i = 0; i < m_config.AUDIO_PORT_COUNT; i++) { AudioPortConfig& port = m_config.m_ports[i]; @@ -736,14 +736,14 @@ int cellAudioSetNotifyEventQueue(u64 key) SMutexGeneralLocker lock(audioMutex); - for (u32 i = 0; i < m_config.m_keys.GetCount(); i++) // check for duplicates + for (u32 i = 0; i < m_config.m_keys.size(); i++) // check for duplicates { if (m_config.m_keys[i] == key) { return CELL_AUDIO_ERROR_PARAM; } } - m_config.m_keys.AddCpy(key); + m_config.m_keys.push_back(key); /*EventQueue* eq; if (!Emu.GetEventManager().GetEventQueue(key, eq)) @@ -769,11 +769,11 @@ int cellAudioRemoveNotifyEventQueue(u64 key) SMutexGeneralLocker lock(audioMutex); bool found = false; - for (u32 i = 0; i < m_config.m_keys.GetCount(); i++) + for (u32 i = 0; i < m_config.m_keys.size(); i++) { if (m_config.m_keys[i] == key) { - m_config.m_keys.RemoveAt(i); + m_config.m_keys.erase(m_config.m_keys.begin() + i); found = true; break; } @@ -862,4 +862,4 @@ void cellAudio_init() cellAudio.AddFunc(0xdab029aa, cellAudioAddData); cellAudio.AddFunc(0xe4046afe, cellAudioGetPortBlockTag); cellAudio.AddFunc(0xff3626fd, cellAudioRemoveNotifyEventQueue); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp index 530a074f29..6eb58a61bb 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp @@ -164,7 +164,11 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m //Decode PNG file. (TODO: Is there any faster alternative? Can we do it without external libraries?) int width, height, actual_components; - std::shared_ptr image(stbi_load_from_memory(png.GetPtr(), fileSize, &width, &height, &actual_components, 4)); + auto image = std::unique_ptr + ( + stbi_load_from_memory(png.GetPtr(), fileSize, &width, &height, &actual_components, 4), + &::free + ); if (!image) return CELL_PNGDEC_ERROR_STREAM_FORMAT; uint image_size = width * height; diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index 32581f3567..6144c7cce3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -148,7 +148,7 @@ u32 vdecOpen(VideoDecoder* data) continue; } - if (vdec.frames.GetCount() >= 50) + if (vdec.frames.GetSize() >= 50) { Sleep(1); continue; @@ -803,4 +803,4 @@ void cellVdec_init() av_register_all(); avcodec_register_all(); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp index 557148cf61..84c2e410e3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp @@ -97,7 +97,7 @@ int cellVpostExec(u32 handle, const u32 inPicBuff_addr, const mem_ptr_tinWidth; + s32 w = ctrlParam->inWidth; u32 h = ctrlParam->inHeight; u32 ow = ctrlParam->outWidth; u32 oh = ctrlParam->outHeight; @@ -193,7 +193,7 @@ int cellVpostExec(u32 handle, const u32 inPicBuff_addr, const mem_ptr_t(ow*4), 0, 0, 0 }; sws_scale(sws, in_data, in_line, 0, h, out_data, out_line); @@ -225,4 +225,4 @@ void cellVpost_init() cellVpost.AddFunc(0x40524325, cellVpostOpenEx); cellVpost.AddFunc(0x10ef39f6, cellVpostClose); cellVpost.AddFunc(0xabb8cc3d, cellVpostExec); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp index ec37e7592b..a49aeba4b8 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp @@ -51,12 +51,12 @@ int sceNpDrmIsAvailable(u32 k_licensee_addr, u32 drm_path_addr) sceNp.Warning("sceNpDrmIsAvailable: Can't find RAP file for DRM!"); else { - Array entries = raps_dir->GetEntries(); - for (unsigned int i = 0; i < entries.GetCount(); i++) + const std::vector &entries = raps_dir->GetEntries(); + for (auto &entry: entries) { - if (entries[i].name.find(fmt::ToUTF8(titleID)) != std::string::npos ) + if (entry.name.find(fmt::ToUTF8(titleID)) != std::string::npos ) { - rap_file_path += fmt::FromUTF8(entries[i].name); + rap_file_path += fmt::FromUTF8(entry.name); break; } } diff --git a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp index 754d7e49eb..03f2c3ba30 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp @@ -80,7 +80,11 @@ s32 getLastError() return errno; #endif } - +#ifdef _WIN32 +using pck_len_t = s32; +#else +using pck_len_t = u32; +#endif // Functions int sys_net_accept(s32 s, mem_ptr_t addr, mem32_t paddrlen) @@ -89,7 +93,7 @@ int sys_net_accept(s32 s, mem_ptr_t addr, mem32_t paddrlen) sockaddr _addr; memcpy(&_addr, Memory.VirtualToRealAddr(addr.GetAddr()), sizeof(sockaddr)); _addr.sa_family = addr->sa_family; - s32 *_paddrlen = (s32 *)Memory.VirtualToRealAddr(paddrlen.GetAddr()); + pck_len_t *_paddrlen = (pck_len_t *) Memory.VirtualToRealAddr(paddrlen.GetAddr()); int ret = accept(s, &_addr, _paddrlen); g_lastError = getLastError(); return ret; @@ -227,7 +231,7 @@ int sys_net_recvfrom(s32 s, u32 buf_addr, u32 len, s32 flags, mem_ptr_tsa_family; - s32 *_paddrlen = (s32 *)Memory.VirtualToRealAddr(paddrlen.GetAddr()); + pck_len_t *_paddrlen = (pck_len_t *) Memory.VirtualToRealAddr(paddrlen.GetAddr()); int ret = recvfrom(s, _buf_addr, len, flags, &_addr, _paddrlen); g_lastError = getLastError(); return ret; diff --git a/rpcs3/Emu/SysCalls/SC_FUNC.h b/rpcs3/Emu/SysCalls/SC_FUNC.h index c77c80af7b..c03ed9ec76 100644 --- a/rpcs3/Emu/SysCalls/SC_FUNC.h +++ b/rpcs3/Emu/SysCalls/SC_FUNC.h @@ -1,8 +1,14 @@ #pragma once -#include "Modules.h" #define RESULT(x) SC_ARGS_1 = (x) +class func_caller +{ +public: + virtual void operator()() = 0; +}; + + template struct get_arg; diff --git a/rpcs3/Emu/SysCalls/Static.cpp b/rpcs3/Emu/SysCalls/Static.cpp index b635da2660..17ff68f413 100644 --- a/rpcs3/Emu/SysCalls/Static.cpp +++ b/rpcs3/Emu/SysCalls/Static.cpp @@ -3,7 +3,7 @@ #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" -extern ArrayF g_static_funcs_list; +extern std::vector g_static_funcs_list; void StaticAnalyse(void* ptr, u32 size, u32 base) { @@ -15,13 +15,13 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) // TODO: optimize search for (u32 i = 0; i < size; i++) { - for (u32 j = 0; j < g_static_funcs_list.GetCount(); j++) + for (u32 j = 0; j < g_static_funcs_list.size(); j++) { - if ((data[i] & g_static_funcs_list[j].ops[0].mask) == g_static_funcs_list[j].ops[0].crc) + if ((data[i] & g_static_funcs_list[j]->ops[0].mask) == g_static_funcs_list[j]->ops[0].crc) { bool found = true; u32 can_skip = 0; - for (u32 k = i, x = 0; x + 1 <= g_static_funcs_list[j].ops.GetCount(); k++, x++) + for (u32 k = i, x = 0; x + 1 <= g_static_funcs_list[j]->ops.size(); k++, x++) { if (k >= size) { @@ -36,8 +36,8 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) continue; } - const u32 mask = g_static_funcs_list[j].ops[x].mask; - const u32 crc = g_static_funcs_list[j].ops[x].crc; + const u32 mask = g_static_funcs_list[j]->ops[x].mask; + const u32 crc = g_static_funcs_list[j]->ops[x].crc; if (!mask) { @@ -83,8 +83,8 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) } if (found) { - ConLog.Write("Function '%s' hooked (addr=0x%x)", g_static_funcs_list[j].name, i * 4 + base); - g_static_funcs_list[j].found++; + ConLog.Write("Function '%s' hooked (addr=0x%x)", g_static_funcs_list[j]->name, i * 4 + base); + g_static_funcs_list[j]->found++; data[i+0] = re32(0x39600000 | j); // li r11, j data[i+1] = se32(0x44000003); // sc 3 data[i+2] = se32(0x4e800020); // blr @@ -95,11 +95,11 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) } // check function groups - for (u32 i = 0; i < g_static_funcs_list.GetCount(); i++) + for (u32 i = 0; i < g_static_funcs_list.size(); i++) { - if (g_static_funcs_list[i].found) // start from some group + if (g_static_funcs_list[i]->found) // start from some group { - const u64 group = g_static_funcs_list[i].group; + const u64 group = g_static_funcs_list[i]->group; enum GroupSearchResult : u32 { @@ -110,24 +110,24 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) u32 res = GSR_SUCCESS; // analyse - for (u32 j = 0; j < g_static_funcs_list.GetCount(); j++) if (g_static_funcs_list[j].group == group) + for (u32 j = 0; j < g_static_funcs_list.size(); j++) if (g_static_funcs_list[j]->group == group) { - u32 count = g_static_funcs_list[j].found; + u32 count = g_static_funcs_list[j]->found; if (count == 0) // not found { // check if this function has been found with different pattern - for (u32 k = 0; k < g_static_funcs_list.GetCount(); k++) if (g_static_funcs_list[k].group == group) + for (u32 k = 0; k < g_static_funcs_list.size(); k++) if (g_static_funcs_list[k]->group == group) { - if (k != j && g_static_funcs_list[k].ptr == g_static_funcs_list[j].ptr) + if (k != j && g_static_funcs_list[k]->ptr == g_static_funcs_list[j]->ptr) { - count += g_static_funcs_list[k].found; + count += g_static_funcs_list[k]->found; } } if (count == 0) { res |= GSR_MISSING; - ConLog.Error("Function '%s' not found", g_static_funcs_list[j].name); + ConLog.Error("Function '%s' not found", g_static_funcs_list[j]->name); } else if (count > 1) { @@ -137,14 +137,14 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) else if (count == 1) // found { // ensure that this function has NOT been found with different pattern - for (u32 k = 0; k < g_static_funcs_list.GetCount(); k++) if (g_static_funcs_list[k].group == group) + for (u32 k = 0; k < g_static_funcs_list.size(); k++) if (g_static_funcs_list[k]->group == group) { - if (k != j && g_static_funcs_list[k].ptr == g_static_funcs_list[j].ptr) + if (k != j && g_static_funcs_list[k]->ptr == g_static_funcs_list[j]->ptr) { - if (g_static_funcs_list[k].found) + if (g_static_funcs_list[k]->found) { res |= GSR_EXCESS; - ConLog.Error("Function '%s' hooked twice", g_static_funcs_list[j].name); + ConLog.Error("Function '%s' hooked twice", g_static_funcs_list[j]->name); } } } @@ -152,14 +152,14 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) else { res |= GSR_EXCESS; - ConLog.Error("Function '%s' hooked twice", g_static_funcs_list[j].name); + ConLog.Error("Function '%s' hooked twice", g_static_funcs_list[j]->name); } } // clear data - for (u32 j = 0; j < g_static_funcs_list.GetCount(); j++) + for (u32 j = 0; j < g_static_funcs_list.size(); j++) { - if (g_static_funcs_list[j].group == group) g_static_funcs_list[j].found = 0; + if (g_static_funcs_list[j]->group == group) g_static_funcs_list[j]->found = 0; } char name[9] = "????????"; @@ -182,9 +182,9 @@ void StaticAnalyse(void* ptr, u32 size, u32 base) void StaticExecute(u32 code) { - if (code < g_static_funcs_list.GetCount()) + if (code < g_static_funcs_list.size()) { - (*g_static_funcs_list[code].func)(); + (*g_static_funcs_list[code]->func)(); } else { @@ -194,5 +194,5 @@ void StaticExecute(u32 code) void StaticFinalize() { - g_static_funcs_list.Clear(); -} \ No newline at end of file + g_static_funcs_list.clear(); +} diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp index 246d597e88..26b4da0617 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp @@ -77,7 +77,7 @@ int sys_event_queue_destroy(u32 equeue_id, int mode) eq->sq.m_mutex.lock(); eq->owner.lock(tid); // check if some threads are waiting for an event - if (!mode && eq->sq.list.GetCount()) + if (!mode && eq->sq.list.size()) { eq->owner.unlock(tid); eq->sq.m_mutex.unlock(); @@ -85,7 +85,7 @@ int sys_event_queue_destroy(u32 equeue_id, int mode) } eq->owner.unlock(tid, ~0); eq->sq.m_mutex.unlock(); - while (eq->sq.list.GetCount()) + while (eq->sq.list.size()) { Sleep(1); if (Emu.IsStopped()) @@ -138,7 +138,7 @@ int sys_event_queue_tryreceive(u32 equeue_id, mem_ptr_t event_ar eq->sq.m_mutex.lock(); eq->owner.lock(tid); - if (eq->sq.list.GetCount()) + if (eq->sq.list.size()) { number = 0; eq->owner.unlock(tid); diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.cpp index 4caf1c1d6f..577b0b3369 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.cpp @@ -50,7 +50,7 @@ int sys_event_flag_destroy(u32 eflag_id) EventFlag* ef; if(!sys_event_flag.CheckId(eflag_id, ef)) return CELL_ESRCH; - if (ef->waiters.GetCount()) // ??? + if (ef->waiters.size()) // ??? { return CELL_EBUSY; } @@ -89,7 +89,7 @@ int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 { SMutexLocker lock(ef->m_mutex); - if (ef->m_type == SYS_SYNC_WAITER_SINGLE && ef->waiters.GetCount() > 0) + if (ef->m_type == SYS_SYNC_WAITER_SINGLE && ef->waiters.size() > 0) { return CELL_EPERM; } @@ -97,13 +97,13 @@ int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 rec.bitptn = bitptn; rec.mode = mode; rec.tid = tid; - ef->waiters.AddCpy(rec); + ef->waiters.push_back(rec); if (ef->check() == tid) { u64 flags = ef->flags; - ef->waiters.RemoveAt(ef->waiters.GetCount() - 1); + ef->waiters.erase(ef->waiters.end() - 1); if (mode & SYS_EVENT_FLAG_WAIT_CLEAR) { @@ -141,11 +141,11 @@ int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 u64 flags = ef->flags; - for (u32 i = 0; i < ef->waiters.GetCount(); i++) + for (u32 i = 0; i < ef->waiters.size(); i++) { if (ef->waiters[i].tid == tid) { - ef->waiters.RemoveAt(i); + ef->waiters.erase(ef->waiters.begin() +i); if (mode & SYS_EVENT_FLAG_WAIT_CLEAR) { @@ -179,11 +179,11 @@ int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 { SMutexLocker lock(ef->m_mutex); - for (u32 i = 0; i < ef->waiters.GetCount(); i++) + for (u32 i = 0; i < ef->waiters.size(); i++) { if (ef->waiters[i].tid == tid) { - ef->waiters.RemoveAt(i); + ef->waiters.erase(ef->waiters.begin() + i); break; } } @@ -300,19 +300,19 @@ int sys_event_flag_cancel(u32 eflag_id, mem32_t num) EventFlag* ef; if(!sys_event_flag.CheckId(eflag_id, ef)) return CELL_ESRCH; - Array tids; + std::vector tids; { SMutexLocker lock(ef->m_mutex); - tids.SetCount(ef->waiters.GetCount()); - for (u32 i = 0; i < ef->waiters.GetCount(); i++) + tids.resize(ef->waiters.size()); + for (u32 i = 0; i < ef->waiters.size(); i++) { tids[i] = ef->waiters[i].tid; } - ef->waiters.Clear(); + ef->waiters.clear(); } - for (u32 i = 0; i < tids.GetCount(); i++) + for (u32 i = 0; i < tids.size(); i++) { if (Emu.IsStopped()) break; ef->signal.lock(tids[i]); @@ -326,7 +326,7 @@ int sys_event_flag_cancel(u32 eflag_id, mem32_t num) if (num.IsGood()) { - num = tids.GetCount(); + num = tids.size(); return CELL_OK; } @@ -352,4 +352,4 @@ int sys_event_flag_get(u32 eflag_id, mem64_t flags) flags = ef->flags; // ??? return CELL_OK; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.h b/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.h index 97209f335a..4cc1539d8d 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.h +++ b/rpcs3/Emu/SysCalls/lv2/SC_Event_flag.h @@ -33,7 +33,7 @@ struct EventFlag { SMutex m_mutex; u64 flags; - Array waiters; + std::vector waiters; SMutex signal; const u32 m_protocol; const int m_type; @@ -51,7 +51,7 @@ struct EventFlag u32 target = 0; - for (u32 i = 0; i < waiters.GetCount(); i++) + for (u32 i = 0; i < waiters.size(); i++) { if (((waiters[i].mode & SYS_EVENT_FLAG_WAIT_AND) && (flags & waiters[i].bitptn) == waiters[i].bitptn) || ((waiters[i].mode & SYS_EVENT_FLAG_WAIT_OR) && (flags & waiters[i].bitptn))) @@ -61,7 +61,7 @@ struct EventFlag target = waiters[i].tid; break; } - sq.list.AddCpy(waiters[i].tid); + sq.list.push_back(waiters[i].tid); } } @@ -72,4 +72,4 @@ struct EventFlag return target; } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp index 6954c45158..5677f5b75f 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp @@ -228,11 +228,11 @@ int sys_lwcond_wait(mem_ptr_t lwcond, u64 timeout) switch (mutex->lock(tid, 0)) { case CELL_OK: break; - case CELL_EDEADLK: sys_lwcond.Warning("sys_lwcond_wait(id=%d): associated mutex was locked", + case static_cast(CELL_EDEADLK): sys_lwcond.Warning("sys_lwcond_wait(id=%d): associated mutex was locked", (u32)lwcond->lwcond_queue); return CELL_OK; - case CELL_ESRCH: sys_lwcond.Warning("sys_lwcond_wait(id=%d): associated mutex not found (%d)", + case static_cast(CELL_ESRCH): sys_lwcond.Warning("sys_lwcond_wait(id=%d): associated mutex not found (%d)", (u32)lwcond->lwcond_queue, (u32)mutex->sleep_queue); return CELL_ESRCH; - case CELL_EINVAL: goto abort; + case static_cast(CELL_EINVAL): goto abort; } mutex->recursive_count = 1; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp index 4b0d480395..78d8372765 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp @@ -100,7 +100,7 @@ int sys_lwmutex_unlock(mem_ptr_t lwmutex) void SleepQueue::push(u32 tid) { std::lock_guard lock(m_mutex); - list.AddCpy(tid); + list.push_back(tid); } u32 SleepQueue::pop() // SYS_SYNC_FIFO @@ -109,10 +109,10 @@ u32 SleepQueue::pop() // SYS_SYNC_FIFO while (true) { - if (list.GetCount()) + if (list.size()) { u32 res = list[0]; - list.RemoveAt(0); + list.erase(list.begin()); if (res && Emu.GetIdManager().CheckID(res)) // check thread { @@ -129,11 +129,11 @@ u32 SleepQueue::pop_prio() // SYS_SYNC_PRIORITY while (true) { - if (list.GetCount()) + if (list.size()) { u32 highest_prio = ~0; u32 sel = 0; - for (u32 i = 0; i < list.GetCount(); i++) + for (u32 i = 0; i < list.size(); i++) { CPUThread* t = Emu.GetCPU().GetThread(list[i]); if (!t) @@ -150,7 +150,7 @@ u32 SleepQueue::pop_prio() // SYS_SYNC_PRIORITY } } u32 res = list[sel]; - list.RemoveAt(sel); + list.erase(list.begin() + sel); /* if (Emu.GetIdManager().CheckID(res)) */ if (res) // check thread @@ -173,11 +173,11 @@ bool SleepQueue::invalidate(u32 tid) { std::lock_guard lock(m_mutex); - if (tid) for (u32 i = 0; i < list.GetCount(); i++) + if (tid) for (u32 i = 0; i < list.size(); i++) { if (list[i] == tid) { - list.RemoveAt(i); + list.erase(list.begin() + i); return true; } } @@ -189,7 +189,7 @@ bool SleepQueue::finalize() { if (!m_mutex.try_lock()) return false; - for (u32 i = 0; i < list.GetCount(); i++) + for (u32 i = 0; i < list.size(); i++) { if (list[i]) { @@ -299,7 +299,7 @@ int sys_lwmutex_t::lock(be_t tid, u64 timeout) { switch (int res = trylock(tid)) { - case CELL_EBUSY: break; + case static_cast(CELL_EBUSY): break; default: return res; } diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h index 2fa724b52d..1239593bee 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h @@ -46,7 +46,7 @@ struct SleepQueue u64 prio; q_rec(u32 tid, u64 prio): tid(tid), prio(prio) {} }; */ - Array list; + std::vector list; std::mutex m_mutex; u64 m_name; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Mutex.h b/rpcs3/Emu/SysCalls/lv2/SC_Mutex.h index 735f20a240..0c30fe3e66 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Mutex.h +++ b/rpcs3/Emu/SysCalls/lv2/SC_Mutex.h @@ -44,11 +44,11 @@ struct Mutex if (!m_queue.m_mutex.try_lock()) return; - for (u32 i = 0; i < m_queue.list.GetCount(); i++) + for (u32 i = 0; i < m_queue.list.size(); i++) { if (u32 owner = m_queue.list[i]) ConLog.Write("Mutex(%d) was waited by thread %d", id, owner); } m_queue.m_mutex.unlock(); } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.cpp index 2ca6ac53d3..d69d224b85 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.cpp @@ -42,7 +42,7 @@ int sys_rwlock_destroy(u32 rw_lock_id) std::lock_guard lock(rw->m_lock); - if (rw->wlock_queue.GetCount() || rw->rlock_list.GetCount() || rw->wlock_thread) return CELL_EBUSY; + if (rw->wlock_queue.size() || rw->rlock_list.size() || rw->wlock_thread) return CELL_EBUSY; Emu.GetIdManager().RemoveID(rw_lock_id); diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.h b/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.h index dc9c563b6d..c80baa9606 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.h +++ b/rpcs3/Emu/SysCalls/lv2/SC_Rwlock.h @@ -20,8 +20,8 @@ struct RWLock { std::mutex m_lock; // internal lock u32 wlock_thread; // write lock owner - Array wlock_queue; // write lock queue - Array rlock_list; // read lock list + std::vector wlock_queue; // write lock queue + std::vector rlock_list; // read lock list u32 m_protocol; // TODO union @@ -41,9 +41,9 @@ struct RWLock { std::lock_guard lock(m_lock); - if (!wlock_thread && !wlock_queue.GetCount()) + if (!wlock_thread && !wlock_queue.size()) { - rlock_list.AddCpy(tid); + rlock_list.push_back(tid); return true; } return false; @@ -53,11 +53,11 @@ struct RWLock { std::lock_guard lock(m_lock); - for (u32 i = rlock_list.GetCount() - 1; ~i; i--) + for (u32 i = rlock_list.size() - 1; ~i; i--) { if (rlock_list[i] == tid) { - rlock_list.RemoveAt(i); + rlock_list.erase(rlock_list.begin() + i); return true; } } @@ -72,7 +72,7 @@ struct RWLock { return false; // deadlock } - for (u32 i = rlock_list.GetCount() - 1; ~i; i--) + for (u32 i = rlock_list.size() - 1; ~i; i--) { if (rlock_list[i] == tid) { @@ -86,31 +86,31 @@ struct RWLock { std::lock_guard lock(m_lock); - if (wlock_thread || rlock_list.GetCount()) // already locked + if (wlock_thread || rlock_list.size()) // already locked { if (!enqueue) { return false; // do not enqueue } - for (u32 i = wlock_queue.GetCount() - 1; ~i; i--) + for (u32 i = wlock_queue.size() - 1; ~i; i--) { if (wlock_queue[i] == tid) { return false; // already enqueued } } - wlock_queue.AddCpy(tid); // enqueue new thread + wlock_queue.push_back(tid); // enqueue new thread return false; } else { - if (wlock_queue.GetCount()) + if (wlock_queue.size()) { // SYNC_FIFO only yet if (wlock_queue[0] == tid) { wlock_thread = tid; - wlock_queue.RemoveAt(0); + wlock_queue.erase(wlock_queue.begin()); return true; } else @@ -119,14 +119,14 @@ struct RWLock { return false; // do not enqueue } - for (u32 i = wlock_queue.GetCount() - 1; ~i; i--) + for (u32 i = wlock_queue.size() - 1; ~i; i--) { if (wlock_queue[i] == tid) { return false; // already enqueued } } - wlock_queue.AddCpy(tid); // enqueue new thread + wlock_queue.push_back(tid); // enqueue new thread return false; } } @@ -149,4 +149,4 @@ struct RWLock } return false; } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp b/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp index ba5c8023d8..8fd8550215 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp @@ -91,7 +91,7 @@ int sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t< } } - if(spu_num >= group_info->list.GetCount()) + if(spu_num >= group_info->list.size()) { return CELL_EINVAL; } @@ -204,7 +204,7 @@ int sys_spu_thread_group_destroy(u32 id) return CELL_EBUSY; } - for (u32 i = 0; i < group_info->list.GetCount(); i++) + for (u32 i = 0; i < group_info->list.size(); i++) { // TODO: disconnect all event ports @@ -228,7 +228,7 @@ int sys_spu_thread_group_start(u32 id) // TODO: check group state - for (u32 i = 0; i < group_info->list.GetCount(); i++) + for (u32 i = 0; i < group_info->list.size(); i++) { CPUThread* t; if (t = Emu.GetCPU().GetThread(group_info->list[i])) @@ -253,7 +253,7 @@ int sys_spu_thread_group_suspend(u32 id) // TODO: check group state - for (u32 i = 0; i < group_info->list.GetCount(); i++) + for (u32 i = 0; i < group_info->list.size(); i++) { if (CPUThread* t = Emu.GetCPU().GetThread(group_info->list[i])) { @@ -277,7 +277,7 @@ int sys_spu_thread_group_resume(u32 id) // TODO: check group state - for (u32 i = 0; i < group_info->list.GetCount(); i++) + for (u32 i = 0; i < group_info->list.size(); i++) { if (CPUThread* t = Emu.GetCPU().GetThread(group_info->list[i])) { @@ -331,7 +331,7 @@ int sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status) cause = SYS_SPU_THREAD_GROUP_JOIN_ALL_THREADS_EXIT; status = 0; //unspecified because of ALL_THREADS_EXIT - for (u32 i = 0; i < group_info->list.GetCount(); i++) + for (u32 i = 0; i < group_info->list.size(); i++) { while (CPUThread* t = Emu.GetCPU().GetThread(group_info->list[i])) { @@ -725,7 +725,7 @@ int sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq, u64 req, u32 } /* - for(u32 i=0; ilist.GetCount(); ++i) + for(u32 i=0; ilist.size(); ++i) { CPUThread* t; if(t = Emu.GetCPU().GetThread(group->list[i])) @@ -754,4 +754,4 @@ int sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup) sc_spu.Error("sys_spu_thread_group_disconnect_event_all_threads(id=%d, spup=%d)", id, spup); return CELL_OK; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.h b/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.h index 3c7d320ed7..12f07ef1d7 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.h +++ b/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.h @@ -58,7 +58,7 @@ struct sys_spu_segment struct SpuGroupInfo { - Array list; + std::vector list; std::atomic lock; std::string m_name; int m_prio; @@ -73,10 +73,10 @@ struct SpuGroupInfo , lock(0) { num = 256; - list.SetCount(num); + list.resize(num); for (u32 i = 0; i < num; i++) { list[i] = 0; } } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index afe861905f..40507556c1 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -32,10 +32,10 @@ Emulator::Emulator() void Emulator::Init() { - while(m_modules_init.GetCount()) + while(m_modules_init.size()) { - m_modules_init[0].Init(); - m_modules_init.RemoveAt(0); + m_modules_init[0]->Init(); + m_modules_init.erase(m_modules_init.begin()); } //if(m_memory_viewer) m_memory_viewer->Close(); //m_memory_viewer = new MemoryViewerPanel(wxGetApp().m_MainFrame); @@ -54,17 +54,17 @@ void Emulator::SetTitleID(const std::string& id) void Emulator::CheckStatus() { - ArrayF& threads = GetCPU().GetThreads(); - if(!threads.GetCount()) + std::vector& threads = GetCPU().GetThreads(); + if(!threads.size()) { Stop(); return; } bool IsAllPaused = true; - for(u32 i=0; iIsPaused()) continue; IsAllPaused = false; break; } @@ -76,9 +76,9 @@ void Emulator::CheckStatus() } bool IsAllStoped = true; - for(u32 i=0; iIsStopped()) continue; IsAllStoped = false; break; } @@ -147,9 +147,9 @@ void Emulator::Load() ConLog.SkipLn(); ConLog.Write("Mount info:"); - for(uint i=0; i %s", m_vfs.m_devices[i].GetPs3Path().c_str(), m_vfs.m_devices[i].GetLocalPath().c_str()); + ConLog.Write("%s -> %s", m_vfs.m_devices[i]->GetPs3Path().c_str(), m_vfs.m_devices[i]->GetLocalPath().c_str()); } ConLog.SkipLn(); @@ -377,8 +377,8 @@ void Emulator::Stop() m_rsx_callback = 0; SavePoints(BreakPointsDBName); - m_break_points.Clear(); - m_marked_points.Clear(); + m_break_points.clear(); + m_marked_points.clear(); m_vfs.UnMountAll(); @@ -407,8 +407,8 @@ void Emulator::SavePoints(const std::string& path) { std::ofstream f(path, std::ios::binary | std::ios::trunc); - u32 break_count = m_break_points.GetCount(); - u32 marked_count = m_marked_points.GetCount(); + u32 break_count = m_break_points.size(); + u32 marked_count = m_marked_points.size(); f << bpdb_version << break_count << marked_count; @@ -447,13 +447,13 @@ void Emulator::LoadPoints(const std::string& path) if(break_count > 0) { - m_break_points.SetCount(break_count); + m_break_points.resize(break_count); f.read(reinterpret_cast(&m_break_points[0]), sizeof(u64) * break_count); } if(marked_count > 0) { - m_marked_points.SetCount(marked_count); + m_marked_points.resize(marked_count); f.read(reinterpret_cast(&m_marked_points[0]), sizeof(u64) * marked_count); } } diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index d963e6d0e5..b6b5445e17 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -76,10 +76,10 @@ class Emulator u32 m_ppu_thr_exit; MemoryViewerPanel* m_memory_viewer; //ArrayF m_cpu_threads; - ArrayF m_modules_init; + std::vector m_modules_init; - Array m_break_points; - Array m_marked_points; + std::vector m_break_points; + std::vector m_marked_points; CPUThreadManager m_thread_manager; PadManager m_pad_manager; @@ -118,14 +118,14 @@ public: AudioManager& GetAudioManager() { return m_audio_manager; } CallbackManager& GetCallbackManager() { return m_callback_manager; } VFS& GetVFS() { return m_vfs; } - Array& GetBreakPoints() { return m_break_points; } - Array& GetMarkedPoints() { return m_marked_points; } + std::vector& GetBreakPoints() { return m_break_points; } + std::vector& GetMarkedPoints() { return m_marked_points; } CPUThread& GetCallbackThread() { return *m_ppu_callback_thr; } EventManager& GetEventManager() { return *m_event_manager; } void AddModuleInit(ModuleInitializer* m) { - m_modules_init.Add(m); + m_modules_init.push_back(m); } void SetTLSData(const u64 addr, const u64 filesz, const u64 memsz) @@ -162,4 +162,4 @@ public: __forceinline bool IsReady() const { return m_status == Ready; } }; -extern Emulator Emu; \ No newline at end of file +extern Emulator Emu; diff --git a/rpcs3/Emu/event.h b/rpcs3/Emu/event.h index 6d1df5cf0f..a9a3630c45 100644 --- a/rpcs3/Emu/event.h +++ b/rpcs3/Emu/event.h @@ -69,7 +69,7 @@ struct EventPort class EventRingBuffer { - Array data; + std::vector data; SMutex m_lock; u32 buf_pos; u32 buf_count; @@ -82,7 +82,7 @@ public: , buf_pos(0) , buf_count(0) { - data.SetCount(size); + data.resize(size); } void clear() @@ -151,7 +151,7 @@ public: class EventPortList { - Array data; + std::vector data; SMutex m_lock; public: @@ -159,28 +159,28 @@ public: void clear() { SMutexLocker lock(m_lock); - for (u32 i = 0; i < data.GetCount(); i++) + for (u32 i = 0; i < data.size(); i++) { SMutexLocker lock2(data[i]->mutex); data[i]->eq = nullptr; // force all ports to disconnect } - data.Clear(); + data.clear(); } void add(EventPort* port) { SMutexLocker lock(m_lock); - data.AddCpy(port); + data.push_back(port); } void remove(EventPort* port) { SMutexLocker lock(m_lock); - for (u32 i = 0; i < data.GetCount(); i++) + for (u32 i = 0; i < data.size(); i++) { if (data[i] == port) { - data.RemoveAt(i); + data.erase(data.begin() + i); return; } } @@ -226,4 +226,4 @@ public: bool GetEventQueue(u64 key, EventQueue*& data); bool UnregisterKey(u64 key); bool SendEvent(u64 key, u64 source, u64 d1, u64 d2, u64 d3); -}; \ No newline at end of file +}; diff --git a/rpcs3/Gui/ConLog.cpp b/rpcs3/Gui/ConLog.cpp index ef68f84a9f..9632e02256 100644 --- a/rpcs3/Gui/ConLog.cpp +++ b/rpcs3/Gui/ConLog.cpp @@ -46,7 +46,7 @@ struct _LogBuffer : public MTPacketBuffer const u32 stext = data.m_text.length(); const u32 scolour = data.m_colour.length(); - m_buffer.Reserve( + m_buffer.resize( m_buffer.size() + sizeof(u32) + sprefix + sizeof(u32) + stext + sizeof(u32) + scolour); diff --git a/rpcs3/Gui/DisAsmFrame.cpp b/rpcs3/Gui/DisAsmFrame.cpp index aa365cbb8f..997981bade 100644 --- a/rpcs3/Gui/DisAsmFrame.cpp +++ b/rpcs3/Gui/DisAsmFrame.cpp @@ -104,8 +104,8 @@ void DisAsmFrame::Resume() #include #include "Loader/ELF.h" -Array* shdr_arr_64 = NULL; -Array* shdr_arr_32 = NULL; +std::vector* shdr_arr_64 = NULL; +std::vector* shdr_arr_32 = NULL; ELF64Loader* l_elf64 = NULL; ELF32Loader* l_elf32 = NULL; bool ElfType64 = false; @@ -135,7 +135,7 @@ public: *done = false; - if(Emu.GetCPU().GetThreads()[0].GetType() != CPU_THREAD_PPU) + if(Emu.GetCPU().GetThreads()[0]->GetType() != CPU_THREAD_PPU) { SPUDisAsm& dis_asm = *new SPUDisAsm(CPUDisAsm_DumpMode); decoder = new SPUDecoder(dis_asm); @@ -153,7 +153,7 @@ public: { ConLog.Write("Start dump in thread %d!", (int)id); const u32 max_value = prog_dial->GetMaxValue(id); - const u32 shdr_count = ElfType64 ? shdr_arr_64->GetCount() : shdr_arr_32->GetCount(); + const u32 shdr_count = ElfType64 ? shdr_arr_64->size() : shdr_arr_32->size(); for(u32 sh=0, vsize=0; shGetCount() : shdr_arr_32->GetCount(); + const u32 shdr_count = ElfType64 ? shdr_arr_64->size() : shdr_arr_32->size(); for(uint sh=0, counter=0; shshdr_name_arr; shdr_arr_64 = &l_elf64->shdr_arr; - if(l_elf64->shdr_arr.GetCount() <= 0) return; + if(l_elf64->shdr_arr.size() <= 0) return; break; case CLASS_ELF32: @@ -334,7 +334,7 @@ void DisAsmFrame::Dump(wxCommandEvent& WXUNUSED(event)) name_arr = l_elf32->shdr_name_arr; shdr_arr_32 = &l_elf32->shdr_arr; - if(l_elf32->shdr_arr.GetCount() <= 0) return; + if(l_elf32->shdr_arr.size() <= 0) return; break; default: ConLog.Error("Corrupted ELF!"); return; @@ -343,7 +343,7 @@ void DisAsmFrame::Dump(wxCommandEvent& WXUNUSED(event)) PPCDisAsm* disasm; PPCDecoder* decoder; - switch(Emu.GetCPU().GetThreads()[0].GetType()) + switch(Emu.GetCPU().GetThreads()[0]->GetType()) { case CPU_THREAD_PPU: { @@ -363,7 +363,7 @@ void DisAsmFrame::Dump(wxCommandEvent& WXUNUSED(event)) break; } - const u32 shdr_count = ElfType64 ? shdr_arr_64->GetCount() : shdr_arr_32->GetCount(); + const u32 shdr_count = ElfType64 ? shdr_arr_64->size() : shdr_arr_32->size(); u64 max_count = 0; for(u32 sh=0; shDeleteAllItems(); - m_func_name.Clear(); - m_func_id.Clear(); + m_func_name.clear(); + m_func_id.clear(); event.Skip(); } @@ -82,8 +81,8 @@ void FnIdGenerator::PrintId() return; const be_t result = GenerateFnId(func_name); - m_func_name.AddCpy(func_name); - m_func_id.AddCpy(result); + m_func_name.push_back(func_name); + m_func_id.push_back(result); ConLog.Write("Function: %s, Id: 0x%08x ", func_name.c_str(), result); UpdateInformation(); @@ -93,9 +92,9 @@ void FnIdGenerator::UpdateInformation() { m_list->DeleteAllItems(); - for(u32 i = 0; i < m_func_name.GetCount(); i++) + for(u32 i = 0; i < m_func_name.size(); i++) { - m_list->InsertItem(m_func_name.GetCount(), wxEmptyString); + m_list->InsertItem(m_func_name.size(), wxEmptyString); m_list->SetItem(i, 0, m_func_name[i]); m_list->SetItem(i, 1, wxString::Format("0x%08x", re(m_func_id[i]))); } diff --git a/rpcs3/Gui/FnIdGenerator.h b/rpcs3/Gui/FnIdGenerator.h index 4f9eebcf9f..e745e9ddd0 100644 --- a/rpcs3/Gui/FnIdGenerator.h +++ b/rpcs3/Gui/FnIdGenerator.h @@ -5,8 +5,8 @@ class FnIdGenerator : public wxDialog { private: - Array m_func_name; - Array m_func_id; + std::vector m_func_name; + std::vector m_func_id; wxListView* m_list; public: diff --git a/rpcs3/Gui/GameViewer.h b/rpcs3/Gui/GameViewer.h index 3a8bd61c68..1076ec3be5 100644 --- a/rpcs3/Gui/GameViewer.h +++ b/rpcs3/Gui/GameViewer.h @@ -28,22 +28,22 @@ struct Column struct ColumnsArr { - ArrayF m_columns; + std::vector m_columns; ColumnsArr() { Init(); } - ArrayF* GetSortedColumnsByPos() + std::vector* GetSortedColumnsByPos() { - static ArrayF& arr = *new ArrayF(); arr.ClearF(); - for(u32 pos=0; pos arr; arr.clear(); + for(u32 pos=0; pospos != pos) continue; + arr.push_back(m_columns[c]); } } @@ -52,16 +52,16 @@ struct ColumnsArr Column* GetColumnByPos(u32 pos) { - ArrayF& columns = *GetSortedColumnsByPos(); - for(u32 c=0; c& columns = *GetSortedColumnsByPos(); + for(u32 c=0; cshown) { pos++; continue; } - if(columns[c].pos != pos) continue; - return &columns[c]; + if(columns[c]->pos != pos) continue; + return columns[c]; } return NULL; @@ -77,9 +77,9 @@ public: void Init() { - m_columns.Clear(); + m_columns.clear(); - #define ADD_COLUMN(x, w, n) x = new Column(m_columns.GetCount(), w, n); m_columns.Add(x); + #define ADD_COLUMN(x, w, n) x = new Column(m_columns.size(), w, n); m_columns.push_back(x); ADD_COLUMN(m_col_name, 160, "Name"); ADD_COLUMN(m_col_serial, 85, "Serial"); ADD_COLUMN(m_col_fw, 55, "FW"); @@ -98,7 +98,7 @@ public: m_col_category->data.clear(); m_col_path->data.clear(); - if(m_columns.GetCount() == 0) return; + if(m_columns.size() == 0) return; for(const auto& game : game_data) { @@ -114,11 +114,11 @@ public: void Show(wxListView* list) { list->DeleteAllColumns(); - ArrayF& c_col = *GetSortedColumnsByPos(); - for(u32 i=0, c=0; i& c_col = *GetSortedColumnsByPos(); + for(u32 i=0, c=0; iInsertColumn(c++, fmt::FromUTF8(c_col[i].name), 0, c_col[i].width); + if(!c_col[i]->shown) continue; + list->InsertColumn(c++, fmt::FromUTF8(c_col[i]->name), 0, c_col[i]->width); } } @@ -158,30 +158,30 @@ public: #define ADD_COLUMN(v, dv, t, n, isshown) \ { \ IniEntry ini; \ - ini.Init(m_columns[i].name + "_" + n, path); \ - if(isLoad) m_columns[i].v = ini.LoadValue(dv); \ - else if(isshown ? m_columns[i].shown : 1) \ + ini.Init(m_columns[i]->name + "_" + n, path); \ + if(isLoad) m_columns[i]->v = ini.LoadValue(dv); \ + else if(isshown ? m_columns[i]->shown : 1) \ { \ - ini.SetValue(m_columns[i].v); \ + ini.SetValue(m_columns[i]->v); \ ini.Save(); \ } \ } - for(u32 i=0; idef_pos, int, "position", 1); + ADD_COLUMN(width, m_columns[i]->def_width, int, "width", 1); ADD_COLUMN(shown, true, bool, "shown", 0); } if(isLoad) { //check for errors - for(u32 c1=0; c1pos == m_columns[c2]->pos) { ConLog.Error("Columns loaded with error!"); Init(); @@ -190,12 +190,12 @@ public: } } - for(u32 p=0; ppos != p) continue; ishas = true; break; } @@ -237,4 +237,4 @@ public: private: virtual void DClick(wxListEvent& event); -}; \ No newline at end of file +}; diff --git a/rpcs3/Gui/InterpreterDisAsm.cpp b/rpcs3/Gui/InterpreterDisAsm.cpp index f240878ab7..94038ddd47 100644 --- a/rpcs3/Gui/InterpreterDisAsm.cpp +++ b/rpcs3/Gui/InterpreterDisAsm.cpp @@ -104,9 +104,9 @@ void InterpreterDisAsmFrame::UpdateUnitList() m_choice_units->Clear(); auto& thrs = Emu.GetCPU().GetThreads(); - for(uint i=0; iAppend(thrs[i].GetFName(), &thrs[i]); + m_choice_units->Append(thrs[i]->GetFName(), thrs[i]); } m_choice_units->Thaw(); @@ -274,7 +274,7 @@ void InterpreterDisAsmFrame::ShowAddr(const u64 addr) { colour = wxColour("White"); - for(u32 i=0; i mpc) remove_markedPC[i]--; } - Emu.GetMarkedPoints().RemoveAt(mpc); + Emu.GetMarkedPoints().erase(Emu.GetMarkedPoints().begin() + mpc); } m_list->SetColumnWidth(0, -1); @@ -456,7 +456,8 @@ void InterpreterDisAsmFrame::Show_Val(wxCommandEvent& WXUNUSED(event)) { u64 pc = CPU ? CPU->PC : 0x0; sscanf(p_pc->GetValue(), "%llx", &pc); - remove_markedPC.AddCpy(Emu.GetMarkedPoints().AddCpy(pc)); + Emu.GetMarkedPoints().push_back(pc); + remove_markedPC.push_back(Emu.GetMarkedPoints().size()-1); ShowAddr(CentrePc(pc)); } } @@ -551,7 +552,7 @@ void InterpreterDisAsmFrame::MouseWheel(wxMouseEvent& event) bool InterpreterDisAsmFrame::IsBreakPoint(u64 pc) { - for(u32 i=0; i remove_markedPC; + std::vector remove_markedPC; wxTextCtrl* m_regs; wxTextCtrl* m_calls; wxButton* m_btn_step; @@ -51,4 +51,4 @@ public: bool IsBreakPoint(u64 pc); void AddBreakPoint(u64 pc); bool RemoveBreakPoint(u64 pc); -}; \ No newline at end of file +}; diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 27617f42e4..c6e2338d30 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -669,7 +669,7 @@ void MainFrame::UpdateUI(wxCommandEvent& event) pause.Enable(!is_stopped); stop.Enable(!is_stopped); //send_exit.Enable(false); - bool enable_commands = !is_stopped && Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount(); + bool enable_commands = !is_stopped && Emu.GetCallbackManager().m_exit_callback.m_callbacks.size(); send_open_menu.SetItemLabel(wxString::Format("Send %s system menu cmd", (m_sys_menu_opened ? "close" : "open"))); send_open_menu.Enable(enable_commands); diff --git a/rpcs3/Gui/Plugins.h b/rpcs3/Gui/Plugins.h index 0cffa91ad2..b527a5c139 100644 --- a/rpcs3/Gui/Plugins.h +++ b/rpcs3/Gui/Plugins.h @@ -299,14 +299,14 @@ struct PluginsManager u32 type; }; - Array m_plugins; - ArrayF m_pad_plugins; + std::vector m_plugins; + std::vector m_pad_plugins; void Load(const wxString& path) { if(!wxDirExists(path)) return; - m_plugins.ClearD(); + m_plugins.clear(); wxDir dir(path); wxArrayString res; @@ -318,11 +318,11 @@ struct PluginsManager Ps3EmuPlugin l(res[i]); if(!l.Test()) continue; - PluginInfo& info = *new PluginInfo(); + m_plugins.emplace_back(); + PluginInfo& info = m_plugins.back(); info.path = res[i]; info.name.Printf("%s v%s", l.Ps3EmuLibGetFullName(), l.FormatVersion()); info.type = l.Ps3EmuLibGetType(); - m_plugins.Add(info); } } @@ -345,11 +345,11 @@ struct PluginsManager wxComboBox* cbox_pad_plugins; s_panel.Add(GetNewComboBox(&dial, "Pad", cbox_pad_plugins), wxSizerFlags().Border(wxALL, 5).Expand()); - for(u32 i=0; iAppend(m_plugins[i].name + " (" + wxFileName(m_plugins[i].path).GetName() + ")"); } } diff --git a/rpcs3/Loader/ELF32.cpp b/rpcs3/Loader/ELF32.cpp index a68a0c2ce1..82d849a4ec 100644 --- a/rpcs3/Loader/ELF32.cpp +++ b/rpcs3/Loader/ELF32.cpp @@ -129,10 +129,11 @@ bool ELF32Loader::LoadPhdrInfo() elf32_f.Seek(ehdr.e_phoff); for(uint i=0; iLoadLE(elf32_f); - else phdr->Load(elf32_f); - phdr_arr.Move(phdr); + phdr_arr.emplace_back(); + if(ehdr.IsLittleEndian()) + phdr_arr.back().LoadLE(elf32_f); + else + phdr_arr.back().Load(elf32_f); } if(/*!Memory.IsGoodAddr(entry)*/ entry & 0x1) @@ -141,7 +142,7 @@ bool ELF32Loader::LoadPhdrInfo() entry &= ~0x1; - for(size_t i=0; i= entry && entry < phdr_arr[i].p_paddr + phdr_arr[i].p_memsz) { @@ -160,31 +161,32 @@ bool ELF32Loader::LoadShdrInfo() elf32_f.Seek(ehdr.e_shoff); for(u32 i=0; iLoadLE(elf32_f); - else shdr->Load(elf32_f); - shdr_arr.Move(shdr); + shdr_arr.emplace_back(); + if(ehdr.IsLittleEndian()) + shdr_arr.back().LoadLE(elf32_f); + else + shdr_arr.back().Load(elf32_f); + } - if(ehdr.e_shstrndx >= shdr_arr.GetCount()) + if(ehdr.e_shstrndx >= shdr_arr.size()) { ConLog.Warning("LoadShdr32 error: shstrndx too big!"); return true; } - for(u32 i=0; i name; + std::string name; while(!elf32_f.Eof()) { char c; elf32_f.Read(&c, 1); if(c == 0) break; - name.AddCpy(c); + name.push_back(c); } - name.AddCpy('\0'); - shdr_name_arr.push_back(std::string(name.GetPtr())); + shdr_name_arr.push_back(name); } return true; @@ -204,7 +206,7 @@ bool ELF32Loader::LoadPhdrData(u64 _offset) { const u64 offset = machine == MACHINE_SPU ? _offset : 0; - for(u32 i=0; i shdr_name_arr; - Array shdr_arr; - Array phdr_arr; + std::vector shdr_arr; + std::vector phdr_arr; ELF32Loader(vfsStream& f); ~ELF32Loader() {Close();} @@ -309,4 +309,4 @@ private: void WriteEhdr(wxFile& f, Elf32_Ehdr& ehdr); void WritePhdr(wxFile& f, Elf32_Phdr& phdr); -void WriteShdr(wxFile& f, Elf32_Shdr& shdr); \ No newline at end of file +void WriteShdr(wxFile& f, Elf32_Shdr& shdr); diff --git a/rpcs3/Loader/ELF64.cpp b/rpcs3/Loader/ELF64.cpp index 2093b89790..665ec21019 100644 --- a/rpcs3/Loader/ELF64.cpp +++ b/rpcs3/Loader/ELF64.cpp @@ -129,7 +129,7 @@ bool ELF64Loader::LoadEhdrInfo(s64 offset) bool ELF64Loader::LoadPhdrInfo(s64 offset) { - phdr_arr.Clear(); + phdr_arr.clear(); if(ehdr.e_phoff == 0 && ehdr.e_phnum) { @@ -141,9 +141,8 @@ bool ELF64Loader::LoadPhdrInfo(s64 offset) for(u32 i=0; iLoad(elf64_f); - phdr_arr.Move(phdr); + phdr_arr.emplace_back(); + phdr_arr.back().Load(elf64_f); } return true; @@ -151,7 +150,7 @@ bool ELF64Loader::LoadPhdrInfo(s64 offset) bool ELF64Loader::LoadShdrInfo(s64 offset) { - shdr_arr.Clear(); + shdr_arr.clear(); shdr_name_arr.clear(); if(ehdr.e_shoff == 0 && ehdr.e_shnum) { @@ -162,30 +161,28 @@ bool ELF64Loader::LoadShdrInfo(s64 offset) elf64_f.Seek(offset < 0 ? ehdr.e_shoff : offset); for(u32 i=0; iLoad(elf64_f); - shdr_arr.Move(shdr); + shdr_arr.emplace_back(); + shdr_arr.back().Load(elf64_f); } - if(ehdr.e_shstrndx >= shdr_arr.GetCount()) + if(ehdr.e_shstrndx >= shdr_arr.size()) { ConLog.Warning("LoadShdr64 error: shstrndx too big!"); return true; } - for(u32 i=0; i name; + std::string name; while(!elf64_f.Eof()) { char c; elf64_f.Read(&c, 1); if(c == 0) break; - name.AddCpy(c); + name.push_back(c); } - name.AddCpy('\0'); - shdr_name_arr.push_back(std::string(name.GetPtr())); + shdr_name_arr.push_back(name); } return true; @@ -203,7 +200,7 @@ bool ELF64Loader::LoadEhdrData(u64 offset) bool ELF64Loader::LoadPhdrData(u64 offset) { - for(u32 i=0; i shdr_name_arr; - Array shdr_arr; - Array phdr_arr; + std::vector shdr_arr; + std::vector phdr_arr; ELF64Loader(vfsStream& f); ~ELF64Loader() {Close();} @@ -188,4 +188,4 @@ private: void WriteEhdr(wxFile& f, Elf64_Ehdr& ehdr); void WritePhdr(wxFile& f, Elf64_Phdr& phdr); -void WriteShdr(wxFile& f, Elf64_Shdr& shdr); \ No newline at end of file +void WriteShdr(wxFile& f, Elf64_Shdr& shdr); diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index a039b04acf..c5ddeb1881 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -273,6 +273,7 @@ enum Status #include "Emu/Memory/Memory.h" #include "Emu/System.h" #include "Emu/Cell/PPUThread.h" +#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/Modules.h" diff --git a/wxWidgets b/wxWidgets index 6637946d55..eb5f454529 160000 --- a/wxWidgets +++ b/wxWidgets @@ -1 +1 @@ -Subproject commit 6637946d55f41e8615c09fd202c6399017916e2b +Subproject commit eb5f4545297a32d04a35a360919e908dbea3dfca