Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,7 @@ static struct config_path_setting *populate_settings_path(
SETTING_PATH("assets_directory", settings->paths.directory_assets, true, NULL, true);
SETTING_PATH("dynamic_wallpapers_directory", settings->paths.directory_dynamic_wallpapers, true, NULL, true);
SETTING_PATH("thumbnails_directory", settings->paths.directory_thumbnails, true, NULL, true);
SETTING_PATH("patches_directory", settings->paths.directory_patches, true, NULL, true);
SETTING_PATH("runtime_log_directory", settings->paths.directory_runtime_log, true, NULL, true);
SETTING_PATH("joypad_autoconfig_dir", settings->paths.directory_autoconfig, false, NULL, true);
SETTING_PATH("savefile_directory", dir_get_ptr(RARCH_DIR_SAVEFILE), true, NULL, false);
Expand Down Expand Up @@ -3172,6 +3173,7 @@ void config_set_defaults(void *data)
*settings->paths.directory_assets = '\0';
*settings->paths.directory_dynamic_wallpapers = '\0';
*settings->paths.directory_thumbnails = '\0';
*settings->paths.directory_patches = '\0';
*settings->paths.directory_playlist = '\0';
*settings->paths.directory_content_favorites = '\0';
*settings->paths.directory_content_history = '\0';
Expand Down Expand Up @@ -4374,6 +4376,8 @@ static bool config_load_file(global_t *global,
*settings->paths.directory_dynamic_wallpapers = '\0';
if (string_is_equal(settings->paths.directory_thumbnails, "default"))
*settings->paths.directory_thumbnails = '\0';
if (string_is_equal(settings->paths.directory_patches, "default"))
*settings->paths.directory_patches = '\0';
if (string_is_equal(settings->paths.directory_playlist, "default"))
*settings->paths.directory_playlist = '\0';
if (string_is_equal(settings->paths.directory_content_favorites, "default"))
Expand Down
1 change: 1 addition & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ typedef struct settings
char directory_assets[DIR_MAX_LENGTH];
char directory_dynamic_wallpapers[DIR_MAX_LENGTH];
char directory_thumbnails[DIR_MAX_LENGTH];
char directory_patches[DIR_MAX_LENGTH];
char directory_menu_config[DIR_MAX_LENGTH];
char directory_menu_content[DIR_MAX_LENGTH];
#ifdef _3DS
Expand Down
8 changes: 8 additions & 0 deletions intl/msg_hash_lbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3364,6 +3364,10 @@ MSG_HASH(
MENU_ENUM_LABEL_RUN,
"collection"
)
MSG_HASH(
MENU_ENUM_LABEL_PATCHES,
"patches"
)
MSG_HASH(
MENU_ENUM_LABEL_RUN_MUSIC,
"collection_music"
Expand Down Expand Up @@ -3829,6 +3833,10 @@ MSG_HASH(
MENU_ENUM_LABEL_THUMBNAILS_DIRECTORY,
"thumbnails_directory"
)
MSG_HASH(
MENU_ENUM_LABEL_PATCHES_DIRECTORY,
"patches_directory"
)
MSG_HASH(
MENU_ENUM_LABEL_PL_THUMBNAILS_UPDATER_LIST,
"pl_thumbnails_updater_list"
Expand Down
16 changes: 16 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -8235,6 +8235,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_THUMBNAILS_DIRECTORY,
"Box art, screenshot, and title screen thumbnails are stored in this directory."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PATCHES_DIRECTORY,
"Patches"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PATCHES_DIRECTORY,
"Patch files are searched in this directory."
)
MSG_HASH( /* FIXME Not RGUI specific */
MENU_ENUM_LABEL_VALUE_RGUI_BROWSER_DIRECTORY,
"Start Directory"
Expand Down Expand Up @@ -9075,6 +9083,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_INFORMATION,
"View more information about the content."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PATCHES,
"Patches"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PATCHES,
"Select and order patches to apply before content is loaded."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_DOWNLOAD_PL_ENTRY_THUMBNAILS,
"Download Thumbnails"
Expand Down
20 changes: 20 additions & 0 deletions menu/cbs/menu_cbs_deferred_push.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ GENERIC_DEFERRED_PUSH(deferred_archive_action, DISPLAYLIST_
GENERIC_DEFERRED_PUSH(deferred_push_core_counters, DISPLAYLIST_PERFCOUNTERS_CORE)
GENERIC_DEFERRED_PUSH(deferred_push_frontend_counters, DISPLAYLIST_PERFCOUNTERS_FRONTEND)
GENERIC_DEFERRED_PUSH(deferred_push_core_cheat_options, DISPLAYLIST_OPTIONS_CHEATS)
#ifdef HAVE_PATCH
GENERIC_DEFERRED_PUSH(deferred_push_patches_list, DISPLAYLIST_OPTIONS_PATCHES)
GENERIC_DEFERRED_PUSH(deferred_push_patches_actions_list, DISPLAYLIST_OPTIONS_PATCHES_ACTIONS)
#endif
GENERIC_DEFERRED_PUSH(deferred_push_core_input_remapping_options, DISPLAYLIST_OPTIONS_REMAPPINGS)
GENERIC_DEFERRED_PUSH(deferred_push_remap_file_manager, DISPLAYLIST_REMAP_FILE_MANAGER)
GENERIC_DEFERRED_PUSH(deferred_push_savestate_list, DISPLAYLIST_SAVESTATE_LIST)
Expand Down Expand Up @@ -738,6 +742,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_PARAMETERS, deferred_push_video_shader_preset_parameters},
{MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS, deferred_push_video_shader_parameters},
{MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS, deferred_push_core_cheat_options},
#ifdef HAVE_PATCH
{MENU_ENUM_LABEL_PATCHES, deferred_push_patches_list},
#endif
{MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS, deferred_push_core_input_remapping_options},
{MENU_ENUM_LABEL_DEFERRED_REMAP_FILE_MANAGER_LIST, deferred_push_remap_file_manager},
{MENU_ENUM_LABEL_VIDEO_SHADER_PRESET, deferred_push_video_shader_preset},
Expand Down Expand Up @@ -1238,6 +1245,19 @@ static int menu_cbs_init_bind_deferred_push_compare_type(
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_cdrom_info_detail_list);
}
#ifdef HAVE_PATCH
else if (type == MENU_SETTING_ACTION_PATCHES)
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_patches_list);
return 0;
}
else if (type >= MENU_SETTINGS_PATCH_BEGIN
&& type <= MENU_SETTINGS_PATCH_END)
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_patches_actions_list);
return 0;
}
#endif
else
return -1;

