Files
tdkpin/original/CODE_DATA_OBJECTS.tsv
T
ddidderr 8b99e9607c feat(reconstruction): complete binary-backed C recovery
Replace the partial mechanics transcriptions with a separate, readable C11
reconstruction of the complete Win16 image while preserving the original raw
Ghidra export as immutable evidence. Cover all ordinary and overlapping entry
points, Borland runtime behavior, Win16 imports, segmented data, callbacks,
resources, indirect control flow, physics, rendering, persistence, and
startup/shutdown lifecycles.

Add deterministic extraction and audit tooling plus address-linked ledgers for
functions, imports, DGROUP ranges and objects, relocations, resources, and
callbacks. The final gate records zero raw, partial, restored, unknown,
blocked, or unclassified required units. Keep the semantic-fidelity boundary
explicit: the portable C is not claimed to reproduce a byte-identical Borland
NE build.

Add strict focused harnesses for every reconstructed C unit, exact resource
round-trip checks, and a 16-bit Borland Real48 reference probe. No Rust source
or Cargo metadata is changed in this phase.

Test Plan:
- `bash original/tools/test_reconstructed_c.sh` -- passed
- `bash original/tools/probe_real48_reference.sh` -- passed bit-for-bit
- `python3 original/tools/audit_reconstruction.py --require-complete` -- passed
- `git diff --cached --check` -- passed
- `git diff HEAD -- '*.rs' Cargo.toml Cargo.lock` -- empty
2026-08-23 16:41:17 +02:00

5.8 KiB

1startendbytesstatusobject_idobject_namec_typeinitializationreadersevidencenotes
21000:00001000:00012verifiedcode_segment_1_tagcode_segment_1_taguint16_tStatic word 0001.NE loader/segment inventoryBinary bytes and NE_SEGMENTS.tsv segment 1 mapping.Compiler-emitted ordinal tag at the start of Code1; explicitly data, never executed.
31008:00001008:00012verifiedcode_segment_2_tagcode_segment_2_taguint16_tStatic word 0002.NE loader/segment inventoryBinary bytes and NE_SEGMENTS.tsv segment 2 mapping.Compiler-emitted ordinal tag at the start of Code2; explicitly data, never executed.
41008:11bd1008:11c48verifieduint16_allocation_rangeg_uint16_rangeBorlandInt32RangeStatic int32 minimum 0 and maximum 65535.tdkpin_create_palette_from_rgb_table 1008:11c5Binary bytes; DI=11bd before verified range check 1008:1305-1313; reconstructed/tests/test_palette.c.Compiler range descriptor proves the 32-bit LOGPALETTE allocation byte count fits the uint16 Borland FreeMem size argument.
51008:131e1008:13258verifiedpalette_byte_index_rangeg_palette_byte_rangeBorlandInt32RangeStatic int32 minimum 0 and maximum 767.tdkpin_load_palette_resource 1008:1326Binary bytes; both DI=131e range calls inside the inclusive 0..02ff loop; reconstructed/tests/test_palette.c.Compiler range descriptor is applied separately to every source and destination byte index.
61010:00001010:00012verifiedcode_segment_3_tagcode_segment_3_taguint16_tStatic word 0003.NE loader/segment inventoryBinary bytes and NE_SEGMENTS.tsv segment 3 mapping.Compiler-emitted ordinal tag at the start of Code3; explicitly data, never executed.
71018:00001018:00012verifiedcode_segment_4_tagcode_segment_4_taguint16_tStatic word 0004.NE loader/segment inventoryBinary bytes and NE_SEGMENTS.tsv segment 4 mapping.Compiler-emitted ordinal tag at the start of Code4; explicitly data, never executed.
81020:00001020:00012verifiedcode_segment_5_tagcode_segment_5_taguint16_tStatic word 0005.NE loader/segment inventoryBinary bytes and NE_SEGMENTS.tsv segment 5 mapping.Compiler-emitted ordinal tag at the start of Code5; explicitly data, never executed.
91020:11911020:11ba42verifiedreal48_sin_coefficientsg_sin_coefficientsBorlandReal48[7]Static -1/15!,+1/13!,-1/11!,+1/9!,-1/7!,+1/5!,-1/3! approximants.borland_real48_sin/cosExact bytes; disassembly 111d-1190; C table; original-offset DOSBox Sin/Cos vectors.Order and rounding at every Horner operation are verified against the original routine.
101020:12401020:126336verifiedreal48_ln_coefficientsg_ln_coefficientsBorlandReal48[6]Static 1/13,1/11,1/9,1/7,1/5,1/3 approximants.borland_real48_lnExact bytes; disassembly 11bb-123f; C table; original-offset DOSBox Ln vectors.Ordered atanh-series coefficients are represented byte-for-byte.
111020:12d71020:130648verifiedreal48_exp_coefficientsg_exp_coefficientsBorlandReal48[8]Static eight-entry Exp polynomial ending in ln(2).borland_real48_expExact bytes; disassembly 1264-12d6; C table; original-offset DOSBox Exp vectors.Exact Horner order, intermediate Real48 rounding, and table extent are verified.
121020:13e81020:143578verifiedreal48_arctan_tablesg_arctan_reduction_and_coefficientsBorlandReal48[13]Static direct threshold, tan/angle reduction pairs, one, pi/4, and five odd-series coefficients.borland_real48_arctan and seriesExact bytes; all indexed reads 1353-13bf; C constants/tables; original-offset DOSBox ArcTan vectors.All 13 entries, paired strides, thresholds, angle selection, and coefficient order are verified.
131020:14fb1020:14fe4verifiedrandom_unsigned_biasrandom_unsigned_biasfloatStatic IEEE-754 single 2147483648.0 (bytes 0000004f).borland_random_unit_interval 1020:14deFADD operand at 14ed; reconstructed/tests/test_random.c.Converts signed FILD of the 32-bit seed to its exact unsigned magnitude before scaling.
141020:14ff1020:15002verifiedrandom_scale_exponentrandom_scale_exponentint16_tStatic signed word -32 (ffe0).borland_random_unit_interval 1020:14deFILD operand at 14e2 followed by FSCALE; reconstructed/tests/test_random.c.Exact binary exponent used to divide the unsigned seed by 2^32.
151020:15371020:15382verifiedrandom_multiplier_low_wordrandom_multiplier_low_worduint16_tStatic word 8405.borland_next_random 1020:1501MUL operand at 150a; full derived multiplier 08088405; reconstructed/tests/test_random.c.Low word embedded by the Borland LCG implementation; higher multiplier contribution is instruction-encoded.