Files
tdkpin/original/reconstructed/tdkpin_shortstrings.h
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

31 lines
1.1 KiB
C

#ifndef TDKPIN_SHORTSTRINGS_H
#define TDKPIN_SHORTSTRINGS_H
#include "tdkpin_segmented.h"
uint32_t borland_shift_right_u32(uint32_t value, uint16_t count);
uint32_t borland_shift_left_u32(uint32_t value, uint16_t count);
void borland_short_assign(Win16FarPtr destination, Win16FarPtr source);
void borland_short_assign_truncated(
Win16FarPtr destination, Win16FarPtr source, uint8_t maximum_length);
void borland_short_substring(
Win16FarPtr destination,
Win16FarPtr source,
int16_t index,
int16_t count);
void borland_short_concat(Win16FarPtr destination, Win16FarPtr source);
uint16_t borland_short_position(Win16FarPtr pattern, Win16FarPtr text);
int16_t borland_short_compare(Win16FarPtr left, Win16FarPtr right);
void borland_character_to_short(Win16FarPtr destination, uint8_t character);
void borland_bytes_to_short(
Win16FarPtr destination, Win16FarPtr source, uint16_t count);
void borland_short_insert(
Win16FarPtr destination,
Win16FarPtr insertion,
int16_t index,
uint8_t maximum_length);
void borland_short_delete(
Win16FarPtr string, int16_t index, int16_t count);
#endif