# pret/pokecrystal architecture

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

- Interactive diagram: https://gitdiagram.com/pret/pokecrystal
- Repository: https://github.com/pret/pokecrystal

## Overview

Pokémon Crystal is a Game Boy Color role-playing game represented here as an assembly disassembly and its game data. The principal player workflow is exploring the overworld, triggering map events, and entering battles that use Pokémon and move data; menus, Pokédex, phone, and audio support additional play. The tree supports these subsystem boundaries, but the README and sampled source do not establish most runtime call paths, so the graph avoids asserting detailed dispatch or data-flow links.

Main entry points: [`home`](https://github.com/pret/pokecrystal/tree/master/home) (Game entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Gameplay runtime"]
  node_home["Game entry"]
  node_overworld["Overworld"]
  node_events["Events"]
  node_battle["Battle engine"]
  node_menus["Menus"]
  node_pokemon["Pokémon systems"]
  node_pokedex["Pokédex"]
  node_pokegear["Pokégear"]
end

subgraph group_content["Game content"]
  node_mapdata["Maps and scripts"]
  node_battledata["Battle data"]
  node_pokemondat["Pokémon data"]
  node_itemdata["Item data"]
  node_phonedata["Phone content"]
end

subgraph group_presentation["Presentation and sound"]
  node_gfx["Graphics assets"]
  node_audio["Audio engine"]
end

subgraph group_systems["Platform systems"]
  node_link["Link features"]
  node_rtc["Real-time clock"]
end

node_player(("Player"))

node_player -->|"starts game"| node_home

click node_home "https://github.com/pret/pokecrystal/tree/master/home"
click node_overworld "https://github.com/pret/pokecrystal/tree/master/engine/overworld"
click node_events "https://github.com/pret/pokecrystal/tree/master/engine/events"
click node_battle "https://github.com/pret/pokecrystal/tree/master/engine/battle"
click node_menus "https://github.com/pret/pokecrystal/tree/master/engine/menus"
click node_pokemon "https://github.com/pret/pokecrystal/tree/master/engine/pokemon"
click node_pokedex "https://github.com/pret/pokecrystal/tree/master/engine/pokedex"
click node_pokegear "https://github.com/pret/pokecrystal/tree/master/engine/pokegear"
click node_mapdata "https://github.com/pret/pokecrystal/tree/master/data/maps"
click node_battledata "https://github.com/pret/pokecrystal/tree/master/data/battle"
click node_pokemondat "https://github.com/pret/pokecrystal/tree/master/data/pokemon"
click node_itemdata "https://github.com/pret/pokecrystal/tree/master/data/items"
click node_gfx "https://github.com/pret/pokecrystal/tree/master/gfx"
click node_audio "https://github.com/pret/pokecrystal/tree/master/audio"
click node_phonedata "https://github.com/pret/pokecrystal/tree/master/data/phone"
click node_link "https://github.com/pret/pokecrystal/tree/master/engine/link"
click node_rtc "https://github.com/pret/pokecrystal/tree/master/engine/rtc"

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_home,node_overworld,node_events,node_battle,node_menus,node_pokemon,node_pokedex,node_pokegear toneBlue
class node_mapdata,node_battledata,node_pokemondat,node_itemdata,node_phonedata toneAmber
class node_gfx,node_audio toneMint
class node_link,node_rtc toneRose
class node_player toneIndigo
```

## Components

### Gameplay runtime

- [Game entry](https://github.com/pret/pokecrystal/tree/master/home): `home`
- [Overworld](https://github.com/pret/pokecrystal/tree/master/engine/overworld): `engine/overworld`
- [Events](https://github.com/pret/pokecrystal/tree/master/engine/events): `engine/events`
- [Battle engine](https://github.com/pret/pokecrystal/tree/master/engine/battle): `engine/battle`
- [Menus](https://github.com/pret/pokecrystal/tree/master/engine/menus): `engine/menus`
- [Pokémon systems](https://github.com/pret/pokecrystal/tree/master/engine/pokemon): `engine/pokemon`
- [Pokédex](https://github.com/pret/pokecrystal/tree/master/engine/pokedex): `engine/pokedex`
- [Pokégear](https://github.com/pret/pokecrystal/tree/master/engine/pokegear): `engine/pokegear`

### Game content

- [Maps and scripts](https://github.com/pret/pokecrystal/tree/master/data/maps): `data/maps`
- [Battle data](https://github.com/pret/pokecrystal/tree/master/data/battle): `data/battle`
- [Pokémon data](https://github.com/pret/pokecrystal/tree/master/data/pokemon): `data/pokemon`
- [Item data](https://github.com/pret/pokecrystal/tree/master/data/items): `data/items`
- [Phone content](https://github.com/pret/pokecrystal/tree/master/data/phone): `data/phone`

### Presentation and sound

- [Graphics assets](https://github.com/pret/pokecrystal/tree/master/gfx): `gfx`
- [Audio engine](https://github.com/pret/pokecrystal/tree/master/audio): `audio`

### Platform systems

- [Link features](https://github.com/pret/pokecrystal/tree/master/engine/link): `engine/link`
- [Real-time clock](https://github.com/pret/pokecrystal/tree/master/engine/rtc): `engine/rtc`

### Other components

- **Player**

## Connections

- Player → Game entry: starts game
