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

85 lines
2.4 KiB
C

#ifndef TDKPIN_COLLISION_RECORDS_H
#define TDKPIN_COLLISION_RECORDS_H
#include "tdkpin_arithmetic.h"
#include "tdkpin_real48.h"
#include "tdkpin_segmented.h"
#pragma pack(push, 1)
typedef struct {
uint8_t type;
uint8_t subtype;
int32_t bounds_min_x_milli;
int32_t bounds_min_y_milli;
int32_t bounds_max_x_milli;
int32_t bounds_max_y_milli;
int32_t point1_x_milli;
int32_t point1_y_milli;
int32_t point2_x_milli;
int32_t point2_y_milli;
BorlandReal48 radius_milli;
BorlandReal48 response_normal;
BorlandReal48 response_tangent;
uint8_t active;
BorlandReal48 response_auxiliary;
BorlandReal48 response_kick;
uint16_t flags;
uint16_t contact_state;
uint16_t score_low;
uint16_t score_high;
uint16_t layer_mask;
uint16_t render_left;
uint16_t render_top;
uint16_t render_right;
uint16_t render_bottom;
} TdkpinCollisionRecord;
/* Exact 40-word Pascal argument block in increasing stack-address order. */
typedef struct {
uint16_t render_bottom;
uint16_t render_right;
uint16_t render_top;
uint16_t render_left;
int32_t fallback_y_adjust;
int32_t fallback_x_adjust;
uint16_t layer_mask;
uint16_t score_low;
uint16_t score_high;
uint16_t contact_state;
uint16_t flags;
BorlandReal48 response_kick;
BorlandReal48 response_auxiliary;
BorlandReal48 response_tangent;
BorlandReal48 response_normal;
int32_t radius;
int32_t point2_y;
int32_t point2_x;
int32_t point1_y;
int32_t point1_x;
uint16_t coordinate_mode;
uint16_t subtype;
uint16_t type;
uint16_t active;
uint16_t index;
} TdkpinCollisionInitArgs;
#pragma pack(pop)
_Static_assert(sizeof(TdkpinCollisionRecord) == 0x53,
"collision record layout drift");
_Static_assert(sizeof(TdkpinCollisionInitArgs) == 0x50,
"collision initializer ABI drift");
_Static_assert(offsetof(TdkpinCollisionRecord, radius_milli) == 0x22,
"collision radius offset drift");
_Static_assert(offsetof(TdkpinCollisionRecord, active) == 0x34,
"collision active offset drift");
_Static_assert(offsetof(TdkpinCollisionRecord, flags) == 0x41,
"collision flags offset drift");
void tdkpin_initialize_collision_record(
const TdkpinCollisionInitArgs *arguments); /* 1008:0138 */
extern int32_t g_collision_path_x; /* 1028:0849..084c */
extern int32_t g_collision_path_y; /* 1028:084d..0850 */
#endif