# noel-varghese/gameboycolor_cpp architecture

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

- Interactive diagram: https://gitdiagram.com/noel-varghese/gameboycolor_cpp
- Repository: https://github.com/noel-varghese/gameboycolor_cpp

## Overview

This is an early-stage C++ Game Boy Color emulator. The implemented workflow parses command-line options, loads and reports a ROM, initializes CPU state, then fetches and dispatches a short sequence of opcodes. Cartridge reads currently expose ROM bytes directly, and instruction handlers are mostly empty. The README describes planned graphics, audio, input, save-state, and link features; these are not present in the sampled source. The graph marks planned areas as unimplemented, and limits implemented relationships to those visible in the excerpts.

Main entry points: [`CPU/CPU.cpp`](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CPU/CPU.cpp) (CPU execution), [`main.cpp`](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/main.cpp) (Program entry), [`Log/logger.cpp`](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/Log/logger.cpp) (Logging), [`Cartridge/Cartridge.cpp`](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/Cartridge/Cartridge.cpp) (ROM cartridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_entry["Program entry<br/>[main.cpp]"]
  node_args["Argument parsing<br/>[CmdLineParser.cpp]"]
end

subgraph group_core["Emulation core"]
  node_cartridge["ROM cartridge<br/>[Cartridge.cpp]"]
  node_cpu["CPU execution<br/>[CPU.cpp]"]
  node_opcodes["Opcode table<br/>[CPU_REG.cpp]"]
  node_registers["CPU register model<br/>[CPU.h]"]
end

subgraph group_support["Runtime support"]
  node_logger["Logging<br/>[logger.cpp]"]
end

subgraph group_planned["Planned capabilities"]
  node_ppu["PPU rendering"]
  node_audio["APU audio"]
  node_input["Joypad input"]
  node_link["Link cable"]
  node_transports["Link transports"]
  node_saves["Save features"]
  node_display["Shaders and display"]
  node_cheats["Cheats menu"]
end

node_user(("Emulator user"))

node_user -->|"runs"| node_entry
node_entry -->|"parses options"| node_args
node_entry -->|"loads ROM"| node_cartridge
node_entry -->|"initializes and steps"| node_cpu
node_entry -->|"sets log level"| node_logger
node_cpu -->|"reads opcode"| node_cartridge
node_cpu -->|"dispatches via table"| node_opcodes
node_cpu -->|"uses state"| node_registers
node_args -->|"logs errors"| node_logger
node_cartridge -->|"logs ROM status"| node_logger
node_cpu -->|"logs execution"| node_logger
node_cpu -.->|"planned subsystem"| node_ppu
node_cpu -.->|"planned subsystem"| node_audio
node_cpu -.->|"planned subsystem"| node_input
node_cpu -.->|"planned subsystem"| node_link
node_link -.->|"planned backends"| node_transports
node_cpu -.->|"planned feature"| node_saves
node_cpu -.->|"planned feature"| node_display
node_cpu -.->|"planned feature"| node_cheats

click node_entry "https://github.com/noel-varghese/gameboycolor_cpp/blob/main/main.cpp"
click node_args "https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CMDLineParser/CmdLineParser.cpp"
click node_cartridge "https://github.com/noel-varghese/gameboycolor_cpp/blob/main/Cartridge/Cartridge.cpp"
click node_cpu "https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CPU/CPU.cpp"
click node_opcodes "https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CPU/CPU_REG.cpp"
click node_registers "https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CPU/CPU.h"
click node_logger "https://github.com/noel-varghese/gameboycolor_cpp/blob/main/Log/logger.cpp"

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_args,node_user toneBlue
class node_cartridge,node_cpu,node_opcodes,node_registers toneAmber
class node_logger toneMint
class node_ppu,node_audio,node_input,node_link,node_transports,node_saves,node_display,node_cheats toneRose
```

## Components

### Application flow

- [Program entry](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/main.cpp): `main.cpp`
- [Argument parsing](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CMDLineParser/CmdLineParser.cpp): `CMDLineParser/CmdLineParser.cpp`

### Emulation core

- [ROM cartridge](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/Cartridge/Cartridge.cpp): `Cartridge/Cartridge.cpp`
- [CPU execution](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CPU/CPU.cpp): `CPU/CPU.cpp`
- [Opcode table](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CPU/CPU_REG.cpp): `CPU/CPU_REG.cpp`
- [CPU register model](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/CPU/CPU.h): `CPU/CPU.h`

### Runtime support

- [Logging](https://github.com/noel-varghese/gameboycolor_cpp/blob/main/Log/logger.cpp): `Log/logger.cpp`

### Planned capabilities

- **PPU rendering**
- **APU audio**
- **Joypad input**
- **Link cable**
- **Link transports**
- **Save features**
- **Shaders and display**
- **Cheats menu**

### Other components

- **Emulator user**

## Connections

- Emulator user → Program entry: runs
- Program entry → Argument parsing: parses options (evidence: `main.cpp`)
- Program entry → ROM cartridge: loads ROM (evidence: `main.cpp`)
- Program entry → CPU execution: initializes and steps (evidence: `main.cpp`)
- Program entry → Logging: sets log level (evidence: `main.cpp`)
- CPU execution → ROM cartridge: reads opcode (evidence: `CPU/CPU.cpp`)
- CPU execution → Opcode table: dispatches via table (evidence: `CPU/CPU.cpp`)
- CPU execution → CPU register model: uses state (evidence: `CPU/CPU.cpp`)
- Argument parsing → Logging: logs errors (evidence: `CMDLineParser/CmdLineParser.cpp`)
- ROM cartridge → Logging: logs ROM status (evidence: `Cartridge/Cartridge.cpp`)
- CPU execution → Logging: logs execution (evidence: `CPU/CPU.cpp`)
- CPU execution → PPU rendering: planned subsystem (evidence: `README.md`)
- CPU execution → APU audio: planned subsystem (evidence: `README.md`)
- CPU execution → Joypad input: planned subsystem (evidence: `README.md`)
- CPU execution → Link cable: planned subsystem (evidence: `README.md`)
- Link cable → Link transports: planned backends (evidence: `README.md`)
- CPU execution → Save features: planned feature (evidence: `README.md`)
- CPU execution → Shaders and display: planned feature (evidence: `README.md`)
- CPU execution → Cheats menu: planned feature (evidence: `README.md`)
