# ps2max32/neutrino architecture

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

- Interactive diagram: https://gitdiagram.com/ps2max32/neutrino
- Repository: https://github.com/ps2max32/neutrino

## Overview

Neutrino is a modular PlayStation 2 device emulator intended to run as a backend for a separate frontend. Its main workflow is to start the command-line loader, select backing-store and emulation options from arguments and TOML configuration, prepare modules and virtual-image access, then reboot into the emulation environment where EE and IOP components emulate devices. Separate capabilities include optical-disc modes, virtual ATA storage, memory-card images, cheats, and GSM video modes. Driver coverage and environment transitions follow the README; unsampled driver implementations are represented at directory level.

Main entry points: [`ee/loader/src/main.c`](https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/main.c) (Loader), [`ee/ee_core/src/main.c`](https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/main.c) (EE Core), [`iop/ministack/src/main.c`](https://github.com/ps2max32/neutrino/blob/master/iop/ministack/src/main.c) (Network Stack), [`iop/udpbd/src/udpbd.c`](https://github.com/ps2max32/neutrino/blob/master/iop/udpbd/src/udpbd.c) (UDPBD Driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_loader["Loading &amp; Configuration"]
  node_config["Config Parsing<br/>[config.c]"]
  node_loader_main["Loader<br/>[main.c]"]
  node_module_list["Module Selection<br/>[modlist.h]"]
  node_fhi_config["Backing-Store Setup<br/>[fhi_config.c]"]
end

subgraph group_ee["EE Runtime"]
  node_ee_core["EE Core<br/>[main.c]"]
  node_cheats["Cheat Support<br/>[cheat_api.c]"]
  node_gsm["GSM Video Modes<br/>[gsm_api.c]"]
  node_patches["Game Patches<br/>[patches.c]"]
end

subgraph group_iop["IOP Device Modules"]
  node_cdvd_emu["CD/DVD Emulation<br/>[cdvdman.c]"]
  node_esr["ESR Drivers<br/>[scecdvdv.c]"]
  node_ata["ATA Emulation<br/>[ps2atad.c]"]
  node_block_drivers["Block Drivers"]
  node_filesystem_drivers["Filesystem Drivers"]
  node_memory_cards["Memory-Card Emulation<br/>[mcemu.c]"]
end

subgraph group_network["Network Storage"]
  node_network_stack["Network Stack<br/>[main.c]"]
  node_udpbd["UDPBD Driver<br/>[udpbd.c]"]
  node_udpfs["UDPFS Driver<br/>[udpfs_core.c]"]
  node_smb["SMB Driver<br/>[smb_fhi.c]"]
end

node_user(("CLI User"))
node_backing_store[("Backing Store")]
node_game_elf["Game ELF"]

node_user -->|"starts"| node_loader_main
node_loader_main -->|"parses settings"| node_config
node_loader_main -->|"selects modules"| node_module_list
node_loader_main -->|"initializes store"| node_fhi_config
node_loader_main -->|"reboots into"| node_ee_core
node_ee_core -->|"loads ELF"| node_game_elf
node_ee_core -->|"enables"| node_cheats
node_ee_core -->|"enables"| node_gsm
node_ee_core -->|"applies patches"| node_patches
node_loader_main -->|"configures modules"| node_cdvd_emu
node_backing_store -->|"provides sectors"| node_block_drivers
node_backing_store -->|"provides files"| node_filesystem_drivers
node_backing_store -.->|"serves disk images"| node_udpbd
node_backing_store -.->|"serves files"| node_udpfs
node_backing_store -.->|"serves files"| node_smb
node_network_stack -.->|"supports networking"| node_udpbd
node_network_stack -.->|"supports networking"| node_udpfs
node_loader_main -->|"selects HDD mode"| node_ata
node_loader_main -->|"selects ESR mode"| node_esr
node_loader_main -->|"configures images"| node_memory_cards

click node_config "https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/config.c"
click node_loader_main "https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/main.c"
click node_module_list "https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/modlist.h"
click node_fhi_config "https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/fhi_config.c"
click node_ee_core "https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/main.c"
click node_cheats "https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/cheat_api.c"
click node_gsm "https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/gsm_api.c"
click node_patches "https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/patches.c"
click node_cdvd_emu "https://github.com/ps2max32/neutrino/blob/master/iop/cdvdman_emu/src/cdvdman.c"
click node_esr "https://github.com/ps2max32/neutrino/blob/master/iop/cdvdman_esr1/src/scecdvdv.c"
click node_ata "https://github.com/ps2max32/neutrino/blob/master/iop/atad_emu/src/ps2atad.c"
click node_block_drivers "https://github.com/ps2max32/neutrino/tree/master/iop"
click node_filesystem_drivers "https://github.com/ps2max32/neutrino/tree/master/iop"
click node_memory_cards "https://github.com/ps2max32/neutrino/blob/master/iop/mc_emu/src/mcemu.c"
click node_network_stack "https://github.com/ps2max32/neutrino/blob/master/iop/ministack/src/main.c"
click node_udpbd "https://github.com/ps2max32/neutrino/blob/master/iop/udpbd/src/udpbd.c"
click node_udpfs "https://github.com/ps2max32/neutrino/blob/master/iop/udpfs/src/udpfs_core.c"
click node_smb "https://github.com/ps2max32/neutrino/blob/master/iop/smb/src/smb_fhi.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_config,node_loader_main,node_module_list,node_fhi_config,node_user toneBlue
class node_ee_core,node_cheats,node_gsm,node_patches,node_backing_store toneAmber
class node_cdvd_emu,node_esr,node_ata,node_block_drivers,node_filesystem_drivers,node_memory_cards toneMint
class node_network_stack,node_udpbd,node_udpfs,node_smb toneRose
class node_game_elf toneIndigo
```

## Components

### Loading & Configuration

- [Config Parsing](https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/config.c): `ee/loader/src/config.c`
- [Loader](https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/main.c): `ee/loader/src/main.c`
- [Module Selection](https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/modlist.h): `ee/loader/src/modlist.h`
- [Backing-Store Setup](https://github.com/ps2max32/neutrino/blob/master/ee/loader/src/fhi_config.c): `ee/loader/src/fhi_config.c`

### EE Runtime

- [EE Core](https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/main.c): `ee/ee_core/src/main.c`
- [Cheat Support](https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/cheat_api.c): `ee/ee_core/src/cheat_api.c`
- [GSM Video Modes](https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/gsm_api.c): `ee/ee_core/src/gsm_api.c`
- [Game Patches](https://github.com/ps2max32/neutrino/blob/master/ee/ee_core/src/patches.c): `ee/ee_core/src/patches.c`

### IOP Device Modules

- [CD/DVD Emulation](https://github.com/ps2max32/neutrino/blob/master/iop/cdvdman_emu/src/cdvdman.c): `iop/cdvdman_emu/src/cdvdman.c`
- [ESR Drivers](https://github.com/ps2max32/neutrino/blob/master/iop/cdvdman_esr1/src/scecdvdv.c): `iop/cdvdman_esr1/src/scecdvdv.c`
- [ATA Emulation](https://github.com/ps2max32/neutrino/blob/master/iop/atad_emu/src/ps2atad.c): `iop/atad_emu/src/ps2atad.c`
- [Block Drivers](https://github.com/ps2max32/neutrino/tree/master/iop): `iop`
- [Filesystem Drivers](https://github.com/ps2max32/neutrino/tree/master/iop): `iop`
- [Memory-Card Emulation](https://github.com/ps2max32/neutrino/blob/master/iop/mc_emu/src/mcemu.c): `iop/mc_emu/src/mcemu.c`

### Network Storage

- [Network Stack](https://github.com/ps2max32/neutrino/blob/master/iop/ministack/src/main.c): `iop/ministack/src/main.c`
- [UDPBD Driver](https://github.com/ps2max32/neutrino/blob/master/iop/udpbd/src/udpbd.c): `iop/udpbd/src/udpbd.c`
- [UDPFS Driver](https://github.com/ps2max32/neutrino/blob/master/iop/udpfs/src/udpfs_core.c): `iop/udpfs/src/udpfs_core.c`
- [SMB Driver](https://github.com/ps2max32/neutrino/blob/master/iop/smb/src/smb_fhi.c): `iop/smb/src/smb_fhi.c`

### Other components

- **CLI User**
- **Backing Store**
- **Game ELF**

## Connections

- CLI User → Loader: starts
- Loader → Config Parsing: parses settings (evidence: `ee/loader/src/main.c`)
- Loader → Module Selection: selects modules (evidence: `ee/loader/src/main.c`)
- Loader → Backing-Store Setup: initializes store (evidence: `ee/loader/src/main.c`)
- Loader → EE Core: reboots into
- EE Core → Game ELF: loads ELF (evidence: `ee/ee_core/src/main.c`)
- EE Core → Cheat Support: enables (evidence: `ee/ee_core/src/main.c`)
- EE Core → GSM Video Modes: enables (evidence: `ee/ee_core/src/main.c`)
- EE Core → Game Patches: applies patches (evidence: `ee/ee_core/src/main.c`)
- Loader → CD/DVD Emulation: configures modules (evidence: `ee/loader/src/main.c`)
- Backing Store → Block Drivers: provides sectors
- Backing Store → Filesystem Drivers: provides files
- Backing Store → UDPBD Driver: serves disk images
- Backing Store → UDPFS Driver: serves files
- Backing Store → SMB Driver: serves files
- Network Stack → UDPBD Driver: supports networking
- Network Stack → UDPFS Driver: supports networking
- Loader → ATA Emulation: selects HDD mode
- Loader → ESR Drivers: selects ESR mode
- Loader → Memory-Card Emulation: configures images (evidence: `ee/loader/src/main.c`)
