# superkeka/kytyps5-native architecture

> Architecture diagram of the GitHub repository superkeka/kytyps5-native, 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/superkeka/kytyps5-native
- Repository: https://github.com/superkeka/kytyps5-native

## Overview

KytyPS5-Native runs legally obtained PS5 game files through a compatibility emulator, translating GPU command buffers for native BC-250 execution while retaining Vulkan presentation and fallback. The principal workflow is launch/configuration, game loading and guest execution, GPU translation or rendering, then display and input. The Decky plugin adds installation, game discovery, per-game settings, patches/add-ons, and updates. Paths and broad native/fallback capabilities follow the README and tree; several runtime links are documented rather than verified from sampled implementation, so those edges cite the README.

Main entry points: [`src/emulator.cpp`](https://github.com/superkeka/kytyps5-native/blob/main/src/emulator.cpp) (Emulator runtime), [`src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp`](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp) (GPU command processing), [`src/main.cpp`](https://github.com/superkeka/kytyps5-native/blob/main/src/main.cpp) (Emulator entry), [`src/graphics/native_gpu/nativePm4.cpp`](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/native_gpu/nativePm4.cpp) (Native GPU backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_decky["Decky management"]
  node_decky_plugin["Decky plugin<br/>[main.py]"]
  node_plugin_ui["Game pages<br/>[index.tsx]"]
  node_launcher["Launcher<br/>[main.cpp]"]
end

subgraph group_runtime["Emulation runtime"]
  node_cli["Emulator entry<br/>[main.cpp]"]
  node_config["Run configuration<br/>[emulatorConfig.cpp]"]
  node_loader["Game loader<br/>[loadExec.cpp]"]
  node_guest_kernel["Guest kernel<br/>[memory.cpp]"]
  node_guest_libs["Guest APIs<br/>[libs.cpp]"]
  node_emulator["Emulator runtime<br/>[emulator.cpp]"]
end

subgraph group_gpu["Graphics execution"]
  node_native_gpu["Native GPU backend<br/>[nativePm4.cpp]"]
  node_guest_gpu["GPU command processing<br/>[pm4Dispatch.cpp]"]
  node_shader_recompiler["Shader recompiler"]
  node_pipeline[("Pipeline cache<br/>[pipelineCache.cpp]")]
  node_vulkan_renderer["Vulkan renderer<br/>[renderContext.cpp]"]
  node_presentation["Presentation<br/>[videoOut.cpp]"]
end

subgraph group_io["Platform services"]
  node_host_input["Controller input<br/>[controller.cpp]"]
  node_common_services["Host services<br/>[subsystems.cpp]"]
end

node_user(("Player / operator"))
node_host_gpu{{"BC-250 GPU"}}
node_display(("Display"))

node_user -->|"manages install"| node_decky_plugin
node_decky_plugin -->|"opens game pages"| node_plugin_ui
node_user -->|"selects game"| node_launcher
node_user -->|"launches game"| node_cli
node_launcher -.->|"starts emulator"| node_cli
node_cli -->|"sets options"| node_config
node_cli -->|"starts runtime"| node_emulator
node_emulator -.->|"loads title"| node_loader
node_loader -.->|"maps guest memory"| node_guest_kernel
node_emulator -.->|"serves guest APIs"| node_guest_libs
node_emulator -.->|"dispatches GPU work"| node_guest_gpu
node_guest_gpu -->|"translates commands"| node_native_gpu
node_native_gpu -->|"submits native work"| node_host_gpu
node_guest_gpu -.->|"translates shaders"| node_shader_recompiler
node_shader_recompiler -->|"compiles modules"| node_pipeline
node_guest_gpu -.->|"fallback rendering"| node_vulkan_renderer
node_vulkan_renderer -.->|"uses pipelines"| node_pipeline
node_native_gpu -.->|"provides frames"| node_presentation
node_vulkan_renderer -.->|"provides frames"| node_presentation
node_presentation -.->|"presents frames"| node_display
node_host_input -.->|"supplies controller state"| node_guest_libs
node_common_services -.->|"initializes services"| node_emulator

click node_decky_plugin "https://github.com/superkeka/kytyps5-native/blob/main/decky-plugin/main.py"
click node_plugin_ui "https://github.com/superkeka/kytyps5-native/blob/main/decky-plugin/src/index.tsx"
click node_launcher "https://github.com/superkeka/kytyps5-native/blob/main/src/launcher/src/main.cpp"
click node_cli "https://github.com/superkeka/kytyps5-native/blob/main/src/main.cpp"
click node_config "https://github.com/superkeka/kytyps5-native/blob/main/src/common/emulatorConfig.cpp"
click node_loader "https://github.com/superkeka/kytyps5-native/blob/main/src/loader/loadExec.cpp"
click node_guest_kernel "https://github.com/superkeka/kytyps5-native/blob/main/src/kernel/memory.cpp"
click node_guest_libs "https://github.com/superkeka/kytyps5-native/blob/main/src/libs/libs.cpp"
click node_emulator "https://github.com/superkeka/kytyps5-native/blob/main/src/emulator.cpp"
click node_native_gpu "https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/native_gpu/nativePm4.cpp"
click node_guest_gpu "https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp"
click node_shader_recompiler "https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/shader/recompiler/ShaderRecompiler.cpp"
click node_pipeline "https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp"
click node_vulkan_renderer "https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/host_gpu/renderer/renderContext.cpp"
click node_presentation "https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/presentation/videoOut.cpp"
click node_host_input "https://github.com/superkeka/kytyps5-native/blob/main/src/libs/controller.cpp"
click node_common_services "https://github.com/superkeka/kytyps5-native/blob/main/src/common/subsystems.cpp"

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_decky_plugin,node_plugin_ui,node_launcher toneBlue
class node_cli,node_config,node_loader,node_guest_kernel,node_guest_libs,node_emulator toneAmber
class node_native_gpu,node_guest_gpu,node_shader_recompiler,node_pipeline,node_vulkan_renderer,node_presentation toneMint
class node_host_input,node_common_services toneRose
class node_user,node_host_gpu,node_display toneIndigo
```

## Components

### Decky management

- [Decky plugin](https://github.com/superkeka/kytyps5-native/blob/main/decky-plugin/main.py): `decky-plugin/main.py`
- [Game pages](https://github.com/superkeka/kytyps5-native/blob/main/decky-plugin/src/index.tsx): `decky-plugin/src/index.tsx`
- [Launcher](https://github.com/superkeka/kytyps5-native/blob/main/src/launcher/src/main.cpp): `src/launcher/src/main.cpp`

### Emulation runtime

- [Emulator entry](https://github.com/superkeka/kytyps5-native/blob/main/src/main.cpp): `src/main.cpp`
- [Run configuration](https://github.com/superkeka/kytyps5-native/blob/main/src/common/emulatorConfig.cpp): `src/common/emulatorConfig.cpp`
- [Game loader](https://github.com/superkeka/kytyps5-native/blob/main/src/loader/loadExec.cpp): `src/loader/loadExec.cpp`
- [Guest kernel](https://github.com/superkeka/kytyps5-native/blob/main/src/kernel/memory.cpp): `src/kernel/memory.cpp`
- [Guest APIs](https://github.com/superkeka/kytyps5-native/blob/main/src/libs/libs.cpp): `src/libs/libs.cpp`
- [Emulator runtime](https://github.com/superkeka/kytyps5-native/blob/main/src/emulator.cpp): `src/emulator.cpp`

### Graphics execution

- [Native GPU backend](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/native_gpu/nativePm4.cpp): `src/graphics/native_gpu/nativePm4.cpp`
- [GPU command processing](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp): `src/graphics/guest_gpu/command_processor/pm4Dispatch.cpp`
- [Shader recompiler](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/shader/recompiler/ShaderRecompiler.cpp): `src/graphics/shader/recompiler/ShaderRecompiler.cpp`
- [Pipeline cache](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp): `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp`
- [Vulkan renderer](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/host_gpu/renderer/renderContext.cpp): `src/graphics/host_gpu/renderer/renderContext.cpp`
- [Presentation](https://github.com/superkeka/kytyps5-native/blob/main/src/graphics/presentation/videoOut.cpp): `src/graphics/presentation/videoOut.cpp`

### Platform services

- [Controller input](https://github.com/superkeka/kytyps5-native/blob/main/src/libs/controller.cpp): `src/libs/controller.cpp`
- [Host services](https://github.com/superkeka/kytyps5-native/blob/main/src/common/subsystems.cpp): `src/common/subsystems.cpp`

### Other components

- **Player / operator**
- **BC-250 GPU**
- **Display**

## Connections

- Player / operator → Decky plugin: manages install (evidence: `README.md`)
- Decky plugin → Game pages: opens game pages (evidence: `decky-plugin/src/index.tsx`)
- Player / operator → Launcher: selects game (evidence: `README.md`)
- Player / operator → Emulator entry: launches game (evidence: `README.md`)
- Launcher → Emulator entry: starts emulator
- Emulator entry → Run configuration: sets options (evidence: `src/main.cpp`)
- Emulator entry → Emulator runtime: starts runtime (evidence: `src/main.cpp`)
- Emulator runtime → Game loader: loads title
- Game loader → Guest kernel: maps guest memory
- Emulator runtime → Guest APIs: serves guest APIs
- Emulator runtime → GPU command processing: dispatches GPU work
- GPU command processing → Native GPU backend: translates commands (evidence: `README.md`)
- Native GPU backend → BC-250 GPU: submits native work (evidence: `README.md`)
- GPU command processing → Shader recompiler: translates shaders
- Shader recompiler → Pipeline cache: compiles modules (evidence: `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp`)
- GPU command processing → Vulkan renderer: fallback rendering (evidence: `README.md`)
- Vulkan renderer → Pipeline cache: uses pipelines
- Native GPU backend → Presentation: provides frames
- Vulkan renderer → Presentation: provides frames
- Presentation → Display: presents frames
- Controller input → Guest APIs: supplies controller state
- Host services → Emulator runtime: initializes services
