Skip to content

Commit 3dd3be1

Browse files
libretroadminLibretroAdmin
authored andcommitted
menu_displaylist: let the screen arrays lead where code was bypassing them
An audit of all fifty-two array-driven screens against the dump found the arrays lead perfectly on order - zero violations, even across cases holding several arrays - but thirty-five shown rows were injected by case code beside them. Thirty are legitimately parametric or capability-absolute: the netplay per-user loop, the cheat rows keyed on the current index, and the latency screen's driver-flag cascade, which must stay hidden even from include-everything and so cannot be a checked entry today. The five that were plain bypasses are fixed where the grammar allows: the frame-time auto-reset toggle becomes a checked entry with its hiding rule in the standard toggle switch, and the updater action row joins the core screen's array as PARSE_ACTION. The core manager row stays coded and documented: it has no backing setting, and settingless action rows are a real gap in the array grammar, alongside absolute conditions and interleaved positions - the three things a layout definition format has to express. All three dump passes byte-identical.
1 parent b2816c3 commit 3dd3be1

1 file changed

Lines changed: 28 additions & 21 deletions

File tree

menu/menu_displaylist.c

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11918,6 +11918,9 @@ unsigned menu_displaylist_build_list(
1191811918
case DISPLAYLIST_CORE_SETTINGS_LIST:
1191911919
{
1192011920
static const menu_displaylist_build_info_t build_list[] = {
11921+
#ifdef HAVE_ONLINE_UPDATER
11922+
{MENU_ENUM_LABEL_UPDATER_SETTINGS, PARSE_ACTION},
11923+
#endif
1192111924
{MENU_ENUM_LABEL_CORE_INFO_CACHE_ENABLE, PARSE_ONLY_BOOL},
1192211925
{MENU_ENUM_LABEL_CORE_INFO_SAVESTATE_BYPASS, PARSE_ONLY_BOOL},
1192311926
{MENU_ENUM_LABEL_SYSTEMFILES_IN_CONTENT_DIR_ENABLE, PARSE_ONLY_BOOL},
@@ -11938,14 +11941,9 @@ unsigned menu_displaylist_build_list(
1193811941
MENU_SETTING_ACTION, 0, 0, NULL))
1193911942
count++;
1194011943

11941-
#ifdef HAVE_ONLINE_UPDATER
11942-
if (menu_entries_append(list,
11943-
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_UPDATER_SETTINGS),
11944-
msg_hash_to_str(MENU_ENUM_LABEL_UPDATER_SETTINGS),
11945-
MENU_ENUM_LABEL_UPDATER_SETTINGS,
11946-
MENU_SETTING_ACTION, 0, 0, NULL))
11947-
count++;
11948-
#endif
11944+
/* core_manager_list has no backing setting, so it cannot
11945+
* be a PARSE_ACTION array entry; the raw append above is
11946+
* the only mechanism for settingless action rows today. */
1194911947

1195011948
for (i = 0; i < ARRAY_SIZE(build_list); i++)
1195111949
{
@@ -12107,27 +12105,36 @@ unsigned menu_displaylist_build_list(
1210712105
case DISPLAYLIST_FRAME_TIME_COUNTER_SETTINGS_LIST:
1210812106
{
1210912107
static menu_displaylist_build_info_selective_t build_list[] = {
12110-
{MENU_ENUM_LABEL_VIDEO_REFRESH_RATE_AUTO, PARSE_ONLY_FLOAT, true},
12111-
{MENU_ENUM_LABEL_VIDEO_FRAME_TIME_SAMPLE_GATED, PARSE_ONLY_BOOL, true},
12108+
{MENU_ENUM_LABEL_VIDEO_REFRESH_RATE_AUTO, PARSE_ONLY_FLOAT, true},
12109+
{MENU_ENUM_LABEL_VIDEO_FRAME_TIME_SAMPLE_GATED, PARSE_ONLY_BOOL, true},
12110+
/* Auto-reset toggle is redundant when gated sampling
12111+
* is active (no contamination enters the buffer to
12112+
* begin with), so it is hidden in that case to keep
12113+
* the menu focused. */
12114+
{MENU_ENUM_LABEL_FRAME_TIME_COUNTER_AUTO_RESET, PARSE_ONLY_BOOL, true},
1211212115
};
1211312116

1211412117
for (i = 0; i < ARRAY_SIZE(build_list); i++)
1211512118
{
12116-
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
12117-
build_list[i].enum_idx, build_list[i].parse_type,
12118-
false) == 0)
12119-
count++;
12119+
switch (build_list[i].enum_idx)
12120+
{
12121+
case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_AUTO_RESET:
12122+
build_list[i].checked =
12123+
!settings->bools.video_frame_time_sample_gated;
12124+
break;
12125+
default:
12126+
break;
12127+
}
1212012128
}
1212112129

12122-
/* Auto-reset toggle is redundant when gated sampling
12123-
* is active (no contamination enters the buffer to
12124-
* begin with), so hide it in that case to keep the
12125-
* menu focused. */
12126-
if (!settings->bools.video_frame_time_sample_gated)
12130+
for (i = 0; i < ARRAY_SIZE(build_list); i++)
1212712131
{
12132+
if (!build_list[i].checked && !include_everything)
12133+
continue;
12134+
1212812135
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
12129-
MENU_ENUM_LABEL_FRAME_TIME_COUNTER_AUTO_RESET,
12130-
PARSE_ONLY_BOOL, false) == 0)
12136+
build_list[i].enum_idx, build_list[i].parse_type,
12137+
false) == 0)
1213112138
count++;
1213212139
}
1213312140
}

0 commit comments

Comments
 (0)