Repository navigation
line-field-15
The line field can refill a vehicle on a recharge strip by a share of its own energy capacity, and not while it is in the air. With the new parameter at 0 the step is line-field-14's, bit for bit.
- Change:
surface->recharge_share, appended to the surface block (Q16 share of the vehicle's ownmax_energyrefilled a tick on a recharge strip, rounded to nearest, clamped atmax_energy; none while the vehicle is in the air; a negative value reads as 0).sh2z_field_recharge(f, v, ticks)applies the same refill to a vehicle the owner drives itself, from one static inline shared with the step, so the two cannot differ. With the share 0 the one globalrechargeapplies in the air as before. - API: one new field,
recharge_share, and one new entry point,sh2z_field_recharge. - Cost: one compare of the share on a recharge zone; with the share set, a 64-bit multiply on a step that is on a strip. Nothing elsewhere.
- Objects: no libc memcpy, memset or memmove in the SH-2 objects; the line field's undefined symbols are the same as on main; compiled with
-Wall -Wextra -Werror. - Evidence: HOST:
line_field_exact26,367,628 checks under GCC, Clang and ASan/UBSan; 400 random scenes hash to the same value with the share at 0 as main does (0x6f29a14e3fe9f895, re-checked at merge against main's step); a control for each claim; 11 of 11 mutation controls caught. No instruction model, no console run. CI on the head passes (host, SH-2 cross compile, math lab, docs). Validation record. - Merge: PR #83, merge
b1e1e39. - Guide:
saturn/LINE_FOLLOWER.md.