Compare commits

..

1 Commits

Author SHA1 Message Date
06601c2a48 docs(re): adopt the homeless disc-contents page, re-measured
`GAME_CONTENTS.md` sat in the workspace root through the whole consolidation,
adopted by neither repo -- the corpus documents formats in depth but never said
what files the disc holds or where they sit.

Re-measured rather than transcribed, and that caught a real error: the source
placed `resource3d/`, `DefTables` and `MiscBin` under `dat/`. All three are in
`hidden/` -- which is why `SYLPHEED_RES3D` points at `hidden/resource3d`.
Counts, the language table and `media_id` (0x2D2E2EEB, from the XEX header)
re-verified against the retail extract.

Half the source was pre-RE speculation phrased as status -- `dat/*.pak` marked
"Unknown, magic bytes TBD" when the container is decoded disc-wide, plus a table
guessing each archive's contents from its name. Carrying that forward would put
claims into the corpus the corpus has already refuted, so it is dropped and the
page says what was dropped and why. INDEX.md stays the single authority on
format status.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 21:07:03 +02:00
3 changed files with 114 additions and 28 deletions

View File

@@ -6,34 +6,14 @@
//! silence. One rule, two outcomes. //! silence. One rule, two outcomes.
use std::path::Path; use std::path::Path;
use std::sync::OnceLock;
use sylpheed_formats::{slb, PakArchive}; use sylpheed_formats::{slb, PakArchive};
mod common; mod common;
use common::skip_without_disc; use common::skip_without_disc;
/// One archive for the whole binary.
///
/// `PakArchive` holds the entire concatenated payload in memory, and
/// `sound.pak` is **1.01 GB** (`sound.p00`-`.p04`). Opening it per call — which
/// the helpers below did, inside loops — put one copy per test thread in flight,
/// so at the default thread count the suite needed ~6 GB and was SIGKILLed by
/// the CI container's 7 GB cap (`--memory-swap` equals `--memory`, so there is
/// no swap to absorb it). A killed suite prints no `test result:` line at all,
/// so it vanishes from the tally rather than failing visibly.
///
/// The archive is immutable once open and every accessor takes `&self`, so one
/// shared instance is equivalent to N private ones — at 1/N the memory.
fn sound(root: &Path) -> &'static PakArchive {
static SOUND: OnceLock<PakArchive> = OnceLock::new();
// Every caller passes the same `disc_root()`, so first-writer-wins is the
// same archive whichever test initialises it.
SOUND.get_or_init(|| PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak"))
}
fn bank(root: &Path, n: u32) -> Vec<u8> { fn bank(root: &Path, n: u32) -> Vec<u8> {
let snd = sound(root); let snd = PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak");
let path = format!("eng\\etc\\VOICE_D_{n}.slb"); let path = format!("eng\\etc\\VOICE_D_{n}.slb");
let entry = snd.find_by_name(&path).expect("bank present"); let entry = snd.find_by_name(&path).expect("bank present");
snd.read(entry).expect("read") snd.read(entry).expect("read")
@@ -91,7 +71,7 @@ fn all_zero_leading_region_is_skipped() {
} }
fn bank_named(root: &Path, path: &str) -> Vec<u8> { fn bank_named(root: &Path, path: &str) -> Vec<u8> {
let snd = sound(root); let snd = PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak");
let entry = snd let entry = snd
.find_by_name(path) .find_by_name(path)
.unwrap_or_else(|| panic!("{path} present")); .unwrap_or_else(|| panic!("{path} present"));
@@ -174,7 +154,7 @@ fn derived_offset_recovers_voice_banks_without_regressing_etc() {
#[test] #[test]
fn scan_data_offset_agrees_with_the_riff_derived_answer() { fn scan_data_offset_agrees_with_the_riff_derived_answer() {
skip_without_disc!(root); skip_without_disc!(root);
let snd = sound(&root); let snd = PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak");
let mut checked = 0usize; let mut checked = 0usize;
let mut agreed = 0usize; let mut agreed = 0usize;
for lang in ["eng", "jpn"] { for lang in ["eng", "jpn"] {
@@ -218,7 +198,7 @@ fn scan_data_offset_agrees_with_the_riff_derived_answer() {
#[test] #[test]
fn scan_only_returns_known_offsets() { fn scan_only_returns_known_offsets() {
skip_without_disc!(root); skip_without_disc!(root);
let snd = sound(&root); let snd = PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak");
let mut seen = 0usize; let mut seen = 0usize;
for n in 1u32..200 { for n in 1u32..200 {
for path in [ for path in [
@@ -252,7 +232,7 @@ fn scan_only_returns_known_offsets() {
#[test] #[test]
fn a_waves_declared_size_is_confirmed_by_the_next_seek() { fn a_waves_declared_size_is_confirmed_by_the_next_seek() {
skip_without_disc!(root); skip_without_disc!(root);
let snd = sound(&root); let snd = PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak");
let mut checked = 0usize; let mut checked = 0usize;
for n in 1u32..400 { for n in 1u32..400 {
for path in [ for path in [
@@ -309,7 +289,7 @@ fn a_waves_declared_size_is_confirmed_by_the_next_seek() {
#[test] #[test]
fn a_bank_that_states_its_own_header_has_no_leading_segment() { fn a_bank_that_states_its_own_header_has_no_leading_segment() {
skip_without_disc!(root); skip_without_disc!(root);
let snd = sound(&root); let snd = PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak");
let mut with_header = 0usize; let mut with_header = 0usize;
let mut mid_bank = 0usize; let mut mid_bank = 0usize;
// Peek at the 56-byte header through the archive's flat data rather than // Peek at the 56-byte header through the archive's flat data rather than
@@ -347,7 +327,7 @@ fn a_bank_that_states_its_own_header_has_no_leading_segment() {
#[test] #[test]
fn the_menu_music_bank_is_exactly_two_sub_waves() { fn the_menu_music_bank_is_exactly_two_sub_waves() {
skip_without_disc!(root); skip_without_disc!(root);
let snd = sound(&root); let snd = PakArchive::open(root.join("dat/sound.pak")).expect("sound.pak");
for (name, sizes) in [ for (name, sizes) in [
("BGM_103.slb", [3_876_864usize, 3_930_112]), ("BGM_103.slb", [3_876_864usize, 3_930_112]),
("BGM_001.slb", [4_466_688, 4_673_536]), ("BGM_001.slb", [4_466_688, 4_673_536]),

View File

@@ -5,7 +5,8 @@ Confidence: ✅ `CONFIRMED` · 🟡 `PROBABLE` · ❔ `HYPOTHESIS`. See [README]
Also durable, and worth reading before proposing anything: Also durable, and worth reading before proposing anything:
[`REFUTED.md`](REFUTED.md) — what has already been tested and died · [`REFUTED.md`](REFUTED.md) — what has already been tested and died ·
[`METHOD.md`](METHOD.md) — the traps this corpus has already paid for · [`METHOD.md`](METHOD.md) — the traps this corpus has already paid for ·
[`BACKLOG.md`](BACKLOG.md) — what is still open. [`BACKLOG.md`](BACKLOG.md) — what is still open ·
[`disc-contents.md`](disc-contents.md) — what files the disc actually holds, and where.
Formats we've already reversed are, for now, **documented by their parser + disc round-trip Formats we've already reversed are, for now, **documented by their parser + disc round-trip
tests** (the executable spec) rather than a prose file — the "Spec" column points there. tests** (the executable spec) rather than a prose file — the "Spec" column points there.
@@ -72,6 +73,7 @@ files, which is how the same ground got covered twice.
| [`autopilot-memory-driven.md`](autopilot-memory-driven.md) | Memory-driven autopilot — build log and current state | 🟢 IT FLIES, KILLS AND SURVIVES — but it loses the mission anyway. | | [`autopilot-memory-driven.md`](autopilot-memory-driven.md) | Memory-driven autopilot — build log and current state | 🟢 IT FLIES, KILLS AND SURVIVES — but it loses the mission anyway. |
| [`canary-scripted-input-traps.md`](canary-scripted-input-traps.md) | Getting past the title screen in the container — three traps and one blocker | ✅ CONFIRMED for the three traps (each reproduced, and two of them | | [`canary-scripted-input-traps.md`](canary-scripted-input-traps.md) | Getting past the title screen in the container — three traps and one blocker | ✅ CONFIRMED for the three traps (each reproduced, and two of them |
| [`challenge-mission-gate.md`](challenge-mission-gate.md) | Challenge / EX missions — the stage set, the GamePart graph, and the kind field | ✅ for the static structure (stage set, GamePart ids, the config-section | | [`challenge-mission-gate.md`](challenge-mission-gate.md) | Challenge / EX missions — the stage set, the GamePart graph, and the kind field | ✅ for the static structure (stage set, GamePart ids, the config-section |
| [`disc-contents.md`](disc-contents.md) | What is actually on the disc, and where | ✅ CONFIRMED — layout, counts and `media_id` re-measured against the retail extract 2026-09-18; `resource3d/` is in `hidden/`, not `dat/` |
| [`dynamic-re-state-restore.md`](dynamic-re-state-restore.md) | The container's dynamic-RE state is not durable — how to rebuild it | ✅ CONFIRMED by rebuilding it (2026-08-23). Everything the dynamic | | [`dynamic-re-state-restore.md`](dynamic-re-state-restore.md) | The container's dynamic-RE state is not durable — how to rebuild it | ✅ CONFIRMED by rebuilding it (2026-08-23). Everything the dynamic |
| [`flight-controls-runtime.md`](flight-controls-runtime.md) | In-flight control mapping — measured, not assumed | ✅ for the weapon bindings (ammo counters move), 🟡 for the rest (HUD | | [`flight-controls-runtime.md`](flight-controls-runtime.md) | In-flight control mapping — measured, not assumed | ✅ for the weapon bindings (ammo counters move), 🟡 for the rest (HUD |
| [`flight-speed-law.md`](flight-speed-law.md) | The throttle is a TARGET-SPEED selector — measured against the definition (2026-08-13) | ✅ for the shape of the law, 🟡 for the unit scale. | | [`flight-speed-law.md`](flight-speed-law.md) | The throttle is a TARGET-SPEED selector — measured against the definition (2026-08-13) | ✅ for the shape of the law, 🟡 for the unit scale. |

104
docs/re/disc-contents.md Normal file
View File

@@ -0,0 +1,104 @@
# What is actually on the disc, and where
**Status:**`CONFIRMED` for the layout and the counts — every figure below was
re-measured against the retail extract on 2026-09-18, not copied from the source
document. ✅ `CONFIRMED` for `media_id`, read from the XEX header.
This page exists because the corpus never had one: it documents formats in depth
(see [INDEX](INDEX.md)) but nowhere said **what files the disc holds and where they sit**.
It is adopted from a pre-RE-era `GAME_CONTENTS.md` that lived homeless in the workspace
root through the repository consolidation. **Only the measured parts were carried over**
see [What was dropped](#what-was-dropped-and-why) at the end, which matters more than the
rest of the page.
Extracted from the XISO image with [extract-xiso](https://github.com/XboxDev/extract-xiso).
---
## Identity
| Field | Value | Source |
|---|---|---|
| `media_id` | `0x2D2E2EEB` | XEX `execution_info`, via `.xex.json` |
| `title_id` | `0x53512D14` (`"SQ"` + `0x2D14`) | XEX `execution_info` |
| `disc_number` / `disc_count` | 1 / 1 | XEX `execution_info` |
---
## Top-level layout
```
<extract root>/
├── default.xex ← the game executable (XEX2, PowerPC BE)
├── config.ini ← language table (Shift-JIS comments)
├── $SystemUpdate/ ← su20076000_00000000 (dashboard update, not game data)
├── dat/ ← 71 entries
└── hidden/ ← 5 entries
```
⚠️ **`resource3d/` is in `hidden/`, not in `dat/`.** So are `DefTables` and `MiscBin`.
The source document placed all three under `dat/`; that is wrong, and it is the reason
this page re-measured rather than transcribed. `SYLPHEED_RES3D` points at
`hidden/resource3d` for exactly this reason.
### `dat/` — 71 entries
| Group | Count | Note |
|---|---|---|
| `*.pak` + `*.p00` pairs | 33 + 33 | the IPFB archives — format ✅ decoded, see [INDEX](INDEX.md) |
| `sound.pak` + `sound.p00``.p04` | 6 | one archive whose payload is split across five chunks |
| `movie/` | 109 entries | |
`dat/movie/` holds **97 `.wmv`** files plus **six language packs** as `.pak`/`.p00`
pairs (`deu eng esp fra ita jpn`). ⚠️ Those packs carry **subtitles and fonts, not voice**
all voice and SFX live in `sound.pak`. That trap is recorded separately; do not go looking
for dialogue audio in the movie directory.
### `hidden/` — 5 entries
| Entry | Size | Note |
|---|---|---|
| `resource3d/` | 166 files | `.xpr` texture/model containers (`Base.xpr`, `BG_*.xpr`, stage and ship sets) |
| `DefTables.pak` / `.p00` | 17 596 B / 3 058 037 B | balance and definition tables |
| `MiscBin.pak` / `.p00` | 496 B / 22 553 238 B | |
---
## `config.ini`
Plain-text INI, **Shift-JIS** comments (they render as mojibake in a UTF-8 reader — the
file is not corrupt). `[SYSTEM]` is present but empty; `[LANGUAGE]` maps the Xbox 360
locale constants onto the disc's three-letter directory names, with `eng` as the default:
```ini
[LANGUAGE]
= eng ; default
#0x01 = eng ; XC_LANGUAGE_ENGLISH
#0x02 = jpn ; XC_LANGUAGE_JAPANESE
#0x03 = deu ; XC_LANGUAGE_GERMAN
```
Those keys are why the six-language pack naming above is what it is.
---
## What was dropped, and why
The source document was written **before** the formats were reversed, and roughly half of
it was speculation phrased as status. Carrying that forward would have put claims into the
corpus that the corpus itself has already refuted — the precise failure mode
[README](README.md) warns about ("a wrong-but-confident note is worse than no note").
Dropped:
- **A "Known File Formats" status table** marking `dat/*.pak` as *"⏳ Unknown — magic bytes
TBD"*, and `.XWB`/`.XSB` as *"⏳ TODO"*. The `.pak` container is ✅ decoded disc-wide.
[INDEX](INDEX.md) is the authority on format status; a second table would only drift.
- **A "PAK Archive Structure (TBD)" section** guessing each archive's contents from its
name ("`GP_BUNK.pak` — likely barracks/crew quarters UI"). Those are guesses, and the
real contents are known.
- **An "RE Entry Points" section** recommending loading `default.xex` into Ghidra to find
the loaders. Static analysis now goes through `sylpheed.db` (see the workspace
`CLAUDE.md` and `/sylph-dis`).
Nothing measured was dropped. The layout, the counts, the identity fields and the language
table are all re-verified above.