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
139 lines
8.4 KiB
C
139 lines
8.4 KiB
C
/* Complete semantic catalog of the 63 resources in TDKPIN.EXE. */
|
|
|
|
#include "tdkpin_resources.h"
|
|
|
|
#define IMAGE(type_, id_, off_, alloc_, used_, width_, height_, disp_, role_) \
|
|
{type_, id_, off_, alloc_, used_, 0x0c00, width_, height_, 0, disp_, role_}
|
|
#define WAV(id_, off_, alloc_, used_, flags_, rate_, role_) \
|
|
{TDKPIN_RESOURCE_WAV, id_, off_, alloc_, used_, flags_, 0, 0, rate_, \
|
|
TDKPIN_RESOURCE_DIRECT, role_}
|
|
#define WINRES(type_, id_, off_, alloc_, used_, disp_, role_) \
|
|
{type_, id_, off_, alloc_, used_, 0x1c30, 0, 0, 0, disp_, role_}
|
|
|
|
const TdkpinResourceDescriptor
|
|
tdkpin_resource_catalog[TDKPIN_RESOURCE_COUNT] = {
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 400, 118272, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 0"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 401, 123904, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 1"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 402, 129536, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 2"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 403, 135168, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 3"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 404, 140800, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 4"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 405, 146432, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 5"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 406, 152064, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 6"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 407, 157696, 5632, 5452, 42, 123,
|
|
TDKPIN_RESOURCE_DIRECT, "player emblem sprite 7"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 600, 163328, 98048, 97960, 544, 180,
|
|
TDKPIN_RESOURCE_DIRECT, "rotating-target and panel-animation atlas"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 701, 261376, 21248, 21056, 146, 142,
|
|
TDKPIN_RESOURCE_DIRECT, "score status level 1"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 702, 282624, 21248, 21056, 146, 142,
|
|
TDKPIN_RESOURCE_DIRECT, "score status level 2"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 703, 303872, 21248, 21056, 146, 142,
|
|
TDKPIN_RESOURCE_DIRECT, "score status level 3"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 704, 325120, 21248, 21056, 146, 142,
|
|
TDKPIN_RESOURCE_DIRECT, "score status level 4"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 801, 346368, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 1"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 802, 350720, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 2"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 803, 355072, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 3"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 804, 359424, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 4"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 805, 363776, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 5"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 806, 368128, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 6"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 807, 372480, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 7"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 808, 376832, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 8"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 809, 381184, 4352, 4188, 68, 61,
|
|
TDKPIN_RESOURCE_DIRECT, "collected-item display count 9"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 900, 385536, 266496, 266440, 900, 296,
|
|
TDKPIN_RESOURCE_DIRECT, "18-frame claw sprite atlas"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 901, 652032, 4096, 3984, 230, 17,
|
|
TDKPIN_RESOURCE_DIRECT, "launcher and velocity-row decoration atlas"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 993, 656128, 108288, 108040, 360, 300,
|
|
TDKPIN_RESOURCE_DIRECT, "high-score window background"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 994, 764416, 3328, 3160, 237, 13,
|
|
TDKPIN_RESOURCE_DIRECT, "asset-loading progress strip"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 995, 767744, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "one-shot board splash"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 997, 1062400, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "immutable restore overlay A"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 998, 1357056, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "restore overlay B and mutable background"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 1001, 1651712, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "board background selected by index 1"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 1002, 1946368, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "board background selected by index 2"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 1003, 2241024, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "board background selected by index 3"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 1004, 2535680, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "board background selected by index 4"),
|
|
IMAGE(TDKPIN_RESOURCE_DAT, 1005, 2830336, 294656, 294440, 640, 460,
|
|
TDKPIN_RESOURCE_DIRECT, "board background selected by index 5"),
|
|
|
|
{TDKPIN_RESOURCE_PAL, 999, 3124992, 768, 768, 0x0c00, 0, 0, 0,
|
|
TDKPIN_RESOURCE_DIRECT, "256 RGB triples shared by all custom DAT DIBs"},
|
|
|
|
WAV(2001, 3125760, 6400, 6302, 0x1c70, 22222, "add-player cue"),
|
|
WAV(2002, 3132160, 4608, 4594, 0x1c70, 22222, "launcher release cue"),
|
|
WAV(2004, 3136768, 7680, 7554, 0x1c70, 22222, "trigger activation cue"),
|
|
WAV(2006, 3144448, 3072, 2906, 0x0c60, 22050, "timed target 51..53 hit cue"),
|
|
WAV(2007, 3147520, 30464, 30452, 0x1c70, 22222, "score-marker or full-item-bank award cue"),
|
|
WAV(2008, 3177984, 39168, 39134, 0x1c70, 22050, "normal ball-end cue"),
|
|
WAV(2011, 3217152, 6912, 6710, 0x0c60, 22050, "rotating-target mechanism start cue"),
|
|
WAV(2012, 3224064, 512, 320, 0x0c60, 22050, "target and panel transition cue"),
|
|
WAV(2013, 3224576, 46592, 46348, 0x0c60, 22050, "panel mechanism motion cue"),
|
|
WAV(2015, 3271168, 8192, 7946, 0x1c70, 22050, "ball capture cue"),
|
|
WAV(2016, 3279360, 3584, 3518, 0x1c70, 22222, "claw ball-release cue"),
|
|
WAV(2017, 3282944, 35072, 34842, 0x1c70, 22050, "completed target-bank/item award cue"),
|
|
WAV(2019, 3318016, 5376, 5148, 0x1c70, 22222, "table nudge or kick-response cue"),
|
|
WAV(2020, 3323392, 30208, 30000, 0x1c70, 22222, "tilt cue"),
|
|
WAV(2021, 3353600, 3328, 3194, 0x1c70, 22222, "flipper motion cue"),
|
|
WAV(2022, 3356928, 22272, 22122, 0x1c70, 22050, "reserved present sound slot with no direct literal call"),
|
|
|
|
{TDKPIN_RESOURCE_BITMAP, 101, 3379200, 256, 232, 0x0c30, 16, 16, 0,
|
|
TDKPIN_RESOURCE_DIRECT, "16x16 SRCPAINT object-composition image"},
|
|
{TDKPIN_RESOURCE_BITMAP, 102, 3379456, 256, 232, 0x0c30, 16, 16, 0,
|
|
TDKPIN_RESOURCE_DIRECT, "16x16 SRCAND object-composition mask"},
|
|
{TDKPIN_RESOURCE_BITMAP, 500, 3379712, 13568, 13320, 0x0c30, 944, 28, 0,
|
|
TDKPIN_RESOURCE_DIRECT, "score-digit and timer indicator atlas"},
|
|
|
|
{TDKPIN_RESOURCE_ICON, 1, 3393280, 768, 744, 0x1c30, 32, 32, 0,
|
|
TDKPIN_RESOURCE_SYSTEM_RESOLVED, "image selected by GROUP_ICON 996"},
|
|
WINRES(TDKPIN_RESOURCE_GROUP_ICON, 996, 3394048, 256, 20,
|
|
TDKPIN_RESOURCE_DIRECT, "main-window icon group loaded at 1000:016c"),
|
|
{TDKPIN_RESOURCE_VERSION, 1, 3394304, 512, 416, 0x0c30, 0, 0, 0,
|
|
TDKPIN_RESOURCE_SYSTEM_RESOLVED, "Windows version metadata; no image-code loader"},
|
|
WINRES(TDKPIN_RESOURCE_DIALOG, 32512, 3394816, 256, 250,
|
|
TDKPIN_RESOURCE_LINKED_UNUSED, "Borland 2D File Open template"),
|
|
WINRES(TDKPIN_RESOURCE_DIALOG, 32513, 3395072, 256, 212,
|
|
TDKPIN_RESOURCE_LINKED_UNUSED, "Borland 2D File Save As template"),
|
|
WINRES(TDKPIN_RESOURCE_DIALOG, 32514, 3395328, 256, 99,
|
|
TDKPIN_RESOURCE_DIRECT, "2D text-entry template selected at 1008:1607"),
|
|
WINRES(TDKPIN_RESOURCE_DIALOG, 32515, 3395584, 512, 372,
|
|
TDKPIN_RESOURCE_LINKED_UNUSED, "Borland CTL3D File Open template"),
|
|
WINRES(TDKPIN_RESOURCE_DIALOG, 32516, 3396096, 512, 309,
|
|
TDKPIN_RESOURCE_LINKED_UNUSED, "Borland CTL3D File Save As template"),
|
|
WINRES(TDKPIN_RESOURCE_DIALOG, 32517, 3396608, 256, 146,
|
|
TDKPIN_RESOURCE_DIRECT, "CTL3D text-entry template selected at 1008:1607"),
|
|
};
|
|
|
|
_Static_assert(
|
|
sizeof(tdkpin_resource_catalog) / sizeof(tdkpin_resource_catalog[0]) ==
|
|
TDKPIN_RESOURCE_COUNT,
|
|
"TDKPIN resource catalog must remain complete");
|
|
|
|
#undef WINRES
|
|
#undef WAV
|
|
#undef IMAGE
|