Expand Down
171 changes: 171 additions & 0 deletions menu/cbs/menu_cbs_ok.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_CORE_OPTION_OVERRIDE_LIST;
case ACTION_OK_DL_REMAP_FILE_MANAGER_LIST:
return MENU_ENUM_LABEL_DEFERRED_REMAP_FILE_MANAGER_LIST;
case ACTION_OK_DL_PATCHES_LIST:
case ACTION_OK_DL_PATCHES_ACTIONS_LIST:
return MENU_ENUM_LABEL_PATCHES;
case ACTION_OK_DL_ADD_TO_PLAYLIST:
return MENU_ENUM_LABEL_DEFERRED_ADD_TO_PLAYLIST_LIST;
case ACTION_OK_DL_ADD_TO_PLAYLIST_QUICKMENU:
Expand Down Expand Up @@ -1779,6 +1782,28 @@ int generic_action_ok_displaylist_push(
info.type = MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_BEGIN + player_no;
}
break;
case ACTION_OK_DL_PATCHES_LIST:
info.list = MENU_LIST_GET_SELECTION(menu_list, 0);
info.directory_ptr = idx;
info.type = type;
info_path = "patches_list";
info_label = "patches_list";
info.enum_idx = MENU_ENUM_LABEL_PATCHES;
menu_entries_append(menu_stack, info_path, info_label,
MENU_ENUM_LABEL_PATCHES, 0, idx, 0, NULL);
dl_type = DISPLAYLIST_OPTIONS_PATCHES;
break;
case ACTION_OK_DL_PATCHES_ACTIONS_LIST:
info.list = MENU_LIST_GET_SELECTION(menu_list, 0);
info.directory_ptr = idx;
info.type = type;
info_path = "patches_actions_list";
info_label = "patches_actions_list";
info.enum_idx = MENU_ENUM_LABEL_PATCHES;
menu_entries_append(menu_stack, info_path, info_label,
MENU_ENUM_LABEL_PATCHES, 0, idx, 0, NULL);
dl_type = DISPLAYLIST_OPTIONS_PATCHES_ACTIONS;
break;
case ACTION_OK_DL_ACCOUNTS_LIST:
case ACTION_OK_DL_ACHIEVEMENTS_HARDCORE_PAUSE_LIST:
case ACTION_OK_DL_INPUT_SETTINGS_LIST:
Expand Down Expand Up @@ -4516,6 +4541,115 @@ static int action_ok_stop_streaming(const char *path,
return generic_action_ok_command(CMD_EVENT_RESUME);
}

