# markmental/japs1me architecture

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

- Interactive diagram: https://gitdiagram.com/markmental/japs1me
- Repository: https://github.com/markmental/japs1me

## Overview

JAPS1ME is a command-line editor for PlayStation 1 memory-card images. Its main workflow dispatches list, convert, import, delete, and install commands: inputs are parsed or transformed, then displayed or safely written to card files. The graph separates CLI orchestration, card-format processing, save operations, and install support. Edges follow the shown main.rs calls and source-index references; install details are documented in the README, while some implementation paths are only partially excerpted.

Main entry points: [`src/ps1/card.rs`](https://github.com/markmental/japs1me/blob/main/src/ps1/card.rs) (Raw card parser), [`src/main.rs`](https://github.com/markmental/japs1me/blob/main/src/main.rs) (Command dispatcher), [`src/ps1/import.rs`](https://github.com/markmental/japs1me/blob/main/src/ps1/import.rs) (Save import), [`src/ps1/delete.rs`](https://github.com/markmental/japs1me/blob/main/src/ps1/delete.rs) (Save deletion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_entry["Command dispatcher<br/>[main.rs]"]
  node_listing["List command<br/>[main.rs]"]
  node_conversion["Convert command<br/>[main.rs]"]
  node_table["Save table<br/>[list.rs]"]
end

subgraph group_formats["Card formats"]
  node_gme["DexDrive parser<br/>[gme.rs]"]
  node_card["Raw card parser<br/>[card.rs]"]
  node_title["Title decoder<br/>[title.rs]"]
end

subgraph group_saves["Save operations"]
  node_importcmd["Import command<br/>[main.rs]"]
  node_import["Save import<br/>[import.rs]"]
  node_deletecmd["Delete command<br/>[main.rs]"]
  node_delete["Save deletion<br/>[delete.rs]"]
end

subgraph group_install["RetroArch install"]
  node_installcmd["Install command<br/>[main.rs]"]
  node_installtools["Directory and backup tools<br/>[install.rs]"]
end

node_user(("CLI user"))
node_cardfiles[("Card files")]
node_retrodir[("RetroArch saves directory")]

node_user -->|"runs command"| node_entry
node_entry -->|"dispatches"| node_listing
node_entry -->|"dispatches"| node_conversion
node_entry -->|"dispatches"| node_importcmd
node_entry -->|"dispatches"| node_deletecmd
node_entry -->|"dispatches"| node_installcmd
node_listing -->|"parses image"| node_card
node_listing -->|"formats output"| node_table
node_conversion -->|"parses input"| node_gme
node_conversion -->|"validates payload"| node_card
node_conversion -->|"writes converted card"| node_cardfiles
node_card -->|"decodes title"| node_title
node_importcmd -->|"parses source"| node_gme
node_importcmd -->|"parses target"| node_card
node_importcmd -->|"imports save"| node_import
node_import -->|"uses card frames"| node_card
node_importcmd -->|"replaces target"| node_cardfiles
node_deletecmd -->|"parses target"| node_card
node_deletecmd -->|"deletes save"| node_delete
node_delete -->|"uses card frames"| node_card
node_deletecmd -->|"replaces target"| node_cardfiles
node_installcmd -->|"discovers and configures"| node_installtools
node_installcmd -->|"installs card"| node_retrodir
node_installtools -->|"scans card files"| node_retrodir

click node_entry "https://github.com/markmental/japs1me/blob/main/src/main.rs"
click node_listing "https://github.com/markmental/japs1me/blob/main/src/main.rs"
click node_conversion "https://github.com/markmental/japs1me/blob/main/src/main.rs"
click node_table "https://github.com/markmental/japs1me/blob/main/src/commands/list.rs"
click node_gme "https://github.com/markmental/japs1me/blob/main/src/gme.rs"
click node_card "https://github.com/markmental/japs1me/blob/main/src/ps1/card.rs"
click node_title "https://github.com/markmental/japs1me/blob/main/src/ps1/title.rs"
click node_importcmd "https://github.com/markmental/japs1me/blob/main/src/main.rs"
click node_import "https://github.com/markmental/japs1me/blob/main/src/ps1/import.rs"
click node_deletecmd "https://github.com/markmental/japs1me/blob/main/src/main.rs"
click node_delete "https://github.com/markmental/japs1me/blob/main/src/ps1/delete.rs"
click node_installcmd "https://github.com/markmental/japs1me/blob/main/src/main.rs"
click node_installtools "https://github.com/markmental/japs1me/blob/main/src/install.rs"

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_entry,node_listing,node_conversion,node_table,node_user toneBlue
class node_gme,node_card,node_title,node_cardfiles,node_retrodir toneAmber
class node_importcmd,node_import,node_deletecmd,node_delete toneMint
class node_installcmd,node_installtools toneRose
```

## Components

### CLI workflows

- [Command dispatcher](https://github.com/markmental/japs1me/blob/main/src/main.rs): `src/main.rs`
- [List command](https://github.com/markmental/japs1me/blob/main/src/main.rs): `src/main.rs`
- [Convert command](https://github.com/markmental/japs1me/blob/main/src/main.rs): `src/main.rs`
- [Save table](https://github.com/markmental/japs1me/blob/main/src/commands/list.rs): `src/commands/list.rs`

### Card formats

- [DexDrive parser](https://github.com/markmental/japs1me/blob/main/src/gme.rs): `src/gme.rs`
- [Raw card parser](https://github.com/markmental/japs1me/blob/main/src/ps1/card.rs): `src/ps1/card.rs`
- [Title decoder](https://github.com/markmental/japs1me/blob/main/src/ps1/title.rs): `src/ps1/title.rs`

### Save operations

- [Import command](https://github.com/markmental/japs1me/blob/main/src/main.rs): `src/main.rs`
- [Save import](https://github.com/markmental/japs1me/blob/main/src/ps1/import.rs): `src/ps1/import.rs`
- [Delete command](https://github.com/markmental/japs1me/blob/main/src/main.rs): `src/main.rs`
- [Save deletion](https://github.com/markmental/japs1me/blob/main/src/ps1/delete.rs): `src/ps1/delete.rs`

### RetroArch install

- [Install command](https://github.com/markmental/japs1me/blob/main/src/main.rs): `src/main.rs`
- [Directory and backup tools](https://github.com/markmental/japs1me/blob/main/src/install.rs): `src/install.rs`

### Other components

- **CLI user**
- **Card files**
- **RetroArch saves directory**

## Connections

- CLI user → Command dispatcher: runs command (evidence: `README.md`)
- Command dispatcher → List command: dispatches (evidence: `src/main.rs`)
- Command dispatcher → Convert command: dispatches (evidence: `README.md`)
- Command dispatcher → Import command: dispatches (evidence: `README.md`)
- Command dispatcher → Delete command: dispatches (evidence: `README.md`)
- Command dispatcher → Install command: dispatches (evidence: `README.md`)
- List command → Raw card parser: parses image (evidence: `src/main.rs`)
- List command → Save table: formats output (evidence: `src/main.rs`)
- Convert command → DexDrive parser: parses input (evidence: `src/main.rs`)
- Convert command → Raw card parser: validates payload (evidence: `src/main.rs`)
- Convert command → Card files: writes converted card (evidence: `README.md`)
- Raw card parser → Title decoder: decodes title (evidence: `src/ps1/card.rs`)
- Import command → DexDrive parser: parses source (evidence: `src/main.rs`)
- Import command → Raw card parser: parses target (evidence: `src/main.rs`)
- Import command → Save import: imports save (evidence: `src/main.rs`)
- Save import → Raw card parser: uses card frames (evidence: `src/ps1/import.rs`)
- Import command → Card files: replaces target (evidence: `README.md`)
- Delete command → Raw card parser: parses target (evidence: `src/main.rs`)
- Delete command → Save deletion: deletes save (evidence: `README.md`)
- Save deletion → Raw card parser: uses card frames (evidence: `src/ps1/delete.rs`)
- Delete command → Card files: replaces target (evidence: `README.md`)
- Install command → Directory and backup tools: discovers and configures (evidence: `src/main.rs`)
- Install command → RetroArch saves directory: installs card (evidence: `README.md`)
- Directory and backup tools → RetroArch saves directory: scans card files (evidence: `src/install.rs`)
