Is the dynarec modular? Or rather, can I build PCSX2 with the dynarec as a separate .so?…
- User
Is the dynarec modular? Or rather, can I build PCSX2 with the dynarec as a separate .so? I want to explore the possibility of running this emulator via Box64. I believe the only x86-specific part of the codebase are the dynamic recompilers, and since PCSX2 is open source, I think I could compile most of the project into native aarch64, and only run the dynarec via Box64.
Assistant
The dynarec in PCSX2 is not modular in a way that allows it to be built as a separate .so file that can be easily swapped. The recompiler code is deeply integrated with the rest of the emulator, and separating it would require substantial modifications to the codebase. While the dynarec itself contains the bulk of the x86-specific instructions, there are other x86 dependencies scattered throughout the project, making a clean separation difficult.
The CMake build system doesn't have an option to build the dynarec separately. The files related to the dynarec (e.g.,
iCore.cpp,iCore.h,iR5900.h,Vif_Dynarec.cpp) are compiled directly into the main PCSX2 executable. Even if you managed to isolate the dynarec code, the numerous interdependencies and assumptions about memory layout and function calls would make linking it back to a predominantly aarch64 codebase a complex undertaking.Your idea of using Box64 to run the dynarec while the rest of PCSX2 runs natively on aarch64 is conceptually interesting. However, the tight integration of the dynarec makes this approach very challenging without significant rewriting of core PCSX2 components. The constant back-and-forth communication between the recompiled code and the emulator core would likely incur substantial performance overhead through Box64's translation layer.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.