#ifdef HAVE_PATCH
#define MENU_LABEL_PATCHES_ADD_LIST "patches_add_list"
#define MENU_LABEL_PATCHES_ACTIONS_LIST "patches_actions_list"

static bool action_ok_patch_get_selected_idx(size_t *idx)
{
unsigned menu_type = FILE_TYPE_NONE;

if (!idx)
return false;

menu_entries_get_last_stack(NULL, NULL, &menu_type, NULL, NULL);

if (menu_type < MENU_SETTINGS_PATCH_BEGIN || menu_type > MENU_SETTINGS_PATCH_END)
return false;

*idx = menu_type - MENU_SETTINGS_PATCH_BEGIN;
return true;
}

static int action_ok_patch_menu(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_displaylist_push(path, NULL,
label, type, idx, entry_idx, ACTION_OK_DL_PUSH_DEFAULT);
}

static int action_ok_patch_add_menu(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
char start_dir[PATH_MAX_LENGTH];

start_dir[0] = '\0';
if (!patch_stack_resolve_selected_patches_dir(start_dir, sizeof(start_dir)))
return 0;

filebrowser_set_type(FILEBROWSER_SELECT_FILE);
return generic_action_ok_displaylist_push(start_dir, start_dir,
MENU_LABEL_PATCHES_ADD_LIST, type, idx, entry_idx, ACTION_OK_DL_CONTENT_LIST);
}

static int action_ok_patch_entry(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_displaylist_push(path, NULL,
MENU_LABEL_PATCHES_ACTIONS_LIST, type, idx, entry_idx, ACTION_OK_DL_PUSH_DEFAULT);
}

static int action_ok_patch_add_candidate(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
struct menu_state *menu_st = menu_state_get_ptr();
const char *menu_path = NULL;
char full_path[PATH_MAX_LENGTH];

menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL);

if (!string_is_empty(menu_path) && !path_is_absolute(path))
fill_pathname_join_special(full_path, menu_path, path, sizeof(full_path));
else
strlcpy(full_path, path, sizeof(full_path));

if (patch_stack_add(full_path))
menu_st->flags |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH;

menu_entries_flush_stack(msg_hash_to_str(MENU_ENUM_LABEL_PATCHES), 0);
return 0;
}

static int action_ok_patch_move_up(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
struct menu_state *menu_st = menu_state_get_ptr();
size_t patch_idx = 0;

if (!action_ok_patch_get_selected_idx(&patch_idx) || !patch_stack_move_up(patch_idx))
return 0;

menu_st->flags |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH;
return action_cancel_pop_default(path, label, type, idx);
}

static int action_ok_patch_move_down(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
struct menu_state *menu_st = menu_state_get_ptr();
size_t patch_idx = 0;

if (!action_ok_patch_get_selected_idx(&patch_idx) || !patch_stack_move_down(patch_idx))
return 0;

menu_st->flags |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH;
return action_cancel_pop_default(path, label, type, idx);
}

static int action_ok_patch_remove(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
struct menu_state *menu_st = menu_state_get_ptr();
size_t patch_idx = 0;

if (!action_ok_patch_get_selected_idx(&patch_idx) || !patch_stack_remove(patch_idx))
return 0;

menu_st->flags |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH;
return action_cancel_pop_default(path, label, type, idx);
}
#endif

