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

Function getIOPThreads

pcsx2/DebugTools/BiosDebugData.cpp:29–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29std::vector<std::unique_ptr<BiosThread>> getIOPThreads()
30{
31 if (!VMManager::HasValidVM() || CurrentBiosInformation.iopThreadListAddr == 0)
32 return {};
33
34 std::vector<std::unique_ptr<BiosThread>> threads;
35
36 u32 item = iopMemRead32(CurrentBiosInformation.iopThreadListAddr);
37
38 for (int i = 0; item != 0; i++)
39 {
40 if (i > 1000)
41 return {};
42
43 IOPInternalThread data{};
44
45 u16 tag = iopMemRead16(item + 0x8);
46 if (tag != 0x7f01)
47 {
48 // something went wrong
49 return {};
50 }
51
52 data.stacMem = iopMemRead32(item + 0x3c);
53 data.stackSize = iopMemRead32(item + 0x40);
54 data.status = iopMemRead8(item + 0xc);
55 data.tid = iopMemRead16(item + 0xa);
56 data.entrypoint = iopMemRead32(item + 0x38);
57 data.waitstate = iopMemRead16(item + 0x1c);
58 data.waitId = iopMemRead32(item + 0x20);
59 data.initPriority = iopMemRead16(item + 0xe);
60
61 data.regCtx = iopMemRead32(item + 0x10);
62
63 data.PC = iopMemRead32(data.regCtx + 0x8c);
64
65 threads.emplace_back(std::make_unique<IOPThread>(data));
66
67 item = iopMemRead32(item + 0x24);
68 }
69
70
71 return threads;
72}
73
74std::vector<IopMod> getIOPModules()
75{

Callers 1

GetThreadListMethod · 0.85

Calls 3

iopMemRead32Function · 0.85
iopMemRead16Function · 0.85
iopMemRead8Function · 0.85

Tested by

no test coverage detected