Skip to content

Commit a191975

Browse files
libretroadminLibretroAdmin
authored andcommitted
settings: fold the frame-time refresh handlers into their row
First of the six post-construction customizations the descriptor referee caught: the sample-gated toggle's menu-refresh handlers lived as builder code after the add call, invisible to the index. They are row data now - the row grammar had the slots all along - and the intl consumer's per-file macro prelude learns the EX variant, the same shape its generator derives from usage. Referee: 526 of 947 entries now byte-faithful from the index, action mismatches down to two, and pointer equality on the interned tuple proves the refresh callbacks moved intact. Both dumps and all three displaylist passes byte-identical. This is burn-down, not yet reduction: the five remaining customizations gate the cut. Once the referee reads zero mismatches, the pure-shaped build functions collapse into one registry walker and their bodies delete - that is where the surface and binary size come out, and it is the next thing that lands.
1 parent 8028a0b commit a191975

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

intl/msg_hash_us.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7527,6 +7527,11 @@ MSG_HASH(
75277527
)
75287528
/* GENERATED REGION: frame time sampling setting (see settings_def_video_frame_time_sample.h). */
75297529
#define SETTINGS_DEF_STRINGS_PASS
7530+
#define S_BOOL_EX(f, T, n, d, sd, df, c, ok, rp, sta, sel, lf, rt, ui, us, sub) \
7531+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us) \
7532+
MSG_HASH(MENU_ENUM_SUBLABEL_##T, sub)
7533+
#define S_BOOL_EX_NS(f, T, n, d, sd, df, c, ok, rp, sta, sel, lf, rt, ui, us) \
7534+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us)
75307535
#define S_BOOL(f, T, n, d, sd, df, c, us, sub) \
75317536
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us) \
75327537
MSG_HASH(MENU_ENUM_SUBLABEL_##T, sub)
@@ -7548,6 +7553,8 @@ MSG_HASH(MENU_ENUM_SUBLABEL_##T, sub)
75487553
#define S_FLOAT_NS(f, T, n, d, rnd, sd, df, c, mn, mx, st, ok, rp, us) \
75497554
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us)
75507555
#include "../settings/settings_def_video_frame_time_sample.h"
7556+
#undef S_BOOL_EX
7557+
#undef S_BOOL_EX_NS
75517558
#undef S_BOOL
75527559
#undef S_BOOL_NS
75537560
#undef S_UINT

menu/menu_setting.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13601,13 +13601,6 @@ static void settings_build_frame_time_counter(
1360113601
frame_time_cou_desc_0, ARRAY_SIZE(frame_time_cou_desc_0),
1360213602
&group_info, &subgroup_info, parent_group);
1360313603
}
13604-
/* Toggling this setting hides/shows
13605-
* 'frame_time_counter_auto_reset' below, so the menu
13606-
* needs a rebuild on change. */
13607-
SETTINGS_ACTION_SET(ok, &(*list)[list_info->index - 1], &setting_bool_action_left_with_refresh)
13608-
SETTINGS_ACTION_SET(left, &(*list)[list_info->index - 1], &setting_bool_action_left_with_refresh)
13609-
SETTINGS_ACTION_SET(right, &(*list)[list_info->index - 1], &setting_bool_action_right_with_refresh)
13610-
1361113604
{
1361213605
settings_list_add_desc(list, list_info, settings,
1361313606
frame_time_cou_desc_1, ARRAY_SIZE(frame_time_cou_desc_1),

settings/settings_def_video_frame_time_sample.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
* matches SDESC_<kind>_ROW; row order is menu display order;
55
* h2json.py parses these rows for the Crowdin source upload. */
66

7-
S_BOOL(video_frame_time_sample_gated, VIDEO_FRAME_TIME_SAMPLE_GATED,
7+
/* Toggling hides/shows 'frame_time_counter_auto_reset', so the
8+
* menu needs a rebuild on change: refresh handlers on all three. */
9+
S_BOOL_EX(video_frame_time_sample_gated, VIDEO_FRAME_TIME_SAMPLE_GATED,
810
"video_frame_time_sample_gated",
911
DEFAULT_FRAME_TIME_SAMPLE_GATED, SD_FLAG_NONE, 0, 0,
12+
setting_bool_action_left_with_refresh, NULL, NULL, NULL,
13+
setting_bool_action_left_with_refresh,
14+
setting_bool_action_right_with_refresh, 0,
1015
"Sample Frame Time Only In Stable State",
1116
"Restrict 'Estimated Screen Refresh Rate' sampling to frames where content is running cleanly (not menu, not paused, not fast-forwarding, frame time within a sanity envelope). The diagnostic readout becomes a real signal at the cost of slower convergence after content load.")

0 commit comments

Comments
 (0)