fix(attract): use remainder-driven item phases
Raw 1000:061c-063b divides the idle tick by 144, copies the remainder from CX:BX into AX:DX, and only then divides by 8. Readable C and Rust instead used an unbounded quotient equivalent to tick/1152, making DAT801-809 advance far too slowly and suggesting a nonexistent negative long-idle index. Use `(tick % 144) / 8` to repeat item states 0,1..9,8..1 every 144 callbacks. Remove the disproven long-idle status crops and restore the ten-minute simulator ceiling. Extend the C and Rust phase tests across the forward, reverse, and wrap boundaries. Test Plan: - raw instruction review at `1000:061c-063b` -- remainder transfer confirmed - `cargo test --workspace --all-targets --all-features` -- 125 passed - `cargo clippy --workspace --all-targets --all-features -- -D warnings` -- passed - `bash original/tools/test_reconstructed_c.sh` -- passed - `python3 original/tools/audit_reconstruction.py --require-complete` -- passed with zero incomplete or unclassified units - `rumdl check --flavor commonmark RECONSTRUCTION.md CHANGELOG.md` -- passed - `git diff --cached --check` -- passed
This commit is contained in:
@@ -469,7 +469,7 @@ static void update_intro_item_status(Win16FarPtr window, int32_t tick)
|
||||
if (remainder_i32(tick, 8) != 0) {
|
||||
return;
|
||||
}
|
||||
int32_t phase = quotient_i32(quotient_i32(tick, 144), 8);
|
||||
int32_t phase = quotient_i32(remainder_i32(tick, 144), 8);
|
||||
int16_t item = (int16_t)(phase < 10 ? phase : 18 - phase);
|
||||
HWND16 handle = win16_read_u16(win16_far_add_offset(window, 4));
|
||||
HDC16 dc = GetDC16(handle);
|
||||
|
||||
Reference in New Issue
Block a user