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
5.8 KiB
5.8 KiB
| 1 | start | end | bytes | status | object_id | object_name | c_type | initialization | readers | evidence | notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 1000:0000 | 1000:0001 | 2 | verified | code_segment_1_tag | code_segment_1_tag | uint16_t | Static word 0001. | NE loader/segment inventory | Binary bytes and NE_SEGMENTS.tsv segment 1 mapping. | Compiler-emitted ordinal tag at the start of Code1; explicitly data, never executed. |
| 3 | 1008:0000 | 1008:0001 | 2 | verified | code_segment_2_tag | code_segment_2_tag | uint16_t | Static word 0002. | NE loader/segment inventory | Binary bytes and NE_SEGMENTS.tsv segment 2 mapping. | Compiler-emitted ordinal tag at the start of Code2; explicitly data, never executed. |
| 4 | 1008:11bd | 1008:11c4 | 8 | verified | uint16_allocation_range | g_uint16_range | BorlandInt32Range | Static int32 minimum 0 and maximum 65535. | tdkpin_create_palette_from_rgb_table 1008:11c5 | Binary 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. |
| 5 | 1008:131e | 1008:1325 | 8 | verified | palette_byte_index_range | g_palette_byte_range | BorlandInt32Range | Static int32 minimum 0 and maximum 767. | tdkpin_load_palette_resource 1008:1326 | Binary 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. |
| 6 | 1010:0000 | 1010:0001 | 2 | verified | code_segment_3_tag | code_segment_3_tag | uint16_t | Static word 0003. | NE loader/segment inventory | Binary bytes and NE_SEGMENTS.tsv segment 3 mapping. | Compiler-emitted ordinal tag at the start of Code3; explicitly data, never executed. |
| 7 | 1018:0000 | 1018:0001 | 2 | verified | code_segment_4_tag | code_segment_4_tag | uint16_t | Static word 0004. | NE loader/segment inventory | Binary bytes and NE_SEGMENTS.tsv segment 4 mapping. | Compiler-emitted ordinal tag at the start of Code4; explicitly data, never executed. |
| 8 | 1020:0000 | 1020:0001 | 2 | verified | code_segment_5_tag | code_segment_5_tag | uint16_t | Static word 0005. | NE loader/segment inventory | Binary bytes and NE_SEGMENTS.tsv segment 5 mapping. | Compiler-emitted ordinal tag at the start of Code5; explicitly data, never executed. |
| 9 | 1020:1191 | 1020:11ba | 42 | verified | real48_sin_coefficients | g_sin_coefficients | BorlandReal48[7] | Static -1/15!,+1/13!,-1/11!,+1/9!,-1/7!,+1/5!,-1/3! approximants. | borland_real48_sin/cos | Exact 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. |
| 10 | 1020:1240 | 1020:1263 | 36 | verified | real48_ln_coefficients | g_ln_coefficients | BorlandReal48[6] | Static 1/13,1/11,1/9,1/7,1/5,1/3 approximants. | borland_real48_ln | Exact bytes; disassembly 11bb-123f; C table; original-offset DOSBox Ln vectors. | Ordered atanh-series coefficients are represented byte-for-byte. |
| 11 | 1020:12d7 | 1020:1306 | 48 | verified | real48_exp_coefficients | g_exp_coefficients | BorlandReal48[8] | Static eight-entry Exp polynomial ending in ln(2). | borland_real48_exp | Exact bytes; disassembly 1264-12d6; C table; original-offset DOSBox Exp vectors. | Exact Horner order, intermediate Real48 rounding, and table extent are verified. |
| 12 | 1020:13e8 | 1020:1435 | 78 | verified | real48_arctan_tables | g_arctan_reduction_and_coefficients | BorlandReal48[13] | Static direct threshold, tan/angle reduction pairs, one, pi/4, and five odd-series coefficients. | borland_real48_arctan and series | Exact 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. |
| 13 | 1020:14fb | 1020:14fe | 4 | verified | random_unsigned_bias | random_unsigned_bias | float | Static IEEE-754 single 2147483648.0 (bytes 0000004f). | borland_random_unit_interval 1020:14de | FADD operand at 14ed; reconstructed/tests/test_random.c. | Converts signed FILD of the 32-bit seed to its exact unsigned magnitude before scaling. |
| 14 | 1020:14ff | 1020:1500 | 2 | verified | random_scale_exponent | random_scale_exponent | int16_t | Static signed word -32 (ffe0). | borland_random_unit_interval 1020:14de | FILD operand at 14e2 followed by FSCALE; reconstructed/tests/test_random.c. | Exact binary exponent used to divide the unsigned seed by 2^32. |
| 15 | 1020:1537 | 1020:1538 | 2 | verified | random_multiplier_low_word | random_multiplier_low_word | uint16_t | Static word 8405. | borland_next_random 1020:1501 | MUL 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. |