# danymb2326/consola-retro-fsem architecture

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

- Interactive diagram: https://gitdiagram.com/danymb2326/consola-retro-fsem
- Repository: https://github.com/danymb2326/consola-retro-fsem

## Overview

BIT-BOY is a Raspberry Pi retro-game console. At startup, its systemd service opens the launcher, which presents the intro and game menu; gamepad input selects a ROM for Mednafen or opens the power menu. USB imports add new ROMs to the library for menu display. The sampled launcher excerpt confirms USB copying, gamepad event handling, rendering, and power commands; README documentation supplies the broader flow. Other source files are represented only where the README identifies their product role.

Main entry points: [`src/launcher.py`](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py) (Game menu), [`src/roms`](https://github.com/danymb2326/consola-retro-fsem/tree/main/src/roms) (ROM library), [`src/retro.service`](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/retro.service) (Startup service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Console runtime"]
  node_intro["Intro screen<br/>[launcher.py]"]
  node_menu["Game menu<br/>[launcher.py]"]
  node_controls["Input handling<br/>[launcher.py]"]
  node_renderer["Screen rendering<br/>[launcher.py]"]
  node_powerdialog["Power dialog<br/>[launcher.py]"]
end

subgraph group_library["Game library"]
  node_importer["USB ROM import<br/>[launcher.py]"]
  node_roms[("ROM library")]
end

subgraph group_platform["Platform"]
  node_service["Startup service<br/>[retro.service]"]
  node_mednafen["Mednafen"]
  node_system["System power"]
end

node_power(("Power on"))
node_gamepad(("Gamepad"))
node_usb(("USB drive"))

node_power -->|"starts"| node_service
node_service -->|"opens"| node_intro
node_intro -->|"continues to"| node_menu
node_gamepad -->|"provides input"| node_controls
node_controls -->|"navigates"| node_menu
node_menu -->|"displays"| node_renderer
node_menu -->|"launches selected game"| node_mednafen
node_mednafen -->|"returns on exit"| node_menu
node_controls -->|"opens"| node_powerdialog
node_powerdialog -->|"requests shutdown or reboot"| node_system
node_usb -->|"supplies ROMs"| node_importer
node_importer -->|"copies new ROMs"| node_roms
node_roms -->|"supplies game list"| node_menu

click node_service "https://github.com/danymb2326/consola-retro-fsem/blob/main/src/retro.service"
click node_intro "https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py"
click node_menu "https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py"
click node_controls "https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py"
click node_renderer "https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py"
click node_powerdialog "https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py"
click node_importer "https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py"
click node_roms "https://github.com/danymb2326/consola-retro-fsem/tree/main/src/roms"

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_intro,node_menu,node_controls,node_renderer,node_powerdialog toneBlue
class node_importer,node_roms toneAmber
class node_service,node_mednafen,node_system toneMint
class node_power,node_gamepad,node_usb toneIndigo
```

## Components

### Console runtime

- [Intro screen](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py): `src/launcher.py`
- [Game menu](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py): `src/launcher.py`
- [Input handling](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py): `src/launcher.py`
- [Screen rendering](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py): `src/launcher.py`
- [Power dialog](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py): `src/launcher.py`

### Game library

- [USB ROM import](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/launcher.py): `src/launcher.py`
- [ROM library](https://github.com/danymb2326/consola-retro-fsem/tree/main/src/roms): `src/roms`

### Platform

- [Startup service](https://github.com/danymb2326/consola-retro-fsem/blob/main/src/retro.service): `src/retro.service`
- **Mednafen**
- **System power**

### Other components

- **Power on**
- **Gamepad**
- **USB drive**

## Connections

- Power on → Startup service: starts (evidence: `readme.MD`)
- Startup service → Intro screen: opens (evidence: `readme.MD`)
- Intro screen → Game menu: continues to (evidence: `readme.MD`)
- Gamepad → Input handling: provides input (evidence: `readme.MD`)
- Input handling → Game menu: navigates (evidence: `readme.MD`)
- Game menu → Screen rendering: displays (evidence: `src/launcher.py`)
- Game menu → Mednafen: launches selected game (evidence: `readme.MD`)
- Mednafen → Game menu: returns on exit (evidence: `readme.MD`)
- Input handling → Power dialog: opens (evidence: `readme.MD`)
- Power dialog → System power: requests shutdown or reboot (evidence: `src/launcher.py`)
- USB drive → USB ROM import: supplies ROMs (evidence: `readme.MD`)
- USB ROM import → ROM library: copies new ROMs (evidence: `src/launcher.py`)
- ROM library → Game menu: supplies game list (evidence: `readme.MD`)
