diff --git a/Source/Core/Core/PowerPC/PowerPC.cpp b/Source/Core/Core/PowerPC/PowerPC.cpp index 45f87607b0..b044f77834 100644 --- a/Source/Core/Core/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/PowerPC/PowerPC.cpp @@ -172,20 +172,7 @@ void Init(int cpu_core) ppcState.pagetable_base = 0; ppcState.pagetable_hashmask = 0; - - for (int tlb = 0; tlb < 2; tlb++) - { - for (int set = 0; set < 64; set++) - { - ppcState.tlb[tlb][set].recent = 0; - for (int way = 0; way < 2; way++) - { - ppcState.tlb[tlb][set].paddr[way] = 0; - ppcState.tlb[tlb][set].pte[way] = 0; - ppcState.tlb[tlb][set].tag[way] = TLB_TAG_INVALID; - } - } - } + ppcState.tlb = {}; ResetRegisters(); diff --git a/Source/Core/Core/PowerPC/PowerPC.h b/Source/Core/Core/PowerPC/PowerPC.h index 885b8a5da2..2d8476e0c2 100644 --- a/Source/Core/Core/PowerPC/PowerPC.h +++ b/Source/Core/Core/PowerPC/PowerPC.h @@ -49,10 +49,10 @@ enum CoreMode struct tlb_entry { - u32 tag[TLB_WAYS]; - u32 paddr[TLB_WAYS]; - u32 pte[TLB_WAYS]; - u8 recent; + u32 tag[TLB_WAYS] = {TLB_TAG_INVALID, TLB_TAG_INVALID}; + u32 paddr[TLB_WAYS] = {}; + u32 pte[TLB_WAYS] = {}; + u8 recent = 0; }; // This contains the entire state of the emulated PowerPC "Gekko" CPU. @@ -116,7 +116,7 @@ struct PowerPCState // also for power management, but we don't care about that. u32 spr[1024]; - tlb_entry tlb[NUM_TLBS][TLB_SIZE / TLB_WAYS]; + std::array, NUM_TLBS> tlb; u32 pagetable_base; u32 pagetable_hashmask;