fix(physics): use predicted magnetic gate bounds
Correct the readable 1000:9b69 reconstruction to read DGROUP 07db/07df and name the helper for its predicted-position role. Rust magnetic rectangles now enter only from an old position inside the record and deactivate when the recomputed prediction exits any edge, replacing the prior swept approximation. Test Plan: - bash original/tools/test_reconstructed_c.sh - python3 original/tools/audit_reconstruction.py --require-complete - cargo test --all-targets - cargo clippy --all-targets --all-features -- -D warnings - rumdl check original/C_RECONSTRUCTION_FINAL_AUDIT.md tdkpin-rs/CHANGELOG.md tdkpin-rs/RECONSTRUCTION.md tdkpin-rs/README.md - git diff --check
This commit is contained in:
@@ -71,6 +71,11 @@ the original Borland compiler.
|
||||
multiball, and scoring. Static/host evidence is not mislabeled as Wine.
|
||||
12. **Phase boundary:** no Rust source or Cargo manifest/lockfile was modified.
|
||||
|
||||
Post-audit evidence correction (2026-08-23): raw `1000:9b69` reads predicted
|
||||
DGROUP coordinates `1028:07db/07df`, not current `07d3/07d7`. The readable
|
||||
helper and its harness now reflect that distinction; the complete C test and
|
||||
ledger gates below still pass.
|
||||
|
||||
## Reproducible gates
|
||||
|
||||
```sh
|
||||
|
||||
@@ -661,8 +661,8 @@ uint16_t tdkpin_receiver_point_in_bounds(
|
||||
x, y, maximum_y, maximum_x, minimum_y, minimum_x);
|
||||
}
|
||||
|
||||
/* 1000:9b69 -- same inclusive rectangle test for the global ball position. */
|
||||
uint16_t tdkpin_ball_in_bounds(
|
||||
/* 1000:9b69 -- test the predicted 1028:07db/07df position against bounds. */
|
||||
uint16_t tdkpin_predicted_ball_in_bounds(
|
||||
uint16_t ignored_static_link,
|
||||
int32_t maximum_y,
|
||||
int32_t maximum_x,
|
||||
@@ -671,8 +671,8 @@ uint16_t tdkpin_ball_in_bounds(
|
||||
{
|
||||
(void)ignored_static_link;
|
||||
return point_in_bounds_with_residue(
|
||||
g_ball_x_milli,
|
||||
g_ball_y_milli,
|
||||
(int32_t)win16_read_u32(win16_dgroup_pointer(0x07db)),
|
||||
(int32_t)win16_read_u32(win16_dgroup_pointer(0x07df)),
|
||||
maximum_y,
|
||||
maximum_x,
|
||||
minimum_y,
|
||||
|
||||
@@ -36,7 +36,7 @@ uint16_t tdkpin_receiver_point_in_bounds(
|
||||
int32_t maximum_x,
|
||||
int32_t minimum_y,
|
||||
int32_t minimum_x); /* 1000:9ae0 */
|
||||
uint16_t tdkpin_ball_in_bounds(
|
||||
uint16_t tdkpin_predicted_ball_in_bounds(
|
||||
uint16_t ignored_static_link,
|
||||
int32_t maximum_y,
|
||||
int32_t maximum_x,
|
||||
|
||||
@@ -223,7 +223,7 @@ static int32_t clamp_motion_speed(
|
||||
static bool broadphase_contains_predicted_ball(
|
||||
const TdkpinCollisionRecord *record, uint16_t caller_bp)
|
||||
{
|
||||
return (uint8_t)tdkpin_ball_in_bounds(
|
||||
return (uint8_t)tdkpin_predicted_ball_in_bounds(
|
||||
caller_bp,
|
||||
record->bounds_max_y_milli,
|
||||
record->bounds_max_x_milli,
|
||||
@@ -686,7 +686,7 @@ static void handle_trigger_record(
|
||||
0x07db, add_wrap(ball_x, motion->velocity_x));
|
||||
write_dgroup_i32(
|
||||
0x07df, add_wrap(ball_y, motion->velocity_y));
|
||||
if ((uint8_t)tdkpin_ball_in_bounds(
|
||||
if ((uint8_t)tdkpin_predicted_ball_in_bounds(
|
||||
0,
|
||||
record->point2_y_milli,
|
||||
record->point2_x_milli,
|
||||
|
||||
@@ -235,9 +235,13 @@ int main(void)
|
||||
assert(tdkpin_receiver_point_in_bounds(
|
||||
0x0100, 0x6000, 0x2000, 0x5000, 0x1300) == 0x1200);
|
||||
|
||||
g_ball_x_milli = 0x1234;
|
||||
g_ball_y_milli = 0x56ab;
|
||||
assert(tdkpin_ball_in_bounds(
|
||||
win16_write_u32(win16_dgroup_pointer(0x07db), 0, 0x00001234u);
|
||||
win16_write_u32(win16_dgroup_pointer(0x07df), 0, 0x000056abu);
|
||||
assert(tdkpin_predicted_ball_in_bounds(
|
||||
0, 0x6000, 0x2000, 0x5000, 0x1000) == 0x5601);
|
||||
g_ball_x_milli = 0;
|
||||
g_ball_y_milli = 0;
|
||||
assert(tdkpin_predicted_ball_in_bounds(
|
||||
0, 0x6000, 0x2000, 0x5000, 0x1000) == 0x5601);
|
||||
|
||||
g_ball_x_milli = 100000;
|
||||
|
||||
@@ -180,7 +180,7 @@ static bool in_bounds(
|
||||
y >= minimum_y && y <= maximum_y;
|
||||
}
|
||||
|
||||
uint16_t tdkpin_ball_in_bounds(
|
||||
uint16_t tdkpin_predicted_ball_in_bounds(
|
||||
uint16_t ignored_static_link,
|
||||
int32_t maximum_y,
|
||||
int32_t maximum_x,
|
||||
|
||||
Reference in New Issue
Block a user