ScePSX is a cross-platform PlayStation 1 emulator written entirely in C#. It provides cycle-accurate emulation of the original PlayStation hardware while offering modern enhancements such as resolution scaling, precision geometry improvements (PGXP), and multiple GPU rendering backends.
This documentation covers the complete emulator architecture, from the user interface layer down to the core hardware emulation. For platform-specific UI details, see User Interface. For core emulation components, see Core Emulation. For graphics subsystem details, see Graphics Subsystem.
Sources: README.md151-152 AvaloniaUI/UI/MainWindow.axaml.cs20
ScePSX emulates the following PlayStation hardware components:
| Component | Implementation | Documentation |
|---|---|---|
| MIPS R3000A CPU | Full instruction set execution | CPU Emulation |
| GTE (Geometry Transform Engine) | 3D transformation coprocessor | GTE |
| GPU | Command processing + multiple backends | Graphics Subsystem |
| SPU | 24-voice audio synthesis with reverb | SPU |
| CD-ROM Drive | Disc reading with multiple format support | CD-ROM Subsystem |
| MDEC | Video decompression | MDEC |
| Controllers | Digital and analog controller emulation | Input and Controllers |
| Memory Cards | Save data management | Memory Card Management |
Sources: README.md154-167
| Feature | Description | Implementation |
|---|---|---|
| Cross-Platform | Windows, Linux, macOS, Android | Avalonia UI + platform-specific renderers |
| Multiple GPU Backends | Software, OpenGL, Vulkan | Runtime-switchable via GPUBackend abstraction |
| PGXP Enhancement | Sub-pixel precision geometry | PGXPVector cache system |
| Save States | Full emulation state serialization | MessagePack-based compression |
| Resolution Scaling | Up to 4K internal resolution | Hardware backends only |
| Cheat Engine | Memory patching support | Cheat Code System |
| Memory Tools | Live memory editing and search | MemEdit |
| Netplay | Online multiplayer | NetPlayFrm |
| ReShade Integration | Post-processing effects | OpenGL/Vulkan backends |
Sources: README.md154-167 AvaloniaUI/Utils/PSXHandler.cs32-33
ScePSX follows a layered architecture with clear separation between platform-specific UI code, orchestration logic, and the core emulation engine.
Key Design Principles:
ScePSX/Core.csproj) has no UI dependenciesPSXHandler implements callback interfaces (IRenderHandler, IAudioHandler, IRumbleHandler)IGPU interface for runtime switchingIniFile class provides consistent configuration across platformsSources: AvaloniaUI/UI/MainWindow.axaml.cs23-94 AvaloniaUI/Utils/PSXHandler.cs10-46 AvaloniaUI/ScePSX.csproj1-44
The following diagram maps the major emulation components to their source files:
Component Responsibilities:
PSXCore: Main execution loop, frame timing, component lifecycle managementBUS: Memory address decoding using jump tables, memory-mapped I/O routingCPU: MIPS R3000A instruction fetch, decode, execute, exception handlingGTE: 3D geometry transformations, lighting calculations, PGXP integrationGPU: GP0/GP1 command parsing, VRAM management, backend coordinationGPUBackend: Runtime backend selection and initializationDMA: Block data transfers between memory regions and peripheralsSPU: 24-channel ADPCM audio, reverb processing, CD-DA mixingSources: AvaloniaUI/Utils/PSXHandler.cs299
ScePSX runs on multiple operating systems through different UI implementations:
| Platform | UI Framework | Architectures | GPU Backends | Notes |
|---|---|---|---|---|
| Windows | Windows Forms | x86, x64, arm | Software, D2D, D3D, OpenGL, Vulkan | Most feature-complete |
| Windows | Avalonia | x64 | Software, OpenGL, Vulkan | Single-file deployment |
| Linux | Avalonia | x64, arm, arm64, riscv64, loongarch64 | Software, OpenGL, Vulkan | Requires OpenGL 3.3+ or Vulkan 1.1+ |
| macOS | Avalonia | x64, arm64 | Software, OpenGL, Vulkan | Vulkan via MoltenVK (not recommended) |
| Android | Avalonia Mobile | arm64-v8a, armeabi-v7a, x64 | Software, OpenGL, Vulkan | Requires Android 5.0+ |
Build Configuration:
ScePSX/Core.csproj (platform-agnostic, .NET 8.0)AvaloniaUI/ScePSX.csproj (cross-platform desktop/mobile)WinUI/*.csproj (.NET Framework, Windows only)Android/*.csproj (.NET MAUI with Avalonia)Sources: README.md247-256 AvaloniaUI/ScePSX.csproj1-44 .github/workflows/build-core.yml1-35
Key Dependencies:
ScePSX/Utils/MessagePack for save state compression (do not install via NuGet)SDLLib directory for input and audio handlingSources: README.md258-266 AvaloniaUI/ScePSX.csproj26-31
ScePSX implements cycle-accurate emulation of PlayStation hardware:
SYNC_CPU_TICK)The emulator synchronizes CPU, GPU, SPU, CDROM, and DMA operations at regular intervals to maintain timing accuracy while balancing performance.
PGXP (Precision Geometry Extension for PlayStation):
PGXPVector cacheuse_pgxp)use_pgxp_highpos)use_pgxp_memcap)use_pgxp_aff)use_perspective_correction)Sources: AvaloniaUI/Utils/PSXHandler.cs273-283
Settings are stored in ScePSX.ini using the IniFile class:
Per-Game Configuration: Settings can be overridden on a per-game basis by creating section [GameID] in the INI file.
Sources: AvaloniaUI/Utils/PSXHandler.cs13 AvaloniaUI/Utils/PSXHandler.cs48-77 AvaloniaUI/Utils/PSXHandler.cs317-328
The following diagram shows the startup sequence and main emulation loop:
Key Methods:
PSXHandler.LoadGame(): Initializes PSXCore with ROM and BIOS AvaloniaUI/Utils/PSXHandler.cs285-342PSXCore.Start(): Launches the main emulation threadPSXCore.PSX_EXECUTE(): Inner loop executing CPU cycles and synchronizing peripheralsPSXHandler.RenderFrame(): Callback receiving completed frame dataPSXHandler.PlaySamples(): Callback receiving audio samplesSources: AvaloniaUI/UI/MainWindow.axaml.cs443-453 AvaloniaUI/Utils/PSXHandler.cs285-342
The repository is organized by subsystem:
ScePSX/
├── ScePSX/ # Core emulation library
│ ├── PSXCore.cs # Main orchestrator
│ ├── Core/ # Hardware components
│ │ ├── CPU.cs # MIPS R3000A
│ │ ├── BUS.cs # Memory management
│ │ ├── DMA.cs # DMA controller
│ │ ├── GPU/ # Graphics subsystem
│ │ ├── SPU.cs # Audio
│ │ └── CDROM.cs # Disc drive
│ └── Utils/ # Helper classes
├── AvaloniaUI/ # Cross-platform UI
│ ├── UI/ # XAML views
│ └── Utils/ # PSXHandler, rendering
├── WinUI/ # Windows Forms UI
├── Android/ # Android mobile UI
└── SDLLib/ # SDL2 precompiled binaries
For detailed project structure and module relationships, see Project Structure.
Sources: AvaloniaUI/ScePSX.csproj42
| Configuration | Memory Usage | Target Hardware |
|---|---|---|
| Software + D2D | ~32 MB | Low-end systems |
| Software + D3D | ~52 MB | Low-end systems |
| Software + OpenGL | ~86 MB | Mainstream systems |
| Hardware OpenGL | ~138 MB | Mainstream systems |
| Hardware Vulkan | ~143 MB | High-end systems |
Sources: README.md169-187
To begin using ScePSX:
bios/ directoryFor development information, see Development Guide.
Sources: README.md188-213
Refresh this wiki