mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-10-02 02:31:51 -04:00
Feature/iop emulator (#244)
* refactor: from guest threads to EE scheduler * feat: bad wip mpeg fix for code veronica * feat: cheap copy from host feat: small perf o vsync tick * feat: added EE clock Hz fix: fix MPEG out of sync with new EE refactor * fix: fix lotr tests * fix: fix cri dtx loading fix: fix wrong mmi instruction translation fix: fix thread info params feat: added EE timers decoder and consumer feat: split SFI and IOP memory to prevent collision and overrides * feat: revert wrong changes * refactor: change GS architecture * feat: IOP emulator refactor: codegen to catch callbacks on mips code feat: added a lot of entries or IOP emulator * feat: analyzer resolve the complete constant-producing sequence with five-instruction backward scan stopped at LUI and therefore * feat: remove recompiled version of GetRomName refactor: split IOP emulator logic feat: added more HLE IOP modules feat: added ps2_path * eat: enhance ELF parser with improved callable entry detection and control flow analysis * feat: update memory hint handling and enhance entry point discovery logic * feat: add SET_GPR_ZE32 macro for zero-extending loads with unsigned semantics * refactor: Refactor PS2 IOP Host Adapter and Memory Management feat: Added PS2Vfs for virtual file system operations, including file opening, reading, writing, and path resolution. feat: Improve VIF1 data processing to handle GIF image packets more efficiently. * feat: added a lot of tests * fix: fix texture caching feat: wip multi version on dbcman * feat: remove LLE IOPs
This commit is contained in:
@@ -5,6 +5,48 @@
|
||||
|
||||
namespace ps2recomp
|
||||
{
|
||||
inline constexpr uint32_t MIPS_INSTRUCTION_SIZE = sizeof(uint32_t);
|
||||
inline constexpr uint16_t MIPS_IMMEDIATE_SIGN_BIT = 0x8000u;
|
||||
inline constexpr uint32_t MIPS_JUMP_TARGET_SHIFT = 2u;
|
||||
inline constexpr uint32_t MIPS_JUMP_REGION_MASK = 0xF0000000u;
|
||||
|
||||
// R5900 general-purpose register indices used by the encoded RS/RT/RD fields.
|
||||
enum GprRegisters : uint32_t
|
||||
{
|
||||
GPR_ZERO = 0,
|
||||
GPR_AT = 1,
|
||||
GPR_V0 = 2,
|
||||
GPR_V1 = 3,
|
||||
GPR_A0 = 4,
|
||||
GPR_A1 = 5,
|
||||
GPR_A2 = 6,
|
||||
GPR_A3 = 7,
|
||||
GPR_T0 = 8,
|
||||
GPR_T1 = 9,
|
||||
GPR_T2 = 10,
|
||||
GPR_T3 = 11,
|
||||
GPR_T4 = 12,
|
||||
GPR_T5 = 13,
|
||||
GPR_T6 = 14,
|
||||
GPR_T7 = 15,
|
||||
GPR_S0 = 16,
|
||||
GPR_S1 = 17,
|
||||
GPR_S2 = 18,
|
||||
GPR_S3 = 19,
|
||||
GPR_S4 = 20,
|
||||
GPR_S5 = 21,
|
||||
GPR_S6 = 22,
|
||||
GPR_S7 = 23,
|
||||
GPR_T8 = 24,
|
||||
GPR_T9 = 25,
|
||||
GPR_K0 = 26,
|
||||
GPR_K1 = 27,
|
||||
GPR_GP = 28,
|
||||
GPR_SP = 29,
|
||||
GPR_FP = 30,
|
||||
GPR_RA = 31,
|
||||
};
|
||||
|
||||
// Basic MIPS opcodes (shared with R4300i)
|
||||
enum MipsOpcodes
|
||||
{
|
||||
|
||||
@@ -42,9 +42,12 @@ namespace ps2recomp
|
||||
std::vector<Function> &functions,
|
||||
std::unordered_map<uint32_t, std::vector<Instruction>> &decodedFunctions,
|
||||
const std::vector<Section> §ions);
|
||||
static size_t ResliceEntryFunctions(
|
||||
std::vector<Function> &functions,
|
||||
std::unordered_map<uint32_t, std::vector<Instruction>> &decodedFunctions);
|
||||
static size_t ResliceEntryFunctions(std::vector<Function> &functions, std::unordered_map<uint32_t, std::vector<Instruction>> &decodedFunctions);
|
||||
static size_t CollectInternalEntryTargets(
|
||||
const std::vector<Function> &functions,
|
||||
const std::unordered_map<uint32_t, std::vector<Instruction>> &decodedFunctions,
|
||||
const std::unordered_set<uint32_t> &entryAddresses,
|
||||
std::unordered_map<uint32_t, std::vector<uint32_t>> &targetsByOwner);
|
||||
|
||||
static std::string ClampFilenameLength(const std::string& baseName, const std::string& extension, std::size_t maxLength);
|
||||
|
||||
@@ -67,6 +70,7 @@ namespace ps2recomp
|
||||
std::unordered_set<std::string> m_stubFunctions;
|
||||
std::unordered_set<uint32_t> m_stubFunctionStarts;
|
||||
std::unordered_map<uint32_t, std::string> m_stubHandlerBindingsByStart;
|
||||
std::unordered_set<uint32_t> m_entryPointHintStarts;
|
||||
std::unordered_set<uint32_t> m_correctnessCriticalFunctionStarts;
|
||||
std::map<uint32_t, std::string> m_generatedStubs;
|
||||
std::unordered_map<uint32_t, std::string> m_functionRenames;
|
||||
|
||||
@@ -187,6 +187,7 @@ namespace ps2recomp
|
||||
std::vector<std::string> skipFunctions;
|
||||
std::unordered_map<uint32_t, std::string> patches;
|
||||
std::vector<std::string> stubImplementations;
|
||||
std::vector<std::string> entryPointHints;
|
||||
std::unordered_map<uint32_t, uint32_t> mmioByInstructionAddress;
|
||||
std::vector<JumpTable> jumpTables;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user