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

60 lines
2.6 KiB
C

#ifndef TDKPIN_DGROUP_H
#define TDKPIN_DGROUP_H
#include "tdkpin_win16.h"
/* DGROUP 1028:0586; assigned from HWND at TPWinCrt window-proc entry. */
extern HWND16 g_tpwincrt_window;
extern uint16_t g_tpwincrt_columns; /* 1028:0540 */
extern uint16_t g_tpwincrt_rows; /* 1028:0542 */
extern uint16_t g_tpwincrt_cursor_column; /* 1028:0544 */
extern uint16_t g_tpwincrt_cursor_row; /* 1028:0546 */
extern uint16_t g_tpwincrt_view_column; /* 1028:0548 */
extern uint16_t g_tpwincrt_view_row; /* 1028:054a */
extern uint8_t g_tpwincrt_break_check_enabled; /* 1028:0560 */
extern uint8_t g_tpwincrt_auto_scroll; /* 1028:055e */
extern uint8_t g_tpwincrt_ctrl_z_is_eof; /* 1028:055f */
extern uint16_t g_tpwincrt_input_count; /* 1028:058a */
extern uint16_t g_tpwincrt_ring_row_origin; /* 1028:0588 */
extern uint8_t g_tpwincrt_window_created; /* 1028:058c */
extern uint8_t g_tpwincrt_has_focus; /* 1028:058d */
extern uint8_t g_tpwincrt_caret_enabled; /* 1028:058e */
extern uint8_t g_tpwincrt_paint_message_active; /* 1028:058f */
extern Win16FarPtr g_tpwincrt_screen_buffer; /* 1028:4ac2/4ac4 */
extern uint16_t g_tpwincrt_character_width; /* 1028:4ace */
extern uint16_t g_tpwincrt_character_height; /* 1028:4ad0 */
extern uint16_t g_tpwincrt_caret_y_offset; /* 1028:4ad2 */
extern HDC16 g_tpwincrt_paint_dc; /* 1028:4ad4 */
extern PAINTSTRUCT16 g_tpwincrt_paint; /* 1028:4ad6..4af5 */
extern HGDIOBJ16 g_tpwincrt_previous_font; /* 1028:4af6 */
extern uint16_t g_tpwincrt_visible_columns; /* 1028:4ac6 */
extern uint16_t g_tpwincrt_visible_rows; /* 1028:4ac8 */
extern uint16_t g_tpwincrt_max_view_column; /* 1028:4aca */
extern uint16_t g_tpwincrt_max_view_row; /* 1028:4acc */
extern uint8_t g_tpwincrt_input_buffer[64]; /* 1028:4af8..4b37 */
enum TpWinCrtScrollCommand {
TPWINCRT_SB_LINEUP = 0,
TPWINCRT_SB_LINEDOWN = 1,
TPWINCRT_SB_PAGEUP = 2,
TPWINCRT_SB_PAGEDOWN = 3,
TPWINCRT_SB_THUMBPOSITION = 4,
TPWINCRT_SB_TOP = 6,
TPWINCRT_SB_BOTTOM = 7,
};
#pragma pack(push, 1)
typedef struct {
uint8_t virtual_key;
uint8_t control_required;
uint8_t vertical;
uint8_t scroll_command;
} TpWinCrtKeyBinding;
#pragma pack(pop)
_Static_assert(sizeof(TpWinCrtKeyBinding) == 4, "TPWinCrt key binding layout drift");
extern const TpWinCrtKeyBinding g_tpwincrt_key_bindings[12]; /* 1028:0590..05bf */
#endif