Add 'Start Core' option

This commit is contained in:
twinaphex 2016-01-24 01:51:05 +01:00
parent 5cd12a106e
commit 1745e71088
5 changed files with 35 additions and 0 deletions

View File

@ -1741,6 +1741,15 @@ static int action_ok_rpl_entry(const char *path,
entry_idx, ACTION_OK_DL_RPL_ENTRY);
}
static int action_ok_start_core(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
event_cmd_ctl(EVENT_CMD_LOAD_CORE, NULL);
if (rarch_task_push_content_load_default(
NULL, NULL, false, CORE_TYPE_PLAIN, NULL, NULL))
action_ok_push_quick_menu();
return 0;
}
static int action_ok_open_archive_detect_core(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
@ -1979,6 +1988,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
switch (hash)
{
case MENU_LABEL_START_CORE:
BIND_ACTION_OK(cbs, action_ok_start_core);
break;
case MENU_LABEL_OPEN_ARCHIVE_DETECT_CORE:
BIND_ACTION_OK(cbs, action_ok_open_archive_detect_core);
break;

View File

@ -1324,9 +1324,14 @@ static int mui_list_push(void *data, void *userdata,
case DISPLAYLIST_MAIN_MENU:
menu_entries_clear(info->list);
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_START_CORE), PARSE_ACTION, false);
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_CONTENT_SETTINGS), PARSE_ACTION, false);
}
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
menu_displaylist_parse_settings(menu, info,

View File

@ -43,6 +43,7 @@
#include "../../verbosity.h"
#include "../../configuration.h"
#include "../../file_ext.h"
#include "../../system.h"
#include "../../tasks/tasks.h"
@ -2567,9 +2568,14 @@ static int xmb_list_push(void *data, void *userdata, menu_displaylist_info_t *in
case DISPLAYLIST_MAIN_MENU:
menu_entries_clear(info->list);
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_START_CORE), PARSE_ACTION, false);
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_CONTENT_SETTINGS), PARSE_ACTION, false);
}
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
menu_displaylist_parse_settings(menu, info,

View File

@ -2597,6 +2597,10 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
info->need_push = true;
break;
case DISPLAYLIST_MAIN_MENU:
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_START_CORE), PARSE_ACTION, false);
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_CONTENT_SETTINGS), PARSE_ACTION, false);

View File

@ -3265,6 +3265,14 @@ static bool setting_append_list_main_menu_options(
general_read_handler);
menu_settings_list_current_add_range(list, list_info, -1, 0, 1, true, false);
CONFIG_ACTION(
list, list_info,
menu_hash_to_str(MENU_LABEL_START_CORE),
menu_hash_to_str(MENU_LABEL_VALUE_START_CORE),
&group_info,
&subgroup_info,
parent_group);
CONFIG_ACTION(
list, list_info,
menu_hash_to_str(MENU_LABEL_CONTENT_SETTINGS),