ixud.rs now has an IdxdObject-shaped reader, IxudObject, and build_caption_text reads captions as FIELDS instead of pairing them with whatever token follows in the pool. build_demo_text token adjacency 134 ids 537 lines build_caption_text token adjacency 3721 8074 build_caption_text record fields 4085 8800 = all of them Verified over the whole disc by tests/ixud_records_disc.rs: 1104/1104 objects parse, 1476/1476 records and 628165/628165 named fields reproduce their ixud_hash, 48 positional, zero failures. The header word at 0x08 is record 0's hash, asserted per object -- there is no schema field, exactly as for IDXD. The module doc described a 12-byte record directory and a "schema/type hash"; both were wrong and are corrected. I also have to correct my own number from the previous commit. "1.3% of the game's text" counted OCCURRENCES: each family lives in 24-45 IXUD blocks and the same key repeats across them. Distinct text-bearing MSG_* keys number 8800, not 44579, and every one has the <id>_<page>_<line> shape. So the real coverage was 537/8800 = 6.1%, and I overstated the gap about fivefold. Direction right, magnitude wrong. The DEMO control is the sharpest evidence for the change: token adjacency finds 537 lines there, the field reader 541. It was dropping lines even in the one family it was written for -- which is why the test now asserts "must not lose lines" rather than "must be identical". Same lesson twice in one session: pool adjacency is a consequence of how records are written, not a rule of the format. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PMRJjbxLqZtsb5Vb7KunPE
96 lines
2.7 KiB
Rust
96 lines
2.7 KiB
Rust
//! # sylpheed-formats
|
|
//!
|
|
//! Asset format parsers for Project Sylpheed: Arc of Deception (Xbox 360).
|
|
//!
|
|
//! This crate handles:
|
|
//! - Reading game files from XISO disc images (native only)
|
|
//! - Reading IPFB archives (`*.pak` / `*.pNN`) and the `IDXD` definition objects inside
|
|
//! - Parsing Xbox 360 texture formats (XPR2 containers + DXT de-tiling)
|
|
//! - Parsing mesh formats (to be reverse engineered)
|
|
//! - Parsing audio formats (XMA → standard PCM)
|
|
//!
|
|
//! ## Platform notes
|
|
//! XISO reading is only available on native (Windows/macOS/Linux).
|
|
//! On WASM, assets must be pre-extracted and served over HTTP.
|
|
|
|
pub mod texture;
|
|
pub mod vfs;
|
|
|
|
// IPFB TOC name-hash (path → 32-bit key), recovered from the retail title
|
|
pub mod hash;
|
|
|
|
// IPFB archive (`*.pak` index + `*.pNN` segments) reader
|
|
pub mod pak;
|
|
|
|
// IDXD reflective object (ship / weapon / effect / menu definitions) reader
|
|
pub mod idxd;
|
|
|
|
// IXUD localized string / subtitle table reader
|
|
pub mod ixud;
|
|
|
|
// Embedded font (OTF / TTF / ttcf) metadata
|
|
pub mod font;
|
|
|
|
// T8aD 2D UI/HUD texture
|
|
pub mod t8ad;
|
|
|
|
// RATC nested resource bundle
|
|
pub mod ratc;
|
|
|
|
/// UI screen layout (`.rat` / RATC) — reassemble a screen from its pak.
|
|
pub mod ui_layout;
|
|
|
|
/// The retail `savedata` file: GDHA container, zlib payload, chunk stream.
|
|
pub mod savegame;
|
|
|
|
// LSTA sprite list (inline T8aD frames)
|
|
pub mod lsta;
|
|
|
|
// XISO reading is not available in-browser
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
pub mod xiso;
|
|
|
|
// Mesh parsing — scaffold for reverse engineering
|
|
pub mod mesh;
|
|
|
|
// Audio parsing — scaffold for XMA handling
|
|
pub mod audio;
|
|
|
|
// Movie cutscene subtitles — the movie → track → text chain.
|
|
pub mod movie_subtitle;
|
|
|
|
// XACT `.slb` sound banks (voice / music) → decodable XMA1 RIFF.
|
|
pub mod slb;
|
|
|
|
// The movie manifest: authoritative movie → subtitle → voice index.
|
|
pub mod movie_manifest;
|
|
|
|
pub mod movie_voice;
|
|
|
|
pub mod game_data;
|
|
|
|
pub mod localization;
|
|
|
|
// Whole-ship assembly from XBG7 part families (capital ships as split parts).
|
|
pub mod ship;
|
|
|
|
/// The runtime layout of a unit / vessel definition object, read out of the
|
|
/// title's loader and verified against a live mission (see the module docs).
|
|
pub mod unit_layout;
|
|
|
|
// Exact capital-ship placement from a runtime F10 ship-capture (ground truth).
|
|
pub mod ship_capture;
|
|
|
|
/// Re-export the most commonly used types at the crate root.
|
|
pub use audio::{AudioCodec, AudioInfo, GameAudio};
|
|
pub use font::FontInfo;
|
|
pub use idxd::{IdxdError, IdxdObject};
|
|
pub use ixud::{Cue, IxudField, IxudObject, IxudRecord, Subtitle};
|
|
pub use movie_subtitle::{SubCue, SubLang};
|
|
pub use mesh::{GameMesh, Xbg7Model};
|
|
pub use ratc::RatcChild;
|
|
pub use t8ad::T8adImage;
|
|
pub use pak::{PakArchive, PakEntry, PakError};
|
|
pub use texture::{X360Texture, X360TextureFormat};
|
|
pub use vfs::{GameAssets, VfsError};
|