# tangerineturtle1/nx2navi architecture

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

- Interactive diagram: https://gitdiagram.com/tangerineturtle1/nx2navi
- Repository: https://github.com/tangerineturtle1/nx2navi

## Overview

NX2navi turns a user’s legally obtained game dump into a native x86-64 game build, then launches and updates it. The runtime replays the game through Vulkan and supplies platform, input, audio, settings, and menu features. The graph retains the documented installation/build stages and major runtime capabilities; some subsystem links are supported only by README statements or source-index references, so unsampled implementation details are not inferred.

Main entry points: [`runtime/main.c`](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/main.c) (Runtime entry), [`runtime/host.h`](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/host.h) (Guest host), [`launcher/ui/app.py`](https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/ui/app.py) (Launcher UI), [`launcher/build.py`](https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/build.py) (Build orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and launch"]
  node_installer["Installer workflow<br/>[steps.py]"]
  node_launcher_ui["Launcher UI<br/>[app.py]"]
  node_launcher_jobs["Launcher jobs<br/>[jobs.py]"]
  node_launcher_build["Build orchestration<br/>[build.py]"]
  node_launcher_settings["Launcher settings<br/>[settings.py]"]
end

subgraph group_build["Game build"]
  node_gamefiles["Game files<br/>[gamefiles.py]"]
  node_recompiler["Static recompiler<br/>[lifter.py]"]
  node_simd_lowering["SIMD lowering<br/>[simd_c.py]"]
  node_shader_translator["Shader translator<br/>[Program.cs]"]
end

subgraph group_runtime["Runtime core"]
  node_runtime_entry["Runtime entry<br/>[main.c]"]
  node_runtime_host["Guest host<br/>[host.h]"]
  node_platform["Platform services<br/>[platform.h]"]
  node_settings["Runtime settings<br/>[cfg.h]"]
end

subgraph group_graphics["Graphics"]
  node_vulkan_replay["Vulkan replay<br/>[vk_pipeline.c]"]
  node_frame_generation["Frame generation<br/>[vk_fg.cpp]"]
end

subgraph group_experience["Player experience"]
  node_player_input["Input handling<br/>[input.c]"]
  node_game_audio["Audio system<br/>[audren.c]"]
  node_game_menu["In-game menu<br/>[menu.cpp]"]
end

node_player(("Player"))
node_game_dump["Game dump"]
node_discord["Discord presence"]

node_player -->|"starts setup"| node_installer
node_game_dump -->|"provides dump"| node_installer
node_installer -->|"extracts game data"| node_gamefiles
node_player -->|"launches game"| node_launcher_ui
node_launcher_ui -->|"starts jobs"| node_launcher_jobs
node_launcher_jobs -->|"runs build"| node_launcher_build
node_launcher_build -.->|"prepares game files"| node_gamefiles
node_gamefiles -.->|"supplies game input"| node_recompiler
node_recompiler -->|"uses lowering"| node_simd_lowering
node_launcher_build -.->|"builds shaders"| node_shader_translator
node_player -->|"runs built game"| node_runtime_entry
node_runtime_entry -->|"runs guest code"| node_runtime_host
node_runtime_entry -->|"uses platform services"| node_platform
node_runtime_entry -->|"initializes settings"| node_settings
node_runtime_host -->|"replays graphics"| node_vulkan_replay
node_shader_translator -->|"translates shaders for"| node_vulkan_replay
node_vulkan_replay -.->|"supports frame generation"| node_frame_generation
node_runtime_host -.->|"handles controls"| node_player_input
node_runtime_host -.->|"provides game audio"| node_game_audio
node_runtime_entry -.->|"runs settings menu"| node_game_menu
node_game_menu -->|"changes settings"| node_settings
node_launcher_ui -->|"reads settings"| node_launcher_settings
node_launcher_settings -->|"configures game"| node_settings
node_runtime_entry -.->|"reports play status"| node_discord

click node_installer "https://github.com/tangerineturtle1/nx2navi/blob/main/installer/steps.py"
click node_launcher_ui "https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/ui/app.py"
click node_launcher_jobs "https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/jobs.py"
click node_launcher_build "https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/build.py"
click node_gamefiles "https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/gamefiles.py"
click node_recompiler "https://github.com/tangerineturtle1/nx2navi/blob/main/recomp/lifter.py"
click node_simd_lowering "https://github.com/tangerineturtle1/nx2navi/blob/main/recomp/simd_c.py"
click node_shader_translator "https://github.com/tangerineturtle1/nx2navi/blob/main/tools/xlate/Program.cs"
click node_runtime_entry "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/main.c"
click node_runtime_host "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/host.h"
click node_platform "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/platform/platform.h"
click node_settings "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/cfg.h"
click node_vulkan_replay "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/vk_pipeline.c"
click node_frame_generation "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/vk_fg.cpp"
click node_player_input "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/input.c"
click node_game_audio "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/audren.c"
click node_game_menu "https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/ui/menu.cpp"
click node_launcher_settings "https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/settings.py"

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_installer,node_launcher_ui,node_launcher_jobs,node_launcher_build,node_launcher_settings toneBlue
class node_gamefiles,node_recompiler,node_simd_lowering,node_shader_translator toneAmber
class node_runtime_entry,node_runtime_host,node_platform,node_settings toneMint
class node_vulkan_replay,node_frame_generation toneRose
class node_player_input,node_game_audio,node_game_menu,node_player,node_game_dump,node_discord toneIndigo
```

## Components

### Setup and launch

- [Installer workflow](https://github.com/tangerineturtle1/nx2navi/blob/main/installer/steps.py): `installer/steps.py`
- [Launcher UI](https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/ui/app.py): `launcher/ui/app.py`
- [Launcher jobs](https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/jobs.py): `launcher/jobs.py`
- [Build orchestration](https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/build.py): `launcher/build.py`
- [Launcher settings](https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/settings.py): `launcher/settings.py`

### Game build

- [Game files](https://github.com/tangerineturtle1/nx2navi/blob/main/launcher/gamefiles.py): `launcher/gamefiles.py`
- [Static recompiler](https://github.com/tangerineturtle1/nx2navi/blob/main/recomp/lifter.py): `recomp/lifter.py`
- [SIMD lowering](https://github.com/tangerineturtle1/nx2navi/blob/main/recomp/simd_c.py): `recomp/simd_c.py`
- [Shader translator](https://github.com/tangerineturtle1/nx2navi/blob/main/tools/xlate/Program.cs): `tools/xlate/Program.cs`

### Runtime core

- [Runtime entry](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/main.c): `runtime/main.c`
- [Guest host](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/host.h): `runtime/host.h`
- [Platform services](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/platform/platform.h): `runtime/platform/platform.h`
- [Runtime settings](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/cfg.h): `runtime/cfg.h`

### Graphics

- [Vulkan replay](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/vk_pipeline.c): `runtime/vk_pipeline.c`
- [Frame generation](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/vk_fg.cpp): `runtime/vk_fg.cpp`

### Player experience

- [Input handling](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/input.c): `runtime/input.c`
- [Audio system](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/audren.c): `runtime/audren.c`
- [In-game menu](https://github.com/tangerineturtle1/nx2navi/blob/main/runtime/ui/menu.cpp): `runtime/ui/menu.cpp`

### Other components

- **Player**
- **Game dump**
- **Discord presence**

## Connections

- Player → Installer workflow: starts setup (evidence: `README.md`)
- Game dump → Installer workflow: provides dump (evidence: `README.md`)
- Installer workflow → Game files: extracts game data (evidence: `installer/steps.py`)
- Player → Launcher UI: launches game (evidence: `README.md`)
- Launcher UI → Launcher jobs: starts jobs (evidence: `launcher/ui/app.py`)
- Launcher jobs → Build orchestration: runs build (evidence: `launcher/jobs.py`)
- Build orchestration → Game files: prepares game files
- Game files → Static recompiler: supplies game input
- Static recompiler → SIMD lowering: uses lowering (evidence: `recomp/lifter.py`)
- Build orchestration → Shader translator: builds shaders
- Player → Runtime entry: runs built game (evidence: `README.md`)
- Runtime entry → Guest host: runs guest code (evidence: `runtime/main.c`)
- Runtime entry → Platform services: uses platform services (evidence: `runtime/main.c`)
- Runtime entry → Runtime settings: initializes settings (evidence: `runtime/main.c`)
- Guest host → Vulkan replay: replays graphics (evidence: `runtime/vk_pipeline.c`)
- Shader translator → Vulkan replay: translates shaders for (evidence: `runtime/vk_pipeline.c`)
- Vulkan replay → Frame generation: supports frame generation
- Guest host → Input handling: handles controls
- Guest host → Audio system: provides game audio
- Runtime entry → In-game menu: runs settings menu
- In-game menu → Runtime settings: changes settings (evidence: `runtime/cfg.h`)
- Launcher UI → Launcher settings: reads settings (evidence: `launcher/ui/app.py`)
- Launcher settings → Runtime settings: configures game
- Runtime entry → Discord presence: reports play status
