# atc1441/action_104_games_and_pacman_doom architecture

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

- Interactive diagram: https://gitdiagram.com/atc1441/action_104_games_and_pacman_doom
- Repository: https://github.com/atc1441/action_104_games_and_pacman_doom

## Overview

This repository runs a single-player Doom port on two Action handheld consoles, replacing their stock firmware. At runtime, the console entry point initializes clocks and peripherals, then enters Doom; player input and timed game ticks drive play, while rendering, sound, and WAD assets provide the on-screen and audio result. The graph preserves major Doom subsystems and the board-specific hardware layer. Several engine relationships are documented only at a high level or have unsampled implementations, so uncertain links are omitted; dashed edges indicate README-level behavior.

Main entry points: [`firmware/port/i_system_console.c`](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/port/i_system_console.c) (Console entry), [`firmware/GBADoom/source/g_game.c`](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/g_game.c) (Game state), [`firmware/GBADoom/source/d_client.c`](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/d_client.c) (Tick scheduler), [`firmware/port/i_sound_console.c`](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/port/i_sound_console.c) (Sound mixer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Console platform"]
  node_entry["Console entry<br/>[i_system_console.c]"]
  node_board["Board definitions<br/>[board.h]"]
  node_soc["SoC register map<br/>[soc.h]"]
  node_clock["Clock control<br/>[clock.c]"]
  node_lcd["LCD driver<br/>[lcd.c]"]
  node_input["Button scanning<br/>[input.c]"]
  node_audio["Audio output<br/>[audio.c]"]
end

subgraph group_engine["Doom runtime"]
  node_doom["Doom entry<br/>[i_main.c]"]
  node_scheduler["Tick scheduler<br/>[d_client.c]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_game["Game state<br/>[g_game.c]"]
  node_world["World simulation<br/>[p_tick.c]"]
  node_actors["Actor behavior<br/>[p_enemy.c]"]
  node_catalog["Game data tables<br/>[info.c]"]
end

subgraph group_presentation["Presentation and assets"]
  node_renderer["Renderer<br/>[r_main.c]"]
  node_hud["HUD and menus<br/>[st_stuff.c]"]
  node_wad[("WAD assets<br/>[w_wad.c]")]
  node_soundmix["Sound mixer<br/>[i_sound_console.c]"]
end

node_player(("Player"))

node_player -.->|"presses"| node_input
node_entry -->|"initializes"| node_clock
node_entry -->|"initializes"| node_lcd
node_entry -->|"initializes"| node_input
node_entry -->|"calls"| node_doom
node_board -->|"uses registers"| node_soc
node_scheduler -->|"ticks"| node_game
node_scheduler -->|"ticks menus"| node_hud
node_game -.->|"advances"| node_world
node_world -.->|"updates"| node_actors
node_game -.->|"renders"| node_renderer
node_game -.->|"updates display"| node_hud
node_soundmix -->|"reads samples"| node_wad
node_soundmix -.->|"streams audio"| node_audio
node_renderer -.->|"draws frames"| node_lcd
node_actors -->|"uses definitions"| node_catalog

click node_entry "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/port/i_system_console.c"
click node_board "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/boards/pacman/board.h"
click node_soc "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/soc.h"
click node_clock "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/clock.c"
click node_lcd "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/lcd.c"
click node_input "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/input.c"
click node_audio "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/audio.c"
click node_doom "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/i_main.c"
click node_scheduler "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/d_client.c"
click node_game "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/g_game.c"
click node_world "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/p_tick.c"
click node_actors "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/p_enemy.c"
click node_renderer "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/r_main.c"
click node_hud "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/st_stuff.c"
click node_wad "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/w_wad.c"
click node_soundmix "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/port/i_sound_console.c"
click node_catalog "https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/info.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_entry,node_board,node_soc,node_clock,node_lcd,node_input,node_audio toneBlue
class node_doom,node_scheduler toneAmber
class node_game,node_world,node_actors,node_catalog toneMint
class node_renderer,node_hud,node_wad,node_soundmix toneRose
class node_player toneIndigo
```

## Components

### Console platform

- [Console entry](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/port/i_system_console.c): `firmware/port/i_system_console.c`
- [Board definitions](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/boards/pacman/board.h): `firmware/boards/pacman/board.h`
- [SoC register map](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/soc.h): `firmware/sdk/soc.h`
- [Clock control](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/clock.c): `firmware/sdk/clock.c`
- [LCD driver](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/lcd.c): `firmware/sdk/lcd.c`
- [Button scanning](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/input.c): `firmware/sdk/input.c`
- [Audio output](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/sdk/audio.c): `firmware/sdk/audio.c`

### Doom runtime

- [Doom entry](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/i_main.c): `firmware/GBADoom/source/i_main.c`
- [Tick scheduler](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/d_client.c): `firmware/GBADoom/source/d_client.c`

### Gameplay systems

- [Game state](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/g_game.c): `firmware/GBADoom/source/g_game.c`
- [World simulation](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/p_tick.c): `firmware/GBADoom/source/p_tick.c`
- [Actor behavior](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/p_enemy.c): `firmware/GBADoom/source/p_enemy.c`
- [Game data tables](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/info.c): `firmware/GBADoom/source/info.c`

### Presentation and assets

- [Renderer](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/r_main.c): `firmware/GBADoom/source/r_main.c`
- [HUD and menus](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/st_stuff.c): `firmware/GBADoom/source/st_stuff.c`
- [WAD assets](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/GBADoom/source/w_wad.c): `firmware/GBADoom/source/w_wad.c`
- [Sound mixer](https://github.com/atc1441/action_104_games_and_pacman_doom/blob/main/firmware/port/i_sound_console.c): `firmware/port/i_sound_console.c`

### Other components

- **Player**

## Connections

- Player → Button scanning: presses
- Console entry → Clock control: initializes (evidence: `firmware/port/i_system_console.c`)
- Console entry → LCD driver: initializes (evidence: `firmware/port/i_system_console.c`)
- Console entry → Button scanning: initializes (evidence: `firmware/port/i_system_console.c`)
- Console entry → Doom entry: calls (evidence: `firmware/port/i_system_console.c`)
- Board definitions → SoC register map: uses registers (evidence: `firmware/boards/pacman/board.h`)
- Tick scheduler → Game state: ticks (evidence: `firmware/GBADoom/source/d_client.c`)
- Tick scheduler → HUD and menus: ticks menus (evidence: `firmware/GBADoom/source/d_client.c`)
- Game state → World simulation: advances
- World simulation → Actor behavior: updates
- Game state → Renderer: renders
- Game state → HUD and menus: updates display
- Sound mixer → WAD assets: reads samples (evidence: `firmware/port/i_sound_console.c`)
- Sound mixer → Audio output: streams audio
- Renderer → LCD driver: draws frames
- Actor behavior → Game data tables: uses definitions (evidence: `firmware/GBADoom/source/info.c`)
