$ show RPCSX/rpcsx
This repository implements a dual-console emulator targeting PlayStation 3 (RPCS3) and PlayStation 4 (RPCSX/Orbis). The codebase is a large C++ project with a modular architecture: kernel emulation layers for both consoles (syscalls, threads, memory management), CPU emulation (PPU/SPU for PS3, GCN for PS4), GPU emulation (RSX for PS3 with OpenGL/Vulkan backends, GCN shader compiler for PS4), audio backends (Cubeb, FAudio, ALSA), input handlers (DS3, DS4, XInput, PS Move, etc.), network emulation (RPCN, UPnP), and a custom overlay UI system. The project is under active development with frequent commits, though many PS3 firmware modules remain as stubs or placeholders. The architecture separates PS3 and PS4 emulation into distinct directories (`rpcs3/` and `rpcsx/`), sharing a common utility library (`rx/`) that provides synchronization primitives, memory management, and debugging tools. The GPU emulation is particularly sophisticated, featuring a custom shader intermediate representation (IR) for AMD GCN instructions with optimization passes and SPIR-V/GLSL backends. The codebase also includes a comprehensive serialization framework for savestates, a YAML-based configuration system, and a texture cache predictor for GPU performance. Key entry points include the main emulator executables (built from `rpcs3/` and `rpcsx/`), the kernel syscall handlers in `kernel/orbis/` and `kernel/cellos/`, the GPU renderers in `rpcs3/Emu/RSX/` and `rpcsx/gpu/`, and the PS3 firmware HLE modules in `ps3fw/`. External dependencies include Vulkan, OpenGL, FFmpeg, WolfSSL, SDL2, libusb, and several audio libraries. The project is primarily a software application for console emulation, with significant reverse-engineering and research components.
The LLM identified 3 files worth highlighting for reuse:
Implements a cross-platform shared mutex using futexes (Linux) and similar primitives (macOS, Windows). Provides exclusive and shared locking with HLE hints. The implementation is self-contained, header-only (with a small .cpp), and can be extracted for use in any multi-threaded C++ project requiring efficient reader-writer locks.
A standalone library for translating AMD GCN GPU instructions to SPIR-V and GLSL. Includes a custom intermediate representation (IR) with optimization passes (constant folding, dominance analysis), dialect tables for all GCN instruction categories, and backends for SPIR-V and GLSL. The library is well-structured with clear separation of concerns and could be reused for any GCN-to-SPIR-V translation task.
Provides a flexible serialization framework with support for versioned savestates, bitwise serialization for trivially copyable types, and custom serializers for complex types. Uses macros like SAVESTATE_INIT_POS and ENABLE_BITWISE_SERIALIZATION. The framework is header-only and decoupled from the emulator's data structures, making it reusable for any project requiring binary serialization with backward compatibility.