# yzfsoldier/astroframe architecture

> Architecture diagram of the GitHub repository yzfsoldier/astroframe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yzfsoldier/astroframe
- Repository: https://github.com/yzfsoldier/astroframe

## Overview

AstroQuest runs ASTRO BOT Rescue Mission on Steam Frame as a native ARM64 Linux program, using the shadPS4 emulator. The user supplies game files; the emulator runs their x86-64 code through FEX, renders through Vulkan, and uses the headset’s OpenXR runtime for VR. The README also documents controller input, SDL audio and microphone, foveated rendering, and emulated PSVR. Some of these capabilities are documented but their Steam Frame implementation paths are not visible in the supplied tree, so their links are documented relationships rather than source-traced calls.

Main entry points: [`shadps4-arm64-main/src/main.cpp`](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/main.cpp) (shadPS4 emulator), [`shadps4-arm64-main/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp`](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp) (Vulkan renderer), [`shadps4-arm64-main/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp`](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp) (Pipeline cache), [`shadps4-arm64-main/src/core/guest_cpu/guest_cpu.cpp`](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/core/guest_cpu/guest_cpu.cpp) (Guest CPU)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_execution["Emulation"]
  node_emulator["shadPS4 emulator<br/>[main.cpp]"]
  node_guestcpu["Guest CPU<br/>[guest_cpu.cpp]"]
  node_fex["FEX engine"]
  node_hle["PS4 system services"]
end

subgraph group_graphics["Graphics"]
  node_graphics["Vulkan renderer"]
  node_shader["Shader compilation"]
  node_pipeline["Pipeline cache"]
  node_cache[("Cache storage<br/>[cache_storage.cpp]")]
  node_foveation["Foveated rendering"]
end

subgraph group_vr["VR and input"]
  node_openxr["OpenXR runtime"]
  node_controllers["Gamepad input<br/>[controller.cpp]"]
  node_psvr["PSVR emulation"]
end

subgraph group_media["Audio"]
  node_audio["SDL audio"]
  node_microphone["SDL microphone<br/>[audioin.cpp]"]
end

node_player(("Steam Frame player"))
node_game["PS4 game files"]

node_player -->|"starts"| node_emulator
node_game -->|"loads"| node_emulator
node_emulator -->|"runs guest code"| node_fex
node_emulator -.->|"executes guest"| node_guestcpu
node_emulator -.->|"emulates services"| node_hle
node_emulator -->|"renders with"| node_graphics
node_graphics -.->|"uses shaders"| node_shader
node_graphics -->|"builds pipelines"| node_pipeline
node_pipeline -->|"loads and saves"| node_cache
node_emulator -->|"uses headset runtime"| node_openxr
node_player -->|"provides input"| node_controllers
node_openxr -->|"supplies eye tracking"| node_foveation
node_emulator -->|"emulates headset"| node_psvr
node_emulator -->|"outputs sound"| node_audio
node_player -->|"provides microphone"| node_microphone

click node_emulator "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/main.cpp"
click node_guestcpu "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/core/guest_cpu/guest_cpu.cpp"
click node_fex "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/core/fex/fex_guest_engine.cpp"
click node_hle "https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/core/libraries"
click node_graphics "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp"
click node_shader "https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/shader_recompiler"
click node_pipeline "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp"
click node_cache "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/cache_storage.cpp"
click node_controllers "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/input/controller.cpp"
click node_foveation "https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/video_core"
click node_psvr "https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/core/vr"
click node_audio "https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/core/libraries/audio"
click node_microphone "https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/core/libraries/audio/audioin.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_emulator,node_guestcpu,node_fex,node_hle toneBlue
class node_graphics,node_shader,node_pipeline,node_cache,node_foveation toneAmber
class node_openxr,node_controllers,node_psvr toneMint
class node_audio,node_microphone toneRose
class node_player,node_game toneIndigo
```

## Components

### Emulation

- [shadPS4 emulator](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/main.cpp): `shadps4-arm64-main/src/main.cpp`
- [Guest CPU](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/core/guest_cpu/guest_cpu.cpp): `shadps4-arm64-main/src/core/guest_cpu/guest_cpu.cpp`
- [FEX engine](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/core/fex/fex_guest_engine.cpp): `shadps4-arm64-main/src/core/fex/fex_guest_engine.cpp`
- [PS4 system services](https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/core/libraries): `shadps4-arm64-main/src/core/libraries`

### Graphics

- [Vulkan renderer](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp): `shadps4-arm64-main/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp`
- [Shader compilation](https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/shader_recompiler): `shadps4-arm64-main/src/shader_recompiler`
- [Pipeline cache](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp): `shadps4-arm64-main/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp`
- [Cache storage](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/video_core/cache_storage.cpp): `shadps4-arm64-main/src/video_core/cache_storage.cpp`
- [Foveated rendering](https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/video_core): `shadps4-arm64-main/src/video_core`

### VR and input

- **OpenXR runtime**
- [Gamepad input](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/input/controller.cpp): `shadps4-arm64-main/src/input/controller.cpp`
- [PSVR emulation](https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/core/vr): `shadps4-arm64-main/src/core/vr`

### Audio

- [SDL audio](https://github.com/yzfsoldier/astroframe/tree/steam-frame/shadps4-arm64-main/src/core/libraries/audio): `shadps4-arm64-main/src/core/libraries/audio`
- [SDL microphone](https://github.com/yzfsoldier/astroframe/blob/steam-frame/shadps4-arm64-main/src/core/libraries/audio/audioin.cpp): `shadps4-arm64-main/src/core/libraries/audio/audioin.cpp`

### Other components

- **Steam Frame player**
- **PS4 game files**

## Connections

- Steam Frame player → shadPS4 emulator: starts (evidence: `README.md`)
- PS4 game files → shadPS4 emulator: loads (evidence: `README.md`)
- shadPS4 emulator → FEX engine: runs guest code (evidence: `README.md`)
- shadPS4 emulator → Guest CPU: executes guest
- shadPS4 emulator → PS4 system services: emulates services
- shadPS4 emulator → Vulkan renderer: renders with (evidence: `README.md`)
- Vulkan renderer → Shader compilation: uses shaders (evidence: `shadps4-arm64-main/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp`)
- Vulkan renderer → Pipeline cache: builds pipelines (evidence: `shadps4-arm64-main/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp`)
- Pipeline cache → Cache storage: loads and saves (evidence: `shadps4-arm64-main/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp`)
- shadPS4 emulator → OpenXR runtime: uses headset runtime (evidence: `README.md`)
- Steam Frame player → Gamepad input: provides input (evidence: `README.md`)
- OpenXR runtime → Foveated rendering: supplies eye tracking (evidence: `README.md`)
- shadPS4 emulator → PSVR emulation: emulates headset (evidence: `README.md`)
- shadPS4 emulator → SDL audio: outputs sound (evidence: `README.md`)
- Steam Frame player → SDL microphone: provides microphone (evidence: `README.md`)
