Commit Graph

13 Commits

Author SHA1 Message Date
0a8a5522f9 Invalidate previous music cue regions before a bank re-export (#6867)
Squash-merged after diff review of PR #6867 - Invalidate previous music cue regions before a bank re-export
2026-11-23 09:48:53 -06:00
9aa16b2e39 Merge pull request #3591 from kotorvr 2026-11-22 17:02:53 -05:00
b9feb841f7 Merge pull request #3272 from kotorvr 2026-11-22 17:01:11 -05:00
2d5d73a42b Merge pull request #3257 from zGLados 2026-11-22 17:01:08 -05:00
0a0e8182c9 rsc8_audio: the facial keyframes are anim_clips sequences; count them with --curves
docs/rsc8_audio.md listed the keyframe curves inside the RSC8 0x5c blocks
as undecoded. A packed block is one sequence of docs/animation.md (0x20
header, version 2, 11 channel types) and the track directory's constant
0x364D3BDB is joaat("facialtranslation"), so tools/anim_clips.py already
reads them. decode_facial_curves() hands a clip's blocks to that decoder
and --curves counts the outcome for every clip (counts only).

On one 1.0.2.1 package all 641,428 clips decode and 88,012,668 of
88,012,668 type-10 chunk boundaries close.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:38:09 +00:00
1f5a7c0fd0 Merge pull request #3272 from kotorvr 2026-11-22 15:16:23 -05:00
3e19396c6f docs/rsc8_audio: nameless 0xbd records; the tag-name spellings are ours
96 cue records have a name word of 0 (78 tags start with one), so "joaat
of the cue name" does not describe every record. The reference prints
two chunk names as seek_table and stream_format, which fail the low-byte
rule; the rule holds for seektable and streamformat. Docs only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:14:32 +00:00
c6cdc785c2 rsc8_audio: frame the 0x5a entries as {position, pitch, ...} with an f32 trailer
@kotorvr's finding in #3232: the entries start 4 bytes earlier than the
decoder read them. Each is {u32 sample position, f32 value, 6 x u16},
and the table ends in an f32 trailer (2/3 on 1,182 streams). Read 4
bytes later, every entry paired one entry's fields with the next one's
position, the first position looked like a header "unknown" and the
trailer looked like the last counter.

Recounted on my copy: positions ascend strictly and stay below the 0x76
sample count on all 1,185 streams; one entry lasts one period of its
value (within 1% on 365,803 of 386,048 pairs), so value reads as a
pitch in Hz; p is a multiple of 512 on every entry.

decode_grid20_table returns position_first/last/increasing and the
trailer as tail_f32; the tally key becomes grid20_position_past_samples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:09:56 +01:00
4cf7e3e718 rsc8_audio: decode the AWC 0xbd tag as cue records, not a header with a magic
The tool read only the first word of a 0xbd tag and called it a magic
(0xE5C74063); docs/rsc8_audio.md described the tag as a 16-byte header.
Over all of audio.rpf the tag is a headerless list of 16-byte records
{name joaat, value, sample offset, extra}, sorted by offset, and that
value is the first word of only 88,082 of 420,168 tags.

decode_marker_records() decodes the list, every scan counts it in new
marker_* summary keys, and the doc carries the measured counts. The
record layout and the tag-id rule (low byte of the chunk name's joaat)
were read in TrinitronClient/GTA6-Asset-Info structure/03-audio-awc.md
(029e4c3) and re-measured here; no code was copied.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 19:57:12 +00:00
5027156fef rsc8_audio: the 0x5a counter is a sample position; the last entry holds an f32 (ASSET-256)
Over all 1,185 audio.rpf streams with a 0x5a table, the counter of every
entry but the last ascends strictly and stays below the stream's 0x76
sample count (largest 0.9986 of it). The last entry holds an f32 at +16
(2/3 on 1,182 streams), about 1.06e9 read as a u32, which made the
counter look 2^11-2^13 times finer than a sample.

decode_grid20_table reports that float as tail_f32 and leaves the last
entry out of the counter checks; the scan tallies
grid20_counter_past_samples (0 over the package). docs/rsc8_audio.md
records the measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:54:05 +01:00
7099cf520f rsc8_audio: decode the undocumented 0x5a/0xd9 AWC companion tags
- decode_grid20_table: 8-byte header (u32 12345678 marker + unknown) and N 20-byte
  entries, with the invariants measured on all 1,185 audio.rpf streams that carry
  the tag (counter strictly increasing, p a multiple of 32; 387,233 entries,
  0 violations).
- decode_index_runs: K groups of {u32 2; u32 len; u32 hash; len ascending u32s}
  whose values index the sibling 0x5a entries (804 streams, 4,853 groups,
  0 violations, 0 overruns).
- Per-stream tallies in decode_awc_bank and the scan summaries (grid20_*/indexrun_*
  keys), facts in _decode_companion_tags; other archives carry 0 of either tag.
- Five synthetic tests (hand-built bytes only); docs rows in rsc8_audio.md,
  audio.md and the docs index, hypotheses labelled as such.
2026-11-22 03:41:52 -08:00
3162124c62 rsc8_audio: accept zero-stream ADAT banks (ASSET-105)
- parse_adat_header_bytes/parse_adat_at_file rejected count == 0 outright, so the validated
  walk missed audio.rpf's two 20-byte zero-stream banks that the encrypted TOC lists and
  AwcRecovery.ReadValidated accepts (docs said 7,160 banks vs design.md's 7,162).
- A zero-stream bank is now accepted only when the flag-selected tables end exactly at the
  declared header size; slop, truncation and out-of-bounds stay rejected.
- Three synthetic tests (no game bytes); docs/rsc8_audio.md corpus row updated to the
  re-measured 7,162 banks / 28,505,691,532 bytes with a note on the layout.
2026-11-22 03:18:52 -08:00
9d74f443a4 ASSET-56: decode RSC8 (v8001) AWC 0x5c facial/lip-sync resources
Add stdlib-only decoder tools/rsc8_audio.py, 15 synthetic unit tests in tests/test_rsc8_audio.py, and full-corpus layout/count documentation in docs/rsc8_audio.md (641,428/641,428 valid across 4 archives, 0 outside ADAT, 0 embedded audio containers).
2026-11-22 00:51:12 -03:00