SBlk body head: the DAW size, stored twice
Picked sound_bank rather than tie, where three discriminators have now come back
negative and a fourth would be guesswork.
The body after the 24-byte head opens with twelve words. Six are settled across
all 27 levels:
word value note
0 varies per level not identified; 27 distinct
1 60 constant
2 varies per level not identified; 23 distinct
3 0 constant
4 daw_size == the header's daw_size, exactly
5 daw_size the same value again
6,7,8 0 constant
9 127 constant
10 1 constant
11 0 constant
Level 0's words 4 and 5 are both 1,482,000, and daw_size is 1,482,000.
THE POINTER THAT WAS NOT ONE
Words 4 and 5 were briefly recorded as pointers into the DAW region. They are not.
The test that promoted them was "does this value fall inside [daw_offset,
daw_offset + daw_size)" -- and the DAW region is ~1.5 MB starting near the front of
a ~1.5 MB extent, so almost any plausible 32-bit word lands inside it. 1,482,000 is
merely just under the top of exactly that range.
A range test is not an identification. What survives is EQUALITY with daw_size,
exact on all 27 levels and asserted, which is a claim that can fail rather than one
that is almost always true.
That is the fourth time this session a plausible reading of a single number has had
to be withdrawn for something falsifiable: the 305x class-ID slot, the UV-corner
texcoords, the VIF code word, and now this. The pattern is consistent enough to be
worth stating as a rule -- a test that passes almost always is measuring the shape
of the data, not a property of it.
Word 0 gets one note: levels 1 and 4 hold 13,042,052 and 13,042,054, two apart,
while their daw_sizes differ by 63,504. Whatever it is, it is not a size.
The remainder of the SBlk body -- the per-sound record table -- is still undecoded,
so sound_bank stays open. A SBlkBodyHead struct carries the twelve words with the
constants asserted in its docs.
259 tests.
This commit is contained in:
@@ -136,6 +136,38 @@ impl SBlkHeader {
|
||||
}
|
||||
}
|
||||
|
||||
/// The first twelve words of the `SBlk` body, after its 24-byte head.
|
||||
///
|
||||
/// Words 4 and 5 both hold the **DAW sample-data size** -- byte for byte, on all
|
||||
/// 27 levels. Words 1, 3, 6, 7, 8, 9, 10 and 11 are the same on every level
|
||||
/// (60, 0, 0, 0, 0, 127, 1, 0). Words 0 and 2 vary per level and are not
|
||||
/// identified.
|
||||
///
|
||||
/// These sizes fall inside `[daw_offset, daw_offset + daw_size)`, so a test of
|
||||
/// the form "is this word in the DAW region?" passes for them and reads as a
|
||||
/// pointer. It is not one; equality with `daw_size` is the claim.
|
||||
///
|
||||
/// Asserted in `sound_bank_sblk_body_head_carries_the_daw_size_twice`.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct SBlkBodyHead {
|
||||
pub word_0: u32,
|
||||
pub word_1: u32,
|
||||
pub word_2: u32,
|
||||
pub word_3: u32,
|
||||
/// Always the DAW sample-data size.
|
||||
pub word_4: u32,
|
||||
/// Always the same value as [`Self::word_4`].
|
||||
pub word_5: u32,
|
||||
pub word_6: u32,
|
||||
pub word_7: u32,
|
||||
pub word_8: u32,
|
||||
/// Always 127.
|
||||
pub word_9: u32,
|
||||
/// Always 1.
|
||||
pub word_10: u32,
|
||||
pub word_11: u32,
|
||||
}
|
||||
|
||||
/// Split a sound extent into its two regions.
|
||||
///
|
||||
/// Bounds are checked before slicing; a level whose head points outside its own
|
||||
|
||||
Reference in New Issue
Block a user