| 7 | #include "VMManager.h" |
| 8 | |
| 9 | std::vector<std::unique_ptr<BiosThread>> getEEThreads() |
| 10 | { |
| 11 | if (!VMManager::HasValidVM() || CurrentBiosInformation.eeThreadListAddr == 0) |
| 12 | return {}; |
| 13 | |
| 14 | const u32 start = CurrentBiosInformation.eeThreadListAddr & 0x3fffff; |
| 15 | |
| 16 | std::vector<std::unique_ptr<BiosThread>> threads; |
| 17 | for (int tid = 0; tid < 256; tid++) |
| 18 | { |
| 19 | EEInternalThread* internal = static_cast<EEInternalThread*>( |
| 20 | PSM(start + tid * sizeof(EEInternalThread))); |
| 21 | |
| 22 | if (internal && internal->status != (int)ThreadStatus::THS_BAD) |
| 23 | threads.emplace_back(std::make_unique<EEThread>(tid, *internal)); |
| 24 | } |
| 25 | |
| 26 | return threads; |
| 27 | } |
| 28 | |
| 29 | std::vector<std::unique_ptr<BiosThread>> getIOPThreads() |
| 30 | { |