/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see .
*/
#include
#include
#include
#include
#include
#include
#include "menu_common_backend.h"
#include "../menu_navigation.h"
#include "../menu_input_line_cb.h"
#include "../../../gfx/gfx_common.h"
#include "../../../gfx/shader_common.h"
#include "../../../driver.h"
#include "../../../file_ext.h"
#include "../../../input/input_common.h"
#include "../../../config.def.h"
#include "../../../input/keyboard_line.h"
#include "../../../settings_data.h"
#ifdef HAVE_CONFIG_H
#include "../../../config.h"
#endif
#if defined(__CELLOS_LV2__)
#include
#if (CELL_SDK_VERSION > 0x340000)
#include
#endif
#endif
#ifdef HAVE_SHADER_MANAGER
static inline struct gfx_shader *shader_manager_get_current_shader(menu_handle_t *menu, unsigned type)
{
struct gfx_shader *shader = NULL;
if (type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS)
shader = menu->shader;
if (!shader && driver.video_poke && driver.video_data && driver.video_poke->get_current_shader)
shader = driver.video_poke->get_current_shader(driver.video_data);
return shader;
}
#endif
static void menu_common_entries_init(menu_handle_t *menu, unsigned menu_type)
{
unsigned i;
char tmp[256];
rarch_setting_t *current_setting = NULL;
rarch_setting_t *setting_data = (rarch_setting_t *)setting_data_get_list();
(void)current_setting;
switch (menu_type)
{
#ifdef HAVE_SHADER_MANAGER
case MENU_SETTINGS_SHADER_PARAMETERS:
case MENU_SETTINGS_SHADER_PRESET_PARAMETERS:
{
file_list_clear(menu->selection_buf);
struct gfx_shader *shader = (struct gfx_shader*)shader_manager_get_current_shader(menu, menu_type);
if (shader)
for (i = 0; i < shader->num_parameters; i++)
file_list_push(menu->selection_buf, shader->parameters[i].desc, "", MENU_SETTINGS_SHADER_PARAMETER_0 + i, 0);
menu->parameter_shader = shader;
break;
}
case MENU_SETTINGS_SHADER_OPTIONS:
{
struct gfx_shader *shader = (struct gfx_shader*)menu->shader;
if (!shader)
return;
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "Apply Shader Changes", "",
MENU_SETTINGS_SHADER_APPLY, 0);
file_list_push(menu->selection_buf, "Default Filter", "", MENU_SETTINGS_SHADER_FILTER, 0);
file_list_push(menu->selection_buf, "Load Shader Preset", "",
MENU_SETTINGS_SHADER_PRESET, 0);
file_list_push(menu->selection_buf, "Save As Shader Preset", "",
MENU_SETTINGS_SHADER_PRESET_SAVE, 0);
file_list_push(menu->selection_buf, "Parameters (Current)", "",
MENU_SETTINGS_SHADER_PARAMETERS, 0);
file_list_push(menu->selection_buf, "Parameters (Menu)", "",
MENU_SETTINGS_SHADER_PRESET_PARAMETERS, 0);
file_list_push(menu->selection_buf, "Shader Passes", "",
MENU_SETTINGS_SHADER_PASSES, 0);
for (i = 0; i < shader->passes; i++)
{
char buf[64];
snprintf(buf, sizeof(buf), "Shader #%u", i);
file_list_push(menu->selection_buf, buf, "",
MENU_SETTINGS_SHADER_0 + 3 * i, 0);
snprintf(buf, sizeof(buf), "Shader #%u Filter", i);
file_list_push(menu->selection_buf, buf, "",
MENU_SETTINGS_SHADER_0_FILTER + 3 * i, 0);
snprintf(buf, sizeof(buf), "Shader #%u Scale", i);
file_list_push(menu->selection_buf, buf, "",
MENU_SETTINGS_SHADER_0_SCALE + 3 * i, 0);
}
}
break;
#endif
case MENU_SETTINGS_GENERAL_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "libretro_log_level", MENU_SETTINGS_LIBRETRO_LOG_LEVEL, 0);
file_list_push(menu->selection_buf, "", "log_verbosity", MENU_SETTINGS_LOGGING_VERBOSITY, 0);
file_list_push(menu->selection_buf, "", "perfcnt_enable", MENU_SETTINGS_PERFORMANCE_COUNTERS_ENABLE, 0);
file_list_push(menu->selection_buf, "", "game_history_size", MENU_CONTENT_HISTORY_SIZE, 0);
file_list_push(menu->selection_buf, "", "config_save_on_exit", MENU_SETTINGS_CONFIG_SAVE_ON_EXIT, 0);
file_list_push(menu->selection_buf, "", "core_specific_config", MENU_SETTINGS_PER_CORE_CONFIG, 0);
file_list_push(menu->selection_buf, "", "video_gpu_screenshot", MENU_SETTINGS_GPU_SCREENSHOT, 0);
file_list_push(menu->selection_buf, "", "dummy_on_core_shutdown", MENU_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN, 0);
file_list_push(menu->selection_buf, "", "fps_show", MENU_SETTINGS_DEBUG_TEXT, 0);
file_list_push(menu->selection_buf, "", "fastforward_ratio", MENU_SETTINGS_FASTFORWARD_RATIO, 0);
file_list_push(menu->selection_buf, "", "slowmotion_ratio", MENU_SETTINGS_SLOWMOTION_RATIO, 0);
file_list_push(menu->selection_buf, "", "rewind_enable", MENU_SETTINGS_REWIND_ENABLE, 0);
file_list_push(menu->selection_buf, "", "rewind_granularity", MENU_SETTINGS_REWIND_GRANULARITY, 0);
file_list_push(menu->selection_buf, "", "block_sram_overwrite", MENU_SETTINGS_BLOCK_SRAM_OVERWRITE, 0);
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "autosave_interval")))
file_list_push(menu->selection_buf, "", "autosave_interval", MENU_SETTINGS_SRAM_AUTOSAVE, 0);
file_list_push(menu->selection_buf, "", "video_disable_composition", MENU_SETTINGS_WINDOW_COMPOSITING_ENABLE, 0);
file_list_push(menu->selection_buf, "", "pause_nonactive", MENU_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST, 0);
file_list_push(menu->selection_buf, "", "savestate_auto_save", MENU_SETTINGS_SAVESTATE_AUTO_SAVE, 0);
file_list_push(menu->selection_buf, "", "savestate_auto_load", MENU_SETTINGS_SAVESTATE_AUTO_LOAD, 0);
break;
case MENU_SETTINGS_VIDEO_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "video_shared_context", MENU_SETTINGS_VIDEO_HW_SHARED_CONTEXT, 0);
#if defined(GEKKO) || defined(__CELLOS_LV2__)
file_list_push(menu->selection_buf, "Screen Resolution", "", MENU_SETTINGS_VIDEO_RESOLUTION, 0);
#endif
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_viwidth")))
file_list_push(menu->selection_buf, "", "video_viwidth", MENU_SETTINGS_VIDEO_VIWIDTH, 0);
file_list_push(menu->selection_buf, "", "video_filter", MENU_SETTINGS_VIDEO_SOFTFILTER, 0);
#if defined(__CELLOS_LV2__)
file_list_push(menu->selection_buf, "PAL60 Mode", "", MENU_SETTINGS_VIDEO_PAL60, 0);
#endif
file_list_push(menu->selection_buf, "", "video_smooth", MENU_SETTINGS_VIDEO_FILTER, 0);
#ifdef HW_RVL
file_list_push(menu->selection_buf, "VI Trap filtering", "", MENU_SETTINGS_VIDEO_SOFT_FILTER, 0);
#endif
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_gamma")))
file_list_push(menu->selection_buf, "", "video_gamma", MENU_SETTINGS_VIDEO_GAMMA, 0);
#ifdef _XBOX1
file_list_push(menu->selection_buf, "Soft filtering", "", MENU_SETTINGS_SOFT_DISPLAY_FILTER, 0);
#endif
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_filter_flicker")))
file_list_push(menu->selection_buf, "", "video_filter_flicker", MENU_SETTINGS_FLICKER_FILTER, 0);
file_list_push(menu->selection_buf, "", "video_scale_integer", MENU_SETTINGS_VIDEO_INTEGER_SCALE, 0);
file_list_push(menu->selection_buf, "", "aspect_ratio_index", MENU_SETTINGS_VIDEO_ASPECT_RATIO, 0);
file_list_push(menu->selection_buf, "Custom Ratio", "", MENU_SETTINGS_CUSTOM_VIEWPORT, 0);
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_fullscreen")))
file_list_push(menu->selection_buf, "", "video_fullscreen", MENU_SETTINGS_TOGGLE_FULLSCREEN, 0);
file_list_push(menu->selection_buf, "", "video_rotation", MENU_SETTINGS_VIDEO_ROTATION, 0);
file_list_push(menu->selection_buf, "", "video_vsync", MENU_SETTINGS_VIDEO_VSYNC, 0);
file_list_push(menu->selection_buf, "", "video_hard_sync", MENU_SETTINGS_VIDEO_HARD_SYNC, 0);
file_list_push(menu->selection_buf, "", "video_hard_sync_frames", MENU_SETTINGS_VIDEO_HARD_SYNC_FRAMES, 0);
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_black_frame_insertion")))
file_list_push(menu->selection_buf, "", "video_black_frame_insertion", MENU_SETTINGS_VIDEO_BLACK_FRAME_INSERTION, 0);
file_list_push(menu->selection_buf, "", "video_swap_interval", MENU_SETTINGS_VIDEO_SWAP_INTERVAL, 0);
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_threaded")))
file_list_push(menu->selection_buf, "", "video_threaded", MENU_SETTINGS_VIDEO_THREADED, 0);
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_scale")))
file_list_push(menu->selection_buf, "", "video_scale", MENU_SETTINGS_VIDEO_WINDOW_SCALE, 0);
file_list_push(menu->selection_buf, "", "video_crop_overscan", MENU_SETTINGS_VIDEO_CROP_OVERSCAN, 0);
file_list_push(menu->selection_buf, "", "video_monitor_index", MENU_SETTINGS_VIDEO_MONITOR_INDEX, 0);
file_list_push(menu->selection_buf, "", "video_refresh_rate", MENU_SETTINGS_VIDEO_REFRESH_RATE, 0);
file_list_push(menu->selection_buf, "Estimated Refresh Rate", "", MENU_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0);
break;
case MENU_SETTINGS_FONT_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "video_font_enable", MENU_SETTINGS_FONT_ENABLE, 0);
file_list_push(menu->selection_buf, "", "video_font_size", MENU_SETTINGS_FONT_SIZE, 0);
break;
case MENU_SETTINGS_CORE_OPTIONS:
file_list_clear(menu->selection_buf);
if (g_extern.system.core_options)
{
size_t i, opts;
opts = core_option_size(g_extern.system.core_options);
for (i = 0; i < opts; i++)
file_list_push(menu->selection_buf,
core_option_get_desc(g_extern.system.core_options, i), "", MENU_SETTINGS_CORE_OPTION_START + i, 0);
}
else
file_list_push(menu->selection_buf, "No options available.", "", MENU_SETTINGS_CORE_OPTION_NONE, 0);
break;
case MENU_SETTINGS_CORE_INFO:
{
core_info_t *info = (core_info_t*)menu->core_info_current;
file_list_clear(menu->selection_buf);
if (info->data)
{
snprintf(tmp, sizeof(tmp), "Core name: %s",
info->display_name ? info->display_name : "");
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
if (info->authors_list)
{
strlcpy(tmp, "Authors: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), info->authors_list, ", ");
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
}
if (info->permissions_list)
{
strlcpy(tmp, "Permissions: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), info->permissions_list, ", ");
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
}
if (info->supported_extensions_list)
{
strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), info->supported_extensions_list, ", ");
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
}
if (info->firmware_count > 0)
{
core_info_list_update_missing_firmware(menu->core_info, info->path,
g_settings.system_directory);
file_list_push(menu->selection_buf, "Firmware: ", "", MENU_SETTINGS_CORE_INFO_NONE, 0);
for (i = 0; i < info->firmware_count; i++)
{
if (info->firmware[i].desc)
{
snprintf(tmp, sizeof(tmp), " name: %s",
info->firmware[i].desc ? info->firmware[i].desc : "");
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
snprintf(tmp, sizeof(tmp), " status: %s, %s",
info->firmware[i].missing ? "missing" : "present",
info->firmware[i].optional ? "optional" : "required");
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
}
}
}
if (info->notes)
{
snprintf(tmp, sizeof(tmp), "Core notes: ");
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
for (i = 0; i < info->note_list->size; i++)
{
snprintf(tmp, sizeof(tmp), " %s", info->note_list->elems[i].data);
file_list_push(menu->selection_buf, tmp, "", MENU_SETTINGS_CORE_INFO_NONE, 0);
}
}
}
else
file_list_push(menu->selection_buf, "No information available.", "", MENU_SETTINGS_CORE_OPTION_NONE, 0);
}
break;
case MENU_SETTINGS_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "Driver Options", "", MENU_SETTINGS_DRIVERS, 0);
file_list_push(menu->selection_buf, "General Options", "", MENU_SETTINGS_GENERAL_OPTIONS, 0);
file_list_push(menu->selection_buf, "Video Options", "", MENU_SETTINGS_VIDEO_OPTIONS, 0);
#ifdef HAVE_SHADER_MANAGER
file_list_push(menu->selection_buf, "Shader Options", "", MENU_SETTINGS_SHADER_OPTIONS, 0);
#endif
file_list_push(menu->selection_buf, "Font Options", "", MENU_SETTINGS_FONT_OPTIONS, 0);
file_list_push(menu->selection_buf, "Audio Options", "", MENU_SETTINGS_AUDIO_OPTIONS, 0);
file_list_push(menu->selection_buf, "Input Options", "", MENU_SETTINGS_INPUT_OPTIONS, 0);
#ifdef HAVE_OVERLAY
file_list_push(menu->selection_buf, "Overlay Options", "", MENU_SETTINGS_OVERLAY_OPTIONS, 0);
#endif
file_list_push(menu->selection_buf, "User Options", "", MENU_SETTINGS_USER_OPTIONS, 0);
#ifdef HAVE_NETPLAY
file_list_push(menu->selection_buf, "Netplay Options", "", MENU_SETTINGS_NETPLAY_OPTIONS, 0);
#endif
file_list_push(menu->selection_buf, "Path Options", "", MENU_SETTINGS_PATH_OPTIONS, 0);
if (g_extern.main_is_init && !g_extern.libretro_dummy)
{
if (g_extern.system.disk_control.get_num_images)
file_list_push(menu->selection_buf, "Disk Options", "", MENU_SETTINGS_DISK_OPTIONS, 0);
}
file_list_push(menu->selection_buf, "Privacy Options", "", MENU_SETTINGS_PRIVACY_OPTIONS, 0);
break;
case MENU_SETTINGS_PRIVACY_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "camera_allow", MENU_SETTINGS_PRIVACY_CAMERA_ALLOW, 0);
file_list_push(menu->selection_buf, "", "location_allow", MENU_SETTINGS_PRIVACY_LOCATION_ALLOW, 0);
break;
case MENU_SETTINGS_DISK_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "Disk Index", "", MENU_SETTINGS_DISK_INDEX, 0);
file_list_push(menu->selection_buf, "Disk Image Append", "", MENU_SETTINGS_DISK_APPEND, 0);
break;
case MENU_SETTINGS_OVERLAY_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "input_overlay", MENU_SETTINGS_OVERLAY_PRESET, 0);
file_list_push(menu->selection_buf, "", "input_overlay_opacity", MENU_SETTINGS_OVERLAY_OPACITY, 0);
file_list_push(menu->selection_buf, "", "input_overlay_scale", MENU_SETTINGS_OVERLAY_SCALE, 0);
break;
case MENU_SETTINGS_USER_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "netplay_nickname", MENU_SETTINGS_NETPLAY_NICKNAME, 0);
file_list_push(menu->selection_buf, "", "user_language", MENU_SETTINGS_USER_LANGUAGE, 0);
break;
case MENU_SETTINGS_NETPLAY_OPTIONS:
file_list_clear(menu->selection_buf);
#ifdef HAVE_NETPLAY
file_list_push(menu->selection_buf, "", "netplay_enable", MENU_SETTINGS_NETPLAY_ENABLE, 0);
file_list_push(menu->selection_buf, "", "netplay_mode", MENU_SETTINGS_NETPLAY_MODE, 0);
file_list_push(menu->selection_buf, "", "netplay_spectator_mode_enable", MENU_SETTINGS_NETPLAY_SPECTATOR_MODE_ENABLE, 0);
file_list_push(menu->selection_buf, "Host IP Address", "", MENU_SETTINGS_NETPLAY_HOST_IP_ADDRESS, 0);
file_list_push(menu->selection_buf, "TCP/UDP Port", "", MENU_SETTINGS_NETPLAY_TCP_UDP_PORT, 0);
file_list_push(menu->selection_buf, "", "netplay_delay_frames", MENU_SETTINGS_NETPLAY_DELAY_FRAMES, 0);
#endif
break;
case MENU_SETTINGS_PATH_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "rgui_browser_directory", MENU_BROWSER_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "content_directory", MENU_CONTENT_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "assets_directory", MENU_ASSETS_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "rgui_config_directory", MENU_CONFIG_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "libretro_dir_path", MENU_LIBRETRO_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "libretro_info_path", MENU_LIBRETRO_INFO_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "game_history_path", MENU_CONTENT_HISTORY_PATH, 0);
file_list_push(menu->selection_buf, "", "video_filter_dir", MENU_FILTER_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "audio_filter_dir", MENU_DSP_FILTER_DIR_PATH, 0);
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "video_shader_dir")))
file_list_push(menu->selection_buf, "", "video_shader_dir", MENU_SHADER_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "savestate_directory", MENU_SAVESTATE_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "savefile_directory", MENU_SAVEFILE_DIR_PATH, 0);
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "overlay_directory")))
file_list_push(menu->selection_buf, "", "overlay_directory", MENU_OVERLAY_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "system_directory", MENU_SYSTEM_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "screenshot_directory", MENU_SCREENSHOT_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "joypad_autoconfig_dir", MENU_AUTOCONFIG_DIR_PATH, 0);
file_list_push(menu->selection_buf, "", "extraction_directory", MENU_EXTRACTION_DIR_PATH, 0);
break;
case MENU_SETTINGS_INPUT_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "Player", "", MENU_SETTINGS_BIND_PLAYER, 0);
file_list_push(menu->selection_buf, "Device", "", MENU_SETTINGS_BIND_DEVICE, 0);
file_list_push(menu->selection_buf, "Device Type", "", MENU_SETTINGS_BIND_DEVICE_TYPE, 0);
file_list_push(menu->selection_buf, "Analog D-pad Mode", "", MENU_SETTINGS_BIND_ANALOG_MODE, 0);
file_list_push(menu->selection_buf, "", "input_axis_threshold", MENU_SETTINGS_INPUT_AXIS_THRESHOLD, 0);
file_list_push(menu->selection_buf, "", "input_autodetect_enable", MENU_SETTINGS_DEVICE_AUTODETECT_ENABLE, 0);
file_list_push(menu->selection_buf, "Bind Mode", "", MENU_SETTINGS_CUSTOM_BIND_MODE, 0);
file_list_push(menu->selection_buf, "Configure All (RetroPad)", "", MENU_SETTINGS_CUSTOM_BIND_ALL, 0);
file_list_push(menu->selection_buf, "Default All (RetroPad)", "", MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, 0);
file_list_push(menu->selection_buf, "", "osk_enable", MENU_SETTINGS_ONSCREEN_KEYBOARD_ENABLE, 0);
for (i = MENU_SETTINGS_BIND_BEGIN; i <= MENU_SETTINGS_BIND_ALL_LAST; i++)
file_list_push(menu->selection_buf, input_config_bind_map[i - MENU_SETTINGS_BIND_BEGIN].desc, "", i, 0);
break;
case MENU_SETTINGS_AUDIO_OPTIONS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "", "audio_dsp_plugin", MENU_SETTINGS_AUDIO_DSP_FILTER, 0);
file_list_push(menu->selection_buf, "", "audio_enable", MENU_SETTINGS_AUDIO_ENABLE, 0);
file_list_push(menu->selection_buf, "", "audio_mute", MENU_SETTINGS_AUDIO_MUTE, 0);
file_list_push(menu->selection_buf, "", "audio_latency", MENU_SETTINGS_AUDIO_LATENCY, 0);
file_list_push(menu->selection_buf, "", "audio_sync", MENU_SETTINGS_AUDIO_SYNC, 0);
file_list_push(menu->selection_buf, "", "audio_rate_control_delta", MENU_SETTINGS_AUDIO_CONTROL_RATE_DELTA, 0);
#ifdef __CELLOS_LV2__
file_list_push(menu->selection_buf, "System BGM Control", "", MENU_SETTINGS_CUSTOM_BGM_CONTROL_ENABLE, 0);
#endif
file_list_push(menu->selection_buf, "", "audio_volume", MENU_SETTINGS_AUDIO_VOLUME, 0);
file_list_push(menu->selection_buf, "", "audio_device", MENU_SETTINGS_DRIVER_AUDIO_DEVICE, 0);
break;
case MENU_SETTINGS_DRIVERS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "Video Driver", "", MENU_SETTINGS_DRIVER_VIDEO, 0);
file_list_push(menu->selection_buf, "Audio Driver", "", MENU_SETTINGS_DRIVER_AUDIO, 0);
file_list_push(menu->selection_buf, "Audio Resampler", "", MENU_SETTINGS_DRIVER_AUDIO_RESAMPLER, 0);
file_list_push(menu->selection_buf, "Input Driver", "", MENU_SETTINGS_DRIVER_INPUT, 0);
file_list_push(menu->selection_buf, "Camera Driver", "", MENU_SETTINGS_DRIVER_CAMERA, 0);
file_list_push(menu->selection_buf, "Location Driver", "", MENU_SETTINGS_DRIVER_LOCATION, 0);
#ifdef HAVE_MENU
file_list_push(menu->selection_buf, "Menu Driver", "", MENU_SETTINGS_DRIVER_MENU, 0);
#endif
break;
case MENU_SETTINGS_PERFORMANCE_COUNTERS:
file_list_clear(menu->selection_buf);
file_list_push(menu->selection_buf, "Frontend Counters", "", MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND, 0);
file_list_push(menu->selection_buf, "Core Counters", "", MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO, 0);
break;
case MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO:
file_list_clear(menu->selection_buf);
{
const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_libretro;
unsigned num = perf_ptr_libretro;
if (!counters || num == 0)
break;
for (i = 0; i < num; i++)
if (counters[i] && counters[i]->ident)
file_list_push(menu->selection_buf, counters[i]->ident, "", MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN + i, 0);
}
break;
case MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND:
file_list_clear(menu->selection_buf);
{
const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_rarch;
unsigned num = perf_ptr_rarch;
if (!counters || num == 0)
break;
for (i = 0; i < num; i++)
if (counters[i] && counters[i]->ident)
file_list_push(menu->selection_buf, counters[i]->ident, "", MENU_SETTINGS_PERF_COUNTERS_BEGIN + i, 0);
}
break;
case MENU_SETTINGS:
file_list_clear(menu->selection_buf);
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
file_list_push(menu->selection_buf, "Core", "", MENU_SETTINGS_CORE, 0);
#endif
if (g_extern.history)
file_list_push(menu->selection_buf, "Load Content (History)", "", MENU_SETTINGS_OPEN_HISTORY, 0);
if (menu->core_info && core_info_list_num_info_files(menu->core_info))
file_list_push(menu->selection_buf, "Load Content (Detect Core)", "", MENU_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE, 0);
if (menu->info.library_name || g_extern.system.info.library_name)
{
char load_game_core_msg[64];
snprintf(load_game_core_msg, sizeof(load_game_core_msg), "Load Content (%s)",
menu->info.library_name ? menu->info.library_name : g_extern.system.info.library_name);
file_list_push(menu->selection_buf, load_game_core_msg, "", MENU_SETTINGS_OPEN_FILEBROWSER, 0);
}
file_list_push(menu->selection_buf, "Core Options", "", MENU_SETTINGS_CORE_OPTIONS, 0);
file_list_push(menu->selection_buf, "Core Information", "", MENU_SETTINGS_CORE_INFO, 0);
file_list_push(menu->selection_buf, "Settings", "", MENU_SETTINGS_OPTIONS, 0);
if (g_extern.perfcnt_enable)
file_list_push(menu->selection_buf, "", "perfcnt_enable", MENU_SETTINGS_PERFORMANCE_COUNTERS, 0);
if (g_extern.main_is_init && !g_extern.libretro_dummy)
{
file_list_push(menu->selection_buf, "Save State", "", MENU_SETTINGS_SAVESTATE_SAVE, 0);
file_list_push(menu->selection_buf, "Load State", "", MENU_SETTINGS_SAVESTATE_LOAD, 0);
file_list_push(menu->selection_buf, "Take Screenshot", "", MENU_SETTINGS_SCREENSHOT, 0);
file_list_push(menu->selection_buf, "Resume Content", "", MENU_SETTINGS_RESUME_GAME, 0);
file_list_push(menu->selection_buf, "Restart Content", "", MENU_SETTINGS_RESTART_GAME, 0);
}
#ifndef HAVE_DYNAMIC
file_list_push(menu->selection_buf, "Restart RetroArch", "", MENU_SETTINGS_RESTART_EMULATOR, 0);
#endif
file_list_push(menu->selection_buf, "RetroArch Config", "", MENU_SETTINGS_CONFIG, 0);
file_list_push(menu->selection_buf, "Save New Config", "", MENU_SETTINGS_SAVE_CONFIG, 0);
file_list_push(menu->selection_buf, "Help", "", MENU_START_SCREEN, 0);
file_list_push(menu->selection_buf, "Quit RetroArch", "", MENU_SETTINGS_QUIT_RARCH, 0);
break;
}
if (driver.menu_ctx && driver.menu_ctx->populate_entries)
driver.menu_ctx->populate_entries(menu, menu_type);
}
static int menu_info_screen_iterate(unsigned action, rarch_setting_t *setting)
{
char msg[PATH_MAX];
rarch_setting_t *current_setting;
rarch_setting_t *setting_data = (rarch_setting_t *)setting_data_get_list();
if (!driver.menu || !setting_data)
return 0;
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render();
current_setting = file_list_get_last_setting(driver.menu->selection_buf, driver.menu->selection_ptr);
if (current_setting)
setting_data_get_description(current_setting, msg, sizeof(msg));
else
{
switch (driver.menu->info_selection)
{
case MENU_SETTINGS_OPEN_FILEBROWSER:
snprintf(msg, sizeof(msg),
" -- Load Content. \n"
"Browse for content. \n"
" \n"
"To load content, you need a \n"
"libretro core to use, and a \n"
"content file. \n"
" \n"
"To control where the menu starts \n"
" to browse for content, set \n"
"Browser Directory. If not set, \n"
"it will start in root. \n"
" \n"
"The browser will filter out \n"
"extensions for the last core set \n"
"in 'Core', and use that core when \n"
"content is loaded."
);
break;
case MENU_SETTINGS_CORE:
snprintf(msg, sizeof(msg),
" -- Core Selection. \n"
" \n"
"Browse for a libretro core \n"
"implementation. Where the browser \n"
"starts depends on your Core Directory \n"
"path. If blank, it will start in root. \n"
" \n"
"If Core Directory is a directory, the menu \n"
"will use that as top folder. If Core \n"
"Directory is a full path, it will start \n"
"in the folder where the file is.");
break;
case MENU_SETTINGS_OPEN_HISTORY:
snprintf(msg, sizeof(msg),
" -- Loading content from history. \n"
" \n"
"As content is loaded, content and libretro \n"
"core combinations are saved to history. \n"
" \n"
"The history is saved to a file in the same \n"
"directory as the RetroArch config file. If \n"
"no config file was loaded in startup, history \n"
"will not be saved or loaded, and will not exist \n"
"in the main menu."
);
break;
case MENU_SETTINGS_SHADER_PRESET:
snprintf(msg, sizeof(msg),
" -- Load Shader Preset. \n"
" \n"
" Load a "
#ifdef HAVE_CG
"Cg"
#endif
#ifdef HAVE_GLSL
#ifdef HAVE_CG
"/"
#endif
"GLSL"
#endif
#ifdef HAVE_HLSL
#if defined(HAVE_CG) || defined(HAVE_HLSL)
"/"
#endif
"HLSL"
#endif
" preset directly. \n"
"The menu shader menu is updated accordingly. \n"
" \n"
"If the CGP uses scaling methods which are not \n"
"simple, (i.e. source scaling, same scaling \n"
"factor for X/Y), the scaling factor displayed \n"
"in the menu might not be correct."
);
break;
case MENU_SETTINGS_SHADER_APPLY:
snprintf(msg, sizeof(msg),
" -- Apply Shader Changes. \n"
" \n"
"After changing shader settings, use this to \n"
"apply changes. \n"
" \n"
"Changing shader settings is a somewhat \n"
"expensive operation so it has to be \n"
"done explicitly. \n"
" \n"
"When you apply shaders, the menu shader \n"
"settings are saved to a temporary file (either \n"
"menu.cgp or menu.glslp) and loaded. The file \n"
"persists after RetroArch exits. The file is \n"
"saved to Shader Directory."
);
break;
case MENU_SETTINGS_SHADER_PASSES:
snprintf(msg, sizeof(msg),
" -- Shader Passes. \n"
" \n"
"RetroArch allows you to mix and match various \n"
"shaders with arbitrary shader passes, with \n"
"custom hardware filters and scale factors. \n"
" \n"
"This option specifies the number of shader \n"
"passes to use. If you set this to 0, and use \n"
"Apply Shader Changes, you use a 'blank' shader. \n"
" \n"
"The Default Filter option will affect the \n"
"stretching filter.");
break;
case MENU_SETTINGS_BIND_DEVICE:
snprintf(msg, sizeof(msg),
" -- Input Device. \n"
" \n"
"Picks which gamepad to use for player N. \n"
"The name of the pad is available."
);
break;
case MENU_SETTINGS_BIND_DEVICE_TYPE:
snprintf(msg, sizeof(msg),
" -- Input Device Type. \n"
" \n"
"Picks which device type to use. This is \n"
"relevant for the libretro core itself."
);
break;
case MENU_SETTINGS_DRIVER_INPUT:
if (!strcmp(g_settings.input.driver, "udev"))
snprintf(msg, sizeof(msg),
" -- udev Input driver. \n"
" \n"
"This driver can run without X. \n"
" \n"
"It uses the recent evdev joypad API \n"
"for joystick support. It supports \n"
"hotplugging and force feedback (if \n"
"supported by device). \n"
" \n"
"The driver reads evdev events for keyboard \n"
"support. It also supports keyboard callback, \n"
"mice and touchpads. \n"
" \n"
"By default in most distros, /dev/input nodes \n"
"are root-only (mode 600). You can set up a udev \n"
"rule which makes these accessible to non-root."
);
else if (!strcmp(g_settings.input.driver, "linuxraw"))
snprintf(msg, sizeof(msg),
" -- linuxraw Input driver. \n"
" \n"
"This driver requires an active TTY. Keyboard \n"
"events are read directly from the TTY which \n"
"makes it simpler, but not as flexible as udev. \n"
"Mice, etc, are not supported at all. \n"
" \n"
"This driver uses the older joystick API \n"
"(/dev/input/js*).");
else
snprintf(msg, sizeof(msg),
" -- Input driver.\n"
" \n"
"Depending on video driver, it might \n"
"force a different input driver.");
break;
case MENU_SETTINGS_AUDIO_DSP_FILTER:
snprintf(msg, sizeof(msg),
" -- Audio DSP plugin.\n"
" Processes audio before it's sent to \n"
"the driver."
#ifndef HAVE_FILTERS_BUILTIN
" \n"
"Path to a dynamic library."
#endif
);
break;
case MENU_LIBRETRO_DIR_PATH:
snprintf(msg, sizeof(msg),
" -- Core Directory. \n"
" \n"
"A directory for where to search for \n"
"libretro core implementations.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_LEFT_X_PLUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_LEFT_X_MINUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_LEFT_Y_PLUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_LEFT_Y_MINUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_RIGHT_X_PLUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_RIGHT_X_MINUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_RIGHT_Y_PLUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_ANALOG_RIGHT_Y_MINUS:
snprintf(msg, sizeof(msg),
" -- Axis for analog stick (DualShock-esque).\n"
" \n"
"Bound as usual, however, if a real analog \n"
"axis is bound, it can be read as a true analog.\n"
" \n"
"Positive X axis is right. \n"
"Positive Y axis is down.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_SHADER_NEXT:
snprintf(msg, sizeof(msg),
" -- Applies next shader in directory.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_SHADER_PREV:
snprintf(msg, sizeof(msg),
" -- Applies previous shader in directory.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_LOAD_STATE_KEY:
snprintf(msg, sizeof(msg),
" -- Loads state.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_SAVE_STATE_KEY:
snprintf(msg, sizeof(msg),
" -- Saves state.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_STATE_SLOT_PLUS:
case MENU_SETTINGS_BIND_BEGIN + RARCH_STATE_SLOT_MINUS:
snprintf(msg, sizeof(msg),
" -- State slots.\n"
" \n"
" With slot set to 0, save state name is *.state \n"
" (or whatever defined on commandline).\n"
"When slot is != 0, path will be (path)(d), \n"
"where (d) is slot number.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_TURBO_ENABLE:
snprintf(msg, sizeof(msg),
" -- Turbo enable.\n"
" \n"
"Holding the turbo while pressing another \n"
"button will let the button enter a turbo \n"
"mode where the button state is modulated \n"
"with a periodic signal. \n"
" \n"
"The modulation stops when the button \n"
"itself (not turbo button) is released.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_FAST_FORWARD_HOLD_KEY:
snprintf(msg, sizeof(msg),
" -- Hold for fast-forward. Releasing button \n"
"disables fast-forward.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_QUIT_KEY:
snprintf(msg, sizeof(msg),
" -- Key to exit RetroArch cleanly."
#if !defined(RARCH_MOBILE) && !defined(RARCH_CONSOLE)
"\nKilling it in any hard way (SIGKILL, \n"
"etc) will terminate without saving\n"
"RAM, etc. On Unix-likes,\n"
"SIGINT/SIGTERM allows\n"
"a clean deinitialization."
#endif
);
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_REWIND:
snprintf(msg, sizeof(msg),
" -- Hold button down to rewind.\n"
" \n"
"Rewind must be enabled.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_MOVIE_RECORD_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggle between recording and not.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_PAUSE_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggle between paused and non-paused state.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_FRAMEADVANCE:
snprintf(msg, sizeof(msg),
" -- Frame advance when content is paused.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_RESET:
snprintf(msg, sizeof(msg),
" -- Reset the content.\n");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_CHEAT_INDEX_PLUS:
snprintf(msg, sizeof(msg),
" -- Increment cheat index.\n");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_CHEAT_INDEX_MINUS:
snprintf(msg, sizeof(msg),
" -- Decrement cheat index.\n");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_CHEAT_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggle cheat index.\n");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_SCREENSHOT:
snprintf(msg, sizeof(msg),
" -- Take screenshot.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_MUTE:
snprintf(msg, sizeof(msg),
" -- Mute/unmute audio.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_NETPLAY_FLIP:
snprintf(msg, sizeof(msg),
" -- Netplay flip players.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_SLOWMOTION:
snprintf(msg, sizeof(msg),
" -- Hold for slowmotion.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_ENABLE_HOTKEY:
snprintf(msg, sizeof(msg),
" -- Enable other hotkeys.\n"
" \n"
" If this hotkey is bound to either keyboard, \n"
"joybutton or joyaxis, all other hotkeys will \n"
"be disabled unless this hotkey is also held \n"
"at the same time. \n"
" \n"
"This is useful for RETRO_KEYBOARD centric \n"
"implementations which query a large area of \n"
"the keyboard, where it is not desirable that \n"
"hotkeys get in the way.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_VOLUME_UP:
snprintf(msg, sizeof(msg),
" -- Increases audio volume.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_VOLUME_DOWN:
snprintf(msg, sizeof(msg),
" -- Decreases audio volume.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_OVERLAY_NEXT:
snprintf(msg, sizeof(msg),
" -- Toggles to next overlay.\n"
" \n"
"Wraps around.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_DISK_EJECT_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggles eject for disks.\n"
" \n"
"Used for multiple-disk content.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_DISK_NEXT:
snprintf(msg, sizeof(msg),
" -- Cycles through disk images. Use after \n"
"ejecting. \n"
" \n"
" Complete by toggling eject again.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_GRAB_MOUSE_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggles mouse grab.\n"
" \n"
"When mouse is grabbed, RetroArch hides the \n"
"mouse, and keeps the mouse pointer inside \n"
"the window to allow relative mouse input to \n"
"work better.");
break;
case MENU_SETTINGS_BIND_BEGIN + RARCH_MENU_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggles menu.");
break;
case MENU_SETTINGS_DRIVER_VIDEO:
if (!strcmp(g_settings.video.driver, "gl"))
snprintf(msg, sizeof(msg),
" -- OpenGL Video driver. \n"
" \n"
"This driver allows libretro GL cores to \n"
"be used in addition to software-rendered \n"
"core implementations.\n"
" \n"
"Performance for software-rendered and \n"
"libretro GL core implementations is \n"
"dependent on your graphics card's \n"
"underlying GL driver).");
else if (!strcmp(g_settings.video.driver, "sdl2"))
snprintf(msg, sizeof(msg),
" -- SDL 2 Video driver.\n"
" \n"
"This is an SDL 2 software-rendered video \n"
"driver.\n"
" \n"
"Performance for software-rendered libretro \n"
"core implementations is dependent \n"
"on your platform SDL implementation.");
else if (!strcmp(g_settings.video.driver, "sdl"))
snprintf(msg, sizeof(msg),
" -- SDL Video driver.\n"
" \n"
"This is an SDL 1.2 software-rendered video \n"
"driver.\n"
" \n"
"Performance is considered to be suboptimal. \n"
"Consider using it only as a last resort.");
else if (!strcmp(g_settings.video.driver, "d3d"))
snprintf(msg, sizeof(msg),
" -- Direct3D Video driver. \n"
" \n"
"Performance for software-rendered cores \n"
"is dependent on your graphic card's \n"
"underlying D3D driver).");
else if (!strcmp(g_settings.video.driver, "exynos"))
snprintf(msg, sizeof(msg),
" -- Exynos-G2D Video Driver. \n"
" \n"
"This is a low-level Exynos video driver. \n"
"Uses the G2D block in Samsung Exynos SoC \n"
"for blit operations. \n"
" \n"
"Performance for software rendered cores \n"
"should be optimal.");
else
snprintf(msg, sizeof(msg),
" -- Current Video driver.");
break;
case MENU_SETTINGS_DRIVER_AUDIO_RESAMPLER:
if (!strcmp(g_settings.audio.resampler, "sinc"))
snprintf(msg, sizeof(msg),
" -- Windowed SINC implementation.");
else if (!strcmp(g_settings.audio.resampler, "CC"))
snprintf(msg, sizeof(msg),
" -- Convoluted Cosine implementation.");
break;
case MENU_SETTINGS_SHADER_0_FILTER + (0 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (1 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (2 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (3 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (4 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (5 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (6 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (7 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (8 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (9 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (10 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (11 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (12 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (13 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (14 * 3):
case MENU_SETTINGS_SHADER_0_FILTER + (15 * 3):
snprintf(msg, sizeof(msg),
" -- Hardware filter for this pass. \n"
" \n"
"If 'Don't Care' is set, 'Default \n"
"Filter' will be used."
);
break;
case MENU_SETTINGS_SHADER_0 + (0 * 3):
case MENU_SETTINGS_SHADER_0 + (1 * 3):
case MENU_SETTINGS_SHADER_0 + (2 * 3):
case MENU_SETTINGS_SHADER_0 + (3 * 3):
case MENU_SETTINGS_SHADER_0 + (4 * 3):
case MENU_SETTINGS_SHADER_0 + (5 * 3):
case MENU_SETTINGS_SHADER_0 + (6 * 3):
case MENU_SETTINGS_SHADER_0 + (7 * 3):
case MENU_SETTINGS_SHADER_0 + (8 * 3):
case MENU_SETTINGS_SHADER_0 + (9 * 3):
case MENU_SETTINGS_SHADER_0 + (10 * 3):
case MENU_SETTINGS_SHADER_0 + (11 * 3):
case MENU_SETTINGS_SHADER_0 + (12 * 3):
case MENU_SETTINGS_SHADER_0 + (13 * 3):
case MENU_SETTINGS_SHADER_0 + (14 * 3):
case MENU_SETTINGS_SHADER_0 + (15 * 3):
snprintf(msg, sizeof(msg),
" -- Path to shader. \n"
" \n"
"All shaders must be of the same \n"
"type (i.e. CG, GLSL or HLSL). \n"
" \n"
"Set Shader Directory to set where \n"
"the browser starts to look for \n"
"shaders."
);
break;
case MENU_SETTINGS_SHADER_0_SCALE + (0 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (1 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (2 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (3 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (4 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (5 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (6 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (7 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (8 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (9 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (10 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (11 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (12 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (13 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (14 * 3):
case MENU_SETTINGS_SHADER_0_SCALE + (15 * 3):
snprintf(msg, sizeof(msg),
" -- Scale for this pass. \n"
" \n"
"The scale factor accumulates, i.e. 2x \n"
"for first pass and 2x for second pass \n"
"will give you a 4x total scale. \n"
" \n"
"If there is a scale factor for last \n"
"pass, the result is stretched to \n"
"screen with the filter specified in \n"
"'Default Filter'. \n"
" \n"
"If 'Don't Care' is set, either 1x \n"
"scale or stretch to fullscreen will \n"
"be used depending if it's not the last \n"
"pass or not."
);
break;
default:
snprintf(msg, sizeof(msg),
"-- No info on this item available. --\n");
}
}
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render_messagebox)
{
if (*msg && msg[0] != '\0')
driver.menu_ctx->render_messagebox(msg);
}
if (action == MENU_ACTION_OK)
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
return 0;
}
static int menu_start_screen_iterate(unsigned action)
{
unsigned i;
char msg[1024];
if (!driver.menu)
return 0;
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render();
static const unsigned binds[] = {
RETRO_DEVICE_ID_JOYPAD_UP,
RETRO_DEVICE_ID_JOYPAD_DOWN,
RETRO_DEVICE_ID_JOYPAD_A,
RETRO_DEVICE_ID_JOYPAD_B,
RETRO_DEVICE_ID_JOYPAD_SELECT,
RARCH_MENU_TOGGLE,
RARCH_QUIT_KEY,
};
char desc[ARRAY_SIZE(binds)][64];
for (i = 0; i < ARRAY_SIZE(binds); i++)
{
const struct retro_keybind *bind = (const struct retro_keybind*)&g_settings.input.binds[0][binds[i]];
const struct retro_keybind *auto_bind = (const struct retro_keybind*)input_get_auto_bind(0, binds[i]);
input_get_bind_string(desc[i], bind, auto_bind, sizeof(desc[i]));
}
snprintf(msg, sizeof(msg),
"-- Welcome to RetroArch --\n"
" \n" // strtok_r doesn't split empty strings.
"Basic Menu controls:\n"
" Scroll (Up): %-20s\n"
" Scroll (Down): %-20s\n"
" Accept/OK: %-20s\n"
" Back: %-20s\n"
" Info: %-20s\n"
"Enter/Exit Menu: %-20s\n"
" Exit RetroArch: %-20s\n"
" \n"
"To run content:\n"
"Load a libretro core (Core).\n"
"Load a content file (Load Content). \n"
" \n"
"See Path Options to set directories\n"
"for faster access to files.\n"
" \n"
"Press Accept/OK to continue.",
desc[0], desc[1], desc[2], desc[3], desc[4], desc[5], desc[6]);
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render_messagebox)
driver.menu_ctx->render_messagebox(msg);
if (action == MENU_ACTION_OK)
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
return 0;
}
static unsigned menu_common_type_is(unsigned type)
{
unsigned ret = 0;
bool type_found;
type_found =
type == MENU_SETTINGS ||
type == MENU_SETTINGS_GENERAL_OPTIONS ||
type == MENU_SETTINGS_CORE_OPTIONS ||
type == MENU_SETTINGS_CORE_INFO ||
type == MENU_SETTINGS_VIDEO_OPTIONS ||
type == MENU_SETTINGS_FONT_OPTIONS ||
type == MENU_SETTINGS_SHADER_OPTIONS ||
type == MENU_SETTINGS_SHADER_PARAMETERS ||
type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS ||
type == MENU_SETTINGS_AUDIO_OPTIONS ||
type == MENU_SETTINGS_DISK_OPTIONS ||
type == MENU_SETTINGS_PATH_OPTIONS ||
type == MENU_SETTINGS_PRIVACY_OPTIONS ||
type == MENU_SETTINGS_OVERLAY_OPTIONS ||
type == MENU_SETTINGS_USER_OPTIONS ||
type == MENU_SETTINGS_NETPLAY_OPTIONS ||
type == MENU_SETTINGS_OPTIONS ||
type == MENU_SETTINGS_DRIVERS ||
type == MENU_SETTINGS_PERFORMANCE_COUNTERS ||
type == MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO ||
type == MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND ||
(type == MENU_SETTINGS_INPUT_OPTIONS);
if (type_found)
{
ret = MENU_SETTINGS;
return ret;
}
type_found = (type >= MENU_SETTINGS_SHADER_0 &&
type <= MENU_SETTINGS_SHADER_LAST &&
((type - MENU_SETTINGS_SHADER_0) % 3) == 0) ||
type == MENU_SETTINGS_SHADER_PRESET;
if (type_found)
{
ret = MENU_SETTINGS_SHADER_OPTIONS;
return ret;
}
type_found =
type == MENU_BROWSER_DIR_PATH ||
type == MENU_CONTENT_DIR_PATH ||
type == MENU_ASSETS_DIR_PATH ||
type == MENU_SHADER_DIR_PATH ||
type == MENU_FILTER_DIR_PATH ||
type == MENU_DSP_FILTER_DIR_PATH ||
type == MENU_SAVESTATE_DIR_PATH ||
type == MENU_LIBRETRO_DIR_PATH ||
type == MENU_LIBRETRO_INFO_DIR_PATH ||
type == MENU_CONFIG_DIR_PATH ||
type == MENU_SAVEFILE_DIR_PATH ||
type == MENU_OVERLAY_DIR_PATH ||
type == MENU_SCREENSHOT_DIR_PATH ||
type == MENU_AUTOCONFIG_DIR_PATH ||
type == MENU_EXTRACTION_DIR_PATH ||
type == MENU_SYSTEM_DIR_PATH;
if (type_found)
{
ret = MENU_FILE_DIRECTORY;
return ret;
}
return ret;
}
static void menu_common_setting_push_current_menu(file_list_t *list, const char *path, unsigned type,
size_t directory_ptr, unsigned action)
{
switch (action)
{
case MENU_ACTION_OK:
file_list_push(list, path, "", type, directory_ptr);
menu_clear_navigation(driver.menu);
driver.menu->need_refresh = true;
break;
}
}
static void menu_action_cancel(void)
{
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
driver.menu->need_refresh = true;
}
static int menu_settings_iterate(unsigned action, rarch_setting_t *setting)
{
const char *label = NULL;
const char *dir = NULL;
unsigned type = 0;
unsigned menu_type = 0;
if (!driver.menu)
return 0;
driver.menu->frame_buf_pitch = driver.menu->width * 2;
if (action != MENU_ACTION_REFRESH)
file_list_get_at_offset(driver.menu->selection_buf, driver.menu->selection_ptr, &label, &type, setting);
if (type == MENU_SETTINGS_CORE)
label = g_settings.libretro_directory;
else if (type == MENU_SETTINGS_CONFIG)
label = g_settings.menu_config_directory;
else if (type == MENU_SETTINGS_DISK_APPEND)
label = g_settings.menu_content_directory;
file_list_get_last(driver.menu->menu_stack, &dir, &menu_type, setting);
if (driver.menu->need_refresh)
action = MENU_ACTION_NOOP;
unsigned scroll_speed = (max(driver.menu->scroll_accel, 2) - 2) / 4 + 1;
unsigned fast_scroll_speed = 4 + 4 * scroll_speed;
switch (action)
{
case MENU_ACTION_UP:
if (driver.menu->selection_ptr >= scroll_speed)
menu_decrement_navigation(driver.menu);
else
menu_set_navigation(driver.menu, file_list_get_size(driver.menu->selection_buf) - 1);
break;
case MENU_ACTION_DOWN:
if (driver.menu->selection_ptr + scroll_speed < file_list_get_size(driver.menu->selection_buf))
menu_increment_navigation(driver.menu);
else
menu_clear_navigation(driver.menu);
break;
case MENU_ACTION_CANCEL:
if (file_list_get_size(driver.menu->menu_stack) > 1)
menu_action_cancel();
break;
case MENU_ACTION_SELECT:
{
const char *path = NULL;
file_list_get_at_offset(driver.menu->selection_buf, driver.menu->selection_ptr, &path, &driver.menu->info_selection, setting);
file_list_push(driver.menu->menu_stack, "", "", MENU_INFO_SCREEN, driver.menu->selection_ptr);
}
break;
case MENU_ACTION_LEFT:
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
case MENU_ACTION_START:
if ((type == MENU_SETTINGS_OPEN_FILEBROWSER || type == MENU_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE)
&& action == MENU_ACTION_OK)
{
driver.menu->defer_core = type == MENU_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE;
menu_common_setting_push_current_menu(driver.menu->menu_stack, g_settings.menu_content_directory, MENU_FILE_DIRECTORY, driver.menu->selection_ptr, action);
}
else if ((type == MENU_SETTINGS_OPEN_HISTORY || menu_common_type_is(type) == MENU_FILE_DIRECTORY) && action == MENU_ACTION_OK)
{
menu_common_setting_push_current_menu(driver.menu->menu_stack, "", type, driver.menu->selection_ptr, action);
}
else if ((menu_common_type_is(type) == MENU_SETTINGS || type == MENU_SETTINGS_CORE || type == MENU_SETTINGS_CONFIG || type == MENU_SETTINGS_DISK_APPEND) && action == MENU_ACTION_OK)
{
menu_common_setting_push_current_menu(driver.menu->menu_stack, label, type, driver.menu->selection_ptr, action);
}
else if (type == MENU_SETTINGS_CUSTOM_VIEWPORT && action == MENU_ACTION_OK)
{
file_list_push(driver.menu->menu_stack, "", "", type, driver.menu->selection_ptr);
// Start with something sane.
rarch_viewport_t *custom = &g_extern.console.screen.viewports.custom_vp;
if (driver.video_data && driver.video && driver.video->viewport_info)
driver.video->viewport_info(driver.video_data, custom);
aspectratio_lut[ASPECT_RATIO_CUSTOM].value = (float)custom->width / custom->height;
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
rarch_main_command(RARCH_CMD_VIDEO_SET_ASPECT_RATIO);
}
else
{
int ret = 0;
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_toggle)
ret = driver.menu_ctx->backend->setting_toggle(type, action, menu_type, setting);
if (ret)
return ret;
}
break;
case MENU_ACTION_REFRESH:
menu_clear_navigation(driver.menu);
driver.menu->need_refresh = true;
break;
case MENU_ACTION_MESSAGE:
driver.menu->msg_force = true;
break;
default:
break;
}
file_list_get_last(driver.menu->menu_stack, &dir, &menu_type, setting);
if (driver.menu->need_refresh && !(menu_type == MENU_FILE_DIRECTORY ||
menu_common_type_is(menu_type) == MENU_SETTINGS_SHADER_OPTIONS ||
menu_common_type_is(menu_type) == MENU_FILE_DIRECTORY ||
menu_type == MENU_SETTINGS_VIDEO_SOFTFILTER ||
menu_type == MENU_SETTINGS_AUDIO_DSP_FILTER ||
menu_type == MENU_SETTINGS_OVERLAY_PRESET ||
menu_type == MENU_CONTENT_HISTORY_PATH ||
menu_type == MENU_SETTINGS_CORE ||
menu_type == MENU_SETTINGS_CONFIG ||
menu_type == MENU_SETTINGS_DISK_APPEND ||
menu_type == MENU_SETTINGS_OPEN_HISTORY))
{
driver.menu->need_refresh = false;
if (
menu_type == MENU_SETTINGS_INPUT_OPTIONS
|| menu_type == MENU_SETTINGS_PATH_OPTIONS
|| menu_type == MENU_SETTINGS_OVERLAY_OPTIONS
|| menu_type == MENU_SETTINGS_NETPLAY_OPTIONS
|| menu_type == MENU_SETTINGS_USER_OPTIONS
|| menu_type == MENU_SETTINGS_OPTIONS
|| menu_type == MENU_SETTINGS_DRIVERS
|| menu_type == MENU_SETTINGS_PERFORMANCE_COUNTERS
|| menu_type == MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND
|| menu_type == MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO
|| menu_type == MENU_SETTINGS_CORE_INFO
|| menu_type == MENU_SETTINGS_CORE_OPTIONS
|| menu_type == MENU_SETTINGS_AUDIO_OPTIONS
|| menu_type == MENU_SETTINGS_DISK_OPTIONS
|| menu_type == MENU_SETTINGS_PRIVACY_OPTIONS
|| menu_type == MENU_SETTINGS_GENERAL_OPTIONS
|| menu_type == MENU_SETTINGS_VIDEO_OPTIONS
|| menu_type == MENU_SETTINGS_FONT_OPTIONS
|| menu_type == MENU_SETTINGS_SHADER_OPTIONS
|| menu_type == MENU_SETTINGS_SHADER_PARAMETERS
|| menu_type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS
)
menu_common_entries_init(driver.menu, menu_type);
else
menu_common_entries_init(driver.menu, MENU_SETTINGS);
}
if (driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render();
// Have to defer it so we let settings refresh.
if (driver.menu->push_start_screen)
{
driver.menu->push_start_screen = false;
file_list_push(driver.menu->menu_stack, "", "", MENU_START_SCREEN, 0);
}
return 0;
}
static int menu_viewport_iterate(unsigned action, rarch_setting_t *setting)
{
int stride_x, stride_y;
char msg[64];
struct retro_game_geometry *geom;
const char *base_msg = NULL;
unsigned menu_type = 0;
rarch_viewport_t *custom = (rarch_viewport_t*)&g_extern.console.screen.viewports.custom_vp;
if (!driver.menu)
return 0;
file_list_get_last(driver.menu->menu_stack, NULL, &menu_type, setting);
geom = (struct retro_game_geometry*)&g_extern.system.av_info.geometry;
stride_x = g_settings.video.scale_integer ?
geom->base_width : 1;
stride_y = g_settings.video.scale_integer ?
geom->base_height : 1;
switch (action)
{
case MENU_ACTION_UP:
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT)
{
custom->y -= stride_y;
custom->height += stride_y;
}
else if (custom->height >= (unsigned)stride_y)
custom->height -= stride_y;
rarch_main_command(RARCH_CMD_VIDEO_APPLY_STATE_CHANGES);
break;
case MENU_ACTION_DOWN:
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT)
{
custom->y += stride_y;
if (custom->height >= (unsigned)stride_y)
custom->height -= stride_y;
}
else
custom->height += stride_y;
rarch_main_command(RARCH_CMD_VIDEO_APPLY_STATE_CHANGES);
break;
case MENU_ACTION_LEFT:
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT)
{
custom->x -= stride_x;
custom->width += stride_x;
}
else if (custom->width >= (unsigned)stride_x)
custom->width -= stride_x;
rarch_main_command(RARCH_CMD_VIDEO_APPLY_STATE_CHANGES);
break;
case MENU_ACTION_RIGHT:
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT)
{
custom->x += stride_x;
if (custom->width >= (unsigned)stride_x)
custom->width -= stride_x;
}
else
custom->width += stride_x;
rarch_main_command(RARCH_CMD_VIDEO_APPLY_STATE_CHANGES);
break;
case MENU_ACTION_CANCEL:
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2)
{
file_list_push(driver.menu->menu_stack, "", "",
MENU_SETTINGS_CUSTOM_VIEWPORT,
driver.menu->selection_ptr);
}
break;
case MENU_ACTION_OK:
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT
&& !g_settings.video.scale_integer)
{
file_list_push(driver.menu->menu_stack, "", "",
MENU_SETTINGS_CUSTOM_VIEWPORT_2,
driver.menu->selection_ptr);
}
break;
case MENU_ACTION_START:
if (!g_settings.video.scale_integer)
{
rarch_viewport_t vp;
if (driver.video_data && driver.video && driver.video->viewport_info)
driver.video->viewport_info(driver.video_data, &vp);
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT)
{
custom->width += custom->x;
custom->height += custom->y;
custom->x = 0;
custom->y = 0;
}
else
{
custom->width = vp.full_width - custom->x;
custom->height = vp.full_height - custom->y;
}
rarch_main_command(RARCH_CMD_VIDEO_APPLY_STATE_CHANGES);
}
break;
case MENU_ACTION_MESSAGE:
driver.menu->msg_force = true;
break;
default:
break;
}
file_list_get_last(driver.menu->menu_stack, NULL, &menu_type, setting);
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render();
if (g_settings.video.scale_integer)
{
custom->x = 0;
custom->y = 0;
custom->width = ((custom->width + geom->base_width - 1) / geom->base_width) * geom->base_width;
custom->height = ((custom->height + geom->base_height - 1) / geom->base_height) * geom->base_height;
base_msg = "Set scale";
snprintf(msg, sizeof(msg), "%s (%4ux%4u, %u x %u scale)",
base_msg,
custom->width, custom->height,
custom->width / geom->base_width,
custom->height / geom->base_height);
}
else
{
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT)
base_msg = "Set Upper-Left Corner";
else if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2)
base_msg = "Set Bottom-Right Corner";
snprintf(msg, sizeof(msg), "%s (%d, %d : %4ux%4u)",
base_msg, custom->x, custom->y, custom->width, custom->height);
}
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render_messagebox)
driver.menu_ctx->render_messagebox(msg);
if (!custom->width)
custom->width = stride_x;
if (!custom->height)
custom->height = stride_y;
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
(float)custom->width / custom->height;
rarch_main_command(RARCH_CMD_VIDEO_APPLY_STATE_CHANGES);
return 0;
}
static void menu_parse_and_resolve(unsigned menu_type)
{
size_t i, list_size;
file_list_t *list = NULL;
rarch_setting_t *setting = NULL;
const core_info_t *info = NULL;
const char *dir = NULL;
if (!driver.menu)
{
RARCH_ERR("Cannot parse and resolve menu, menu handle is not initialized.\n");
return;
}
file_list_clear(driver.menu->selection_buf);
// parsing switch
switch (menu_type)
{
case MENU_SETTINGS_OPEN_HISTORY:
/* History parse */
list_size = content_playlist_size(g_extern.history);
for (i = 0; i < list_size; i++)
{
char fill_buf[PATH_MAX];
const char *path, *core_path, *core_name = NULL;
content_playlist_get_index(g_extern.history, i,
&path, &core_path, &core_name);
if (path)
{
char path_short[PATH_MAX];
fill_pathname(path_short, path_basename(path), "", sizeof(path_short));
snprintf(fill_buf, sizeof(fill_buf), "%s (%s)",
path_short, core_name);
}
else
strlcpy(fill_buf, core_name, sizeof(fill_buf));
file_list_push(driver.menu->selection_buf, fill_buf, "", MENU_FILE_PLAIN, 0);
}
break;
case MENU_SETTINGS_DEFERRED_CORE:
break;
default:
{
/* Directory parse */
file_list_get_last(driver.menu->menu_stack, &dir, &menu_type, setting);
if (!*dir)
{
#if defined(GEKKO)
#ifdef HW_RVL
file_list_push(driver.menu->selection_buf, "sd:/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "usb:/", "", menu_type, 0);
#endif
file_list_push(driver.menu->selection_buf, "carda:/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "cardb:/", "", menu_type, 0);
#elif defined(_XBOX1)
file_list_push(driver.menu->selection_buf, "C:", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "D:", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "E:", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "F:", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "G:", "", menu_type, 0);
#elif defined(_XBOX360)
file_list_push(driver.menu->selection_buf, "game:", "", menu_type, 0);
#elif defined(_WIN32)
unsigned drives = GetLogicalDrives();
char drive[] = " :\\";
for (i = 0; i < 32; i++)
{
drive[0] = 'A' + i;
if (drives & (1 << i))
file_list_push(driver.menu->selection_buf, drive, "", menu_type, 0);
}
#elif defined(__CELLOS_LV2__)
file_list_push(driver.menu->selection_buf, "/app_home/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_hdd0/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_hdd1/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/host_root/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_usb000/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_usb001/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_usb002/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_usb003/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_usb004/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_usb005/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/dev_usb006/", "", menu_type, 0);
#elif defined(PSP)
file_list_push(driver.menu->selection_buf, "ms0:/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "ef0:/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "host0:/", "", menu_type, 0);
#elif defined(IOS)
file_list_push(driver.menu->selection_buf, "/var/mobile/", "", menu_type, 0);
file_list_push(driver.menu->selection_buf, g_defaults.core_dir, "", menu_type, 0);
file_list_push(driver.menu->selection_buf, "/", "", menu_type, 0);
#else
file_list_push(driver.menu->selection_buf, "/", "", menu_type, 0);
#endif
return;
}
#if defined(GEKKO) && defined(HW_RVL)
LWP_MutexLock(gx_device_mutex);
int dev = gx_get_device_from_path(dir);
if (dev != -1 && !gx_devices[dev].mounted && gx_devices[dev].interface->isInserted())
fatMountSimple(gx_devices[dev].name, gx_devices[dev].interface);
LWP_MutexUnlock(gx_device_mutex);
#endif
const char *exts;
char ext_buf[1024];
if (menu_type == MENU_SETTINGS_CORE)
exts = EXT_EXECUTABLES;
else if (menu_type == MENU_SETTINGS_CONFIG)
exts = "cfg";
else if (menu_type == MENU_SETTINGS_SHADER_PRESET)
exts = "cgp|glslp";
else if (menu_common_type_is(menu_type) == MENU_SETTINGS_SHADER_OPTIONS)
exts = "cg|glsl";
else if (menu_type == MENU_SETTINGS_VIDEO_SOFTFILTER)
exts = EXT_EXECUTABLES;
else if (menu_type == MENU_SETTINGS_AUDIO_DSP_FILTER)
exts = "dsp";
else if (menu_type == MENU_SETTINGS_OVERLAY_PRESET)
exts = "cfg";
else if (menu_type == MENU_CONTENT_HISTORY_PATH)
exts = "cfg";
else if (menu_common_type_is(menu_type) == MENU_FILE_DIRECTORY)
exts = ""; // we ignore files anyway
else if (driver.menu->defer_core)
exts = driver.menu->core_info ? core_info_list_get_all_extensions(driver.menu->core_info) : "";
else if (driver.menu->info.valid_extensions)
{
exts = ext_buf;
if (*driver.menu->info.valid_extensions)
snprintf(ext_buf, sizeof(ext_buf), "%s|zip", driver.menu->info.valid_extensions);
else
*ext_buf = '\0';
}
else
exts = g_extern.system.valid_extensions;
struct string_list *list = dir_list_new(dir, exts, true);
if (!list)
return;
dir_list_sort(list, true);
if (menu_common_type_is(menu_type) == MENU_FILE_DIRECTORY)
file_list_push(driver.menu->selection_buf, "