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

29 lines
1.0 KiB
C

#ifndef TDKPIN_BORLAND_STARTUP_H
#define TDKPIN_BORLAND_STARTUP_H
#include "tdkpin_segmented.h"
/* Register contract at the Win16 NE entry before 1020:0002 is called. */
typedef struct {
uint16_t loader_ax;
Win16FarPtr command_line; /* ES:BX */
uint16_t show_command; /* DX */
HINSTANCE16 previous_instance; /* SI */
HINSTANCE16 instance; /* DI */
} BorlandWin16StartupRegisters;
BorlandWin16StartupRegisters InitTask16(void);
void borland_initialize_win16_runtime(
const BorlandWin16StartupRegisters *registers); /* 1020:0002 */
extern HINSTANCE16 g_win16_previous_instance; /* 1028:06fc */
extern HINSTANCE16 g_win16_instance; /* 1028:06fe */
extern uint16_t g_win16_show_command; /* 1028:0700 */
extern Win16FarPtr g_borland_command_line; /* 1028:0702/0704 */
extern uint16_t g_borland_windows_mode; /* 1028:071c */
extern uint16_t g_borland_huge_pointer_increment; /* 1028:0724 */
extern uint8_t g_borland_cpu_level; /* 1028:0726 */
#endif