diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c
index bde19d16c1..638e479d2e 100644
--- a/menu/cbs/menu_cbs_ok.c
+++ b/menu/cbs/menu_cbs_ok.c
@@ -24,6 +24,7 @@
#include "../menu_shader.h"
#include "../menu_navigation.h"
#include "../menu_hash.h"
+#include "../menu_content.h"
#include "../../core_info.h"
#include "../../defaults.h"
@@ -415,7 +416,7 @@ static int rarch_defer_core_wrapper(size_t idx, size_t entry_idx, const char *pa
runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_LIST_GET, &list);
- ret = rarch_defer_core(list,
+ ret = menu_content_defer_core(list,
menu_path_new, path, menu_label, menu->deferred_path,
sizeof(menu->deferred_path));
@@ -1844,7 +1845,7 @@ static int action_ok_load_archive_detect_core(const char *path,
runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_LIST_GET, &list);
- ret = rarch_defer_core(list, menu_path, content_path, label,
+ ret = menu_content_defer_core(list, menu_path, content_path, label,
menu->deferred_path, sizeof(menu->deferred_path));
fill_pathname_join(detect_content_path, menu_path, content_path,
diff --git a/menu/menu_content.c b/menu/menu_content.c
index b989cfef8d..a97dea2527 100644
--- a/menu/menu_content.c
+++ b/menu/menu_content.c
@@ -13,13 +13,16 @@
* If not, see .
*/
+#include
#include
#include "menu_content.h"
#include "menu_driver.h"
#include "menu_display.h"
+#include "menu_hash.h"
#include "menu_shader.h"
+#include "../core_info.h"
#include "../configuration.h"
#include "../defaults.h"
#include "../frontend/frontend.h"
@@ -133,3 +136,72 @@ bool menu_content_load(void)
return true;
}
+
+/**
+ * menu_content_defer_core:
+ * @core_info : Core info list handle.
+ * @dir : Directory. Gets joined with @path.
+ * @path : Path. Gets joined with @dir.
+ * @menu_label : Label identifier of menu setting.
+ * @s : Deferred core path. Will be filled in
+ * by function.
+ * @len : Size of @s.
+ *
+ * Gets deferred core.
+ *
+ * Returns: 0 if there are multiple deferred cores and a
+ * selection needs to be made from a list, otherwise
+ * returns -1 and fills in @s with path to core.
+ **/
+int menu_content_defer_core(void *data, const char *dir,
+ const char *path, const char *menu_label,
+ char *s, size_t len)
+{
+ char new_core_path[PATH_MAX_LENGTH];
+ const core_info_t *info = NULL;
+ size_t supported = 0;
+ core_info_list_t *core_info = (core_info_list_t*)data;
+ uint32_t menu_label_hash = menu_hash_calculate(menu_label);
+
+ fill_pathname_join(s, dir, path, len);
+
+#ifdef HAVE_COMPRESSION
+ if (path_is_compressed_file(dir))
+ {
+ /* In case of a compressed archive, we have to join with a hash */
+ /* We are going to write at the position of dir: */
+ retro_assert(strlen(dir) < strlen(s));
+ s[strlen(dir)] = '#';
+ }
+#endif
+
+ if (core_info)
+ core_info_list_get_supported_cores(core_info, s, &info,
+ &supported);
+
+ /* We started the menu with 'Load Content', we are
+ * going to use the current core to load this. */
+ if (menu_label_hash == MENU_LABEL_LOAD_CONTENT)
+ {
+ runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_GET, (void*)&info);
+ if (info)
+ {
+ RARCH_LOG("Use the current core (%s) to load this content...\n", info->path);
+ supported = 1;
+ }
+ }
+
+ /* There are multiple deferred cores and a
+ * selection needs to be made from a list, return 0. */
+ if (supported != 1)
+ return 0;
+
+ if (info)
+ strlcpy(new_core_path, info->path, sizeof(new_core_path));
+
+ runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, s);
+
+ if (path_file_exists(new_core_path))
+ runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, new_core_path);
+ return -1;
+}
diff --git a/menu/menu_content.h b/menu/menu_content.h
index d1e89b7170..e7aa6275e7 100644
--- a/menu/menu_content.h
+++ b/menu/menu_content.h
@@ -35,6 +35,27 @@ extern "C" {
**/
bool menu_content_load(void);
+/**
+ * menu_content_defer_core:
+ * @core_info : Core info list handle.
+ * @dir : Directory. Gets joined with @path.
+ * @path : Path. Gets joined with @dir.
+ * @menu_label : Label identifier of menu setting.
+ * @s : Deferred core path. Will be filled in
+ * by function.
+ * @len : Size of @s.
+ *
+ * Gets deferred core.
+ *
+ * Returns: 0 if there are multiple deferred cores and a
+ * selection needs to be made from a list, otherwise
+ * returns -1 and fills in @s with path to core.
+ **/
+int menu_content_defer_core(void *data,
+ const char *dir, const char *path,
+ const char *menu_label,
+ char *s, size_t len);
+
#ifdef __cplusplus
}
#endif
diff --git a/retroarch.c b/retroarch.c
index 3558ce6c49..8049f5e459 100644
--- a/retroarch.c
+++ b/retroarch.c
@@ -1586,78 +1586,6 @@ void rarch_playlist_load_content(void *data, unsigned idx)
event_cmd_ctl(EVENT_CMD_LOAD_CORE, NULL);
}
-/**
- * rarch_defer_core:
- * @core_info : Core info list handle.
- * @dir : Directory. Gets joined with @path.
- * @path : Path. Gets joined with @dir.
- * @menu_label : Label identifier of menu setting.
- * @s : Deferred core path. Will be filled in
- * by function.
- * @len : Size of @s.
- *
- * Gets deferred core.
- *
- * Returns: 0 if there are multiple deferred cores and a
- * selection needs to be made from a list, otherwise
- * returns -1 and fills in @s with path to core.
- **/
-int rarch_defer_core(void *data, const char *dir,
- const char *path, const char *menu_label,
- char *s, size_t len)
-{
- char new_core_path[PATH_MAX_LENGTH];
- const core_info_t *info = NULL;
- size_t supported = 0;
- core_info_list_t *core_info = (core_info_list_t*)data;
-#ifdef HAVE_MENU
- uint32_t menu_label_hash = msg_hash_calculate(menu_label);
-#endif
-
- fill_pathname_join(s, dir, path, len);
-
-#ifdef HAVE_COMPRESSION
- if (path_is_compressed_file(dir))
- {
- /* In case of a compressed archive, we have to join with a hash */
- /* We are going to write at the position of dir: */
- retro_assert(strlen(dir) < strlen(s));
- s[strlen(dir)] = '#';
- }
-#endif
-
- if (core_info)
- core_info_list_get_supported_cores(core_info, s, &info,
- &supported);
-
-#ifdef HAVE_MENU
- /* We started the menu with 'Load Content', we are
- * going to use the current core to load this. */
- if (menu_label_hash == MENU_LABEL_LOAD_CONTENT)
- {
- runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_GET, (void*)&info);
- if (info)
- {
- RARCH_LOG("Use the current core (%s) to load this content...\n", info->path);
- supported = 1;
- }
- }
-#endif
- /* There are multiple deferred cores and a
- * selection needs to be made from a list, return 0. */
- if (supported != 1)
- return 0;
-
- if (info)
- strlcpy(new_core_path, info->path, sizeof(new_core_path));
-
- runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, s);
-
- if (path_file_exists(new_core_path))
- runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, new_core_path);
- return -1;
-}
-
int rarch_info_get_capabilities(enum rarch_capabilities type, char *s, size_t len)
{
switch (type)
diff --git a/retroarch.h b/retroarch.h
index cc0a27a5c8..4adfba6b3e 100644
--- a/retroarch.h
+++ b/retroarch.h
@@ -208,27 +208,6 @@ void rarch_main_deinit(void);
**/
void rarch_playlist_load_content(void *data, unsigned index);
-/**
- * rarch_defer_core:
- * @core_info : Core info list handle.
- * @dir : Directory. Gets joined with @path.
- * @path : Path. Gets joined with @dir.
- * @menu_label : Label identifier of menu setting.
- * @s : Deferred core path. Will be filled in
- * by function.
- * @len : Size of @s.
- *
- * Gets deferred core.
- *
- * Returns: 0 if there are multiple deferred cores and a
- * selection needs to be made from a list, otherwise
- * returns -1 and fills in @s with path to core.
- **/
-int rarch_defer_core(void *data,
- const char *dir, const char *path,
- const char *menu_label,
- char *s, size_t len);
-
void rarch_set_paths(const char *path);
int rarch_info_get_capabilities(enum rarch_capabilities type, char *s, size_t len);