MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / setInstructions

Method setInstructions

pcsx2-qt/Debugger/DisassemblyView.cpp:1042–1070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1040}
1041
1042void DisassemblyView::setInstructions(u32 start, u32 end, u32 value)
1043{
1044 const u32 count = (end - start) / 4 + 1;
1045
1046 const QPointer<DisassemblyView> view(this);
1047 Host::RunOnCPUThread([view, start, count, cpu = &cpu(), value] {
1048 std::vector<u32> original_instructions;
1049 original_instructions.reserve(count);
1050 for (u32 i = 0; i < count; i++)
1051 {
1052 const u32 address = start + i * 4;
1053 original_instructions.emplace_back(cpu->Read32(address));
1054 cpu->Write32(address, value);
1055 }
1056
1057 QtHost::RunOnUIThread([view, start, count, original_instructions = std::move(original_instructions)]() {
1058 if (!view)
1059 return;
1060
1061 for (u32 i = 0; i < count; i++)
1062 {
1063 const u32 address = start + i * 4;
1064 view->m_nopedInstructions.emplace(address, original_instructions[i]);
1065 }
1066
1067 DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
1068 });
1069 });
1070}
1071
1072bool DisassemblyView::AddressCanRestore(u32 start, u32 end)
1073{

Callers

nothing calls this directly

Calls 4

VMUpdateClass · 0.85
reserveMethod · 0.45
Read32Method · 0.45
Write32Method · 0.45

Tested by

no test coverage detected