# banjorecomp/banjorecomp architecture

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

- Interactive diagram: https://gitdiagram.com/banjorecomp/banjorecomp
- Repository: https://github.com/banjorecomp/banjorecomp

## Overview

Banjo: Recompiled is a native port of Banjo-Kazooie produced through static recompilation, with RT64 rendering and extensive mod support. The principal workflow is: a player supplies the original game, the launcher/runtime prepares it, and the recompiled game runs with patches and configurable enhancements. The graph preserves documented graphics, audio, input, save, and mod capabilities. Source excerpts are partial, so some subsystem links are dashed where implementation wiring was not shown.

Main entry points: [`src/main/main.cpp`](https://github.com/banjorecomp/banjorecomp/blob/main/src/main/main.cpp) (Application Runtime), [`src/game/recomp_api.cpp`](https://github.com/banjorecomp/banjorecomp/blob/main/src/game/recomp_api.cpp) (Recomp Game API), [`src/game/config.cpp`](https://github.com/banjorecomp/banjorecomp/blob/main/src/game/config.cpp) (User Configuration), [`patches/patches.h`](https://github.com/banjorecomp/banjorecomp/blob/main/patches/patches.h) (Game Patch Framework)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Launch and Runtime"]
  node_main["Application Runtime<br/>[main.cpp]"]
  node_launcher["Launcher Animation"]
  node_config["User Configuration<br/>[config.cpp]"]
  node_support["Platform Support<br/>[banjo_support.h]"]
end

subgraph group_integration["Game Integration"]
  node_decompression["ROM Decompression"]
  node_recomp_api["Recomp Game API<br/>[recomp_api.cpp]"]
  node_recomp_data["Mod Data API"]
  node_recomp_extensions["Mod Extension API"]
  node_overlays["Overlay Registration"]
  node_patch_registration["Patch Registration"]
  node_patches["Game Patch Framework<br/>[patches.h]"]
  node_slotmap[("Mod Data Storage<br/>[slot_map.h]")]
end

subgraph group_enhancements["Gameplay Enhancements"]
  node_saving["Notes and Jinjos<br/>[note_saving.c]"]
  node_camera["Camera Controls"]
end

subgraph group_rendering["Rendering and Audio"]
  node_transform["Transform Tagging"]
  node_hud["HUD Rendering"]
  node_graphics["Graphics Settings<br/>[graphics_patches.c]"]
  node_audio["Audio Processing<br/>[sound_patches.c]"]
end

node_player(("Player"))
node_game_rom["Original Game ROM"]
node_rt64["RT64 Renderer"]

node_player -->|"starts"| node_main
node_player -->|"provides"| node_game_rom
node_main -->|"sets up"| node_launcher
node_main -->|"uses settings"| node_config
node_main -.->|"prepares game"| node_decompression
node_game_rom -.->|"supplies data"| node_decompression
node_main -.->|"registers runtime API"| node_recomp_api
node_main -->|"registers overlays"| node_overlays
node_main -->|"registers patches"| node_patch_registration
node_patch_registration -.->|"registers"| node_patches
node_recomp_api -->|"reads options"| node_config
node_recomp_api -->|"exposes controls"| node_camera
node_recomp_api -.->|"exposes settings"| node_graphics
node_recomp_data -->|"stores mod data"| node_slotmap
node_recomp_extensions -->|"stores extensions"| node_slotmap
node_recomp_extensions -.->|"uses patch helpers"| node_patches
node_patches -.->|"enables save patches"| node_saving
node_config -.->|"configures saving"| node_saving
node_config -.->|"configures camera"| node_camera
node_transform -.->|"tags transforms"| node_rt64
node_hud -.->|"tags HUD rendering"| node_rt64
node_graphics -.->|"configures rendering"| node_rt64
node_audio -.->|"provides audio"| node_main
node_support -.->|"provides platform services"| node_main

click node_main "https://github.com/banjorecomp/banjorecomp/blob/main/src/main/main.cpp"
click node_launcher "https://github.com/banjorecomp/banjorecomp/blob/main/src/main/launcher_animation.cpp"
click node_config "https://github.com/banjorecomp/banjorecomp/blob/main/src/game/config.cpp"
click node_support "https://github.com/banjorecomp/banjorecomp/blob/main/include/banjo_support.h"
click node_decompression "https://github.com/banjorecomp/banjorecomp/blob/main/src/game/rom_decompression.cpp"
click node_recomp_api "https://github.com/banjorecomp/banjorecomp/blob/main/src/game/recomp_api.cpp"
click node_recomp_data "https://github.com/banjorecomp/banjorecomp/blob/main/src/game/recomp_data_api.cpp"
click node_recomp_extensions "https://github.com/banjorecomp/banjorecomp/blob/main/src/game/recomp_extension_api.cpp"
click node_overlays "https://github.com/banjorecomp/banjorecomp/blob/main/src/main/register_overlays.cpp"
click node_patch_registration "https://github.com/banjorecomp/banjorecomp/blob/main/src/main/register_patches.cpp"
click node_patches "https://github.com/banjorecomp/banjorecomp/blob/main/patches/patches.h"
click node_saving "https://github.com/banjorecomp/banjorecomp/blob/main/patches/note_saving.c"
click node_camera "https://github.com/banjorecomp/banjorecomp/blob/main/patches/camera_and_axis_inversion_patches.c"
click node_transform "https://github.com/banjorecomp/banjorecomp/blob/main/patches/transform_tagging.c"
click node_hud "https://github.com/banjorecomp/banjorecomp/blob/main/patches/hud_transform_tagging.c"
click node_graphics "https://github.com/banjorecomp/banjorecomp/blob/main/patches/graphics_patches.c"
click node_audio "https://github.com/banjorecomp/banjorecomp/blob/main/patches/sound_patches.c"
click node_slotmap "https://github.com/banjorecomp/banjorecomp/blob/main/lib/SlotMap/slot_map.h"

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_main,node_launcher,node_config,node_support toneBlue
class node_decompression,node_recomp_api,node_recomp_data,node_recomp_extensions,node_overlays,node_patch_registration,node_patches,node_slotmap toneAmber
class node_saving,node_camera toneMint
class node_transform,node_hud,node_graphics,node_audio toneRose
class node_player,node_game_rom,node_rt64 toneIndigo
```

## Components

### Launch and Runtime

- [Application Runtime](https://github.com/banjorecomp/banjorecomp/blob/main/src/main/main.cpp): `src/main/main.cpp`
- [Launcher Animation](https://github.com/banjorecomp/banjorecomp/blob/main/src/main/launcher_animation.cpp): `src/main/launcher_animation.cpp`
- [User Configuration](https://github.com/banjorecomp/banjorecomp/blob/main/src/game/config.cpp): `src/game/config.cpp`
- [Platform Support](https://github.com/banjorecomp/banjorecomp/blob/main/include/banjo_support.h): `include/banjo_support.h`

### Game Integration

- [ROM Decompression](https://github.com/banjorecomp/banjorecomp/blob/main/src/game/rom_decompression.cpp): `src/game/rom_decompression.cpp`
- [Recomp Game API](https://github.com/banjorecomp/banjorecomp/blob/main/src/game/recomp_api.cpp): `src/game/recomp_api.cpp`
- [Mod Data API](https://github.com/banjorecomp/banjorecomp/blob/main/src/game/recomp_data_api.cpp): `src/game/recomp_data_api.cpp`
- [Mod Extension API](https://github.com/banjorecomp/banjorecomp/blob/main/src/game/recomp_extension_api.cpp): `src/game/recomp_extension_api.cpp`
- [Overlay Registration](https://github.com/banjorecomp/banjorecomp/blob/main/src/main/register_overlays.cpp): `src/main/register_overlays.cpp`
- [Patch Registration](https://github.com/banjorecomp/banjorecomp/blob/main/src/main/register_patches.cpp): `src/main/register_patches.cpp`
- [Game Patch Framework](https://github.com/banjorecomp/banjorecomp/blob/main/patches/patches.h): `patches/patches.h`
- [Mod Data Storage](https://github.com/banjorecomp/banjorecomp/blob/main/lib/SlotMap/slot_map.h): `lib/SlotMap/slot_map.h`

### Gameplay Enhancements

- [Notes and Jinjos](https://github.com/banjorecomp/banjorecomp/blob/main/patches/note_saving.c): `patches/note_saving.c`
- [Camera Controls](https://github.com/banjorecomp/banjorecomp/blob/main/patches/camera_and_axis_inversion_patches.c): `patches/camera_and_axis_inversion_patches.c`

### Rendering and Audio

- [Transform Tagging](https://github.com/banjorecomp/banjorecomp/blob/main/patches/transform_tagging.c): `patches/transform_tagging.c`
- [HUD Rendering](https://github.com/banjorecomp/banjorecomp/blob/main/patches/hud_transform_tagging.c): `patches/hud_transform_tagging.c`
- [Graphics Settings](https://github.com/banjorecomp/banjorecomp/blob/main/patches/graphics_patches.c): `patches/graphics_patches.c`
- [Audio Processing](https://github.com/banjorecomp/banjorecomp/blob/main/patches/sound_patches.c): `patches/sound_patches.c`

### Other components

- **Player**
- **Original Game ROM**
- **RT64 Renderer**

## Connections

- Player → Application Runtime: starts (evidence: `README.md`)
- Player → Original Game ROM: provides (evidence: `README.md`)
- Application Runtime → Launcher Animation: sets up (evidence: `src/main/main.cpp`)
- Application Runtime → User Configuration: uses settings (evidence: `src/main/main.cpp`)
- Application Runtime → ROM Decompression: prepares game
- Original Game ROM → ROM Decompression: supplies data
- Application Runtime → Recomp Game API: registers runtime API
- Application Runtime → Overlay Registration: registers overlays (evidence: `src/main/main.cpp`)
- Application Runtime → Patch Registration: registers patches (evidence: `src/main/main.cpp`)
- Patch Registration → Game Patch Framework: registers
- Recomp Game API → User Configuration: reads options (evidence: `src/game/recomp_api.cpp`)
- Recomp Game API → Camera Controls: exposes controls (evidence: `src/game/recomp_api.cpp`)
- Recomp Game API → Graphics Settings: exposes settings
- Mod Data API → Mod Data Storage: stores mod data (evidence: `src/game/recomp_data_api.cpp`)
- Mod Extension API → Mod Data Storage: stores extensions (evidence: `src/game/recomp_extension_api.cpp`)
- Mod Extension API → Game Patch Framework: uses patch helpers
- Game Patch Framework → Notes and Jinjos: enables save patches (evidence: `patches/note_saving.c`)
- User Configuration → Notes and Jinjos: configures saving
- User Configuration → Camera Controls: configures camera
- Transform Tagging → RT64 Renderer: tags transforms
- HUD Rendering → RT64 Renderer: tags HUD rendering
- Graphics Settings → RT64 Renderer: configures rendering
- Audio Processing → Application Runtime: provides audio
- Platform Support → Application Runtime: provides platform services (evidence: `src/main/main.cpp`)
