# dmorazasanchez/kytyps5-native-beta architecture

> Architecture diagram of the GitHub repository dmorazasanchez/kytyps5-native-beta, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dmorazasanchez/kytyps5-native-beta
- Repository: https://github.com/dmorazasanchez/kytyps5-native-beta

## Overview

KytyPS5-Native is a PS5 emulator fork packaged for BC-250 Linux systems, with a desktop launcher and optional Steam Deck integration. The main workflow is to select a legally obtained game archive or folder in the launcher, configure it, and hand it to the emulator; the emulator loads guest state, translates GPU shaders and commands, and presents rendered frames. The repository also contains controller support, upscaling/frame-generation integrations, and host-GPU memory and pipeline management. Edges are limited to relationships visible in the excerpts, SOURCE INDEX references, or README; unsampled internals are not traced.

Main entry points: [`beta/launcher/src/KytyPS5.Launcher/Program.cs`](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/Program.cs) (Desktop launcher), [`src/main.cpp`](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/main.cpp) (Emulator entry), [`src/emulator.cpp`](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/emulator.cpp) (Emulator lifecycle), [`src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp`](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp) (Guest GPU commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launcher and library"]
  node_launcher["Desktop launcher<br/>[Program.cs]"]
  node_game_library["Game library<br/>[Library.cs]"]
  node_archive["Game archives<br/>[ZArchive.cs]"]
  node_bridge["Emulator bridge<br/>[KytyBridge.cs]"]
  node_audio["Launcher audio<br/>[AudioEngine.cs]"]
  node_music["Music library<br/>[MusicLibrary.cs]"]
  node_decky["Decky plugin<br/>[index.tsx]"]
end

subgraph group_emu["Emulator runtime"]
  node_emulator_entry["Emulator entry<br/>[main.cpp]"]
  node_emulator["Emulator lifecycle<br/>[emulator.cpp]"]
  node_config["Runtime configuration<br/>[emulatorConfig.h]"]
  node_symbol_db["Symbol database<br/>[symbolDatabase.cpp]"]
  node_controller["Guest controllers<br/>[controller.cpp]"]
end

subgraph group_graphics["Graphics runtime"]
  node_guest_gpu["Guest GPU commands<br/>[pm4Dispatch.cpp]"]
  node_shader["Shader translation<br/>[Program.cpp]"]
  node_pipeline[("Pipeline cache<br/>[pipelineCache.cpp]")]
  node_host_memory["GPU memory mapping<br/>[pageManager.cpp]"]
  node_upscaling["Upscaling and frame gen"]
end

subgraph group_platform["Host services"]
  node_common["Common services<br/>[file.h]"]
end

node_user(("Player"))
node_host(("Linux host"))

node_user -->|"selects game"| node_launcher
node_launcher -.->|"browses titles"| node_game_library
node_game_library -.->|"opens archive"| node_archive
node_launcher -->|"launches game"| node_bridge
node_bridge -.->|"starts runtime"| node_emulator_entry
node_emulator_entry -->|"configures runtime"| node_emulator
node_emulator_entry -->|"reads files"| node_common
node_emulator_entry -.->|"reads settings"| node_config
node_emulator -.->|"resolves symbols"| node_symbol_db
node_emulator -.->|"initializes input"| node_controller
node_controller -.->|"reads gamepads"| node_host
node_emulator -.->|"dispatches commands"| node_guest_gpu
node_guest_gpu -.->|"requests pipelines"| node_pipeline
node_pipeline -->|"translates shaders"| node_shader
node_pipeline -.->|"uses GPU memory"| node_host_memory
node_guest_gpu -.->|"uses effects"| node_upscaling
node_launcher -->|"plays UI audio"| node_audio
node_audio -->|"loads tracks"| node_music
node_user -.->|"uses Steam UI"| node_decky
node_decky -.->|"controls games"| node_launcher

click node_launcher "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/Program.cs"
click node_game_library "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/Library.cs"
click node_archive "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/SharpEmu.HLE/FileSystem/ZArchive.cs"
click node_bridge "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/KytyBridge.cs"
click node_audio "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/AudioEngine.cs"
click node_music "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/MusicLibrary.cs"
click node_emulator_entry "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/main.cpp"
click node_emulator "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/emulator.cpp"
click node_config "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/common/emulatorConfig.h"
click node_symbol_db "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/loader/symbolDatabase.cpp"
click node_controller "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/libs/controller.cpp"
click node_guest_gpu "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp"
click node_shader "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/shader/recompiler/ir/Program.cpp"
click node_pipeline "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp"
click node_host_memory "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/host_gpu/pageManager.cpp"
click node_upscaling "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/3rdparty/fidelityfx/src/components/fsr3upscaler/ffx_fsr3upscaler.cpp"
click node_common "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/common/file.h"
click node_decky "https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/decky-plugin/src/index.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher,node_game_library,node_archive,node_bridge,node_audio,node_music,node_decky toneBlue
class node_emulator_entry,node_emulator,node_config,node_symbol_db,node_controller toneAmber
class node_guest_gpu,node_shader,node_pipeline,node_host_memory,node_upscaling toneMint
class node_common toneRose
class node_user,node_host toneIndigo
```

## Components

### Launcher and library

- [Desktop launcher](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/Program.cs): `beta/launcher/src/KytyPS5.Launcher/Program.cs`
- [Game library](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/Library.cs): `beta/launcher/src/KytyPS5.Launcher/Library.cs`
- [Game archives](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/SharpEmu.HLE/FileSystem/ZArchive.cs): `beta/launcher/src/SharpEmu.HLE/FileSystem/ZArchive.cs`
- [Emulator bridge](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/KytyBridge.cs): `beta/launcher/src/KytyPS5.Launcher/KytyBridge.cs`
- [Launcher audio](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/AudioEngine.cs): `beta/launcher/src/KytyPS5.Launcher/AudioEngine.cs`
- [Music library](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/beta/launcher/src/KytyPS5.Launcher/MusicLibrary.cs): `beta/launcher/src/KytyPS5.Launcher/MusicLibrary.cs`
- [Decky plugin](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/decky-plugin/src/index.tsx): `decky-plugin/src/index.tsx`

### Emulator runtime

- [Emulator entry](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/main.cpp): `src/main.cpp`
- [Emulator lifecycle](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/emulator.cpp): `src/emulator.cpp`
- [Runtime configuration](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/common/emulatorConfig.h): `src/common/emulatorConfig.h`
- [Symbol database](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/loader/symbolDatabase.cpp): `src/loader/symbolDatabase.cpp`
- [Guest controllers](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/libs/controller.cpp): `src/libs/controller.cpp`

### Graphics runtime

- [Guest GPU commands](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp): `src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp`
- [Shader translation](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/shader/recompiler/ir/Program.cpp): `src/graphics/shader/recompiler/ir/Program.cpp`
- [Pipeline cache](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp): `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp`
- [GPU memory mapping](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/graphics/host_gpu/pageManager.cpp): `src/graphics/host_gpu/pageManager.cpp`
- [Upscaling and frame gen](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/3rdparty/fidelityfx/src/components/fsr3upscaler/ffx_fsr3upscaler.cpp): `3rdparty/fidelityfx/src/components/fsr3upscaler/ffx_fsr3upscaler.cpp`

### Host services

- [Common services](https://github.com/dmorazasanchez/kytyps5-native-beta/blob/main/src/common/file.h): `src/common/file.h`

### Other components

- **Player**
- **Linux host**

## Connections

- Player → Desktop launcher: selects game
- Desktop launcher → Game library: browses titles
- Game library → Game archives: opens archive
- Desktop launcher → Emulator bridge: launches game (evidence: `beta/launcher/src/KytyPS5.Launcher/Program.cs`)
- Emulator bridge → Emulator entry: starts runtime
- Emulator entry → Emulator lifecycle: configures runtime (evidence: `src/main.cpp`)
- Emulator entry → Common services: reads files (evidence: `src/main.cpp`)
- Emulator entry → Runtime configuration: reads settings
- Emulator lifecycle → Symbol database: resolves symbols
- Emulator lifecycle → Guest controllers: initializes input
- Guest controllers → Linux host: reads gamepads
- Emulator lifecycle → Guest GPU commands: dispatches commands
- Guest GPU commands → Pipeline cache: requests pipelines
- Pipeline cache → Shader translation: translates shaders (evidence: `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp`)
- Pipeline cache → GPU memory mapping: uses GPU memory
- Guest GPU commands → Upscaling and frame gen: uses effects
- Desktop launcher → Launcher audio: plays UI audio (evidence: `beta/launcher/src/KytyPS5.Launcher/Program.cs`)
- Launcher audio → Music library: loads tracks (evidence: `beta/launcher/src/KytyPS5.Launcher/AudioEngine.cs`)
- Player → Decky plugin: uses Steam UI
- Decky plugin → Desktop launcher: controls games
