# nepjr/oot-nx architecture

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

- Interactive diagram: https://gitdiagram.com/nepjr/oot-nx
- Repository: https://github.com/nepjr/oot-nx

## Overview

This repository is a work-in-progress decompilation of The Legend of Zelda: Ocarina of Time, not a PC port. Its principal user-facing workflow is the game runtime: startup initializes system services, a graph thread drives gameplay and presentation, and the player interacts with a world of scenes and actors. The tree also shows distinct audio, save, effects, and interface subsystems. The sampled main and overlay-manager files support only a few concrete runtime links; other subsystem connections are omitted rather than inferred.

Main entry points: [`src/code/main.c`](https://github.com/nepjr/oot-nx/blob/master/src/code/main.c) (Main initialization), [`src/code/z_kaleido_manager.c`](https://github.com/nepjr/oot-nx/blob/master/src/code/z_kaleido_manager.c) (Interface and menus), [`src/code/sched.c`](https://github.com/nepjr/oot-nx/blob/master/src/code/sched.c) (Scheduler), [`src/code/load.c`](https://github.com/nepjr/oot-nx/blob/master/src/code/load.c) (Overlay loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and scheduling"]
  node_main["Main initialization<br/>[main.c]"]
  node_scheduler["Scheduler<br/>[sched.c]"]
  node_game["Game state<br/>[game.c]"]
  node_overlay_loader["Overlay loading<br/>[load.c]"]
end

subgraph group_world["World and gameplay"]
  node_scene["Scene and room loading<br/>[z_scene.c]"]
  node_actors["Actor systems<br/>[z_actor.c]"]
  node_player_actor["Player actor<br/>[z_player.c]"]
  node_collision["Collision checks"]
  node_camera["Camera<br/>[z_camera.c]"]
end

subgraph group_presentation["Presentation"]
  node_interface["Interface and menus"]
  node_graphics["Graphics pipeline<br/>[graph.c]"]
  node_effects["Effects<br/>[z_effect.c]"]
end

subgraph group_services["Platform services"]
  node_audio["Audio system<br/>[audioMgr.c]"]
  node_input["Controller input<br/>[controller.c]"]
  node_save["Save data<br/>[z_sram.c]"]
end

node_player(("Player"))

node_main -->|"initializes"| node_input
node_main -->|"unlocks"| node_audio
node_main -->|"starts thread"| node_graphics
node_main -->|"initializes"| node_scheduler
node_main -.->|"initializes"| node_interface
node_interface -->|"loads overlays"| node_overlay_loader
node_player -.->|"starts game"| node_main

click node_main "https://github.com/nepjr/oot-nx/blob/master/src/code/main.c"
click node_scheduler "https://github.com/nepjr/oot-nx/blob/master/src/code/sched.c"
click node_game "https://github.com/nepjr/oot-nx/blob/master/src/code/game.c"
click node_scene "https://github.com/nepjr/oot-nx/blob/master/src/code/z_scene.c"
click node_actors "https://github.com/nepjr/oot-nx/blob/master/src/code/z_actor.c"
click node_player_actor "https://github.com/nepjr/oot-nx/blob/master/src/overlays/actors/ovl_player_actor/z_player.c"
click node_collision "https://github.com/nepjr/oot-nx/blob/master/src/code/z_collision_check.c"
click node_camera "https://github.com/nepjr/oot-nx/blob/master/src/code/z_camera.c"
click node_interface "https://github.com/nepjr/oot-nx/blob/master/src/code/z_kaleido_manager.c"
click node_graphics "https://github.com/nepjr/oot-nx/blob/master/src/code/graph.c"
click node_effects "https://github.com/nepjr/oot-nx/blob/master/src/code/z_effect.c"
click node_audio "https://github.com/nepjr/oot-nx/blob/master/src/code/audioMgr.c"
click node_input "https://github.com/nepjr/oot-nx/blob/master/src/libultra/io/controller.c"
click node_save "https://github.com/nepjr/oot-nx/blob/master/src/code/z_sram.c"
click node_overlay_loader "https://github.com/nepjr/oot-nx/blob/master/src/code/load.c"

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_scheduler,node_game,node_overlay_loader toneBlue
class node_scene,node_actors,node_player_actor,node_collision,node_camera toneAmber
class node_interface,node_graphics,node_effects toneMint
class node_audio,node_input,node_save toneRose
class node_player toneIndigo
```

## Components

### Runtime and scheduling

- [Main initialization](https://github.com/nepjr/oot-nx/blob/master/src/code/main.c): `src/code/main.c`
- [Scheduler](https://github.com/nepjr/oot-nx/blob/master/src/code/sched.c): `src/code/sched.c`
- [Game state](https://github.com/nepjr/oot-nx/blob/master/src/code/game.c): `src/code/game.c`
- [Overlay loading](https://github.com/nepjr/oot-nx/blob/master/src/code/load.c): `src/code/load.c`

### World and gameplay

- [Scene and room loading](https://github.com/nepjr/oot-nx/blob/master/src/code/z_scene.c): `src/code/z_scene.c`
- [Actor systems](https://github.com/nepjr/oot-nx/blob/master/src/code/z_actor.c): `src/code/z_actor.c`
- [Player actor](https://github.com/nepjr/oot-nx/blob/master/src/overlays/actors/ovl_player_actor/z_player.c): `src/overlays/actors/ovl_player_actor/z_player.c`
- [Collision checks](https://github.com/nepjr/oot-nx/blob/master/src/code/z_collision_check.c): `src/code/z_collision_check.c`
- [Camera](https://github.com/nepjr/oot-nx/blob/master/src/code/z_camera.c): `src/code/z_camera.c`

### Presentation

- [Interface and menus](https://github.com/nepjr/oot-nx/blob/master/src/code/z_kaleido_manager.c): `src/code/z_kaleido_manager.c`
- [Graphics pipeline](https://github.com/nepjr/oot-nx/blob/master/src/code/graph.c): `src/code/graph.c`
- [Effects](https://github.com/nepjr/oot-nx/blob/master/src/code/z_effect.c): `src/code/z_effect.c`

### Platform services

- [Audio system](https://github.com/nepjr/oot-nx/blob/master/src/code/audioMgr.c): `src/code/audioMgr.c`
- [Controller input](https://github.com/nepjr/oot-nx/blob/master/src/libultra/io/controller.c): `src/libultra/io/controller.c`
- [Save data](https://github.com/nepjr/oot-nx/blob/master/src/code/z_sram.c): `src/code/z_sram.c`

### Other components

- **Player**

## Connections

- Main initialization → Controller input: initializes (evidence: `src/code/main.c`)
- Main initialization → Audio system: unlocks (evidence: `src/code/main.c`)
- Main initialization → Graphics pipeline: starts thread (evidence: `src/code/main.c`)
- Main initialization → Scheduler: initializes (evidence: `src/code/main.c`)
- Main initialization → Interface and menus: initializes
- Interface and menus → Overlay loading: loads overlays (evidence: `src/code/z_kaleido_manager.c`)
- Player → Main initialization: starts game
