port: D392 — train-intro soldier pose: read firing-table fields by name on PC (ABI/layout only)

chrlvUpdateAimendbackShoulders read the leading anim union of
weapon_firing_animation_table through raw (f32*) slots [12/13/16/17].
On PC the union widens four->eight bytes, so those offsets alias the
wrong fields and the intro soldier hunched with the hand through the
torso (D392, vs the 1964 reference).

The #ifdef PORT arm reads the intended limits/arm fractions by name
(config->max_up/max_down, free_arm_frac_up/down); the non-PORT arm is
untouched. No logic or behavior change beyond the pointer-width
misread; D392 finding + Train aim-angle probe confirm, user visually
verified against 1964.
This commit is contained in:
James Dansereau committed 2026-09-27 22:03:48 -04:00
1 parent c214fa7815
commit 368daf1242
1 file changed
+28
+28
View File
@@ -6212,6 +6212,33 @@ void chrlvUpdateAimendbackShoulders(ChrRecord *self, void *arg1, s32 same, s32 s
next_aimendback = 0.0f;
next_lshoulder = next;
#ifdef PORT
/* The leading anim union in weapon_firing_animation_table grows from
* four to eight bytes on PC. N64's float slots [12,13,16,17] are now
* different fields; read the intended limits/arm fractions by name. */
if (arg1 != NULL)
{
struct weapon_firing_animation_table *config = arg1;
if (config->max_up < next)
{
next_aimendback = next - config->max_up;
next_lshoulder = config->max_up;
}
else if (next < config->max_down)
{
next_aimendback = next - config->max_down;
next_lshoulder = config->max_down;
}
if (next_lshoulder > 0.0f)
{
next_rshoulder = config->free_arm_frac_up * next_lshoulder;
}
else
{
next_rshoulder = config->free_arm_frac_down * next_lshoulder;
}
}
#else
if (arg1 != NULL)
{
if (((f32*)arg1)[12] < next)
@@ -6235,6 +6262,7 @@ void chrlvUpdateAimendbackShoulders(ChrRecord *self, void *arg1, s32 same, s32 s
next_rshoulder = ((f32*)arg1)[17] * next_lshoulder;
}
}
#endif
if (swap != 0)
{