DuckStation Documentation

repository·master·Indexed 27 days ago

https://github.com/stenzek/duckstation

A high-performance PlayStation 1 (PSX) emulator/simulator focused on accuracy, speed, and maintainability across x86, ARM, and RISC-V architectures. Includes documentation for installing ReShade FX shaders and details on integrated dependencies such as the Biscuit RISC-V runtime code generator, libcubeb audio library, fast_float, and the {fmt} formatting library.

Tokens
16.5K
Snippets
36
Records
97
Agent score
94%

What's inside DuckStation

  1. Overview of the {fmt} library

    master
    The {fmt} library is a high-performance C++ formatting library designed to address the limitations of printf, iostreams, Boost Format, and FastFormat. It provides a safe, fast, and feature-rich alternative for string formatting, supporting positional arguments, user-defined types, and various encoding/padding options that other libraries may lack.
  2. Overview of DuckStation features

    master

    DuckStation is a PlayStation 1 (PSX) emulator focused on gameplay, speed, and long-term maintenance. It aims for high accuracy while maintaining performance on modest hardware.

    Key features include:

    • CPU/GPU: JIT CPU recompiler (x86-64, armv7/AArch32, AArch64, RISC-V/RV64) and hardware rendering via D3D11, D3D12, OpenGL, Vulkan, and Metal.
    • Visual Enhancements: Upscaling, texture filtering, PGXP for geometry precision, adaptive deinterlacing, and post-processing shader chains (GLSL, Reshade FX, Slang).
    • Audio/Input: Time-stretched audio, support for GunCon/Justifier (mouse-simulated), NeGcon, and Multitap (up to 8 devices).
    • System Features: Save states with runahead/rewind, emulated CPU overclocking, RetroAchievements, and automatic game content scanning using redump.org hashes.
    • File Support: Direct CD reading, bin/cue, MAME CHD, ECM, MDS/MDF, CCD, unencrypted PBP, and Portable Sound Format (psf).
  3. Overview of Biscuit RISC-V Runtime Code Generation

    master
    Biscuit is an experimental runtime code generator for RISC-V, similar to Xbyak for x86. It allows for the runtime generation of RISC-V instructions. It supports both 32-bit and 64-bit instructions across various ISA features including A, B, C, D, F, H, K, M, N, Q, RV32I, RV64I, S, V, Sstc, Zfh, Zfhmin, Zicbom, Zicbop, Zicboz, Zicsr, Zifencei, and Zihintntl.
  4. Overview of DuckStation Emulator

    master

    DuckStation is a PlayStation (PS1) simulator/emulator designed for playability, speed, and long-term maintainability. It aims for high accuracy while remaining performant on low-end devices.

    Note on BIOS: A PS1 or PS2 BIOS ROM image is required to start the emulator and play games. DuckStation does not provide these images. You must provide your own (e.g., dumped from your own console). While any hardware version or region can be used, mismatching game regions and BIOS regions may cause compatibility issues.

  5. Overview of VIXL components

    master

    VIXL is an Armv8 runtime code generation library consisting of three main components:

    1. Assemblers: Programmatic tools to generate A64, A32, or T32 code at runtime. They abstract ISA constraints (e.g., supporting any immediate for most instructions).
    2. Disassemblers: Tools to print any instruction emitted by the assemblers.
    3. Simulator: A simulator for A64 instructions that allows generated code to be run on architectures other than AArch64. The simulator is optimized for 64-bit amd64 platforms.
  6. Use xxHash for fast hashing

    master

    xxHash is an extremely fast hash algorithm that runs at RAM speed limits and passes the SMHasher test suite. It is highly portable and produces identical hashes across all platforms (little/big endian).

    Key algorithms include:

    • XXH32: 32-bit hash.
    • XXH64: 64-bit hash, offering superior speed and dispersion for 64-bit systems.
    • XXH3: A newer algorithm (available from v0.7.0) that generates 64 and 128-bit hashes and is faster for both long and small inputs. Note that XXH3 return values will be finalized in v0.8.0.
  7. Integrate rcheevos for RetroAchievements support

    master

    The rcheevos library helps emulators process RetroAchievements data (achievements and leaderboards).

    Important Constraints:

    • No Networking: The library does not provide HTTP network connections. You must fetch data from RetroAchievements via your own HTTP client and pass the response to rcheevos for processing.
    • Branch Selection: While development occurs on the _develop branch, it is recommended to use the _master branch for integration to ensure stability and use the last official release.
  8. DuckStation Key Features

    master

    DuckStation provides a comprehensive emulation experience with the following capabilities:

    User Interfaces

    • Qt Frontend: A fully-featured desktop interface.
    • Big Picture UI: A fullscreen/TV-style UI based on Dear ImGui.

    Rendering & Graphics

    • Hardware Renderers: Supports D3D11, D3D12, OpenGL, Vulkan, and Metal.
    • Enhancements: Upscaling, texture filtering, true colour (24-bit), and PGXP (geometry precision, texture correction, and depth buffer emulation).
    • Post-Processing: Supports shader chains (GLSL, Reshade FX, and Slang Presets) and border overlays/bezels.
    • Software Renderer: Vectorized and multi-threaded.

    Emulation & Gameplay

    • CPU: Recompiler/JIT support for multiple architectures.
    • Audio: Time-stretched audio for non-100% speeds and direct loading of Portable Sound Format (psf) files.
    • Save/State Management: Save states with runahead and rewind support; memory card editor and save importer.
    • Disc Support: Reads CD, bin/cue, MAME CHD, single-track ECM, MDS/MDF, CCD, and unencrypted PBP formats.
    • Controller Support: Digital/analog controllers (with rumble), GunCon/Justifier (simulated via mouse), NeGcon, and Multitap (up to 8 devices).
    • Advanced Features: Emulated CPU overclocking, RetroAchievements, Discord Rich Presence, and Parallel port cartridge emulation.
  9. Install DuckStation on Android

    master

    Supports armv7 (32-bit), AArch64 (64-bit), or x86_64. 64-bit is preferred. For 32-bit devices, a CPU of at least 1.5 GHz is recommended.

    1. Download via Google Play: https://play.google.com/store/apps/details?id=com.github.stenzek.duckstation
    2. Install and run the app.
    3. Follow the Setup Wizard.

    Note: Support for the Android app is not provided. Do not send emails regarding Android issues.

  10. Build libcubeb with MinGW-w64

    master

    To build libcubeb using MinGW-w64, ensure you have installed MinGW-w64 with Win32 threads and CMake. Use the MinGW-w64 Terminal and follow these specific steps:

    1. Clone and enter the directory.
    2. Configure the build using the MinGW generator.
    3. Build and test.
    git clone --recursive https://github.com/mozilla/cubeb.git
    cd cubeb
    cmake -G "MinGW Makefiles" ../cubeb
    cmake --build ./build
    cd build && ctest