diff --git a/Source/Core/Core/Src/BootManager.cpp b/Source/Core/Core/Src/BootManager.cpp index a7051dd127..b6dcb7df43 100644 --- a/Source/Core/Core/Src/BootManager.cpp +++ b/Source/Core/Core/Src/BootManager.cpp @@ -45,8 +45,8 @@ namespace BootManager struct ConfigCache { bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread, - bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2; - int iTLBHack, iCPUCore; + bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2, bTLBHack; + int iCPUCore; TEXIDevices m_EXIDevice[2]; std::string strBackend; }; @@ -91,7 +91,7 @@ bool BootCore(const std::string& _rFilename) config_cache.bEnableFPRF = StartUp.bEnableFPRF; config_cache.bMMU = StartUp.bMMU; config_cache.bDCBZOFF = StartUp.bDCBZOFF; - config_cache.iTLBHack = StartUp.iTLBHack; + config_cache.bTLBHack = StartUp.bTLBHack; config_cache.bVBeamSpeedHack = StartUp.bVBeamSpeedHack; config_cache.bSyncGPU = StartUp.bSyncGPU; config_cache.bFastDiscSpeed = StartUp.bFastDiscSpeed; @@ -109,7 +109,7 @@ bool BootCore(const std::string& _rFilename) game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle); game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF); game_ini.Get("Core", "MMU", &StartUp.bMMU, StartUp.bMMU); - game_ini.Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack); + game_ini.Get("Core", "TLBHack", &StartUp.bTLBHack, StartUp.bTLBHack); game_ini.Get("Core", "DCBZ", &StartUp.bDCBZOFF, StartUp.bDCBZOFF); game_ini.Get("Core", "VBeam", &StartUp.bVBeamSpeedHack, StartUp.bVBeamSpeedHack); game_ini.Get("Core", "SyncGPU", &StartUp.bSyncGPU, StartUp.bSyncGPU); @@ -184,7 +184,7 @@ void Stop() StartUp.bEnableFPRF = config_cache.bEnableFPRF; StartUp.bMMU = config_cache.bMMU; StartUp.bDCBZOFF = config_cache.bDCBZOFF; - StartUp.iTLBHack = config_cache.iTLBHack; + StartUp.bTLBHack = config_cache.bTLBHack; StartUp.bVBeamSpeedHack = config_cache.bVBeamSpeedHack; StartUp.bSyncGPU = config_cache.bSyncGPU; StartUp.bFastDiscSpeed = config_cache.bFastDiscSpeed; diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index d93378f91f..84afc54a6d 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -426,7 +426,7 @@ void SConfig::LoadSettings() ini.Get("Core", "RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false); ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false); ini.Get("Core", "MMU", &m_LocalCoreStartupParameter.bMMU, false); - ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0); + ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.bTLBHack, false); ini.Get("Core", "BBDumpPort", &m_LocalCoreStartupParameter.iBBDumpPort, -1); ini.Get("Core", "VBeam", &m_LocalCoreStartupParameter.bVBeamSpeedHack, false); ini.Get("Core", "SyncGPU", &m_LocalCoreStartupParameter.bSyncGPU, false); diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index 462a7e8474..8c64462e02 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -37,7 +37,7 @@ SCoreStartupParameter::SCoreStartupParameter() bMergeBlocks(false), bEnableMemcardSaving(true), bDPL2Decoder(false), iLatency(14), bRunCompareServer(false), bRunCompareClient(false), - bMMU(false), bDCBZOFF(false), iTLBHack(0), iBBDumpPort(0), bVBeamSpeedHack(false), + bMMU(false), bDCBZOFF(false), bTLBHack(false), iBBDumpPort(0), bVBeamSpeedHack(false), bSyncGPU(false), bFastDiscSpeed(false), SelectedLanguage(0), bWii(false), bConfirmStop(false), bHideCursor(false), @@ -73,7 +73,7 @@ void SCoreStartupParameter::LoadDefaults() bEnableFPRF = false; bMMU = false; bDCBZOFF = false; - iTLBHack = 0; + bTLBHack = false; iBBDumpPort = -1; bVBeamSpeedHack = false; bSyncGPU = false; diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index 6e87673f95..986424a089 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -137,7 +137,7 @@ struct SCoreStartupParameter bool bMMU; bool bDCBZOFF; - int iTLBHack; + bool bTLBHack; int iBBDumpPort; bool bVBeamSpeedHack; bool bSyncGPU; diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp index 82b984fdb2..3e236eaaf7 100644 --- a/Source/Core/Core/Src/HW/Memmap.cpp +++ b/Source/Core/Core/Src/HW/Memmap.cpp @@ -340,7 +340,7 @@ static const int num_views = sizeof(views) / sizeof(MemoryView); void Init() { bool wii = SConfig::GetInstance().m_LocalCoreStartupParameter.bWii; - bFakeVMEM = SConfig::GetInstance().m_LocalCoreStartupParameter.iTLBHack == 1; + bFakeVMEM = SConfig::GetInstance().m_LocalCoreStartupParameter.bTLBHack == true; bMMU = SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU; u32 flags = 0; diff --git a/Source/Core/Core/Src/HW/MemmapFunctions.cpp b/Source/Core/Core/Src/HW/MemmapFunctions.cpp index 47872e3cd0..3a6604a385 100644 --- a/Source/Core/Core/Src/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/Src/HW/MemmapFunctions.cpp @@ -328,7 +328,7 @@ u32 Read_Opcode(u32 _Address) } if (Core::g_CoreStartupParameter.bMMU && - !Core::g_CoreStartupParameter.iTLBHack && + !Core::g_CoreStartupParameter.bTLBHack && (_Address & ADDR_MASK_MEM1)) { // TODO: Check for MSR instruction address translation flag before translating diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp index 7403ead883..dc9acf98f7 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp @@ -92,9 +92,9 @@ void Jit64AsmRoutineManager::Generate() FixupBranch exit_vmem; if (Core::g_CoreStartupParameter.bWii) mask = JIT_ICACHE_EXRAM_BIT; - if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) mask |= JIT_ICACHE_VMEM_BIT; - if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { TEST(32, R(EAX), Imm32(mask)); no_mem = J_CC(CC_NZ); @@ -106,12 +106,12 @@ void Jit64AsmRoutineManager::Generate() MOV(64, R(RSI), Imm64((u64)jit->GetBlockCache()->GetICache())); MOV(32, R(EAX), MComplex(RSI, EAX, SCALE_1, 0)); #endif - if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { exit_mem = J(); SetJumpTarget(no_mem); } - if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { TEST(32, R(EAX), Imm32(JIT_ICACHE_VMEM_BIT)); FixupBranch no_vmem = J_CC(CC_Z); @@ -138,9 +138,9 @@ void Jit64AsmRoutineManager::Generate() #endif SetJumpTarget(no_exram); } - if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) SetJumpTarget(exit_mem); - if (Core::g_CoreStartupParameter.bWii && (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack)) + if (Core::g_CoreStartupParameter.bWii && (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack)) SetJumpTarget(exit_vmem); #else #ifdef _M_IX86 diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStoreFloating.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStoreFloating.cpp index 7083d24276..dc8d926282 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStoreFloating.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStoreFloating.cpp @@ -164,7 +164,7 @@ void Jit64::stfd(UGeckoInstruction inst) u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; if (Core::g_CoreStartupParameter.bMMU || - Core::g_CoreStartupParameter.iTLBHack) { + Core::g_CoreStartupParameter.bTLBHack) { mem_mask |= Memory::ADDR_MASK_MEM1; } #ifdef ENABLE_MEM_CHECK diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index 78bf1db57c..38c1314fd3 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -531,7 +531,7 @@ static void regEmitMemLoad(RegInfo& RI, InstLoc I, unsigned Size) { } u32 mem_mask = 0; - if (SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU || SConfig::GetInstance().m_LocalCoreStartupParameter.iTLBHack) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU || SConfig::GetInstance().m_LocalCoreStartupParameter.bTLBHack) mem_mask = 0x20000000; RI.Jit->TEST(32, R(ECX), Imm32(0x0C000000 | mem_mask)); @@ -1352,7 +1352,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak // if SafeWriteRegToReg() is modified. u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; if (Core::g_CoreStartupParameter.bMMU || - Core::g_CoreStartupParameter.iTLBHack) { + Core::g_CoreStartupParameter.bTLBHack) { mem_mask |= Memory::ADDR_MASK_MEM1; } #ifdef ENABLE_MEM_CHECK diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp index 15786980fa..9750a0e690 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitILAsm.cpp @@ -94,9 +94,9 @@ void JitILAsmRoutineManager::Generate() FixupBranch exit_vmem; if (Core::g_CoreStartupParameter.bWii) mask = JIT_ICACHE_EXRAM_BIT; - if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) mask |= JIT_ICACHE_VMEM_BIT; - if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { TEST(32, R(EAX), Imm32(mask)); no_mem = J_CC(CC_NZ); @@ -108,12 +108,12 @@ void JitILAsmRoutineManager::Generate() MOV(64, R(RSI), Imm64((u64)jit->GetBlockCache()->GetICache())); MOV(32, R(EAX), MComplex(RSI, EAX, SCALE_1, 0)); #endif - if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { exit_mem = J(); SetJumpTarget(no_mem); } - if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { TEST(32, R(EAX), Imm32(JIT_ICACHE_VMEM_BIT)); FixupBranch no_vmem = J_CC(CC_Z); @@ -140,9 +140,9 @@ void JitILAsmRoutineManager::Generate() #endif SetJumpTarget(no_exram); } - if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bWii || Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) SetJumpTarget(exit_mem); - if (Core::g_CoreStartupParameter.bWii && (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack)) + if (Core::g_CoreStartupParameter.bWii && (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack)) SetJumpTarget(exit_vmem); #else #ifdef _M_IX86 diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp index 637dff171b..5e0ec4bdad 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp @@ -122,7 +122,7 @@ void EmuCodeBlock::SafeLoadToEAX(const Gen::OpArg & opAddress, int accessSize, s #endif { u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; - if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { mem_mask |= Memory::ADDR_MASK_MEM1; } @@ -230,7 +230,7 @@ void EmuCodeBlock::SafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acce u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; - if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) { mem_mask |= Memory::ADDR_MASK_MEM1; } @@ -263,7 +263,7 @@ void EmuCodeBlock::SafeWriteFloatToReg(X64Reg xmm_value, X64Reg reg_addr) // This path should be faster but for some reason it causes errors so I've disabled it. u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; - if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bTLBHack) mem_mask |= Memory::ADDR_MASK_MEM1; #ifdef ENABLE_MEM_CHECK diff --git a/Source/Core/Core/Src/PowerPC/JitInterface.cpp b/Source/Core/Core/Src/PowerPC/JitInterface.cpp index 787ffebb6e..f5158dad6f 100644 --- a/Source/Core/Core/Src/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/Src/PowerPC/JitInterface.cpp @@ -40,7 +40,7 @@ namespace JitInterface } CPUCoreBase *InitJitCore(int core) { - bFakeVMEM = SConfig::GetInstance().m_LocalCoreStartupParameter.iTLBHack == 1; + bFakeVMEM = SConfig::GetInstance().m_LocalCoreStartupParameter.bTLBHack == true; bMMU = SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU; CPUCoreBase *ptr = NULL; diff --git a/Source/Core/DolphinWX/Src/Debugger/MemoryWindow.cpp b/Source/Core/DolphinWX/Src/Debugger/MemoryWindow.cpp index fa85ce808e..e32d9b447d 100644 --- a/Source/Core/DolphinWX/Src/Debugger/MemoryWindow.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/MemoryWindow.cpp @@ -87,7 +87,7 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id, sizerRight->Add(new wxButton(this, IDM_DUMP_MEMORY, _("&Dump MRAM"))); sizerRight->Add(new wxButton(this, IDM_DUMP_MEM2, _("&Dump EXRAM"))); - if (SConfig::GetInstance().m_LocalCoreStartupParameter.iTLBHack == 1) + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bTLBHack == true) sizerRight->Add(new wxButton(this, IDM_DUMP_FAKEVMEM, _("&Dump FakeVMEM"))); wxStaticBoxSizer* sizerSearchType = new wxStaticBoxSizer(wxVERTICAL, this, _("Search"));