# supakan1223-ui/trombone-champ-switch-cfw-project architecture

> Architecture diagram of the GitHub repository supakan1223-ui/trombone-champ-switch-cfw-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/supakan1223-ui/trombone-champ-switch-cfw-project
- Repository: https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project

## Overview

The repository contains three command-line utilities: TexturePatcher for inspecting and modifying Unity AssetBundles, TrombConverter for reading and writing saved-level data, and AudioPatcher, whose implementation is not described by the sampled source. The main evidenced workflow is a user invoking TexturePatcher commands, which dispatch to analysis or patching components; texture patching encodes image data and updates bundle resources. TrombConverter converts JSON into serialized SavedLevel data and can read that data back. AudioPatcher is shown only as a separate executable; its behavior is uncertain.

Main entry points: [`TexturePatcher/Program.cs`](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Program.cs) (Command Router), [`TexturePatcher/Commands/PatchBgCommand.cs`](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/PatchBgCommand.cs) (Background Patch), [`TexturePatcher/Commands/PatchCommand.cs`](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/PatchCommand.cs) (Texture Patch), [`TexturePatcher/Core/BackgroundAnalyzer.cs`](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/BackgroundAnalyzer.cs) (Background Analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Texture CLI"]
  node_texture_cli["Command Router<br/>[Program.cs]"]
  node_info["Image Info<br/>[InfoCommand.cs]"]
  node_list["Texture Listing<br/>[ListCommand.cs]"]
end

subgraph group_inspect["Bundle Inspection"]
  node_inspect_cmd["Background Inspect<br/>[InspectCommand.cs]"]
  node_analyze["Bundle Analysis<br/>[AnalyzeCommand.cs]"]
  node_bg_analyzer["Background Analyzer"]
  node_asset_fields["Asset Field Helpers<br/>[AssetField.cs]"]
  node_candidate["Background Candidate<br/>[BgCandidate.cs]"]
end

subgraph group_patch["Bundle Editing"]
  node_patch_cmd["Texture Patch<br/>[PatchCommand.cs]"]
  node_patch_bg["Background Patch<br/>[PatchBgCommand.cs]"]
  node_hide_cmd["Renderer Hiding<br/>[HideCommand.cs]"]
  node_renderer_hider["Renderer Hider<br/>[RendererHider.cs]"]
  node_bundle_io["Bundle Texture I/O<br/>[BundleTextureIO.cs]"]
  node_codec["Texture Codec<br/>[TextureCodec.cs]"]
end

subgraph group_tromb["Level Conversion"]
  node_converter["Tromb Converter<br/>[Program.cs]"]
  node_saved_level["Saved Level Model<br/>[SavedLevel.cs]"]
  node_song_custom["Custom Song Data<br/>[SongDataCustom.cs]"]
end

subgraph group_audio["Audio Utility"]
  node_audio_patcher["Audio Patcher<br/>[Program.cs]"]
end

node_user(("User"))

node_user -->|"runs command"| node_texture_cli
node_texture_cli -->|"dispatches info"| node_info
node_texture_cli -->|"dispatches list"| node_list
node_texture_cli -->|"dispatches inspect"| node_inspect_cmd
node_texture_cli -->|"dispatches analyze"| node_analyze
node_texture_cli -->|"dispatches patch"| node_patch_cmd
node_texture_cli -->|"dispatches patchbg"| node_patch_bg
node_texture_cli -->|"dispatches hide"| node_hide_cmd
node_inspect_cmd -->|"finds candidate"| node_bg_analyzer
node_inspect_cmd -->|"formats output"| node_codec
node_analyze -->|"finds targets"| node_bg_analyzer
node_bg_analyzer -->|"uses helpers"| node_asset_fields
node_patch_cmd -->|"finds texture"| node_bundle_io
node_patch_cmd -->|"encodes image"| node_codec
node_patch_cmd -->|"uses helpers"| node_asset_fields
node_bundle_io -->|"reads fields"| node_asset_fields
node_patch_bg -->|"selects targets"| node_bg_analyzer
node_patch_bg -->|"reads resources"| node_bundle_io
node_patch_bg -->|"encodes textures"| node_codec
node_patch_bg -->|"uses hide logic"| node_hide_cmd
node_user -->|"runs conversion"| node_converter
node_converter -->|"serializes model"| node_saved_level
node_converter -->|"deserializes model"| node_saved_level

click node_texture_cli "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Program.cs"
click node_info "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/InfoCommand.cs"
click node_list "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/ListCommand.cs"
click node_inspect_cmd "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/InspectCommand.cs"
click node_analyze "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/AnalyzeCommand.cs"
click node_bg_analyzer "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/BackgroundAnalyzer.cs"
click node_asset_fields "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Util/AssetField.cs"
click node_patch_cmd "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/PatchCommand.cs"
click node_patch_bg "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/PatchBgCommand.cs"
click node_hide_cmd "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/HideCommand.cs"
click node_renderer_hider "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/RendererHider.cs"
click node_bundle_io "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/BundleTextureIO.cs"
click node_codec "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/TextureCodec.cs"
click node_candidate "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Models/BgCandidate.cs"
click node_converter "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TrombConverter/Program.cs"
click node_saved_level "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TrombConverter/SavedLevel.cs"
click node_song_custom "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TrombConverter/SongDataCustom.cs"
click node_audio_patcher "https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/AudioPatcher/Program.cs"

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_texture_cli,node_info,node_list,node_user toneBlue
class node_inspect_cmd,node_analyze,node_bg_analyzer,node_asset_fields,node_candidate toneAmber
class node_patch_cmd,node_patch_bg,node_hide_cmd,node_renderer_hider,node_bundle_io,node_codec toneMint
class node_converter,node_saved_level,node_song_custom toneRose
class node_audio_patcher toneIndigo
```

## Components

### Texture CLI

- [Command Router](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Program.cs): `TexturePatcher/Program.cs`
- [Image Info](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/InfoCommand.cs): `TexturePatcher/Commands/InfoCommand.cs`
- [Texture Listing](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/ListCommand.cs): `TexturePatcher/Commands/ListCommand.cs`

### Bundle Inspection

- [Background Inspect](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/InspectCommand.cs): `TexturePatcher/Commands/InspectCommand.cs`
- [Bundle Analysis](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/AnalyzeCommand.cs): `TexturePatcher/Commands/AnalyzeCommand.cs`
- [Background Analyzer](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/BackgroundAnalyzer.cs): `TexturePatcher/Core/BackgroundAnalyzer.cs`
- [Asset Field Helpers](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Util/AssetField.cs): `TexturePatcher/Util/AssetField.cs`
- [Background Candidate](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Models/BgCandidate.cs): `TexturePatcher/Models/BgCandidate.cs`

### Bundle Editing

- [Texture Patch](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/PatchCommand.cs): `TexturePatcher/Commands/PatchCommand.cs`
- [Background Patch](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/PatchBgCommand.cs): `TexturePatcher/Commands/PatchBgCommand.cs`
- [Renderer Hiding](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Commands/HideCommand.cs): `TexturePatcher/Commands/HideCommand.cs`
- [Renderer Hider](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/RendererHider.cs): `TexturePatcher/Core/RendererHider.cs`
- [Bundle Texture I/O](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/BundleTextureIO.cs): `TexturePatcher/Core/BundleTextureIO.cs`
- [Texture Codec](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TexturePatcher/Core/TextureCodec.cs): `TexturePatcher/Core/TextureCodec.cs`

### Level Conversion

- [Tromb Converter](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TrombConverter/Program.cs): `TrombConverter/Program.cs`
- [Saved Level Model](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TrombConverter/SavedLevel.cs): `TrombConverter/SavedLevel.cs`
- [Custom Song Data](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/TrombConverter/SongDataCustom.cs): `TrombConverter/SongDataCustom.cs`

### Audio Utility

- [Audio Patcher](https://github.com/supakan1223-ui/trombone-champ-switch-cfw-project/blob/main/AudioPatcher/Program.cs): `AudioPatcher/Program.cs`

### Other components

- **User**

## Connections

- User → Command Router: runs command (evidence: `TexturePatcher/Program.cs`)
- Command Router → Image Info: dispatches info (evidence: `TexturePatcher/Program.cs`)
- Command Router → Texture Listing: dispatches list (evidence: `TexturePatcher/Program.cs`)
- Command Router → Background Inspect: dispatches inspect (evidence: `TexturePatcher/Program.cs`)
- Command Router → Bundle Analysis: dispatches analyze (evidence: `TexturePatcher/Program.cs`)
- Command Router → Texture Patch: dispatches patch (evidence: `TexturePatcher/Program.cs`)
- Command Router → Background Patch: dispatches patchbg (evidence: `TexturePatcher/Program.cs`)
- Command Router → Renderer Hiding: dispatches hide (evidence: `TexturePatcher/Program.cs`)
- Background Inspect → Background Analyzer: finds candidate (evidence: `TexturePatcher/Commands/InspectCommand.cs`)
- Background Inspect → Texture Codec: formats output (evidence: `TexturePatcher/Commands/InspectCommand.cs`)
- Bundle Analysis → Background Analyzer: finds targets (evidence: `TexturePatcher/Commands/AnalyzeCommand.cs`)
- Background Analyzer → Asset Field Helpers: uses helpers (evidence: `TexturePatcher/Core/BackgroundAnalyzer.cs`)
- Texture Patch → Bundle Texture I/O: finds texture (evidence: `TexturePatcher/Commands/PatchCommand.cs`)
- Texture Patch → Texture Codec: encodes image (evidence: `TexturePatcher/Commands/PatchCommand.cs`)
- Texture Patch → Asset Field Helpers: uses helpers (evidence: `TexturePatcher/Commands/PatchCommand.cs`)
- Bundle Texture I/O → Asset Field Helpers: reads fields (evidence: `TexturePatcher/Core/BundleTextureIO.cs`)
- Background Patch → Background Analyzer: selects targets (evidence: `TexturePatcher/Commands/PatchBgCommand.cs`)
- Background Patch → Bundle Texture I/O: reads resources (evidence: `TexturePatcher/Commands/PatchBgCommand.cs`)
- Background Patch → Texture Codec: encodes textures (evidence: `TexturePatcher/Commands/PatchBgCommand.cs`)
- Background Patch → Renderer Hiding: uses hide logic (evidence: `TexturePatcher/Commands/PatchBgCommand.cs`)
- User → Tromb Converter: runs conversion (evidence: `TrombConverter/Program.cs`)
- Tromb Converter → Saved Level Model: serializes model (evidence: `TrombConverter/Program.cs`)
- Tromb Converter → Saved Level Model: deserializes model (evidence: `TrombConverter/Program.cs`)
