Skip to content

line-field-15

Choose a tag to compare

@lamb2k lamb2k released this 23 Nov 01:15
· 7 commits to main since this release
b1e1e39

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 own max_energy refilled a tick on a recharge strip, rounded to nearest, clamped at max_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 global recharge applies 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_exact 26,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.