screen-transitions.md carried a 14-unit "black hold" that the page itself flagged as arithmetic rather than measurement. Measured it against the running game; the guess was wrong, and finding the instrument to measure it turned up a second, larger error in the same page. 1. fade_quads.py was STALE. It read each pose's time from blk+36 -- the next record's time word -- the association the keyframe record-layout fix retired in the crate. sylpheed-cli was rebuilt at the time; the Python helper was never swept with it. Signature: it cannot time a group's last pose, so it printed a trailing `t=-`. Fixed, controlled against the rebuilt `screen info` ([0 12 70 80] for build 5's pteff00.prm). 2. Through it, the page labelled the quad's CLEAR-hold as its fade-in and published 0.87 s / 0.97 s / 4.08 s for a ramp that is 0.20 s / 0.20 s / 0.27 s. A port pacing its menu fade-in off that would run it 5x too slow. 3. The measurement. fade_decompose.sh boots to the main menu, arms the UI draw capture there, then presses (B), so one 260-frame window holds the whole screen change. The fade quad is identified rather than guessed: a .prm carries no tex[base=] and paints last, so it is the last full-screen untextured quad of a frame. Control first -- the quad's ramp is decoded at 10 units = 5 frames, and measures 4 submitted-frame steps with one unlogged frame in the span. Result: content elements begin fading at frame 34; the black quad first appears at 40 and is opaque by 43; the menu's last frame is 45; frame 46 has 6 draws against 12. So the ~14 extra units are the content's own fade-outs OVERLAPPING the quad's ramp, not a hold after it, and the inter-screen black is one frame. Refutation attempted: sylpheed-port's entries 13/14 twins. Re-derived off the disc -- 3.06 / 4.33 / 47.91, identical to two decimals. Recorded as confirming their addressing and arithmetic, NOT as independent support: same renderer, same disc, which is their own rule. Reach: one transition, one run; the frame axis has gaps (232 headers over frames 3..260), so every span is +-1 frame. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
72 lines
2.6 KiB
Python
Executable File
72 lines
2.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Per-frame alpha of the fade quad (`pteff00.prm`), from a `log_ui_draws` capture.
|
|
|
|
`screen-transitions.md` measures a screen change's fade-out as a ~0.4 s lump and
|
|
then SPLITS it by arithmetic -- the declared ramp is 10 units, 0.4 s is ~24, "so
|
|
the other ~14 must be the black hold". That page flags the split as a fit, not a
|
|
measurement. This measures it.
|
|
|
|
Identifying the quad, rather than guessing at it: the fade quad is a `.prm`
|
|
PRIMITIVE, so its draw carries NO `tex[base=...]`, and it is its screen's
|
|
last-painting element (structures/ui-paint-order-key.md). So: per frame, the LAST
|
|
full-screen draw with no bound texture. Taking merely the last full-screen quad
|
|
picks up textured backdrops and gets a different answer.
|
|
|
|
⚠️ The frame axis has gaps. A 260-frame window produced 232 `--- frame` headers,
|
|
so ~10 % of submitted frames carry no UI draw at all. A duration in frames is
|
|
therefore +-1 frame per gap it spans, and this prints the gaps so a reader can
|
|
see which spans are affected.
|
|
|
|
fade_envelope.py <capture.log>
|
|
"""
|
|
import re
|
|
import sys
|
|
sys.path.insert(0, __file__.rsplit("/", 1)[0])
|
|
|
|
W, H = 1280, 720
|
|
VERT = re.compile(r"col=([0-9A-F]{8})")
|
|
|
|
|
|
def envelope(log):
|
|
"""Yield (frame, alpha|None) -- alpha of the last untextured full-screen quad."""
|
|
frame, pending_untex = None, None
|
|
last = {}
|
|
seen = []
|
|
for line in open(log):
|
|
if line.startswith("--- frame"):
|
|
if frame is not None:
|
|
seen.append(frame)
|
|
frame = int(line.split()[2])
|
|
continue
|
|
m = re.match(r"\s*(\d+) prim=(\d+) indices=(\d+)", line)
|
|
if m:
|
|
# a primitive draw has no bound texture
|
|
pending_untex = ("tex[base=" not in line) and m.group(2) == "13"
|
|
continue
|
|
if "vb=0x" in line and pending_untex:
|
|
cols = VERT.findall(line)
|
|
# full-screen NDC quad: every vertex at +-1
|
|
if cols and line.count("[-1.00,1.00,") >= 1:
|
|
last[frame] = int(cols[-1][:2], 16)
|
|
pending_untex = None
|
|
if frame is not None:
|
|
seen.append(frame)
|
|
return last, seen
|
|
|
|
|
|
def main():
|
|
last, seen = envelope(sys.argv[1])
|
|
gaps = [(a, b) for a, b in zip(seen, seen[1:]) if b != a + 1]
|
|
print(f"# {len(seen)} frame headers, {seen[0]}..{seen[-1]}; "
|
|
f"{sum(b-a-1 for a,b in gaps)} submitted frames carry no UI draw")
|
|
print("# gaps: " + " ".join(f"{a}->{b}" for a, b in gaps))
|
|
print("frame alpha")
|
|
for f in seen:
|
|
a = last.get(f)
|
|
print(f"{f:6d} {'-' if a is None else a:>5}")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|