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

41 lines
1.3 KiB
C

#ifndef TDKPIN_RUNTIME_UI_H
#define TDKPIN_RUNTIME_UI_H
#include "tdkpin_dgroup.h"
#include <stdbool.h>
typedef struct {
int16_t thumb_position;
uint16_t command;
} TpWinCrtScrollMessage;
int16_t tpwincrt_min_i16(int16_t left, int16_t right);
int16_t tpwincrt_max_i16(int16_t left, int16_t right);
int16_t tpwincrt_apply_scroll_command(
const TpWinCrtScrollMessage *message,
int16_t maximum,
int16_t page,
int16_t current);
Win16FarPtr tpwincrt_cell_pointer(int16_t logical_row, int16_t column);
void tpwincrt_scroll_to(int16_t target_column, int16_t target_row);
void tpwincrt_update_scrollbars(void);
void tpwincrt_scroll_cursor_into_view(void);
void tpwincrt_begin_drawing(void);
void tpwincrt_end_drawing(void);
void tpwincrt_create_caret(void);
void tpwincrt_destroy_caret(void);
void tpwincrt_handle_scroll(
uint16_t thumb_position, uint16_t command, uint16_t vertical);
void tpwincrt_on_size(int16_t client_width, int16_t client_height);
void tpwincrt_handle_keydown(uint8_t virtual_key);
void tpwincrt_queue_character(uint8_t character);
_Noreturn void tpwincrt_abort_on_ctrl_c(void);
void tpwincrt_on_create(void);
void tpwincrt_on_destroy(void);
void tpwincrt_fill_minmax_info(Win16FarPtr minmax_info);
LRESULT16 tpwincrt_window_proc(
HWND16 window, UINT16 message, WPARAM16 wparam, LPARAM16 lparam);
#endif