# libretro/bsnes2014 architecture

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

- Interactive diagram: https://gitdiagram.com/libretro/bsnes2014
- Repository: https://github.com/libretro/bsnes2014

## Overview

This repository is an emulator suite with desktop-facing tooling: Ananke handles game/archive and cartridge-related tasks, while the fc, gb, gba, and sfc trees implement console systems. A principal user workflow is selecting a game through the desktop application, loading it into a system, then running emulation and presenting audio/video and input. Phoenix supplies a cross-platform GUI abstraction. The README is empty and most emulator sources were not sampled, so runtime links among those subsystems are shown as unverified rather than asserted; the Phoenix links reflect indexed imports and excerpts.

Main entry points: [`phoenix/core/core.cpp`](https://github.com/libretro/bsnes2014/blob/libretro/phoenix/core/core.cpp) (GUI abstraction), [`fc/system/system.cpp`](https://github.com/libretro/bsnes2014/blob/libretro/fc/system/system.cpp) (Famicom), [`processor`](https://github.com/libretro/bsnes2014/tree/libretro/processor) (CPU cores), [`ananke/ananke.cpp`](https://github.com/libretro/bsnes2014/blob/libretro/ananke/ananke.cpp) (Game management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and tools"]
  node_ananke["Game management<br/>[ananke.cpp]"]
  node_archive["Archive handling<br/>[archive.cpp]"]
  node_romdb[("Game databases")]
end

subgraph group_systems["Console systems"]
  node_fc["Famicom<br/>[system.cpp]"]
  node_gb["Game Boy<br/>[system.cpp]"]
  node_gba["Game Boy Advance<br/>[system.cpp]"]
  node_sfc["Super Famicom<br/>[system.cpp]"]
  node_sfcports["SNES controllers<br/>[controller.cpp]"]
end

subgraph group_shared["Shared emulation"]
  node_processors["CPU cores"]
  node_audio["Audio engines<br/>[apu.cpp]"]
  node_video["Video output<br/>[video.hpp]"]
  node_input["Input backends<br/>[input.hpp]"]
  node_state["Save states<br/>[serialization.cpp]"]
end

subgraph group_ui["User interface"]
  node_phoenix["GUI abstraction<br/>[core.cpp]"]
  node_nativeui["Native platforms<br/>[platform.cpp]"]
end

node_user(("User"))

node_user -.->|"operates"| node_phoenix
node_phoenix -->|"dispatches to"| node_nativeui
node_user -.->|"selects games"| node_ananke
node_ananke -.->|"handles archives"| node_archive
node_ananke -.->|"consults metadata"| node_romdb
node_phoenix -.->|"launches"| node_fc
node_phoenix -.->|"launches"| node_gb
node_phoenix -.->|"launches"| node_gba
node_phoenix -.->|"launches"| node_sfc
node_fc -.->|"uses CPU"| node_processors
node_gb -.->|"uses CPU"| node_processors
node_gba -.->|"uses CPU"| node_processors
node_sfc -.->|"uses CPU"| node_processors
node_fc -.->|"produces audio"| node_audio
node_fc -.->|"produces video"| node_video
node_user -.->|"provides controls"| node_input
node_sfc -.->|"uses ports"| node_sfcports
node_gba -.->|"serializes state"| node_state

click node_ananke "https://github.com/libretro/bsnes2014/blob/libretro/ananke/ananke.cpp"
click node_archive "https://github.com/libretro/bsnes2014/blob/libretro/ananke/archive.cpp"
click node_romdb "https://github.com/libretro/bsnes2014/tree/libretro/ananke/database"
click node_fc "https://github.com/libretro/bsnes2014/blob/libretro/fc/system/system.cpp"
click node_gb "https://github.com/libretro/bsnes2014/blob/libretro/gb/system/system.cpp"
click node_gba "https://github.com/libretro/bsnes2014/blob/libretro/gba/system/system.cpp"
click node_sfc "https://github.com/libretro/bsnes2014/blob/libretro/sfc/system/system.cpp"
click node_processors "https://github.com/libretro/bsnes2014/tree/libretro/processor"
click node_audio "https://github.com/libretro/bsnes2014/blob/libretro/fc/apu/apu.cpp"
click node_video "https://github.com/libretro/bsnes2014/blob/libretro/ruby/video.hpp"
click node_input "https://github.com/libretro/bsnes2014/blob/libretro/ruby/input.hpp"
click node_phoenix "https://github.com/libretro/bsnes2014/blob/libretro/phoenix/core/core.cpp"
click node_nativeui "https://github.com/libretro/bsnes2014/blob/libretro/phoenix/gtk/platform.cpp"
click node_sfcports "https://github.com/libretro/bsnes2014/blob/libretro/sfc/controller/controller.cpp"
click node_state "https://github.com/libretro/bsnes2014/blob/libretro/gba/system/serialization.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_ananke,node_archive,node_romdb,node_user toneBlue
class node_fc,node_gb,node_gba,node_sfc,node_sfcports toneAmber
class node_processors,node_audio,node_video,node_input,node_state toneMint
class node_phoenix,node_nativeui toneRose
```

## Components

### Application and tools

- [Game management](https://github.com/libretro/bsnes2014/blob/libretro/ananke/ananke.cpp): `ananke/ananke.cpp`
- [Archive handling](https://github.com/libretro/bsnes2014/blob/libretro/ananke/archive.cpp): `ananke/archive.cpp`
- [Game databases](https://github.com/libretro/bsnes2014/tree/libretro/ananke/database): `ananke/database`

### Console systems

- [Famicom](https://github.com/libretro/bsnes2014/blob/libretro/fc/system/system.cpp): `fc/system/system.cpp`
- [Game Boy](https://github.com/libretro/bsnes2014/blob/libretro/gb/system/system.cpp): `gb/system/system.cpp`
- [Game Boy Advance](https://github.com/libretro/bsnes2014/blob/libretro/gba/system/system.cpp): `gba/system/system.cpp`
- [Super Famicom](https://github.com/libretro/bsnes2014/blob/libretro/sfc/system/system.cpp): `sfc/system/system.cpp`
- [SNES controllers](https://github.com/libretro/bsnes2014/blob/libretro/sfc/controller/controller.cpp): `sfc/controller/controller.cpp`

### Shared emulation

- [CPU cores](https://github.com/libretro/bsnes2014/tree/libretro/processor): `processor`
- [Audio engines](https://github.com/libretro/bsnes2014/blob/libretro/fc/apu/apu.cpp): `fc/apu/apu.cpp`
- [Video output](https://github.com/libretro/bsnes2014/blob/libretro/ruby/video.hpp): `ruby/video.hpp`
- [Input backends](https://github.com/libretro/bsnes2014/blob/libretro/ruby/input.hpp): `ruby/input.hpp`
- [Save states](https://github.com/libretro/bsnes2014/blob/libretro/gba/system/serialization.cpp): `gba/system/serialization.cpp`

### User interface

- [GUI abstraction](https://github.com/libretro/bsnes2014/blob/libretro/phoenix/core/core.cpp): `phoenix/core/core.cpp`
- [Native platforms](https://github.com/libretro/bsnes2014/blob/libretro/phoenix/gtk/platform.cpp): `phoenix/gtk/platform.cpp`

### Other components

- **User**

## Connections

- User → GUI abstraction: operates
- GUI abstraction → Native platforms: dispatches to (evidence: `phoenix/gtk/platform.cpp`)
- User → Game management: selects games
- Game management → Archive handling: handles archives
- Game management → Game databases: consults metadata
- GUI abstraction → Famicom: launches
- GUI abstraction → Game Boy: launches
- GUI abstraction → Game Boy Advance: launches
- GUI abstraction → Super Famicom: launches
- Famicom → CPU cores: uses CPU
- Game Boy → CPU cores: uses CPU
- Game Boy Advance → CPU cores: uses CPU
- Super Famicom → CPU cores: uses CPU
- Famicom → Audio engines: produces audio
- Famicom → Video output: produces video
- User → Input backends: provides controls
- Super Famicom → SNES controllers: uses ports
- Game Boy Advance → Save states: serializes state
