# omrrexd/sd2cloud architecture

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

- Interactive diagram: https://gitdiagram.com/omrrexd/sd2cloud
- Repository: https://github.com/omrrexd/sd2cloud

## Overview

SD2Cloud is a PS2 application for managing sd2psx-family memory cards and backing them up to Google Drive. Its main workflow starts in the PS2 app entry point, opens the interactive screens, and lets users browse or modify cards and saves; cloud backup and restore are additional outcomes, with IGR able to trigger automatic sync on game exit. The README documents capabilities not fully visible in the sampled excerpts; those relationships are cited to it. Unsampled module internals are not inferred beyond documented features.

Main entry points: [`src/app/browse.c`](https://github.com/omrrexd/sd2cloud/blob/main/src/app/browse.c) (Card and file browser), [`src/main.c`](https://github.com/omrrexd/sd2cloud/blob/main/src/main.c) (Application entry), [`src/core/cards.c`](https://github.com/omrrexd/sd2cloud/blob/main/src/core/cards.c) (Card catalog), [`src/core/mcfs.c`](https://github.com/omrrexd/sd2cloud/blob/main/src/core/mcfs.c) (Card filesystem)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and screens"]
  node_main["Application entry<br/>[main.c]"]
  node_menu["Main menu<br/>[menu.c]"]
  node_settings["Settings<br/>[settings.c]"]
end

subgraph group_memory["Card and save management"]
  node_browse["Card and file browser<br/>[browse.c]"]
  node_saves["Save manager<br/>[saves.c]"]
  node_install["Save installer<br/>[install.c]"]
  node_tools["Templates and tools<br/>[tools.c]"]
  node_templates["Save templates<br/>[templates.c]"]
end

subgraph group_cloud["Cloud and backup"]
  node_backup["Backup and sync<br/>[backup.c]"]
  node_autosync["IGR auto-sync<br/>[autosync.c]"]
  node_restore["Backup restore<br/>[restore.c]"]
  node_google["Google Drive client<br/>[google.c]"]
end

subgraph group_runtime["Storage and platform"]
  node_cards["Card catalog<br/>[cards.c]"]
  node_mcfs["Card filesystem<br/>[mcfs.c]"]
  node_state[("Persistent state<br/>[state.c]")]
  node_files["File operations<br/>[files.c]"]
  node_update["Self updater<br/>[update.c]"]
  node_platform["PS2 platform services<br/>[system.h]"]
end

subgraph group_presentation["Interface rendering"]
  node_ui["Screen renderer<br/>[ui.c]"]
  node_icons["Save icon renderer<br/>[icon.c]"]
end

node_user(("PS2 user"))
node_drive[("Google Drive")]

node_user -->|"starts app"| node_main
node_main -->|"opens screen"| node_menu
node_main -->|"dispatches IGR"| node_autosync
node_user -->|"browses cards"| node_browse
node_menu -.->|"opens browser"| node_browse
node_browse -.->|"lists cards"| node_cards
node_browse -->|"opens saves"| node_saves
node_saves -.->|"manages saves"| node_mcfs
node_browse -->|"opens imports"| node_install
node_install -->|"writes saves"| node_mcfs
node_user -->|"manages templates"| node_tools
node_tools -.->|"configures templates"| node_templates
node_user -->|"changes settings"| node_settings
node_settings -.->|"saves options"| node_state
node_backup -.->|"checks changes"| node_cards
node_backup -->|"uploads backups"| node_google
node_google -->|"stores backups"| node_drive
node_autosync -->|"starts sync"| node_backup
node_restore -->|"fetches backup"| node_google
node_restore -->|"writes card"| node_mcfs
node_cards -.->|"fingerprints cards"| node_mcfs
node_cards -.->|"scans files"| node_files
node_update -.->|"checks releases"| node_platform
node_main -.->|"initializes system"| node_platform
node_menu -.->|"draws screens"| node_ui
node_saves -->|"shows save icons"| node_icons
node_icons -->|"renders graphics"| node_ui

click node_main "https://github.com/omrrexd/sd2cloud/blob/main/src/main.c"
click node_menu "https://github.com/omrrexd/sd2cloud/blob/main/src/app/menu.c"
click node_browse "https://github.com/omrrexd/sd2cloud/blob/main/src/app/browse.c"
click node_saves "https://github.com/omrrexd/sd2cloud/blob/main/src/app/saves.c"
click node_install "https://github.com/omrrexd/sd2cloud/blob/main/src/app/install.c"
click node_tools "https://github.com/omrrexd/sd2cloud/blob/main/src/app/tools.c"
click node_settings "https://github.com/omrrexd/sd2cloud/blob/main/src/app/settings.c"
click node_cards "https://github.com/omrrexd/sd2cloud/blob/main/src/core/cards.c"
click node_mcfs "https://github.com/omrrexd/sd2cloud/blob/main/src/core/mcfs.c"
click node_state "https://github.com/omrrexd/sd2cloud/blob/main/src/core/state.c"
click node_files "https://github.com/omrrexd/sd2cloud/blob/main/src/core/files.c"
click node_backup "https://github.com/omrrexd/sd2cloud/blob/main/src/app/backup.c"
click node_autosync "https://github.com/omrrexd/sd2cloud/blob/main/src/app/autosync.c"
click node_restore "https://github.com/omrrexd/sd2cloud/blob/main/src/core/restore.c"
click node_google "https://github.com/omrrexd/sd2cloud/blob/main/src/core/google.c"
click node_templates "https://github.com/omrrexd/sd2cloud/blob/main/src/core/templates.c"
click node_update "https://github.com/omrrexd/sd2cloud/blob/main/src/core/update.c"
click node_platform "https://github.com/omrrexd/sd2cloud/blob/main/src/platform/system.h"
click node_ui "https://github.com/omrrexd/sd2cloud/blob/main/src/ui/ui.c"
click node_icons "https://github.com/omrrexd/sd2cloud/blob/main/src/ui/icon.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_main,node_menu,node_settings,node_user toneBlue
class node_browse,node_saves,node_install,node_tools,node_templates,node_drive toneAmber
class node_backup,node_autosync,node_restore,node_google toneMint
class node_cards,node_mcfs,node_state,node_files,node_update,node_platform toneRose
class node_ui,node_icons toneIndigo
```

## Components

### App entry and screens

- [Application entry](https://github.com/omrrexd/sd2cloud/blob/main/src/main.c): `src/main.c`
- [Main menu](https://github.com/omrrexd/sd2cloud/blob/main/src/app/menu.c): `src/app/menu.c`
- [Settings](https://github.com/omrrexd/sd2cloud/blob/main/src/app/settings.c): `src/app/settings.c`

### Card and save management

- [Card and file browser](https://github.com/omrrexd/sd2cloud/blob/main/src/app/browse.c): `src/app/browse.c`
- [Save manager](https://github.com/omrrexd/sd2cloud/blob/main/src/app/saves.c): `src/app/saves.c`
- [Save installer](https://github.com/omrrexd/sd2cloud/blob/main/src/app/install.c): `src/app/install.c`
- [Templates and tools](https://github.com/omrrexd/sd2cloud/blob/main/src/app/tools.c): `src/app/tools.c`
- [Save templates](https://github.com/omrrexd/sd2cloud/blob/main/src/core/templates.c): `src/core/templates.c`

### Cloud and backup

- [Backup and sync](https://github.com/omrrexd/sd2cloud/blob/main/src/app/backup.c): `src/app/backup.c`
- [IGR auto-sync](https://github.com/omrrexd/sd2cloud/blob/main/src/app/autosync.c): `src/app/autosync.c`
- [Backup restore](https://github.com/omrrexd/sd2cloud/blob/main/src/core/restore.c): `src/core/restore.c`
- [Google Drive client](https://github.com/omrrexd/sd2cloud/blob/main/src/core/google.c): `src/core/google.c`

### Storage and platform

- [Card catalog](https://github.com/omrrexd/sd2cloud/blob/main/src/core/cards.c): `src/core/cards.c`
- [Card filesystem](https://github.com/omrrexd/sd2cloud/blob/main/src/core/mcfs.c): `src/core/mcfs.c`
- [Persistent state](https://github.com/omrrexd/sd2cloud/blob/main/src/core/state.c): `src/core/state.c`
- [File operations](https://github.com/omrrexd/sd2cloud/blob/main/src/core/files.c): `src/core/files.c`
- [Self updater](https://github.com/omrrexd/sd2cloud/blob/main/src/core/update.c): `src/core/update.c`
- [PS2 platform services](https://github.com/omrrexd/sd2cloud/blob/main/src/platform/system.h): `src/platform/system.h`

### Interface rendering

- [Screen renderer](https://github.com/omrrexd/sd2cloud/blob/main/src/ui/ui.c): `src/ui/ui.c`
- [Save icon renderer](https://github.com/omrrexd/sd2cloud/blob/main/src/ui/icon.c): `src/ui/icon.c`

### Other components

- **PS2 user**
- **Google Drive**

## Connections

- PS2 user → Application entry: starts app (evidence: `README.md`)
- Application entry → Main menu: opens screen (evidence: `src/main.c`)
- Application entry → IGR auto-sync: dispatches IGR (evidence: `src/main.c`)
- PS2 user → Card and file browser: browses cards (evidence: `README.md`)
- Main menu → Card and file browser: opens browser
- Card and file browser → Card catalog: lists cards
- Card and file browser → Save manager: opens saves (evidence: `README.md`)
- Save manager → Card filesystem: manages saves
- Card and file browser → Save installer: opens imports (evidence: `README.md`)
- Save installer → Card filesystem: writes saves (evidence: `README.md`)
- PS2 user → Templates and tools: manages templates (evidence: `README.md`)
- Templates and tools → Save templates: configures templates
- PS2 user → Settings: changes settings (evidence: `README.md`)
- Settings → Persistent state: saves options
- Backup and sync → Card catalog: checks changes
- Backup and sync → Google Drive client: uploads backups (evidence: `README.md`)
- Google Drive client → Google Drive: stores backups (evidence: `README.md`)
- IGR auto-sync → Backup and sync: starts sync (evidence: `README.md`)
- Backup restore → Google Drive client: fetches backup
- Backup restore → Card filesystem: writes card (evidence: `README.md`)
- Card catalog → Card filesystem: fingerprints cards
- Card catalog → File operations: scans files
- Self updater → PS2 platform services: checks releases
- Application entry → PS2 platform services: initializes system
- Main menu → Screen renderer: draws screens
- Save manager → Save icon renderer: shows save icons (evidence: `README.md`)
- Save icon renderer → Screen renderer: renders graphics (evidence: `src/ui/icon.c`)
