# calab/coco_crypts_of_vael architecture

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

- Interactive diagram: https://gitdiagram.com/calab/coco_crypts_of_vael
- Repository: https://github.com/calab/coco_crypts_of_vael

## Overview

Crypts of Vael is a CoCo 3 first-person dungeon-crawl game, not a web service. The player enters seeded or random runs, issues typed commands to explore five generated crypt levels, manages light and equipment, fights monsters, and seeks the Hollow King’s crown. The README documents rendering, sound, monitor selection, and banked-memory loading; source excerpts focus on asset-generation tools rather than gameplay assembly, so runtime subsystem links are documented at README level and not presented as inspected call chains.

Main entry points: [`src/main.asm`](https://github.com/calab/coco_crypts_of_vael/blob/main/src/main.asm) (Game entry), [`src/cmd.asm`](https://github.com/calab/coco_crypts_of_vael/blob/main/src/cmd.asm) (Typed commands), [`src/sim.asm`](https://github.com/calab/coco_crypts_of_vael/blob/main/src/sim.asm) (Game simulation), [`src/attack.asm`](https://github.com/calab/coco_crypts_of_vael/blob/main/src/attack.asm) (Combat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game play"]
  node_entry["Game entry<br/>[main.asm]"]
  node_commands["Typed commands<br/>[cmd.asm]"]
  node_combat["Combat<br/>[attack.asm]"]
  node_items["Items and pack<br/>[items.asm]"]
  node_status["Status display<br/>[status.asm]"]
end

subgraph group_world["Crypt world"]
  node_maze["Maze generation<br/>[mazegen.asm]"]
  node_map["Map and level<br/>[map.asm]"]
  node_monsters["Monster behavior<br/>[monsters.asm]"]
  node_simulation["Game simulation<br/>[sim.asm]"]
end

subgraph group_presentation["Display and sound"]
  node_view["Dungeon view<br/>[view.asm]"]
  node_drawing["Vector drawing<br/>[draw.asm]"]
  node_attackfx["Attack pictures<br/>[fxpics.asm]"]
  node_sound["Sound effects<br/>[sound.asm]"]
  node_tunes["Win/lose tunes<br/>[tune.asm]"]
end

subgraph group_platform["CoCo platform"]
  node_data["Banked game data<br/>[dload.asm]"]
  node_banking["Memory banks<br/>[bank3e.asm]"]
  node_interrupts["Keyboard and timing<br/>[low.asm]"]
end

node_player(("Player"))
node_externaldac["6-bit DAC"]
node_coco(("CoCo 3 player"))

node_player -->|"starts game"| node_entry
node_player -->|"types commands"| node_commands
node_entry -->|"accepts input"| node_commands
node_entry -->|"starts seeded run"| node_maze
node_entry -->|"loads game data"| node_data
node_commands -->|"applies actions"| node_simulation
node_commands -->|"dispatches attacks"| node_combat
node_commands -->|"dispatches item use"| node_items
node_simulation -->|"updates level state"| node_map
node_simulation -->|"advances monsters"| node_monsters
node_maze -->|"builds five levels"| node_map
node_commands -->|"requests look"| node_view
node_view -->|"draws scene"| node_drawing
node_combat -->|"shows attack pictures"| node_attackfx
node_entry -->|"shows status"| node_status
node_simulation -->|"plays effects"| node_sound
node_entry -->|"plays ending tunes"| node_tunes
node_sound -->|"outputs samples"| node_externaldac
node_entry -->|"runs own interrupts"| node_interrupts
node_data -->|"copies into banks"| node_banking
node_coco -->|"runs game"| node_entry

click node_entry "https://github.com/calab/coco_crypts_of_vael/blob/main/src/main.asm"
click node_commands "https://github.com/calab/coco_crypts_of_vael/blob/main/src/cmd.asm"
click node_combat "https://github.com/calab/coco_crypts_of_vael/blob/main/src/attack.asm"
click node_items "https://github.com/calab/coco_crypts_of_vael/blob/main/src/items.asm"
click node_status "https://github.com/calab/coco_crypts_of_vael/blob/main/src/status.asm"
click node_maze "https://github.com/calab/coco_crypts_of_vael/blob/main/src/mazegen.asm"
click node_map "https://github.com/calab/coco_crypts_of_vael/blob/main/src/map.asm"
click node_monsters "https://github.com/calab/coco_crypts_of_vael/blob/main/src/monsters.asm"
click node_simulation "https://github.com/calab/coco_crypts_of_vael/blob/main/src/sim.asm"
click node_view "https://github.com/calab/coco_crypts_of_vael/blob/main/src/view.asm"
click node_drawing "https://github.com/calab/coco_crypts_of_vael/blob/main/src/draw.asm"
click node_attackfx "https://github.com/calab/coco_crypts_of_vael/blob/main/src/fxpics.asm"
click node_sound "https://github.com/calab/coco_crypts_of_vael/blob/main/src/sound.asm"
click node_tunes "https://github.com/calab/coco_crypts_of_vael/blob/main/src/tune.asm"
click node_data "https://github.com/calab/coco_crypts_of_vael/blob/main/src/dload.asm"
click node_banking "https://github.com/calab/coco_crypts_of_vael/blob/main/src/bank3e.asm"
click node_interrupts "https://github.com/calab/coco_crypts_of_vael/blob/main/src/low.asm"

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_entry,node_commands,node_combat,node_items,node_status toneBlue
class node_maze,node_map,node_monsters,node_simulation toneAmber
class node_view,node_drawing,node_attackfx,node_sound,node_tunes toneMint
class node_data,node_banking,node_interrupts toneRose
class node_player,node_externaldac,node_coco toneIndigo
```

## Components

### Game play

- [Game entry](https://github.com/calab/coco_crypts_of_vael/blob/main/src/main.asm): `src/main.asm`
- [Typed commands](https://github.com/calab/coco_crypts_of_vael/blob/main/src/cmd.asm): `src/cmd.asm`
- [Combat](https://github.com/calab/coco_crypts_of_vael/blob/main/src/attack.asm): `src/attack.asm`
- [Items and pack](https://github.com/calab/coco_crypts_of_vael/blob/main/src/items.asm): `src/items.asm`
- [Status display](https://github.com/calab/coco_crypts_of_vael/blob/main/src/status.asm): `src/status.asm`

### Crypt world

- [Maze generation](https://github.com/calab/coco_crypts_of_vael/blob/main/src/mazegen.asm): `src/mazegen.asm`
- [Map and level](https://github.com/calab/coco_crypts_of_vael/blob/main/src/map.asm): `src/map.asm`
- [Monster behavior](https://github.com/calab/coco_crypts_of_vael/blob/main/src/monsters.asm): `src/monsters.asm`
- [Game simulation](https://github.com/calab/coco_crypts_of_vael/blob/main/src/sim.asm): `src/sim.asm`

### Display and sound

- [Dungeon view](https://github.com/calab/coco_crypts_of_vael/blob/main/src/view.asm): `src/view.asm`
- [Vector drawing](https://github.com/calab/coco_crypts_of_vael/blob/main/src/draw.asm): `src/draw.asm`
- [Attack pictures](https://github.com/calab/coco_crypts_of_vael/blob/main/src/fxpics.asm): `src/fxpics.asm`
- [Sound effects](https://github.com/calab/coco_crypts_of_vael/blob/main/src/sound.asm): `src/sound.asm`
- [Win/lose tunes](https://github.com/calab/coco_crypts_of_vael/blob/main/src/tune.asm): `src/tune.asm`

### CoCo platform

- [Banked game data](https://github.com/calab/coco_crypts_of_vael/blob/main/src/dload.asm): `src/dload.asm`
- [Memory banks](https://github.com/calab/coco_crypts_of_vael/blob/main/src/bank3e.asm): `src/bank3e.asm`
- [Keyboard and timing](https://github.com/calab/coco_crypts_of_vael/blob/main/src/low.asm): `src/low.asm`

### Other components

- **Player**
- **6-bit DAC**
- **CoCo 3 player**

## Connections

- Player → Game entry: starts game (evidence: `README.md`)
- Player → Typed commands: types commands (evidence: `README.md`)
- Game entry → Typed commands: accepts input (evidence: `README.md`)
- Game entry → Maze generation: starts seeded run (evidence: `README.md`)
- Game entry → Banked game data: loads game data (evidence: `README.md`)
- Typed commands → Game simulation: applies actions (evidence: `README.md`)
- Typed commands → Combat: dispatches attacks (evidence: `README.md`)
- Typed commands → Items and pack: dispatches item use (evidence: `README.md`)
- Game simulation → Map and level: updates level state (evidence: `README.md`)
- Game simulation → Monster behavior: advances monsters (evidence: `README.md`)
- Maze generation → Map and level: builds five levels (evidence: `README.md`)
- Typed commands → Dungeon view: requests look (evidence: `README.md`)
- Dungeon view → Vector drawing: draws scene (evidence: `README.md`)
- Combat → Attack pictures: shows attack pictures (evidence: `README.md`)
- Game entry → Status display: shows status (evidence: `README.md`)
- Game simulation → Sound effects: plays effects (evidence: `README.md`)
- Game entry → Win/lose tunes: plays ending tunes (evidence: `README.md`)
- Sound effects → 6-bit DAC: outputs samples (evidence: `README.md`)
- Game entry → Keyboard and timing: runs own interrupts (evidence: `README.md`)
- Banked game data → Memory banks: copies into banks (evidence: `README.md`)
- CoCo 3 player → Game entry: runs game (evidence: `README.md`)
