HUD status icons and clock (executable)
Completes “How a status shows” (status run) and the Battle HUD section. Sprite numbers are BtMenu table indices.
Status icon row 0x140157860(hud, player, x, y), called twice from the status panel 0x140155310 (0x140157276, 0x140157806):
- Blink phase b = (match clock 0x1404bc8c0 / 30) & 1 while the match phase is 6, else 0: it flips once a second.
- The four stat slots, in the table order of
0x1402f1200
(
{slot, sprite+, sprite−, colour}: slot 0 {44, 43, 0xffcd4d4d}, slot 1 {49, 48, 0xff4d4dcd}, slot 3 {46, 45, 0xffcdcdcd}, slot 2 {52, 51, 0xffcdbe4d}): value v = the slot (0x14024d4d0); a value outside −9..9 is shown divided by 10. v = 0 draws nothing and takes no place. Otherwise, b = 0: the icon, the first sprite for v > 0 and the second for v < 0, tinted 0xff854322; b = 1: the blank plate, sprite 39, in the same tint, and on it the signed value as text (a sign and the digits; sx 8, sy 16, at (+2, +1), in the row’s colour). Then x += 25. - Then the flag slots of 0x1402f1298 (4 → 50, 5 → 41, 6 → 42, 33 → 47, 35 → 90, 36 → 40): each set slot’s sprite at (x₀ + 25 · n, y), tint 0xff854322, n counting every icon drawn so far. In the one-view layout, for a player index above 0, the row wraps after five icons (n = 0, y += 17).
- It ends by setting the text scale back to 7 / 14. So the first / second sprite of each pair is the “raised” / “lowered” icon (this settles the pair order the status run left open), and a stat icon alternates each second with its number.
Clock (0x140154cc9; needs
bit 0x20 of the menu flag word
+0x58): back plate quads, the icon
(sprite 87) and the time as text at (x + 0x12,
0x1ac) in 0xfff54322, through the
printf-and-draw helper 0x140126dd0. Seconds =
clock / 30 (0 outside phase 6), minutes =
seconds / 60, both truncated. Last
minute: while minutes = 0 and seconds
> 0 the colour is blended (0x140153640) from
black toward 0xfff54322 by a = 255 − c for c
< 176, else c − 96, where c is the HUD’s
counter at +0xc44 (its step was not
traced): the clock pulses.
Colour blend 0x140153640(from, to, a): a = 0 → from, 255 → to, else per channel (from · (255 − a) + to · a) >> 8, alpha forced to 255. Used by the aura-state colours, the clock and the slot colours.
Confidence: icon row H for the code path (tables read from the file), M for which of a pair means raised; clock M (pulse counter not traced).
Not decoded: the status
panel 0x140155310 beyond what “Battle HUD” lists
(9.5 KB; other players’ rows, the health drain
animation, where it calls the icon row from);
the slot flash frames 91–118; damage numbers (no
number sprite draw was found in the HUD class:
lead only); the +0xc44 counter.
(The lock marker’s rule is decoded: “Lock-on
marker”, docs 11-15.)
Implementation notes for the rebuild
pd_hud.gd: draw the icon row from the two tables exactly (25 px pitch, tint 0xff854322, the once-a-second swap between icon and signed number on plate 39, divide by 10 outside ±9, the five-per-row wrap for other players).- Clock: truncate (not round up) the seconds; pulse in the last minute with the blend above (the counter’s speed is a placeholder until traced).
- Use one
blend(from, to, a)helper with the >> 8 rule for all HUD colour animation.