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

Function GetBranchTarget

pcsx2/DebugTools/MIPSAnalyst.cpp:41–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 u32 GetBranchTarget(u32 addr, MemoryInterface& reader)
42 {
43 u32 op = reader.Read32(addr);
44 const R5900::OPCODE& opcode = R5900::GetInstruction(op);
45
46 int branchType = (opcode.flags & BRANCHTYPE_MASK);
47 if ((opcode.flags & IS_BRANCH) && (branchType == BRANCHTYPE_BRANCH || branchType == BRANCHTYPE_BC1 || branchType == BRANCHTYPE_BC0))
48 return addr + 4 + ((signed short)(op&0xFFFF)<<2);
49 else
50 return INVALIDTARGET;
51 }
52
53 u32 GetBranchTargetNoRA(u32 addr, MemoryInterface& reader)
54 {

Callers

nothing calls this directly

Calls 1

Read32Method · 0.45

Tested by

no test coverage detected