# librologica/3dvibe64 architecture

> Architecture diagram of the GitHub repository librologica/3dvibe64, 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/librologica/3dvibe64
- Repository: https://github.com/librologica/3dvibe64

## Overview

3Dvibe64 is a source SDK for generating Commodore 64 graphics and runtime applications. The principal workflow is a developer supplying scene or render settings to a mode-specific builder, which validates/configures the request and emits native code; optional runtime-scene and animation compilers extend that workflow. The graph preserves the documented modes 1–8, distance fade, AnimatedMesh, and RuntimeScene. Several gameplay subsystems are represented at their exact directories because their implementation files were not sampled; their internal connections are therefore omitted.

Main entry points: [`work/mode8/build.py`](https://github.com/librologica/3dvibe64/blob/main/work/mode8/build.py) (Mode 8 Builder), [`work/q8/build.py`](https://github.com/librologica/3dvibe64/blob/main/work/q8/build.py) (Q8 Adapter), [`work/runtime_scene.py`](https://github.com/librologica/3dvibe64/blob/main/work/runtime_scene.py) (Runtime Scene Compiler), [`work/runtime_support_native.py`](https://github.com/librologica/3dvibe64/blob/main/work/runtime_support_native.py) (Native Runtime Support)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_builders["Mode Builders"]
  node_mode7["Mode 7 Builder<br/>[mode7.py]"]
  node_legacy["LegacyPlus Renderer"]
  node_mode7parent["Mode 7 Geometry"]
end

subgraph group_q8["Q8 Rendering"]
  node_q8build["Q8 Adapter<br/>[build.py]"]
  node_q8continuous["Continuous Geometry<br/>[continuous.py]"]
  node_q8emit["Assembly Emitter<br/>[emit.py]"]
  node_q8allocation["Code Allocation<br/>[allocation.py]"]
  node_q8normalized["Normalized Geometry<br/>[normalized.py]"]
  node_q8modes["Normalized Modes<br/>[nf_modes.py]"]
  node_q8perspective["Perspective Mapping<br/>[perspective.py]"]
  node_q8edges["Texture Edges<br/>[texture_edges.py]"]
  node_q8texture["Texture Rendering<br/>[texture.py]"]
  node_q8camera["Camera Setup<br/>[camera.py]"]
  node_q8screen["Screen Operations<br/>[screen.py]"]
  node_q8exact["Exact Projection"]
end

subgraph group_mode8["Mode 8"]
  node_mode8build["Mode 8 Builder<br/>[build.py]"]
  node_mode8contract["Scene Contract<br/>[contract.py]"]
  node_mode8nav["Navigation Model<br/>[navigation.py]"]
  node_mode8walls["Wall Events<br/>[walls.py]"]
  node_mode8model["Map Model<br/>[model.py]"]
end

subgraph group_runtime["Runtime Capabilities"]
  node_distance["Distance Fade<br/>[distance_fade.py]"]
  node_animated["Animated Mesh Compiler<br/>[animated_mesh.py]"]
  node_scene["Runtime Scene Compiler<br/>[runtime_scene.py]"]
  node_native["Native Runtime Support"]
  node_contacts["Runtime Contacts"]
end

subgraph group_gameplay["Gameplay Extensions"]
  node_dynamics["Scene Dynamics<br/>[dynamics.py]"]
  node_gameplaylevel["Level Data"]
  node_gameplaymaterials["Materials"]
  node_gameplayentities["Entities"]
  node_gameplayvisibility["Visibility"]
  node_gameplaybillboards["Billboards"]
  node_gameplaymotion["Controlled Motion"]
  node_gameplayworld["World Groups"]
end

node_developer(("SDK User"))

node_developer -.->|"configures"| node_mode7
node_developer -->|"supplies scene"| node_mode8build
node_developer -->|"selects precision"| node_q8build
node_developer -.->|"provides scene"| node_scene
node_developer -.->|"provides animation"| node_animated
node_mode8build -->|"validates with"| node_mode8contract
node_mode8build -->|"simulates with"| node_mode8nav
node_mode8build -->|"uses"| node_mode8walls
node_mode8build -->|"uses"| node_mode8model
node_mode8contract -->|"checks model"| node_mode8model
node_mode8nav -->|"reads topology"| node_mode8model
node_q8build -->|"selects adapter"| node_q8continuous
node_q8build -->|"uses"| node_q8emit
node_q8build -->|"uses"| node_q8camera
node_q8build -->|"uses"| node_q8texture
node_q8continuous -->|"imports helpers"| node_q8emit
node_q8continuous -->|"uses screen ABI"| node_q8screen
node_q8emit -->|"allocates through"| node_q8allocation
node_q8normalized -->|"extends modes"| node_q8modes
node_q8modes -->|"imports geometry"| node_q8normalized
node_q8texture -->|"uses"| node_q8edges
node_q8perspective -->|"uses"| node_q8edges
node_scene -->|"integrates"| node_animated
node_scene -->|"patches renderer"| node_legacy
node_scene -->|"emits support"| node_native
node_scene -->|"uses contracts"| node_dynamics
node_native -->|"extends renderer"| node_legacy
node_native -->|"supports"| node_animated
node_native -->|"uses"| node_contacts
node_mode7 -.->|"uses geometry"| node_mode7parent
node_mode8build -.->|"offers fade"| node_distance
node_developer -.->|"configures"| node_gameplaylevel
node_developer -.->|"configures"| node_gameplaymaterials
node_developer -.->|"configures"| node_gameplayentities
node_developer -.->|"configures"| node_gameplayvisibility
node_developer -.->|"configures"| node_gameplaybillboards
node_developer -.->|"configures"| node_gameplaymotion
node_developer -.->|"configures"| node_gameplayworld

click node_mode7 "https://github.com/librologica/3dvibe64/blob/main/work/mode7.py"
click node_mode8build "https://github.com/librologica/3dvibe64/blob/main/work/mode8/build.py"
click node_mode8contract "https://github.com/librologica/3dvibe64/blob/main/work/mode8/contract.py"
click node_mode8nav "https://github.com/librologica/3dvibe64/blob/main/work/mode8/navigation.py"
click node_mode8walls "https://github.com/librologica/3dvibe64/blob/main/work/mode8/walls.py"
click node_mode8model "https://github.com/librologica/3dvibe64/blob/main/work/mode8/model.py"
click node_q8build "https://github.com/librologica/3dvibe64/blob/main/work/q8/build.py"
click node_q8continuous "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/continuous.py"
click node_q8emit "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/emit.py"
click node_q8allocation "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/allocation.py"
click node_q8normalized "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/normalized.py"
click node_q8modes "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/nf_modes.py"
click node_q8perspective "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/perspective.py"
click node_q8edges "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/texture_edges.py"
click node_q8texture "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/texture.py"
click node_q8camera "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/camera.py"
click node_q8screen "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/screen.py"
click node_q8exact "https://github.com/librologica/3dvibe64/blob/main/work/q8/src/perspective_exact.py"
click node_legacy "https://github.com/librologica/3dvibe64/blob/main/work/legacy_plus_exact.py"
click node_mode7parent "https://github.com/librologica/3dvibe64/blob/main/work/legacy_mode7_parent_exact.py"
click node_distance "https://github.com/librologica/3dvibe64/blob/main/work/distance_fade.py"
click node_animated "https://github.com/librologica/3dvibe64/blob/main/work/animated_mesh.py"
click node_scene "https://github.com/librologica/3dvibe64/blob/main/work/runtime_scene.py"
click node_native "https://github.com/librologica/3dvibe64/blob/main/work/runtime_support_native.py"
click node_contacts "https://github.com/librologica/3dvibe64/blob/main/work/runtime_contacts.py"
click node_dynamics "https://github.com/librologica/3dvibe64/blob/main/extensions/gameplay/dynamics.py"
click node_gameplaylevel "https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/level"
click node_gameplaymaterials "https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/materials"
click node_gameplayentities "https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/entities"
click node_gameplayvisibility "https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/visibility"
click node_gameplaybillboards "https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/billboards"
click node_gameplaymotion "https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/motion"
click node_gameplayworld "https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/world"

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_mode7,node_legacy,node_mode7parent,node_developer toneBlue
class node_q8build,node_q8continuous,node_q8emit,node_q8allocation,node_q8normalized,node_q8modes,node_q8perspective,node_q8edges,node_q8texture,node_q8camera,node_q8screen,node_q8exact toneAmber
class node_mode8build,node_mode8contract,node_mode8nav,node_mode8walls,node_mode8model toneMint
class node_distance,node_animated,node_scene,node_native,node_contacts toneRose
class node_dynamics,node_gameplaylevel,node_gameplaymaterials,node_gameplayentities,node_gameplayvisibility,node_gameplaybillboards,node_gameplaymotion,node_gameplayworld toneIndigo
```

## Components

### Mode Builders

- [Mode 7 Builder](https://github.com/librologica/3dvibe64/blob/main/work/mode7.py): `work/mode7.py`
- [LegacyPlus Renderer](https://github.com/librologica/3dvibe64/blob/main/work/legacy_plus_exact.py): `work/legacy_plus_exact.py`
- [Mode 7 Geometry](https://github.com/librologica/3dvibe64/blob/main/work/legacy_mode7_parent_exact.py): `work/legacy_mode7_parent_exact.py`

### Q8 Rendering

- [Q8 Adapter](https://github.com/librologica/3dvibe64/blob/main/work/q8/build.py): `work/q8/build.py`
- [Continuous Geometry](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/continuous.py): `work/q8/src/continuous.py`
- [Assembly Emitter](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/emit.py): `work/q8/src/emit.py`
- [Code Allocation](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/allocation.py): `work/q8/src/allocation.py`
- [Normalized Geometry](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/normalized.py): `work/q8/src/normalized.py`
- [Normalized Modes](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/nf_modes.py): `work/q8/src/nf_modes.py`
- [Perspective Mapping](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/perspective.py): `work/q8/src/perspective.py`
- [Texture Edges](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/texture_edges.py): `work/q8/src/texture_edges.py`
- [Texture Rendering](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/texture.py): `work/q8/src/texture.py`
- [Camera Setup](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/camera.py): `work/q8/src/camera.py`
- [Screen Operations](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/screen.py): `work/q8/src/screen.py`
- [Exact Projection](https://github.com/librologica/3dvibe64/blob/main/work/q8/src/perspective_exact.py): `work/q8/src/perspective_exact.py`

### Mode 8

- [Mode 8 Builder](https://github.com/librologica/3dvibe64/blob/main/work/mode8/build.py): `work/mode8/build.py`
- [Scene Contract](https://github.com/librologica/3dvibe64/blob/main/work/mode8/contract.py): `work/mode8/contract.py`
- [Navigation Model](https://github.com/librologica/3dvibe64/blob/main/work/mode8/navigation.py): `work/mode8/navigation.py`
- [Wall Events](https://github.com/librologica/3dvibe64/blob/main/work/mode8/walls.py): `work/mode8/walls.py`
- [Map Model](https://github.com/librologica/3dvibe64/blob/main/work/mode8/model.py): `work/mode8/model.py`

### Runtime Capabilities

- [Distance Fade](https://github.com/librologica/3dvibe64/blob/main/work/distance_fade.py): `work/distance_fade.py`
- [Animated Mesh Compiler](https://github.com/librologica/3dvibe64/blob/main/work/animated_mesh.py): `work/animated_mesh.py`
- [Runtime Scene Compiler](https://github.com/librologica/3dvibe64/blob/main/work/runtime_scene.py): `work/runtime_scene.py`
- [Native Runtime Support](https://github.com/librologica/3dvibe64/blob/main/work/runtime_support_native.py): `work/runtime_support_native.py`
- [Runtime Contacts](https://github.com/librologica/3dvibe64/blob/main/work/runtime_contacts.py): `work/runtime_contacts.py`

### Gameplay Extensions

- [Scene Dynamics](https://github.com/librologica/3dvibe64/blob/main/extensions/gameplay/dynamics.py): `extensions/gameplay/dynamics.py`
- [Level Data](https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/level): `extensions/gameplay/level`
- [Materials](https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/materials): `extensions/gameplay/materials`
- [Entities](https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/entities): `extensions/gameplay/entities`
- [Visibility](https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/visibility): `extensions/gameplay/visibility`
- [Billboards](https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/billboards): `extensions/gameplay/billboards`
- [Controlled Motion](https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/motion): `extensions/gameplay/motion`
- [World Groups](https://github.com/librologica/3dvibe64/tree/main/extensions/gameplay/world): `extensions/gameplay/world`

### Other components

- **SDK User**

## Connections

- SDK User → Mode 7 Builder: configures (evidence: `README.md`)
- SDK User → Mode 8 Builder: supplies scene (evidence: `work/mode8/build.py`)
- SDK User → Q8 Adapter: selects precision (evidence: `work/q8/build.py`)
- SDK User → Runtime Scene Compiler: provides scene (evidence: `README.md`)
- SDK User → Animated Mesh Compiler: provides animation (evidence: `README.md`)
- Mode 8 Builder → Scene Contract: validates with (evidence: `work/mode8/build.py`)
- Mode 8 Builder → Navigation Model: simulates with (evidence: `work/mode8/build.py`)
- Mode 8 Builder → Wall Events: uses (evidence: `work/mode8/build.py`)
- Mode 8 Builder → Map Model: uses (evidence: `work/mode8/build.py`)
- Scene Contract → Map Model: checks model (evidence: `work/mode8/contract.py`)
- Navigation Model → Map Model: reads topology (evidence: `work/mode8/navigation.py`)
- Q8 Adapter → Continuous Geometry: selects adapter (evidence: `work/q8/build.py`)
- Q8 Adapter → Assembly Emitter: uses (evidence: `work/q8/build.py`)
- Q8 Adapter → Camera Setup: uses (evidence: `work/q8/build.py`)
- Q8 Adapter → Texture Rendering: uses (evidence: `work/q8/build.py`)
- Continuous Geometry → Assembly Emitter: imports helpers (evidence: `work/q8/src/continuous.py`)
- Continuous Geometry → Screen Operations: uses screen ABI (evidence: `work/q8/src/continuous.py`)
- Assembly Emitter → Code Allocation: allocates through (evidence: `work/q8/src/emit.py`)
- Normalized Geometry → Normalized Modes: extends modes (evidence: `work/q8/src/normalized.py`)
- Normalized Modes → Normalized Geometry: imports geometry (evidence: `work/q8/src/nf_modes.py`)
- Texture Rendering → Texture Edges: uses (evidence: `work/q8/src/texture.py`)
- Perspective Mapping → Texture Edges: uses (evidence: `work/q8/src/perspective.py`)
- Runtime Scene Compiler → Animated Mesh Compiler: integrates (evidence: `work/runtime_scene.py`)
- Runtime Scene Compiler → LegacyPlus Renderer: patches renderer (evidence: `work/runtime_scene.py`)
- Runtime Scene Compiler → Native Runtime Support: emits support (evidence: `work/runtime_scene.py`)
- Runtime Scene Compiler → Scene Dynamics: uses contracts (evidence: `work/runtime_scene.py`)
- Native Runtime Support → LegacyPlus Renderer: extends renderer (evidence: `work/runtime_support_native.py`)
- Native Runtime Support → Animated Mesh Compiler: supports (evidence: `work/runtime_support_native.py`)
- Native Runtime Support → Runtime Contacts: uses (evidence: `work/runtime_support_native.py`)
- Mode 7 Builder → Mode 7 Geometry: uses geometry
- Mode 8 Builder → Distance Fade: offers fade (evidence: `work/mode8/build.py`)
- SDK User → Level Data: configures (evidence: `README.md`)
- SDK User → Materials: configures (evidence: `README.md`)
- SDK User → Entities: configures (evidence: `README.md`)
- SDK User → Visibility: configures (evidence: `README.md`)
- SDK User → Billboards: configures (evidence: `README.md`)
- SDK User → Controlled Motion: configures (evidence: `README.md`)
- SDK User → World Groups: configures (evidence: `README.md`)
