Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

All notable changes to `xtafkit` will be documented in this file.

## [Unreleased]

### ISO / disc-image support
- Added `xtafkit extract` for streaming Xbox / Xbox 360 XISO contents to a local directory, with `$SystemUpdate` skipped by default. Supports `--keep-systemupdate` to override and `--dry-run` to preview file list + byte totals without writing.
- Added `xtafkit god` for XISO → Games-on-Demand conversion. Default trim is `compact`; `preserve-layout` and `none` stay available for debugging and compatibility. Game-title slot in the CON header auto-fills from the bundled catalog; pass `--game-title TITLE` to override.
- TUI upload (`u`) now sniffs every local file and, on XISO detection, prompts **e(X)tract / (G)oD / (R)aw / Esc**. Default flips by cwd context: inside `/Content/<XUID>/` defaults to GoD (BC playback target); everywhere else defaults to Extract (alt-dashboard target).
- Extract destination folder name is resolved from the catalog when the title is known — `disc1.iso` with TitleID `4D5307E6` extracts as `Halo 3/` rather than `disc1/`. Falls back to the file stem on catalog miss. Names are sanitized for FATX (illegal chars replaced with `-`, runs of whitespace collapsed, truncated to 42 bytes).
- Introduced a shared `fatxlib::iso` namespace for image reading, manifest planning, compact repacking, and GoD conversion.
- Reworked compact GoD conversion to stream a virtual dense XDVDFS layout instead of staging a temporary ISO on disk — peak local disk usage during conversion is zero.
- Centralized ISO filtering and planning so extract, compact trim, and dry-run reporting share the same manifest.
- Removed the old public `fatxlib::xiso` and `fatxlib::iso2god` entry points in favor of `fatxlib::iso::{image,manifest,compact,god}`.
- Refactored GoD conversion to share its engine between host-filesystem and FATX-volume targets via an internal `GodSink` trait — one `run_conversion` loop, two sink implementations.

### Performance
- Hot-path SHA-1 in GoD conversion routes through `openssl::sha::sha1` by default (ARMv8 SHA on Apple Silicon, SHA-NI on x86). Gated by the default-on `openssl-hash` cargo feature; disable to fall back to RustCrypto's `sha1` crate with zero system OpenSSL dependency.
- Fixed a double-I/O bug in `write_part`: the upstream implementation read each subpart, hashed it, then `seek_relative`d back and re-read it via `io::copy` to write the part file. Now writes from the buffer it already has, halving I/O on the hot path (~33 % wall-time reduction on large ISOs).
- 1 MiB `BufReader` on the source ISO during the metadata pre-pass cuts syscall tax on multi-GiB inputs.
- Streaming variant of GoD conversion to FATX (`convert_iso_to_fatx`) builds each part in a reused ~163 MiB buffer and streams straight into the volume — no local staging.

### TUI / quality of life
- Mid-conversion `Esc` cancels GoD conversion cleanly (checked between parts and between MHT-chain steps); no partial silent failures.
- Per-part byte-level progress with MiB/s throughput, rate-limited to ~200 ms intervals.
- Upload prompt no longer prefills with the last-used path — always starts blank.
- TUI extract worker skips `$SystemUpdate` and surfaces the skip count + bytes in the completion message.

### Library API additions
- `fatxlib::iso::image::XisoImage::title_info()` parses the embedded `Default.xex` / `default.xbe` and returns the title's execution info. Used by catalog name resolution and by the GoD conversion pipeline.
- `fatxlib::executable` (top-level module) holds `TitleInfo` / `TitleExecutionInfo` and the XEX/XBE parsers — shared between `iso::image` and `iso::god`.
- `fatxlib::volume::FatxVolume::create_file_from_reader` streams a file into FATX cluster-by-cluster from any `Read` source, capping working-set at one cluster regardless of total file size.

## [1.1.0] - 2026-05-16

First release under the `xtafkit` name. Forked from
Expand Down
11 changes: 8 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Rust toolkit for reading and writing FATX/XTAF file systems on Xbox/Xbox 360 for
## Architecture
- **Cargo workspace** with two crates:
- `fatxlib` — Library crate. FATX/XTAF volume implementation, types, partition detection, platform I/O. Also: bundled title catalog (Xbox 360 + Original Xbox), STFS header parser, profile (Account) blob decryption, slot-aware display formatting.
- `xtafkit` (root) — Single binary (`xtafkit`). Five subcommands via clap (`browse`, `ls`, `scan`, `mkimage`, `resolve`); no-args entry point launches the TUI via guided picker. Ratatui-based TUI is the primary UX. Test image generator (`mkimage`) is the only non-TUI write path that ships.
- `xtafkit` (root) — Single binary (`xtafkit`). Seven subcommands via clap (`browse`, `ls`, `scan`, `mkimage`, `resolve`, `extract`, `god`); no-args entry point launches the TUI via guided picker. Ratatui-based TUI is the primary UX. `extract` and `god` handle XISO work; `mkimage` is the only non-TUI write path that targets FATX/XTAF itself.

## Key Technical Details

Expand Down Expand Up @@ -84,10 +84,15 @@ cargo run -p fatxlib --example check_profile -- /path/to/profile-file
- Commit and push at each milestone (working feature, major fix, etc.)

### XISO / disc-image support
- `fatxlib::xiso` wraps `xdvdfs` (sync feature, no async runtime) and exposes `XisoImage::{open, walk_files, read_into, file_reader, read_at}` plus a `LAYOUTS` table for raw / XGD1 / XGD2 / XGD3 pre-partition offsets.
- `fatxlib::iso` owns ISO-domain work:
- `image` wraps `xdvdfs` (sync feature, no async runtime) and exposes `XisoImage::{open, walk_files, read_into, file_reader, read_at}` plus a `LAYOUTS` table for raw / XGD1 / XGD2 / XGD3 pre-partition offsets.
- `manifest` builds the shared ISO file manifest, skips `$SystemUpdate` by default, and feeds both extract and compact planning.
- `compact` builds a dense virtual XDVDFS image for hard-trim GoD conversion.
- `god` owns GoD packaging.
- `xtafkit extract` streams XISO files to disk; `xtafkit god` converts XISO to GoD and defaults to `compact` trim.
- TUI upload (`u`) sniffs every local file with `XisoImage::open`. On a hit, the user is prompted **Extract contents (Y/n)** — default extracts via `IoCmd::ExtractXiso`, `n` falls back to raw `WriteFile`. Extraction streams each entry through `XisoFileReader` → `FatxVolume::create_file_from_reader`, which keeps the working set at one cluster regardless of image size.
- Useful because Aurora / FreeStyle Dash / XBMC4XBOX scan the drive for loose `default.xex` / `default.xbe` and launch them directly; STFS-wrapped GoD packaging is **not** required for those dashboards.

## Future Work (Deferred)
- Eager / deferred-sync auto-resolve for files inside STFS content-type folders (Marketplace/Arcade/etc.) — currently on-demand only
- `iso2god`-style ISO → Games-on-Demand conversion (cherry-picked from iso2god-rs, refactored for streaming) — needed only for Xbox 360 BC, which requires STFS GoD packages; alt-dashboard playback already works via the XISO extract flow above
- Further split `fatxlib::iso::god::convert` into a pure conversion core plus transport-specific sinks if the current host-FS / FATX split starts accumulating more policy
Loading