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

Function GetBranchTargetNoRA

pcsx2/DebugTools/MIPSAnalyst.cpp:53–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 }
52
53 u32 GetBranchTargetNoRA(u32 addr, MemoryInterface& reader)
54 {
55 u32 op = reader.Read32(addr);
56 const R5900::OPCODE& opcode = R5900::GetInstruction(op);
57
58 int branchType = (opcode.flags & BRANCHTYPE_MASK);
59 if ((opcode.flags & IS_BRANCH) && (branchType == BRANCHTYPE_BRANCH || branchType == BRANCHTYPE_BC1 || branchType == BRANCHTYPE_BC0))
60 {
61 if (!(opcode.flags & IS_LINKED))
62 return addr + 4 + ((signed short)(op&0xFFFF)<<2);
63 else
64 return INVALIDTARGET;
65 }
66 else
67 return INVALIDTARGET;
68 }
69
70 u32 GetSureBranchTarget(u32 addr, MemoryInterface& reader)
71 {

Callers 2

ScanAheadForJumpbackFunction · 0.85
ScanForFunctionsFunction · 0.85

Calls 1

Read32Method · 0.45

Tested by

no test coverage detected