[RE] log_ui_draws: log the UI quad's colour attribute

A UI quad carries a k_8_8_8_8 colour next to its position, and its alpha is the
fade the bundle's keyframes animate. Logging it costs one more read per vertex
and turns the capture from "where is this quad" into "where is it and how faded".

It was added to separate two elements that decode to the same 1133x280 and sit on
opposite sides of a third in the declaration table. It does NOT separate them —
both rest at 255 — but it does check the fade decode against the running game for
the first time: every static element draws at exactly the resting alpha the
bundle predicts, and the only two quads whose alpha changes between consecutive
frames are the rotating effect pair and the PRESS (A) glow, which are the two
things visibly animating.
This commit is contained in:
Sylpheed RE agent
2026-08-19 01:09:04 +00:00
parent 4cd019b769
commit 53b208bf4d

View File

@@ -308,6 +308,11 @@ void CommandProcessor::CaptureUiDrawForRE(
ui_out << fmt::format("\n vb=0x{:08X} stride={} attrs=[", vbase, stride); ui_out << fmt::format("\n vb=0x{:08X} stride={} attrs=[", vbase, stride);
int32_t pos_off = -1; int32_t pos_off = -1;
uint32_t pos_fmt = 0; uint32_t pos_fmt = 0;
// The k_8_8_8_8 attribute is the per-vertex colour, and its ALPHA is what
// separates two elements that decode to the same size: the bundle gives
// them different resting fade alphas. Without it a draw of, say, 1133x280
// could be either `ptlogo_back2eff` or `ptlogo_back2eff5`.
int32_t col_off = -1;
for (const auto& attr : binding.attributes) { for (const auto& attr : binding.attributes) {
uint32_t f = uint32_t(attr.fetch_instr.attributes.data_format); uint32_t f = uint32_t(attr.fetch_instr.attributes.data_format);
uint32_t off = attr.fetch_instr.attributes.offset * 4; uint32_t off = attr.fetch_instr.attributes.offset * 4;
@@ -316,6 +321,11 @@ void CommandProcessor::CaptureUiDrawForRE(
pos_off = int32_t(off); pos_off = int32_t(off);
pos_fmt = f; pos_fmt = f;
} }
if (col_off < 0 &&
attr.fetch_instr.attributes.data_format ==
xenos::VertexFormat::k_8_8_8_8) {
col_off = int32_t(off);
}
} }
ui_out << "]"; ui_out << "]";
if (stride && vbase && pos_off >= 0) { if (stride && vbase && pos_off >= 0) {
@@ -342,7 +352,15 @@ void CommandProcessor::CaptureUiDrawForRE(
std::memcpy(&f0, &w0, 4); std::memcpy(&f0, &w0, 4);
std::memcpy(&f1, &w1, 4); std::memcpy(&f1, &w1, 4);
std::memcpy(&f2, &w2, 4); std::memcpy(&f2, &w2, 4);
ui_out << fmt::format(" [{:.2f},{:.2f},z={:.5f}]", f0, f1, f2); ui_out << fmt::format(" [{:.2f},{:.2f},z={:.5f}", f0, f1, f2);
if (col_off >= 0) {
const uint8_t* c = memory_->TranslatePhysical<const uint8_t*>(
vbase + v * stride + uint32_t(col_off));
if (c) {
ui_out << fmt::format(",col={:08X}", be_u32(c));
}
}
ui_out << "]";
} }
} }
} }