#ifdef HAVE_CHEATS
static int action_ok_cheat_add_top(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
Expand Down Expand Up @@ -9617,6 +9751,18 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
{
BIND_ACTION_OK(cbs, action_ok_cheat);
}
#ifdef HAVE_PATCH
else if (type >= MENU_SETTINGS_PATCH_BEGIN
&& type <= MENU_SETTINGS_PATCH_END)
{
BIND_ACTION_OK(cbs, action_ok_patch_entry);
}
else if (type >= MENU_SETTINGS_PATCH_CANDIDATE_BEGIN
&& type <= MENU_SETTINGS_PATCH_CANDIDATE_END)
{
BIND_ACTION_OK(cbs, action_ok_patch_add_candidate);
}
#endif
else if ( (type >= MENU_SETTINGS_CORE_OPTION_START)
&& (type < MENU_SETTINGS_CHEEVOS_START))
{
Expand Down Expand Up @@ -9997,6 +10143,14 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
break;
case FILE_TYPE_IN_CARCHIVE:
case FILE_TYPE_PLAIN:
#ifdef HAVE_PATCH
if (string_is_equal(menu_label, MENU_LABEL_PATCHES_ADD_LIST))
{
BIND_ACTION_OK(cbs, action_ok_patch_add_candidate);
break;
}
#endif

if (filebrowser_get_type() == FILEBROWSER_SCAN_FILE)
{
#ifdef HAVE_LIBRETRODB
Expand Down Expand Up @@ -10130,6 +10284,23 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
case MENU_SETTING_ACTION_CONTENTLESS_CORE_RUN:
BIND_ACTION_OK(cbs, action_ok_contentless_core_run);
break;
#ifdef HAVE_PATCH
case MENU_SETTING_ACTION_PATCHES:
BIND_ACTION_OK(cbs, action_ok_patch_menu);
break;
case MENU_SETTING_ACTION_PATCH_ADD:
BIND_ACTION_OK(cbs, action_ok_patch_add_menu);
break;
case MENU_SETTING_ACTION_PATCH_MOVE_UP:
BIND_ACTION_OK(cbs, action_ok_patch_move_up);
break;
case MENU_SETTING_ACTION_PATCH_MOVE_DOWN:
BIND_ACTION_OK(cbs, action_ok_patch_move_down);
break;
case MENU_SETTING_ACTION_PATCH_REMOVE:
BIND_ACTION_OK(cbs, action_ok_patch_remove);
break;
#endif
default:
return -1;
}
Expand Down
8 changes: 8 additions & 0 deletions menu/cbs/menu_cbs_sublabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_netplay_refresh_lan,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_rename_entry, MENU_ENUM_SUBLABEL_RENAME_ENTRY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_delete_entry, MENU_ENUM_SUBLABEL_DELETE_ENTRY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_information, MENU_ENUM_SUBLABEL_INFORMATION)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_patches, MENU_ENUM_SUBLABEL_PATCHES)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_run, MENU_ENUM_SUBLABEL_RUN)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_add_to_favorites, MENU_ENUM_SUBLABEL_ADD_TO_FAVORITES)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_add_to_playlist, MENU_ENUM_SUBLABEL_ADD_TO_PLAYLIST)
Expand Down Expand Up @@ -1100,6 +1101,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_use_builtin_media_player,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_use_builtin_image_viewer, MENU_ENUM_SUBLABEL_USE_BUILTIN_IMAGE_VIEWER)
DEFAULT_SUBLABEL_MACRO(action_bind_dynamic_wallpapers_directory, MENU_ENUM_SUBLABEL_DYNAMIC_WALLPAPERS_DIRECTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_thumbnails_directory, MENU_ENUM_SUBLABEL_THUMBNAILS_DIRECTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_patches_directory, MENU_ENUM_SUBLABEL_PATCHES_DIRECTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_rgui_config_directory, MENU_ENUM_SUBLABEL_RGUI_CONFIG_DIRECTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_latency_frames, MENU_ENUM_SUBLABEL_NETPLAY_INPUT_LATENCY_FRAMES_MIN)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_latency_frames_range, MENU_ENUM_SUBLABEL_NETPLAY_INPUT_LATENCY_FRAMES_RANGE)
Expand Down Expand Up @@ -3347,6 +3349,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_THUMBNAILS_DIRECTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_thumbnails_directory);
break;
case MENU_ENUM_LABEL_PATCHES_DIRECTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_patches_directory);
break;
case MENU_ENUM_LABEL_DYNAMIC_WALLPAPERS_DIRECTORY:
BIND_ACTION_SUBLABEL(cbs, action_bind_dynamic_wallpapers_directory);
break;
Expand Down Expand Up @@ -3591,6 +3596,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_INFORMATION:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_information);
break;
case MENU_ENUM_LABEL_PATCHES:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_patches);
break;
case MENU_ENUM_LABEL_RENAME_ENTRY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_rename_entry);
break;
Expand Down
1 change: 1 addition & 0 deletions menu/drivers/materialui.c
Original file line number Diff line number Diff line change
Expand Up @@ -11685,6 +11685,7 @@ static void materialui_list_insert(void *userdata,
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_GAME))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_QUICK_MENU_OVERRIDE_OPTIONS))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_PATCHES))
|| string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETWORK_ON_DEMAND_THUMBNAILS))
)
{
Expand Down
1 change: 1 addition & 0 deletions menu/drivers/ozone.c
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,7 @@ static uintptr_t ozone_entries_icon_get_texture(
case MENU_ENUM_LABEL_CONTENT_SHOW_REWIND:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_REWIND];
case MENU_ENUM_LABEL_QUICK_MENU_OVERRIDE_OPTIONS:
case MENU_ENUM_LABEL_PATCHES:
case MENU_ENUM_LABEL_DEFERRED_QUICK_MENU_OVERRIDE_OPTIONS:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_CORE_OVERRIDES:
case MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_CONTENT_DIR_OVERRIDES:
Expand Down
Loading
Loading