Both tools joined a following stream only after an exactly 65,536-byte one, the rule #2129 fixed in
text_tables. A resource's first stream can be 128 or 192 KiB (docs/page_directory.md).
- gamedata_index: only the headed `other` branch (0DRP pages and the MAGIC kinds) now continues after
any nonzero multiple of 64 KiB. Binary, text and XML runs keep the exact rule, since nothing proves a
continuation there; applying the multiple rule to them too folded 26,284 payloads into 25,000.
- gamedata_maps: the join is already bounded by the header's declared size, so any whole number of
64 KiB blocks may continue.
Real data (counts only), data.rpf: 0DRP pages keep 15,768 payloads and gain the 50 continuation streams
(15,877 -> 15,927). Those 50 streams stop being separate payloads (43 `binary`, 7 `text`), so the
payloads go 26,284 -> 26,234; psin/rbf0 unchanged. gamedata_maps on two carves without heightmaps:
identical output.
Tests: test_a_resource_continues_after_any_whole_number_of_64k_blocks (a 128 KiB 0DRP page joins its
continuation, a 128 KiB binary run does not) and test_groups_a_continuation_after_a_128k_first_stream
(main: all fail).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Validate --json before scanning <carve_dir> (and again against index.json rows): refuse existing directories and paths colliding with <carve_dir>, <carve_dir>/index.json, or any carved .bin stream (including symlinks, hard links, Windows verbatim prefixes, and macOS APFS/NFD case-only variants). Create missing parent folders before writing JSON with LF line endings. Adds unit tests in tests/test_gamedata_maps.py. No game files.
Byte 0x28 is a u8 default height: 23 in both MHIU payloads, the value the
empty rows hold, and the value the encoder crops each row by (0 of 6,902
span ends are 23 although 23 is 82% of cells). The decoder now reads the
default from the header, reports the three following bytes as pad_29 and
counts span ends on the default. A scan of all 12 archives finds 2 MHIU
payloads, both in common.rpf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both common.rpf payloads are heightmaps, not square/u16 grids. MHIU is a 2048x2048 single-layer map: u16 width@0x06, height@0x08, then height 8-byte row headers {u16 start, u16 count, i32 offset} and packed u8 heights with a measured default of 23. The two measured payloads fill 1,724/1,727 rows and their spans cover the packed bytes with 0 gaps and 0 overlaps; the old zero prefix is the empty rows' headers. PAMH is the GTA HMAP layout stored little-endian (version 1.2): a row table, width*height max u8 rows and width*height min u8 rows. The old u16 reading interleaved the two arrays. Both scale as min.z + value/255 * (max.z - min.z). Cross-check: MHIU vs PAMH max correlates at r=0.861 and r=0.870 in the natural orientation, with land-mask IoU 0.61. The MHIU 0x28 word is still unidentified and is not called a checksum. Tests are synthetic and cover the row table, the default fill, negative offsets, the max/min split and the 64 KiB stream join.
Add a stdlib reader for the two MHIU headers and square byte grids and the PAMH row table plus u16 grid, with synthetic tests and measured header notes. The checksum and the MHIU prefix remain unknown.