Merge pull request #12700 from mitaclaw/search-instruction-optimize
MenuBar: Optimize SearchInstruction
This commit is contained in:
commit
b9bedbc5ba
|
@ -1774,20 +1774,19 @@ void MenuBar::SearchInstruction()
|
||||||
auto& system = Core::System::GetInstance();
|
auto& system = Core::System::GetInstance();
|
||||||
auto& memory = system.GetMemory();
|
auto& memory = system.GetMemory();
|
||||||
|
|
||||||
Core::CPUThreadGuard guard(system);
|
const std::string op_std = op.toStdString();
|
||||||
|
const Core::CPUThreadGuard guard(system);
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (u32 addr = Memory::MEM1_BASE_ADDR; addr < Memory::MEM1_BASE_ADDR + memory.GetRamSizeReal();
|
for (u32 addr = Memory::MEM1_BASE_ADDR; addr < Memory::MEM1_BASE_ADDR + memory.GetRamSizeReal();
|
||||||
addr += 4)
|
addr += 4)
|
||||||
{
|
{
|
||||||
const auto ins_name = QString::fromStdString(
|
if (op_std == PPCTables::GetInstructionName(PowerPC::MMU::HostRead_U32(guard, addr), addr))
|
||||||
PPCTables::GetInstructionName(PowerPC::MMU::HostRead_U32(guard, addr), addr));
|
|
||||||
if (op == ins_name)
|
|
||||||
{
|
{
|
||||||
NOTICE_LOG_FMT(POWERPC, "Found {} at {:08x}", op.toStdString(), addr);
|
NOTICE_LOG_FMT(POWERPC, "Found {} at {:08x}", op_std, addr);
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
NOTICE_LOG_FMT(POWERPC, "Opcode {} not found", op.toStdString());
|
NOTICE_LOG_FMT(POWERPC, "Opcode {} not found", op_std);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue