diff options
| author | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 03:51:37 -0300 |
|---|---|---|
| committer | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 08:29:21 -0300 |
| commit | 4e87570eefcc484f6f60499f600287db4dc81391 (patch) | |
| tree | 28b35113cfc6c57041c8b7713c869a0b2dcb68b9 /runtime/src/main.cpp | |
| parent | bb2e18421dac527374eb837c88b5063c5d96f81f (diff) | |
rsc8_audio: --start/--limit window edges
Two problems with archive windows, both on main:
- A bank that starts inside the window but ends past it added its full size to adat_bytes, so
adat_bytes could exceed span. adat_bytes is now the window's bytes that belong to a bank; the
bank is still decoded whole, and its bytes past the window are adat_bytes_past_window
(adat_banks_past_window counts such banks).
- A window starting inside a bank never saw that bank's header, so every RSC8 clip in the rest of
it was reported as rsc8_outside_adat. The scan now looks back from --start (at most
MAX_AWC_FILE_BYTES) for the nearest bank header; if that bank covers --start, its range is
known (offset in window_starts_in_bank) and its bytes inside the window count in adat_bytes,
but it is not counted as a bank of this window.
With both, adjacent windows add up to a full scan.
Real data (counts only), each archive cut into 7 adjacent windows, every cut 4 KiB inside a bank
that holds RSC8 clips:
- shared_minigame000.rpf: main reports 18 clips outside ADAT and one window with adat_bytes >
span; with this change 0 and 0, and banks / clips / adat_bytes equal the full scan
(638 / 1,957 / 359,078,504).
- story000_restofworld.rpf: main reports 9 clips outside ADAT; now 0, totals equal the full scan
(15 / 9 / 8,908,216).
Full scans are unchanged.
Tests: test_window_edges_inside_a_bank ends a window halfway through a bank (main: adat_bytes
9784 for a 4892-byte span), checks the two halves add up to the bank, and starts windows inside
the bank with a 256-byte scan chunk so the look-back crosses several chunks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/main.cpp')
0 files changed, 0 insertions, 0 deletions