# suke0930/luma3ds-bbp-online architecture

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

- Interactive diagram: https://gitdiagram.com/suke0930/luma3ds-bbp-online
- Repository: https://github.com/suke0930/luma3ds-bbp-online

## Overview

Luma3DS is Nintendo 3DS custom firmware; this fork adds Band Brothers P Online by relaying the game’s local-wireless traffic. Its documented user workflow is to configure relay options in Rosalina, launch the game, and use its local-wireless room flow. The graph also preserves documented boot, homebrew, modding, debugging, and overlay capabilities. Several internal links are dashed because the supplied source excerpts do not show their runtime wiring; documented relationships cite the README.

Main entry points: [`arm9/source/main.c`](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/main.c) (Boot menu), [`sysmodules/rosalina/source/main.c`](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/main.c) (Rosalina overlay), [`sysmodules/rosalina/source/gdb/server.c`](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/server.c) (GDB stub), [`sysmodules/rosalina/source/uds_service.c`](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/uds_service.c) (UDS traffic relay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and firmware"]
  node_bootmenu["Boot menu<br/>[main.c]"]
  node_config["Boot configuration<br/>[config.c]"]
  node_chainload["Firmware chainloader<br/>[chainloader.c]"]
  node_firmware["Firmware loading<br/>[firm.c]"]
  node_display["Screen and input<br/>[screen.c]"]
  node_arm9_draw["Boot graphics<br/>[draw.h]"]
  node_arm9_i2c["Hardware I2C<br/>[i2c.c]"]
  node_arm9_memory["Memory utilities<br/>[memory.c]"]
end

subgraph group_system["System services"]
  node_loader["Homebrew loader<br/>[main.c]"]
  node_process_manager["Process management<br/>[manager.c]"]
  node_service_manager["Service sessions<br/>[main.c]"]
  node_pxi["PXI messaging<br/>[main.c]"]
  node_game_mods["Game modding<br/>[process_patches.c]"]
  node_plugins["Game plugins<br/>[plgloader.c]"]
  node_loader_services["Loader services<br/>[service_manager.c]"]
  node_pm_services["PM services<br/>[service_manager.c]"]
end

subgraph group_overlay["Rosalina overlay"]
  node_rosalina["Rosalina overlay<br/>[main.c]"]
  node_screen_filters["Screen filters<br/>[screen_filters.c]"]
  node_input_redirect["Input redirection"]
end

subgraph group_online["BBP Online"]
  node_bbp_menu["BBP Online menu<br/>[bbp_online.c]"]
  node_uds["UDS traffic relay<br/>[uds_service.c]"]
  node_secure_transport["Encrypted transport"]
end

subgraph group_debug["Debug and kernel"]
  node_kernel_ext["Kernel extension<br/>[main.c]"]
  node_kernel_svc["Kernel SVC handlers<br/>[svc.c]"]
  node_exceptions["Exception handling"]
  node_gdb["GDB stub<br/>[server.c]"]
  node_gdb_network["GDB networking<br/>[net.c]"]
  node_gdb_threads["GDB threads<br/>[thread.c]"]
  node_gdb_queries["GDB queries<br/>[query.c]"]
end

node_player(("Console user"))
node_relay(("Relay server"))

node_player -.->|"starts firmware"| node_bootmenu
node_player -->|"opens menu"| node_bbp_menu
node_bbp_menu -.->|"configures relay"| node_uds
node_player -->|"plays local wireless"| node_uds
node_uds -->|"forwards traffic"| node_relay
node_uds -.->|"encrypts traffic"| node_secure_transport
node_secure_transport -->|"sends encrypted traffic"| node_relay
node_player -->|"opens overlay"| node_rosalina
node_player -->|"selects payload"| node_chainload
node_player -->|"sets boot options"| node_config
node_bootmenu -->|"offers chainloading"| node_chainload
node_bootmenu -.->|"launches firmware"| node_firmware
node_player -->|"connects debugger"| node_gdb
node_rosalina -.->|"offers debugger"| node_gdb
node_rosalina -->|"offers filters"| node_screen_filters
node_rosalina -->|"offers redirection"| node_input_redirect
node_rosalina -->|"supports plugins"| node_plugins
node_rosalina -->|"supports modding"| node_game_mods
node_loader -.->|"applies patches"| node_game_mods
node_process_manager -.->|"manages processes"| node_loader
node_service_manager -.->|"handles sessions"| node_loader_services
node_process_manager -.->|"handles sessions"| node_pm_services
node_gdb -.->|"serves connections"| node_gdb_network
node_gdb -.->|"handles threads"| node_gdb_threads
node_gdb -.->|"dispatches queries"| node_gdb_queries
node_kernel_ext -.->|"extends services"| node_kernel_svc
node_kernel_ext -.->|"installs handlers"| node_exceptions
node_bootmenu -.->|"draws screens"| node_arm9_draw
node_bootmenu -.->|"reads hardware"| node_arm9_i2c
node_bootmenu -.->|"uses memory helpers"| node_arm9_memory
node_pxi -.->|"uses system IPC"| node_service_manager

click node_bootmenu "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/main.c"
click node_config "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/config.c"
click node_chainload "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/chainloader.c"
click node_firmware "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/firm.c"
click node_display "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/screen.c"
click node_kernel_ext "https://github.com/suke0930/luma3ds-bbp-online/blob/master/k11_extension/source/main.c"
click node_kernel_svc "https://github.com/suke0930/luma3ds-bbp-online/blob/master/k11_extension/source/svc.c"
click node_exceptions "https://github.com/suke0930/luma3ds-bbp-online/blob/master/k11_extension/source/fatalExceptionHandlersMain.c"
click node_loader "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/loader/source/main.c"
click node_process_manager "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/pm/source/manager.c"
click node_service_manager "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/sm/source/main.c"
click node_pxi "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/pxi/source/main.c"
click node_rosalina "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/main.c"
click node_bbp_menu "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/menus/bbp_online.c"
click node_uds "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/uds_service.c"
click node_secure_transport "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/bbp_secure_transport.c"
click node_gdb "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/server.c"
click node_game_mods "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/process_patches.c"
click node_screen_filters "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/menus/screen_filters.c"
click node_input_redirect "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/input_redirection.c"
click node_plugins "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/plugin/plgloader.c"
click node_arm9_draw "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/draw.h"
click node_arm9_i2c "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/i2c.c"
click node_arm9_memory "https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/memory.c"
click node_gdb_network "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/net.c"
click node_gdb_threads "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/thread.c"
click node_loader_services "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/loader/source/service_manager.c"
click node_pm_services "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/pm/source/service_manager.c"
click node_gdb_queries "https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/query.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_bootmenu,node_config,node_chainload,node_firmware,node_display,node_arm9_draw,node_arm9_i2c,node_arm9_memory,node_player toneBlue
class node_loader,node_process_manager,node_service_manager,node_pxi,node_game_mods,node_plugins,node_loader_services,node_pm_services toneAmber
class node_rosalina,node_screen_filters,node_input_redirect,node_relay toneMint
class node_bbp_menu,node_uds,node_secure_transport toneRose
class node_kernel_ext,node_kernel_svc,node_exceptions,node_gdb,node_gdb_network,node_gdb_threads,node_gdb_queries toneIndigo
```

## Components

### Boot and firmware

- [Boot menu](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/main.c): `arm9/source/main.c`
- [Boot configuration](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/config.c): `arm9/source/config.c`
- [Firmware chainloader](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/chainloader.c): `arm9/source/chainloader.c`
- [Firmware loading](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/firm.c): `arm9/source/firm.c`
- [Screen and input](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/screen.c): `arm9/source/screen.c`
- [Boot graphics](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/draw.h): `arm9/source/draw.h`
- [Hardware I2C](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/i2c.c): `arm9/source/i2c.c`
- [Memory utilities](https://github.com/suke0930/luma3ds-bbp-online/blob/master/arm9/source/memory.c): `arm9/source/memory.c`

### System services

- [Homebrew loader](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/loader/source/main.c): `sysmodules/loader/source/main.c`
- [Process management](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/pm/source/manager.c): `sysmodules/pm/source/manager.c`
- [Service sessions](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/sm/source/main.c): `sysmodules/sm/source/main.c`
- [PXI messaging](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/pxi/source/main.c): `sysmodules/pxi/source/main.c`
- [Game modding](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/process_patches.c): `sysmodules/rosalina/source/process_patches.c`
- [Game plugins](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/plugin/plgloader.c): `sysmodules/rosalina/source/plugin/plgloader.c`
- [Loader services](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/loader/source/service_manager.c): `sysmodules/loader/source/service_manager.c`
- [PM services](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/pm/source/service_manager.c): `sysmodules/pm/source/service_manager.c`

### Rosalina overlay

- [Rosalina overlay](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/main.c): `sysmodules/rosalina/source/main.c`
- [Screen filters](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/menus/screen_filters.c): `sysmodules/rosalina/source/menus/screen_filters.c`
- [Input redirection](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/input_redirection.c): `sysmodules/rosalina/source/input_redirection.c`

### BBP Online

- [BBP Online menu](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/menus/bbp_online.c): `sysmodules/rosalina/source/menus/bbp_online.c`
- [UDS traffic relay](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/uds_service.c): `sysmodules/rosalina/source/uds_service.c`
- [Encrypted transport](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/bbp_secure_transport.c): `sysmodules/rosalina/source/bbp_secure_transport.c`

### Debug and kernel

- [Kernel extension](https://github.com/suke0930/luma3ds-bbp-online/blob/master/k11_extension/source/main.c): `k11_extension/source/main.c`
- [Kernel SVC handlers](https://github.com/suke0930/luma3ds-bbp-online/blob/master/k11_extension/source/svc.c): `k11_extension/source/svc.c`
- [Exception handling](https://github.com/suke0930/luma3ds-bbp-online/blob/master/k11_extension/source/fatalExceptionHandlersMain.c): `k11_extension/source/fatalExceptionHandlersMain.c`
- [GDB stub](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/server.c): `sysmodules/rosalina/source/gdb/server.c`
- [GDB networking](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/net.c): `sysmodules/rosalina/source/gdb/net.c`
- [GDB threads](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/thread.c): `sysmodules/rosalina/source/gdb/thread.c`
- [GDB queries](https://github.com/suke0930/luma3ds-bbp-online/blob/master/sysmodules/rosalina/source/gdb/query.c): `sysmodules/rosalina/source/gdb/query.c`

### Other components

- **Console user**
- **Relay server**

## Connections

- Console user → Boot menu: starts firmware
- Console user → BBP Online menu: opens menu (evidence: `README.md`)
- BBP Online menu → UDS traffic relay: configures relay
- Console user → UDS traffic relay: plays local wireless (evidence: `README.md`)
- UDS traffic relay → Relay server: forwards traffic (evidence: `README.md`)
- UDS traffic relay → Encrypted transport: encrypts traffic
- Encrypted transport → Relay server: sends encrypted traffic (evidence: `README.md`)
- Console user → Rosalina overlay: opens overlay (evidence: `README.md`)
- Console user → Firmware chainloader: selects payload (evidence: `README.md`)
- Console user → Boot configuration: sets boot options (evidence: `README.md`)
- Boot menu → Firmware chainloader: offers chainloading (evidence: `README.md`)
- Boot menu → Firmware loading: launches firmware
- Console user → GDB stub: connects debugger (evidence: `README.md`)
- Rosalina overlay → GDB stub: offers debugger
- Rosalina overlay → Screen filters: offers filters (evidence: `README.md`)
- Rosalina overlay → Input redirection: offers redirection (evidence: `README.md`)
- Rosalina overlay → Game plugins: supports plugins (evidence: `README.md`)
- Rosalina overlay → Game modding: supports modding (evidence: `README.md`)
- Homebrew loader → Game modding: applies patches
- Process management → Homebrew loader: manages processes
- Service sessions → Loader services: handles sessions
- Process management → PM services: handles sessions
- GDB stub → GDB networking: serves connections
- GDB stub → GDB threads: handles threads
- GDB stub → GDB queries: dispatches queries
- Kernel extension → Kernel SVC handlers: extends services
- Kernel extension → Exception handling: installs handlers
- Boot menu → Boot graphics: draws screens (evidence: `arm9/source/main.c`)
- Boot menu → Hardware I2C: reads hardware
- Boot menu → Memory utilities: uses memory helpers
- PXI messaging → Service sessions: uses system IPC
