Skip to content

Commit 8f976cf

Browse files
libretroadminLibretroAdmin
authored andcommitted
menu_setting: two builders become data, their bodies deleted
The generic desc-group walker already runs the cheats, crt and turbo-fire lists from registry data with no code. Two more join them: frame_time_counter, whose two adjacent row files concatenate into one table now that the auto-reset hide moved to the displaylist, and steam, always a single table. Both build functions delete; their registry entries carry the rows, counts and group enums the walker needs. Net 43 lines out, and two fewer functions in .text. That is the whole safe yield this round, and the reason is worth recording. Of the forty-odd remaining builders, one runs a runtime capability check per row (gamemode), one customizes after construction (the LV widget-scale residue), one splits its two tables under different compile guards (accounts), and thirty-eight construct settings by hand with CONFIG_* rather than descriptor tables. The walker cannot swallow any of those without either runtime-condition and compile-guard columns in the registry - real grammar, not a macro - or migrating the hand CONFIG_* settings into def files first. The hand-CONFIG migration is the large lever and the honest next objective; the walker was never going to clear more than a handful until it lands.
1 parent df7503a commit 8f976cf

1 file changed

Lines changed: 12 additions & 55 deletions

File tree

menu/menu_setting.c

Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11263,12 +11263,9 @@ static const setting_desc_t cs_desc_2[] = {
1126311263
#endif
1126411264

1126511265
static const setting_desc_t frame_time_cou_desc_0[] = {
11266-
/* GENERATED: rows come from settings_def_video_frame_time_sample.h in order. */
11266+
/* GENERATED: two adjacent row files, concatenated so the whole
11267+
* screen is one table and the builder becomes pure data. */
1126711268
#include "../settings/settings_def_video_frame_time_sample.h"
11268-
};
11269-
11270-
static const setting_desc_t frame_time_cou_desc_1[] = {
11271-
/* GENERATED: rows come from settings_def_frame_time_counter.h in order. */
1127211269
#include "../settings/settings_def_frame_time_counter.h"
1127311270
};
1127411271

@@ -13481,29 +13478,6 @@ static void settings_build_cloud_sync(
1348113478
}
1348213479
}
1348313480

13484-
static void settings_build_frame_time_counter(
13485-
settings_t *settings, global_t *global,
13486-
rarch_setting_t **list, rarch_setting_info_t *list_info,
13487-
const char *parent_group)
13488-
{
13489-
rarch_setting_group_info_t group_info;
13490-
rarch_setting_group_info_t subgroup_info;
13491-
group_info.name = NULL;
13492-
subgroup_info.name = NULL;
13493-
(void)settings; (void)global; (void)group_info; (void)subgroup_info;
13494-
{
13495-
START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS), parent_group);
13496-
13497-
parent_group = msg_hash_to_str(MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS);
13498-
13499-
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
13500-
13501-
ADD_DESC(frame_time_cou_desc_0);
13502-
ADD_DESC(frame_time_cou_desc_1);
13503-
13504-
GROUP_END();
13505-
}
13506-
}
1350713481

1350813482
static void settings_build_rewind(
1350913483
settings_t *settings, global_t *global,
@@ -17322,30 +17296,6 @@ static void settings_build_manual_content_scan(
1732217296
}
1732317297

1732417298
#ifdef HAVE_MIST
17325-
static void settings_build_steam(
17326-
settings_t *settings, global_t *global,
17327-
rarch_setting_t **list, rarch_setting_info_t *list_info,
17328-
const char *parent_group)
17329-
{
17330-
rarch_setting_group_info_t group_info;
17331-
rarch_setting_group_info_t subgroup_info;
17332-
group_info.name = NULL;
17333-
subgroup_info.name = NULL;
17334-
(void)settings; (void)global; (void)group_info; (void)subgroup_info;
17335-
{
17336-
START_GROUP(list, list_info, &group_info,
17337-
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_STEAM_SETTINGS), parent_group);
17338-
17339-
parent_group = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_STEAM_SETTINGS);
17340-
17341-
START_SUB_GROUP(list, list_info, "State",
17342-
&group_info, &subgroup_info, parent_group);
17343-
17344-
ADD_DESC(steam_desc_0);
17345-
17346-
GROUP_END();
17347-
}
17348-
}
1734917299
#endif
1735017300

1735117301
#ifdef HAVE_SMBCLIENT
@@ -17504,7 +17454,11 @@ static const settings_build_entry_t settings_build_registry[] = {
1750417454
{ SETTINGS_LIST_LOGGING, settings_build_logging, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
1750517455
{ SETTINGS_LIST_SAVING, settings_build_saving, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
1750617456
{ SETTINGS_LIST_CLOUD_SYNC, settings_build_cloud_sync, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
17507-
{ SETTINGS_LIST_FRAME_TIME_COUNTER, settings_build_frame_time_counter, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
17457+
{ SETTINGS_LIST_FRAME_TIME_COUNTER, NULL,
17458+
frame_time_cou_desc_0, (unsigned)ARRAY_SIZE(frame_time_cou_desc_0),
17459+
MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS,
17460+
MSG_UNKNOWN,
17461+
MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS },
1750817462
{ SETTINGS_LIST_REWIND, settings_build_rewind, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
1750917463
{ SETTINGS_LIST_CHEATS, NULL,
1751017464
cheats_desc_0, (unsigned)ARRAY_SIZE(cheats_desc_0),
@@ -17610,7 +17564,11 @@ static const settings_build_entry_t settings_build_registry[] = {
1761017564
{ SETTINGS_LIST_MIDI, settings_build_midi, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
1761117565
{ SETTINGS_LIST_MANUAL_CONTENT_SCAN, settings_build_manual_content_scan, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
1761217566
#ifdef HAVE_MIST
17613-
{ SETTINGS_LIST_STEAM, settings_build_steam, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
17567+
{ SETTINGS_LIST_STEAM, NULL,
17568+
steam_desc_0, (unsigned)ARRAY_SIZE(steam_desc_0),
17569+
MENU_ENUM_LABEL_VALUE_STEAM_SETTINGS,
17570+
MSG_UNKNOWN,
17571+
MENU_ENUM_LABEL_VALUE_STEAM_SETTINGS },
1761417572
#endif
1761517573
#ifdef HAVE_SMBCLIENT
1761617574
{ SETTINGS_LIST_SMBCLIENT, settings_build_smbclient, NULL, 0, MSG_UNKNOWN, MSG_UNKNOWN, MSG_UNKNOWN },
@@ -17818,7 +17776,6 @@ static const settings_desc_table_t settings_desc_registry[] = {
1781817776
#endif
1781917777
#endif
1782017778
{ frame_time_cou_desc_0, (uint16_t)ARRAY_SIZE(frame_time_cou_desc_0) },
17821-
{ frame_time_cou_desc_1, (uint16_t)ARRAY_SIZE(frame_time_cou_desc_1) },
1782217779
{ rewind_desc_0, (uint16_t)ARRAY_SIZE(rewind_desc_0) },
1782317780
{ rewind_desc_1, (uint16_t)ARRAY_SIZE(rewind_desc_1) },
1782417781
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (defined(IOS) && TARGET_OS_TV)

0 commit comments

Comments
 (0)