/* 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 "../../../driver.h"
#include "../../../file_ext.h"
#include "../../../input/input_common.h"
#include "../../../config.def.h"
#include "../../../input/keyboard_line.h"
#ifdef HAVE_CONFIG_H
#include "../../../config.h"
#endif
#if defined(__CELLOS_LV2__)
#include
#if (CELL_SDK_VERSION > 0x340000)
#include
#endif
#endif
static unsigned info_selection_ptr = 0;
#ifdef HAVE_SHADER_MANAGER
static inline struct gfx_shader *shader_manager_get_current_shader(void *data, unsigned type)
{
rgui_handle_t *rgui = (rgui_handle_t*)data;
if (!rgui)
{
RARCH_ERR("Cannot get current shader, menu handle is not initialized.\n");
return NULL;
}
struct gfx_shader *shader = type == RGUI_SETTINGS_SHADER_PRESET_PARAMETERS ? &rgui->shader : NULL;
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(void *data, unsigned menu_type)
{
unsigned i, last;
char tmp[256];
rgui_handle_t *rgui = (rgui_handle_t*)data;
if (!rgui)
return;
switch (menu_type)
{
#ifdef HAVE_SHADER_MANAGER
case RGUI_SETTINGS_SHADER_PARAMETERS:
case RGUI_SETTINGS_SHADER_PRESET_PARAMETERS:
{
file_list_clear(rgui->selection_buf);
struct gfx_shader *shader = shader_manager_get_current_shader(rgui, menu_type);
if (shader)
for (i = 0; i < shader->num_parameters; i++)
file_list_push(rgui->selection_buf, shader->parameters[i].desc, RGUI_SETTINGS_SHADER_PARAMETER_0 + i, 0);
rgui->parameter_shader = shader;
break;
}
case RGUI_SETTINGS_SHADER_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Apply Shader Changes",
RGUI_SETTINGS_SHADER_APPLY, 0);
file_list_push(rgui->selection_buf, "Default Filter", RGUI_SETTINGS_SHADER_FILTER, 0);
file_list_push(rgui->selection_buf, "Load Shader Preset",
RGUI_SETTINGS_SHADER_PRESET, 0);
file_list_push(rgui->selection_buf, "Save As Shader Preset",
RGUI_SETTINGS_SHADER_PRESET_SAVE, 0);
file_list_push(rgui->selection_buf, "Parameters (Current)",
RGUI_SETTINGS_SHADER_PARAMETERS, 0);
file_list_push(rgui->selection_buf, "Parameters (RGUI)",
RGUI_SETTINGS_SHADER_PRESET_PARAMETERS, 0);
file_list_push(rgui->selection_buf, "Shader Passes",
RGUI_SETTINGS_SHADER_PASSES, 0);
for (i = 0; i < rgui->shader.passes; i++)
{
char buf[64];
snprintf(buf, sizeof(buf), "Shader #%u", i);
file_list_push(rgui->selection_buf, buf,
RGUI_SETTINGS_SHADER_0 + 3 * i, 0);
snprintf(buf, sizeof(buf), "Shader #%u Filter", i);
file_list_push(rgui->selection_buf, buf,
RGUI_SETTINGS_SHADER_0_FILTER + 3 * i, 0);
snprintf(buf, sizeof(buf), "Shader #%u Scale", i);
file_list_push(rgui->selection_buf, buf,
RGUI_SETTINGS_SHADER_0_SCALE + 3 * i, 0);
}
break;
#endif
case RGUI_SETTINGS_GENERAL_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Libretro Logging Level", RGUI_SETTINGS_LIBRETRO_LOG_LEVEL, 0);
file_list_push(rgui->selection_buf, "Logging Verbosity", RGUI_SETTINGS_LOGGING_VERBOSITY, 0);
file_list_push(rgui->selection_buf, "Configuration Save On Exit", RGUI_SETTINGS_CONFIG_SAVE_ON_EXIT, 0);
file_list_push(rgui->selection_buf, "Configuration Per-Core", RGUI_SETTINGS_PER_CORE_CONFIG, 0);
#ifdef HAVE_SCREENSHOTS
file_list_push(rgui->selection_buf, "GPU Screenshots", RGUI_SETTINGS_GPU_SCREENSHOT, 0);
#endif
file_list_push(rgui->selection_buf, "Load Dummy On Core Shutdown", RGUI_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN, 0);
file_list_push(rgui->selection_buf, "Show Framerate", RGUI_SETTINGS_DEBUG_TEXT, 0);
file_list_push(rgui->selection_buf, "Maximum Run Speed", RGUI_SETTINGS_FASTFORWARD_RATIO, 0);
file_list_push(rgui->selection_buf, "Slow-Motion Ratio", RGUI_SETTINGS_SLOWMOTION_RATIO, 0);
file_list_push(rgui->selection_buf, "Rewind", RGUI_SETTINGS_REWIND_ENABLE, 0);
file_list_push(rgui->selection_buf, "Rewind Granularity", RGUI_SETTINGS_REWIND_GRANULARITY, 0);
file_list_push(rgui->selection_buf, "SRAM Block Overwrite", RGUI_SETTINGS_BLOCK_SRAM_OVERWRITE, 0);
#if defined(HAVE_THREADS)
file_list_push(rgui->selection_buf, "SRAM Autosave", RGUI_SETTINGS_SRAM_AUTOSAVE, 0);
#endif
file_list_push(rgui->selection_buf, "Window Compositing", RGUI_SETTINGS_WINDOW_COMPOSITING_ENABLE, 0);
file_list_push(rgui->selection_buf, "Window Unfocus Pause", RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST, 0);
file_list_push(rgui->selection_buf, "Savestate Autosave On Exit", RGUI_SETTINGS_SAVESTATE_AUTO_SAVE, 0);
file_list_push(rgui->selection_buf, "Savestate Autoload", RGUI_SETTINGS_SAVESTATE_AUTO_LOAD, 0);
break;
case RGUI_SETTINGS_VIDEO_OPTIONS:
file_list_clear(rgui->selection_buf);
#if defined(GEKKO) || defined(__CELLOS_LV2__)
file_list_push(rgui->selection_buf, "Screen Resolution", RGUI_SETTINGS_VIDEO_RESOLUTION, 0);
#endif
file_list_push(rgui->selection_buf, "Soft Filter", RGUI_SETTINGS_VIDEO_SOFTFILTER, 0);
#if defined(__CELLOS_LV2__)
file_list_push(rgui->selection_buf, "PAL60 Mode", RGUI_SETTINGS_VIDEO_PAL60, 0);
#endif
#ifndef HAVE_SHADER_MANAGER
file_list_push(rgui->selection_buf, "Default Filter", RGUI_SETTINGS_VIDEO_FILTER, 0);
#endif
#ifdef HW_RVL
file_list_push(rgui->selection_buf, "VI Trap filtering", RGUI_SETTINGS_VIDEO_SOFT_FILTER, 0);
#endif
#if defined(HW_RVL) || defined(_XBOX360)
file_list_push(rgui->selection_buf, "Gamma", RGUI_SETTINGS_VIDEO_GAMMA, 0);
#endif
#ifdef _XBOX1
file_list_push(rgui->selection_buf, "Soft filtering", RGUI_SETTINGS_SOFT_DISPLAY_FILTER, 0);
file_list_push(rgui->selection_buf, "Flicker filtering", RGUI_SETTINGS_FLICKER_FILTER, 0);
#endif
file_list_push(rgui->selection_buf, "Integer Scale", RGUI_SETTINGS_VIDEO_INTEGER_SCALE, 0);
file_list_push(rgui->selection_buf, "Aspect Ratio", RGUI_SETTINGS_VIDEO_ASPECT_RATIO, 0);
file_list_push(rgui->selection_buf, "Custom Ratio", RGUI_SETTINGS_CUSTOM_VIEWPORT, 0);
#if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)
file_list_push(rgui->selection_buf, "Toggle Fullscreen", RGUI_SETTINGS_TOGGLE_FULLSCREEN, 0);
#endif
file_list_push(rgui->selection_buf, "Rotation", RGUI_SETTINGS_VIDEO_ROTATION, 0);
file_list_push(rgui->selection_buf, "VSync", RGUI_SETTINGS_VIDEO_VSYNC, 0);
file_list_push(rgui->selection_buf, "Hard GPU Sync", RGUI_SETTINGS_VIDEO_HARD_SYNC, 0);
file_list_push(rgui->selection_buf, "Hard GPU Sync Frames", RGUI_SETTINGS_VIDEO_HARD_SYNC_FRAMES, 0);
#if !defined(RARCH_MOBILE)
file_list_push(rgui->selection_buf, "Black Frame Insertion", RGUI_SETTINGS_VIDEO_BLACK_FRAME_INSERTION, 0);
#endif
file_list_push(rgui->selection_buf, "VSync Swap Interval", RGUI_SETTINGS_VIDEO_SWAP_INTERVAL, 0);
#if defined(HAVE_THREADS) && !defined(GEKKO)
file_list_push(rgui->selection_buf, "Threaded Driver", RGUI_SETTINGS_VIDEO_THREADED, 0);
#endif
#if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)
file_list_push(rgui->selection_buf, "Windowed Scale (X)", RGUI_SETTINGS_VIDEO_WINDOW_SCALE_X, 0);
file_list_push(rgui->selection_buf, "Windowed Scale (Y)", RGUI_SETTINGS_VIDEO_WINDOW_SCALE_Y, 0);
#endif
file_list_push(rgui->selection_buf, "Crop Overscan (reload)", RGUI_SETTINGS_VIDEO_CROP_OVERSCAN, 0);
file_list_push(rgui->selection_buf, "Monitor Index", RGUI_SETTINGS_VIDEO_MONITOR_INDEX, 0);
file_list_push(rgui->selection_buf, "Estimated Monitor FPS", RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0);
break;
case RGUI_SETTINGS_FONT_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "OSD Font Enable", RGUI_SETTINGS_FONT_ENABLE, 0);
file_list_push(rgui->selection_buf, "OSD Font Scale to Window", RGUI_SETTINGS_FONT_SCALE, 0);
file_list_push(rgui->selection_buf, "OSD Font Size", RGUI_SETTINGS_FONT_SIZE, 0);
break;
case RGUI_SETTINGS_CORE_OPTIONS:
file_list_clear(rgui->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(rgui->selection_buf,
core_option_get_desc(g_extern.system.core_options, i), RGUI_SETTINGS_CORE_OPTION_START + i, 0);
}
else
file_list_push(rgui->selection_buf, "No options available.", RGUI_SETTINGS_CORE_OPTION_NONE, 0);
break;
case RGUI_SETTINGS_CORE_INFO:
file_list_clear(rgui->selection_buf);
if (rgui->core_info_current.data)
{
snprintf(tmp, sizeof(tmp), "Core name: %s",
rgui->core_info_current.display_name ? rgui->core_info_current.display_name : "");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
if (rgui->core_info_current.authors_list)
{
strlcpy(tmp, "Authors: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), rgui->core_info_current.authors_list, ", ");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
}
if (rgui->core_info_current.permissions_list)
{
strlcpy(tmp, "Permissions: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), rgui->core_info_current.permissions_list, ", ");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
}
if (rgui->core_info_current.supported_extensions_list)
{
strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), rgui->core_info_current.supported_extensions_list, ", ");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
}
if (rgui->core_info_current.firmware_count > 0)
{
core_info_list_update_missing_firmware(rgui->core_info, rgui->core_info_current.path,
g_settings.system_directory);
file_list_push(rgui->selection_buf, "Firmware: ", RGUI_SETTINGS_CORE_INFO_NONE, 0);
for (i = 0; i < rgui->core_info_current.firmware_count; i++)
{
if (rgui->core_info_current.firmware[i].desc)
{
snprintf(tmp, sizeof(tmp), " name: %s",
rgui->core_info_current.firmware[i].desc ? rgui->core_info_current.firmware[i].desc : "");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
snprintf(tmp, sizeof(tmp), " status: %s, %s",
rgui->core_info_current.firmware[i].missing ? "missing" : "present",
rgui->core_info_current.firmware[i].optional ? "optional" : "required");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
}
}
}
if (rgui->core_info_current.notes)
{
snprintf(tmp, sizeof(tmp), "Core notes: ");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
for (i = 0; i < rgui->core_info_current.note_list->size; i++)
{
snprintf(tmp, sizeof(tmp), " %s", rgui->core_info_current.note_list->elems[i].data);
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
}
}
}
else
file_list_push(rgui->selection_buf, "No information available.", RGUI_SETTINGS_CORE_OPTION_NONE, 0);
break;
case RGUI_SETTINGS_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "General Options", RGUI_SETTINGS_GENERAL_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Video Options", RGUI_SETTINGS_VIDEO_OPTIONS, 0);
#ifdef HAVE_SHADER_MANAGER
file_list_push(rgui->selection_buf, "Shader Options", RGUI_SETTINGS_SHADER_OPTIONS, 0);
#endif
file_list_push(rgui->selection_buf, "Font Options", RGUI_SETTINGS_FONT_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Audio Options", RGUI_SETTINGS_AUDIO_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Input Options", RGUI_SETTINGS_INPUT_OPTIONS, 0);
#ifdef HAVE_OVERLAY
file_list_push(rgui->selection_buf, "Overlay Options", RGUI_SETTINGS_OVERLAY_OPTIONS, 0);
#endif
#ifdef HAVE_NETPLAY
file_list_push(rgui->selection_buf, "Netplay Options", RGUI_SETTINGS_NETPLAY_OPTIONS, 0);
#endif
file_list_push(rgui->selection_buf, "Path Options", RGUI_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(rgui->selection_buf, "Disk Options", RGUI_SETTINGS_DISK_OPTIONS, 0);
}
file_list_push(rgui->selection_buf, "Privacy Options", RGUI_SETTINGS_PRIVACY_OPTIONS, 0);
break;
case RGUI_SETTINGS_PRIVACY_OPTIONS:
file_list_clear(rgui->selection_buf);
#ifdef HAVE_CAMERA
file_list_push(rgui->selection_buf, "Allow Camera", RGUI_SETTINGS_PRIVACY_CAMERA_ALLOW, 0);
#endif
#ifdef HAVE_LOCATION
file_list_push(rgui->selection_buf, "Allow Location Services", RGUI_SETTINGS_PRIVACY_LOCATION_ALLOW, 0);
#endif
break;
case RGUI_SETTINGS_DISK_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Disk Index", RGUI_SETTINGS_DISK_INDEX, 0);
file_list_push(rgui->selection_buf, "Disk Image Append", RGUI_SETTINGS_DISK_APPEND, 0);
break;
case RGUI_SETTINGS_OVERLAY_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Overlay Preset", RGUI_SETTINGS_OVERLAY_PRESET, 0);
file_list_push(rgui->selection_buf, "Overlay Opacity", RGUI_SETTINGS_OVERLAY_OPACITY, 0);
file_list_push(rgui->selection_buf, "Overlay Scale", RGUI_SETTINGS_OVERLAY_SCALE, 0);
break;
#ifdef HAVE_NETPLAY
case RGUI_SETTINGS_NETPLAY_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Netplay Enable", RGUI_SETTINGS_NETPLAY_ENABLE, 0);
file_list_push(rgui->selection_buf, "Netplay Mode", RGUI_SETTINGS_NETPLAY_MODE, 0);
file_list_push(rgui->selection_buf, "Spectator Mode Enable", RGUI_SETTINGS_NETPLAY_SPECTATOR_MODE_ENABLE, 0);
file_list_push(rgui->selection_buf, "Host IP Address", RGUI_SETTINGS_NETPLAY_HOST_IP_ADDRESS, 0);
file_list_push(rgui->selection_buf, "TCP/UDP Port", RGUI_SETTINGS_NETPLAY_TCP_UDP_PORT, 0);
file_list_push(rgui->selection_buf, "Delay Frames", RGUI_SETTINGS_NETPLAY_DELAY_FRAMES, 0);
file_list_push(rgui->selection_buf, "Nickname", RGUI_SETTINGS_NETPLAY_NICKNAME, 0);
break;
#endif
case RGUI_SETTINGS_PATH_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Browser Directory", RGUI_BROWSER_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Content Directory", RGUI_CONTENT_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Assets Directory", RGUI_ASSETS_DIR_PATH, 0);
#ifdef HAVE_DYNAMIC
file_list_push(rgui->selection_buf, "Config Directory", RGUI_CONFIG_DIR_PATH, 0);
#endif
file_list_push(rgui->selection_buf, "Core Directory", RGUI_LIBRETRO_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Core Info Directory", RGUI_LIBRETRO_INFO_DIR_PATH, 0);
#ifdef HAVE_DYLIB
file_list_push(rgui->selection_buf, "Soft Filter Directory", RGUI_FILTER_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "DSP Filter Directory", RGUI_DSP_FILTER_DIR_PATH, 0);
#endif
#ifdef HAVE_SHADER_MANAGER
file_list_push(rgui->selection_buf, "Shader Directory", RGUI_SHADER_DIR_PATH, 0);
#endif
file_list_push(rgui->selection_buf, "Savestate Directory", RGUI_SAVESTATE_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Savefile Directory", RGUI_SAVEFILE_DIR_PATH, 0);
#ifdef HAVE_OVERLAY
file_list_push(rgui->selection_buf, "Overlay Directory", RGUI_OVERLAY_DIR_PATH, 0);
#endif
file_list_push(rgui->selection_buf, "System Directory", RGUI_SYSTEM_DIR_PATH, 0);
#ifdef HAVE_SCREENSHOTS
file_list_push(rgui->selection_buf, "Screenshot Directory", RGUI_SCREENSHOT_DIR_PATH, 0);
#endif
file_list_push(rgui->selection_buf, "Autoconfig Directory", RGUI_AUTOCONFIG_DIR_PATH, 0);
break;
case RGUI_SETTINGS_INPUT_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Player", RGUI_SETTINGS_BIND_PLAYER, 0);
file_list_push(rgui->selection_buf, "Device", RGUI_SETTINGS_BIND_DEVICE, 0);
file_list_push(rgui->selection_buf, "Device Type", RGUI_SETTINGS_BIND_DEVICE_TYPE, 0);
file_list_push(rgui->selection_buf, "Analog D-pad Mode", RGUI_SETTINGS_BIND_ANALOG_MODE, 0);
file_list_push(rgui->selection_buf, "Input Axis Threshold", RGUI_SETTINGS_INPUT_AXIS_THRESHOLD, 0);
file_list_push(rgui->selection_buf, "Autodetect Enable", RGUI_SETTINGS_DEVICE_AUTODETECT_ENABLE, 0);
file_list_push(rgui->selection_buf, "Bind Mode", RGUI_SETTINGS_CUSTOM_BIND_MODE, 0);
file_list_push(rgui->selection_buf, "Configure All (RetroPad)", RGUI_SETTINGS_CUSTOM_BIND_ALL, 0);
file_list_push(rgui->selection_buf, "Default All (RetroPad)", RGUI_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, 0);
#ifdef HAVE_OSK
file_list_push(rgui->selection_buf, "Onscreen Keyboard Enable", RGUI_SETTINGS_ONSCREEN_KEYBOARD_ENABLE, 0);
#endif
last = (driver.input && driver.input->set_keybinds && !driver.input->get_joypad_driver) ? RGUI_SETTINGS_BIND_R3 : RGUI_SETTINGS_BIND_MENU_TOGGLE;
for (i = RGUI_SETTINGS_BIND_BEGIN; i <= last; i++)
file_list_push(rgui->selection_buf, input_config_bind_map[i - RGUI_SETTINGS_BIND_BEGIN].desc, i, 0);
break;
case RGUI_SETTINGS_AUDIO_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "DSP Filter", RGUI_SETTINGS_AUDIO_DSP_FILTER, 0);
file_list_push(rgui->selection_buf, "Audio Mute", RGUI_SETTINGS_AUDIO_MUTE, 0);
file_list_push(rgui->selection_buf, "Rate Control Delta", RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA, 0);
#ifdef __CELLOS_LV2__
file_list_push(rgui->selection_buf, "System BGM Control", RGUI_SETTINGS_CUSTOM_BGM_CONTROL_ENABLE, 0);
#endif
#ifdef _XBOX1
file_list_push(rgui->selection_buf, "Volume Effect", RGUI_SETTINGS_AUDIO_DSP_EFFECT, 0);
#endif
file_list_push(rgui->selection_buf, "Volume Level", RGUI_SETTINGS_AUDIO_VOLUME, 0);
break;
case RGUI_SETTINGS_DRIVERS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Video Driver", RGUI_SETTINGS_DRIVER_VIDEO, 0);
file_list_push(rgui->selection_buf, "Audio Driver", RGUI_SETTINGS_DRIVER_AUDIO, 0);
file_list_push(rgui->selection_buf, "Audio Device", RGUI_SETTINGS_DRIVER_AUDIO_DEVICE, 0);
file_list_push(rgui->selection_buf, "Audio Resampler", RGUI_SETTINGS_DRIVER_AUDIO_RESAMPLER, 0);
file_list_push(rgui->selection_buf, "Input Driver", RGUI_SETTINGS_DRIVER_INPUT, 0);
#ifdef HAVE_CAMERA
file_list_push(rgui->selection_buf, "Camera Driver", RGUI_SETTINGS_DRIVER_CAMERA, 0);
#endif
#ifdef HAVE_LOCATION
file_list_push(rgui->selection_buf, "Location Driver", RGUI_SETTINGS_DRIVER_LOCATION, 0);
#endif
#ifdef HAVE_MENU
file_list_push(rgui->selection_buf, "Menu Driver", RGUI_SETTINGS_DRIVER_MENU, 0);
#endif
break;
case RGUI_SETTINGS:
file_list_clear(rgui->selection_buf);
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
file_list_push(rgui->selection_buf, "Core", RGUI_SETTINGS_CORE, 0);
#endif
if (rgui->history)
file_list_push(rgui->selection_buf, "Load Content (History)", RGUI_SETTINGS_OPEN_HISTORY, 0);
if (rgui->core_info && core_info_list_num_info_files(rgui->core_info))
file_list_push(rgui->selection_buf, "Load Content (Detect Core)", RGUI_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE, 0);
if (rgui->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)",
rgui->info.library_name ? rgui->info.library_name : g_extern.system.info.library_name);
file_list_push(rgui->selection_buf, load_game_core_msg, RGUI_SETTINGS_OPEN_FILEBROWSER, 0);
}
file_list_push(rgui->selection_buf, "Core Options", RGUI_SETTINGS_CORE_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Core Information", RGUI_SETTINGS_CORE_INFO, 0);
file_list_push(rgui->selection_buf, "Settings", RGUI_SETTINGS_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Drivers", RGUI_SETTINGS_DRIVERS, 0);
if (g_extern.main_is_init && !g_extern.libretro_dummy)
{
file_list_push(rgui->selection_buf, "Save State", RGUI_SETTINGS_SAVESTATE_SAVE, 0);
file_list_push(rgui->selection_buf, "Load State", RGUI_SETTINGS_SAVESTATE_LOAD, 0);
#ifdef HAVE_SCREENSHOTS
file_list_push(rgui->selection_buf, "Take Screenshot", RGUI_SETTINGS_SCREENSHOT, 0);
#endif
file_list_push(rgui->selection_buf, "Resume Content", RGUI_SETTINGS_RESUME_GAME, 0);
file_list_push(rgui->selection_buf, "Restart Content", RGUI_SETTINGS_RESTART_GAME, 0);
}
#ifndef HAVE_DYNAMIC
file_list_push(rgui->selection_buf, "Restart RetroArch", RGUI_SETTINGS_RESTART_EMULATOR, 0);
#endif
file_list_push(rgui->selection_buf, "RetroArch Config", RGUI_SETTINGS_CONFIG, 0);
file_list_push(rgui->selection_buf, "Save New Config", RGUI_SETTINGS_SAVE_CONFIG, 0);
file_list_push(rgui->selection_buf, "Help", RGUI_START_SCREEN, 0);
file_list_push(rgui->selection_buf, "Quit RetroArch", RGUI_SETTINGS_QUIT_RARCH, 0);
break;
}
if (driver.menu_ctx && driver.menu_ctx->populate_entries)
driver.menu_ctx->populate_entries(rgui, menu_type);
}
static int menu_info_screen_iterate(unsigned action)
{
unsigned i;
char msg[1024];
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
if (!rgui)
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,
RARCH_MENU_TOGGLE,
RARCH_QUIT_KEY,
};
char desc[ARRAY_SIZE(binds)][64];
for (i = 0; i < ARRAY_SIZE(binds); i++)
{
if (driver.input && driver.input->set_keybinds)
{
struct platform_bind key_label;
strlcpy(key_label.desc, "Unknown", sizeof(key_label.desc));
key_label.joykey = g_settings.input.binds[0][binds[i]].joykey;
driver.input->set_keybinds(&key_label, 0, 0, 0, 1ULL << KEYBINDS_ACTION_GET_BIND_LABEL);
strlcpy(desc[i], key_label.desc, sizeof(desc[i]));
}
else
{
const struct retro_keybind *bind = &g_settings.input.binds[0][binds[i]];
input_get_bind_string(desc[i], bind, sizeof(desc[i]));
}
}
switch(info_selection_ptr)
{
case RGUI_SETTINGS_WINDOW_COMPOSITING_ENABLE:
snprintf(msg, sizeof(msg),
"-- Forcibly disable composition.\n"
"Only valid on Windows Vista/7 for now.");
break;
case RGUI_SETTINGS_LIBRETRO_LOG_LEVEL:
snprintf(msg, sizeof(msg),
"-- Sets log level for libretro cores \n"
"(GET_LOG_INTERFACE). \n"
" \n"
" If a log level issued by a libretro \n"
" core is below libretro_log level, it \n"
" is ignored.\n"
" \n"
" DEBUG logs are always ignored unless \n"
" verbose mode is activated (--verbose).\n"
" \n"
" DEBUG = 0\n"
" INFO = 1\n"
" WARN = 2\n"
" ERROR = 3"
);
break;
case RGUI_SETTINGS_LOGGING_VERBOSITY:
snprintf(msg, sizeof(msg),
"-- Enable or disable verbosity level \n"
"of frontend.");
break;
case RGUI_SYSTEM_DIR_PATH:
snprintf(msg, sizeof(msg),
"-- Sets the 'system' directory.\n"
"Implementations can query for this\n"
"directory to load BIOSes, system-\n"
"specific configs, etc.");
break;
case RGUI_START_SCREEN:
snprintf(msg, sizeof(msg),
" -- Show startup screen in menu.\n"
"Is automatically set to false when seen\n"
"for the first time.\n"
" \n"
"This is only updated in config if\n"
"'Config Save On Exit' is set to true.\n");
break;
case RGUI_SETTINGS_CONFIG_SAVE_ON_EXIT:
snprintf(msg, sizeof(msg),
" -- Flushes config to disk on exit.\n"
"Useful for menu as settings can be\n"
"modified. Overwrites the config.\n"
" \n"
"#include's and comments are not pre-\n"
"served.\n");
break;
case RGUI_SETTINGS_PER_CORE_CONFIG:
snprintf(msg, sizeof(msg),
" -- Load up a specific config file \n"
"based on the core being used.\n");
break;
case RGUI_SETTINGS_VIDEO_WINDOW_SCALE_X:
case RGUI_SETTINGS_VIDEO_WINDOW_SCALE_Y:
snprintf(msg, sizeof(msg),
" -- Fullscreen resolution.\n"
" \n"
"Resolution of 0 uses the \n"
"resolution of the environment.\n");
break;
case RGUI_SETTINGS_VIDEO_VSYNC:
snprintf(msg, sizeof(msg),
" -- Video V-Sync.\n");
break;
case RGUI_SETTINGS_VIDEO_HARD_SYNC:
snprintf(msg, sizeof(msg),
" -- Attempts to hard-synchronize \n"
"CPU and GPU.\n"
" \n"
"Can reduce latency at cost of \n"
"performance.");
break;
case RGUI_SETTINGS_VIDEO_HARD_SYNC_FRAMES:
snprintf(msg, sizeof(msg),
" -- Sets how many frames CPU can \n"
"run ahead of GPU when using 'GPU \n"
"Hard Sync'.\n"
" \n"
"Maximum is 3.\n"
" \n"
" 0: Syncs to GPU immediately.\n"
" 1: Syncs to previous frame.\n"
" 2: Etc ...");
break;
case RGUI_SETTINGS_VIDEO_BLACK_FRAME_INSERTION:
snprintf(msg, sizeof(msg),
" -- Inserts a black frame inbetween \n"
"frames.\n"
" \n"
"Useful for 120 Hz monitors who want to \n"
"play 60 Hz material with eliminated \n"
"ghosting.\n"
" \n"
"Video refresh rate should still be con-\n"
"figured as if it is a 60 Hz monitor \n"
"(divide refresh rate by 2).");
break;
case RGUI_SETTINGS_VIDEO_THREADED:
snprintf(msg, sizeof(msg),
" -- Use threaded video driver.\n"
" \n"
"Using this might improve performance at \n"
"possible cost of latency and more video \n"
"stuttering.");
break;
case RGUI_SETTINGS_VIDEO_INTEGER_SCALE:
snprintf(msg, sizeof(msg),
" -- Only scales video in integer \n"
"steps.\n"
" \n"
"The base size depends on system-reported \n"
"geometry and aspect ratio.\n"
" \n"
"If Force Aspect is not set, X/Y will be \n"
"integer scaled independently.");
break;
case RGUI_SETTINGS_VIDEO_CROP_OVERSCAN:
snprintf(msg, sizeof(msg),
" -- Forces cropping of overscanned \n"
"frames.\n"
" \n"
"Exact behavior of this option is core-\n"
"implementation specific.");
break;
case RGUI_SETTINGS_VIDEO_MONITOR_INDEX:
snprintf(msg, sizeof(msg),
" -- Which monitor to prefer.\n"
" \n"
"0 (default) means no particular monitor \n"
"is preferred, 1 and up (1 being first \n"
"monitor), suggests RetroArch to use that \n"
"particular monitor.");
break;
case RGUI_SETTINGS_VIDEO_ROTATION:
snprintf(msg, sizeof(msg),
" -- Forces a certain rotation \n"
"of the screen.\n"
" \n"
"The rotation is added to rotations which\n"
"the libretro core sets (see Video Allow\n"
"Rotate).");
break;
case RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA:
snprintf(msg, sizeof(msg),
" -- Audio rate control.\n"
" \n"
"Setting this to 0 disables rate control.\n"
"Any other value controls audio rate control \n"
"delta.\n"
" \n"
"Defines how much input rate can be adjusted \n"
"dynamically.\n"
" \n"
" Input rate is defined as: \n"
" input rate * (1.0 +/- (rate control delta))");
break;
case RGUI_SETTINGS_AUDIO_VOLUME:
snprintf(msg, sizeof(msg),
" -- Audio volume, expressed in dB.\n"
" \n"
" 0 dB is normal volume. No gain will be applied.\n"
"Gain can be controlled in runtime with Input\n"
"Volume Up / Input Volume Down.");
break;
case RGUI_SETTINGS_VIDEO_SOFTFILTER:
#ifdef HAVE_FILTERS_BUILTIN
snprintf(msg, sizeof(msg),
" -- CPU-based video filter.");
#else
snprintf(msg, sizeof(msg),
" -- CPU-based video filter.\n"
" \n"
"Path to a dynamic library.");
#endif
break;
case RGUI_SETTINGS_BLOCK_SRAM_OVERWRITE:
snprintf(msg, sizeof(msg),
" -- Block SRAM from being overwritten \n"
"when loading save states.\n"
" \n"
"Might potentially lead to buggy games.");
break;
case RGUI_SETTINGS_PRIVACY_CAMERA_ALLOW:
snprintf(msg, sizeof(msg),
" -- Allow or disallow camera access by \n"
"cores.");
break;
case RGUI_SETTINGS_PRIVACY_LOCATION_ALLOW:
snprintf(msg, sizeof(msg),
" -- Allow or disallow location services \n"
"access by cores.");
break;
case RGUI_SETTINGS_REWIND_ENABLE:
snprintf(msg, sizeof(msg),
" -- Enable rewinding.\n"
" \n"
"This will take a performance hit, \n"
"so it is disabled by default.");
break;
case RGUI_SETTINGS_REWIND_GRANULARITY:
snprintf(msg, sizeof(msg),
" -- Rewind granularity.\n"
" \n"
" When rewinding defined number of \n"
"frames, you can rewind several frames \n"
"at a time, increasing the rewinding \n"
"speed.");
break;
case RGUI_SETTINGS_DEVICE_AUTODETECT_ENABLE:
snprintf(msg, sizeof(msg),
" -- Enable input auto-detection.\n"
" \n"
"Will attempt to auto-configure \n"
"joypads, Plug-and-Play style.");
break;
case RGUI_SETTINGS_INPUT_AXIS_THRESHOLD:
snprintf(msg, sizeof(msg),
" -- Defines axis threshold.\n"
" \n"
" Possible values are [0.0, 1.0].");
break;
case RGUI_SETTINGS_DRIVER_INPUT:
snprintf(msg, sizeof(msg),
" -- Input driver.\n"
" \n"
"Depending on video driver, it might \n"
"force a different input driver.");
break;
case RGUI_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 RGUI_SETTINGS_TOGGLE_FULLSCREEN:
snprintf(msg, sizeof(msg),
" -- Toggles fullscreen.");
break;
case RGUI_SETTINGS_SLOWMOTION_RATIO:
snprintf(msg, sizeof(msg),
" -- Slowmotion ratio."
" \n"
"When slowmotion, content will slow\n"
"down by factor.");
break;
case RGUI_SETTINGS_FASTFORWARD_RATIO:
snprintf(msg, sizeof(msg),
" -- Fastforward ratio."
" \n"
"The maximum rate at which content will\n"
"be run when using fast forward.\n"
" \n"
" (E.g. 5.0 for 60 fps content => 300 fps \n"
"cap).\n"
" \n"
"RetroArch will go to sleep to ensure that \n"
"the maximum rate will not be exceeded.\n"
"Do not rely on this cap to be perfectly \n"
"accurate.");
break;
case RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST:
snprintf(msg, sizeof(msg),
" -- Pause gameplay when window focus \n"
"is lost.");
break;
case RGUI_SETTINGS_GPU_SCREENSHOT:
snprintf(msg, sizeof(msg),
" -- Screenshots output of GPU shaded \n"
"material if available.");
break;
case RGUI_SETTINGS_SRAM_AUTOSAVE:
snprintf(msg, sizeof(msg),
" -- Autosaves the non-volatile SRAM \n"
"at a regular interval.\n"
" \n"
"This is disabled by default unless set \n"
"otherwise. The interval is measured in \n"
"seconds. \n"
" \n"
"A value of 0 disables autosave.");
break;
case RGUI_SCREENSHOT_DIR_PATH:
snprintf(msg, sizeof(msg),
" -- Directory to dump screenshots to.");
break;
case RGUI_SETTINGS_DRIVER_AUDIO_DEVICE:
snprintf(msg, sizeof(msg),
" -- Override the default audio device \n"
"the audio driver uses.\n"
"This is driver dependent. E.g.\n"
#ifdef HAVE_ALSA
" \n"
"ALSA wants a PCM device."
#endif
#ifdef HAVE_OSS
" \n"
"OSS wants a path (e.g. /dev/dsp)."
#endif
#ifdef HAVE_JACK
" \n"
"JACK wants portnames (e.g. system:playback1\n"
",system:playback_2)."
#endif
#ifdef HAVE_RSOUND
" \n"
"RSound wants an IP address to an RSound \n"
"server."
#endif
);
break;
case RGUI_ASSETS_DIR_PATH:
snprintf(msg, sizeof(msg),
" -- Assets directory. \n"
" This location is queried by default when \n"
"menu interfaces try to look for loadable \n"
"assets, etc.");
break;
case RGUI_SETTINGS_SAVESTATE_AUTO_SAVE:
snprintf(msg, sizeof(msg),
" -- Automatically saves a savestate at the \n"
"end of RetroArch's lifetime.\n"
" \n"
"RetroArch will automatically load any savestate\n"
"with this path on startup if 'Savestate Auto\n"
"Load' is set.");
break;
case RGUI_SETTINGS_VIDEO_SWAP_INTERVAL:
snprintf(msg, sizeof(msg),
" -- VSync Swap Interval.\n"
" \n"
"Uses a custom swap interval for VSync. Set this \n"
"to effectively halve monitor refresh rate.");
break;
case RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO:
snprintf(msg, sizeof(msg),
" -- Refresh Rate Auto.\n"
" \n"
"The accurate refresh rate of our monitor (Hz).\n"
"This is used to calculate audio input rate with \n"
"the formula: \n"
" \n"
"audio_input_rate = game input rate * display \n"
"refresh rate / game refresh rate\n"
" \n"
"If the implementation does not report any \n"
"values, NTSC defaults will be assumed for \n"
"compatibility.\n"
" \n"
"This value should stay close to 60Hz to avoid \n"
"large pitch changes. If your monitor does \n"
"not run at 60Hz, or something close to it, \n"
"disable VSync, and leave this at its default.");
break;
case RGUI_LIBRETRO_DIR_PATH:
snprintf(msg, sizeof(msg),
" -- A directory for where to search for \n"
"libretro core implementations.");
break;
case RGUI_SAVEFILE_DIR_PATH:
snprintf(msg, sizeof(msg),
" -- Save all save files (*.srm) to this \n"
"directory. This includes related files like \n"
".bsv, .rt, .psrm, etc...\n"
" \n"
"This will be overridden by explicit command line\n"
"options.");
break;
case RGUI_SAVESTATE_DIR_PATH:
snprintf(msg, sizeof(msg),
" -- Save all save states (*.state) to this \n"
"directory.\n"
" \n"
"This will be overridden by explicit command line\n"
"options.");
break;
case RGUI_SETTINGS_BIND_ANALOG_LEFT_X_PLUS:
case RGUI_SETTINGS_BIND_ANALOG_LEFT_X_MINUS:
case RGUI_SETTINGS_BIND_ANALOG_LEFT_Y_PLUS:
case RGUI_SETTINGS_BIND_ANALOG_LEFT_Y_MINUS:
case RGUI_SETTINGS_BIND_ANALOG_RIGHT_X_PLUS:
case RGUI_SETTINGS_BIND_ANALOG_RIGHT_X_MINUS:
case RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_PLUS:
case RGUI_SETTINGS_BIND_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 RGUI_SETTINGS_BIND_SHADER_NEXT:
snprintf(msg, sizeof(msg),
" -- Applies next shader in directory.");
break;
case RGUI_SETTINGS_BIND_SHADER_PREV:
snprintf(msg, sizeof(msg),
" -- Applies previous shader in directory.");
break;
case RGUI_SETTINGS_BIND_LOAD_STATE_KEY:
snprintf(msg, sizeof(msg),
" -- Loads state.");
break;
case RGUI_SETTINGS_BIND_SAVE_STATE_KEY:
snprintf(msg, sizeof(msg),
" -- Saves state.");
break;
case RGUI_SETTINGS_BIND_STATE_SLOT_PLUS:
case RGUI_SETTINGS_BIND_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 RGUI_SETTINGS_BIND_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 RGUI_SETTINGS_BIND_FAST_FORWARD_HOLD_KEY:
snprintf(msg, sizeof(msg),
" -- Hold for fast-forward. Releasing button \n"
"disables fast-forward.");
break;
case RGUI_SETTINGS_BIND_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 RGUI_SETTINGS_BIND_REWIND:
snprintf(msg, sizeof(msg),
" -- Hold button down to rewind.\n"
" \n"
"Rewind must be enabled.");
break;
case RGUI_SETTINGS_BIND_MOVIE_RECORD_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggle between recording and not.");
break;
case RGUI_SETTINGS_BIND_PAUSE_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggle between paused and non-paused state.");
break;
case RGUI_SETTINGS_BIND_FRAMEADVANCE:
snprintf(msg, sizeof(msg),
" -- Frame advance when content is paused.");
break;
case RGUI_SETTINGS_BIND_RESET:
snprintf(msg, sizeof(msg),
" -- Reset the content.\n");
break;
case RGUI_SETTINGS_BIND_CHEAT_INDEX_PLUS:
snprintf(msg, sizeof(msg),
" -- Increment cheat index.\n");
break;
case RGUI_SETTINGS_BIND_CHEAT_INDEX_MINUS:
snprintf(msg, sizeof(msg),
" -- Decrement cheat index.\n");
break;
case RGUI_SETTINGS_BIND_CHEAT_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggle cheat index.\n");
break;
case RGUI_SETTINGS_BIND_SCREENSHOT:
snprintf(msg, sizeof(msg),
" -- Take screenshot.");
break;
case RGUI_SETTINGS_BIND_MUTE:
snprintf(msg, sizeof(msg),
" -- Mute/unmute audio.");
break;
case RGUI_SETTINGS_BIND_NETPLAY_FLIP:
snprintf(msg, sizeof(msg),
" -- Netplay flip players.");
break;
case RGUI_SETTINGS_BIND_SLOWMOTION:
snprintf(msg, sizeof(msg),
" -- Hold for slowmotion.");
break;
case RGUI_SETTINGS_BIND_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 RGUI_SETTINGS_BIND_VOLUME_UP:
snprintf(msg, sizeof(msg),
" -- Increases audio volume.");
break;
case RGUI_SETTINGS_BIND_VOLUME_DOWN:
snprintf(msg, sizeof(msg),
" -- Decreases audio volume.");
break;
case RGUI_SETTINGS_BIND_OVERLAY_NEXT:
snprintf(msg, sizeof(msg),
" -- Toggles to next overlay.\n"
" \n"
"Wraps around.");
break;
case RGUI_SETTINGS_BIND_DISK_EJECT_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggles eject for disks.\n"
" \n"
"Used for multiple-disk content.");
break;
case RGUI_SETTINGS_BIND_DISK_NEXT:
snprintf(msg, sizeof(msg),
" -- Cycles through disk images. Use after \n"
"ejecting. \n"
" \n"
" Complete by toggling eject again.");
break;
case RGUI_SETTINGS_BIND_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 RGUI_SETTINGS_BIND_MENU_TOGGLE:
snprintf(msg, sizeof(msg),
" -- Toggles menu.");
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)
driver.menu_ctx->render_messagebox(msg);
if (action == RGUI_ACTION_OK)
file_list_pop(rgui->menu_stack, &rgui->selection_ptr);
return 0;
}
static int menu_start_screen_iterate(unsigned action)
{
unsigned i;
char msg[1024];
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
if (!rgui)
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++)
{
if (driver.input && driver.input->set_keybinds)
{
struct platform_bind key_label;
strlcpy(key_label.desc, "Unknown", sizeof(key_label.desc));
key_label.joykey = g_settings.input.binds[0][binds[i]].joykey;
driver.input->set_keybinds(&key_label, 0, 0, 0, 1ULL << KEYBINDS_ACTION_GET_BIND_LABEL);
strlcpy(desc[i], key_label.desc, sizeof(desc[i]));
}
else
{
const struct retro_keybind *bind = &g_settings.input.binds[0][binds[i]];
input_get_bind_string(desc[i], bind, sizeof(desc[i]));
}
}
snprintf(msg, sizeof(msg),
"-- Welcome to RetroArch / RGUI --\n"
" \n" // strtok_r doesn't split empty strings.
"Basic RGUI controls:\n"
" Scroll (Up): %-20s\n"
" Scroll (Down): %-20s\n"
" Accept/OK: %-20s\n"
" Back: %-20s\n"
" Info: %-20s\n"
"Enter/Exit RGUI: %-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 == RGUI_ACTION_OK)
file_list_pop(rgui->menu_stack, &rgui->selection_ptr);
return 0;
}
static unsigned menu_common_type_is(unsigned type)
{
unsigned ret = 0;
bool type_found;
type_found =
type == RGUI_SETTINGS ||
type == RGUI_SETTINGS_GENERAL_OPTIONS ||
type == RGUI_SETTINGS_CORE_OPTIONS ||
type == RGUI_SETTINGS_CORE_INFO ||
type == RGUI_SETTINGS_VIDEO_OPTIONS ||
type == RGUI_SETTINGS_FONT_OPTIONS ||
type == RGUI_SETTINGS_SHADER_OPTIONS ||
type == RGUI_SETTINGS_SHADER_PARAMETERS ||
type == RGUI_SETTINGS_SHADER_PRESET_PARAMETERS ||
type == RGUI_SETTINGS_AUDIO_OPTIONS ||
type == RGUI_SETTINGS_DISK_OPTIONS ||
type == RGUI_SETTINGS_PATH_OPTIONS ||
type == RGUI_SETTINGS_PRIVACY_OPTIONS ||
type == RGUI_SETTINGS_OVERLAY_OPTIONS ||
type == RGUI_SETTINGS_NETPLAY_OPTIONS ||
type == RGUI_SETTINGS_OPTIONS ||
type == RGUI_SETTINGS_DRIVERS ||
(type == RGUI_SETTINGS_INPUT_OPTIONS);
if (type_found)
{
ret = RGUI_SETTINGS;
return ret;
}
type_found = (type >= RGUI_SETTINGS_SHADER_0 &&
type <= RGUI_SETTINGS_SHADER_LAST &&
((type - RGUI_SETTINGS_SHADER_0) % 3) == 0) ||
type == RGUI_SETTINGS_SHADER_PRESET;
if (type_found)
{
ret = RGUI_SETTINGS_SHADER_OPTIONS;
return ret;
}
type_found =
type == RGUI_BROWSER_DIR_PATH ||
type == RGUI_CONTENT_DIR_PATH ||
type == RGUI_ASSETS_DIR_PATH ||
type == RGUI_SHADER_DIR_PATH ||
type == RGUI_FILTER_DIR_PATH ||
type == RGUI_DSP_FILTER_DIR_PATH ||
type == RGUI_SAVESTATE_DIR_PATH ||
type == RGUI_LIBRETRO_DIR_PATH ||
type == RGUI_LIBRETRO_INFO_DIR_PATH ||
type == RGUI_CONFIG_DIR_PATH ||
type == RGUI_SAVEFILE_DIR_PATH ||
type == RGUI_OVERLAY_DIR_PATH ||
type == RGUI_SCREENSHOT_DIR_PATH ||
type == RGUI_AUTOCONFIG_DIR_PATH ||
type == RGUI_SYSTEM_DIR_PATH;
if (type_found)
{
ret = RGUI_FILE_DIRECTORY;
return ret;
}
return ret;
}
static int menu_settings_iterate(unsigned action)
{
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
if (!rgui)
return 0;
rgui->frame_buf_pitch = rgui->width * 2;
unsigned type = 0;
const char *label = NULL;
if (action != RGUI_ACTION_REFRESH)
file_list_get_at_offset(rgui->selection_buf, rgui->selection_ptr, &label, &type);
if (type == RGUI_SETTINGS_CORE)
label = g_settings.libretro_directory;
else if (type == RGUI_SETTINGS_CONFIG)
label = g_settings.rgui_config_directory;
else if (type == RGUI_SETTINGS_DISK_APPEND)
label = g_settings.rgui_content_directory;
const char *dir = NULL;
unsigned menu_type = 0;
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
rgui = (rgui_handle_t*)driver.menu;
if (rgui->need_refresh)
action = RGUI_ACTION_NOOP;
switch (action)
{
case RGUI_ACTION_UP:
if (rgui->selection_ptr > 0)
menu_decrement_navigation(rgui);
else
menu_set_navigation(rgui, rgui->selection_buf->size - 1);
break;
case RGUI_ACTION_DOWN:
if (rgui->selection_ptr + 1 < rgui->selection_buf->size)
menu_increment_navigation(rgui);
else
menu_clear_navigation(rgui);
break;
case RGUI_ACTION_CANCEL:
if (rgui->menu_stack->size > 1)
{
file_list_pop(rgui->menu_stack, &rgui->selection_ptr);
rgui->need_refresh = true;
}
break;
case RGUI_ACTION_SELECT:
{
const char *path = NULL;
file_list_get_at_offset(rgui->selection_buf, rgui->selection_ptr, &path, &info_selection_ptr);
file_list_push(rgui->menu_stack, "", RGUI_INFO_SCREEN, 0);
}
break;
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
case RGUI_ACTION_START:
if ((type == RGUI_SETTINGS_OPEN_FILEBROWSER || type == RGUI_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE)
&& action == RGUI_ACTION_OK)
{
rgui->defer_core = type == RGUI_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE;
file_list_push(rgui->menu_stack, g_settings.rgui_content_directory, RGUI_FILE_DIRECTORY, rgui->selection_ptr);
menu_clear_navigation(rgui);
rgui->need_refresh = true;
}
else if ((type == RGUI_SETTINGS_OPEN_HISTORY || menu_common_type_is(type) == RGUI_FILE_DIRECTORY) && action == RGUI_ACTION_OK)
{
file_list_push(rgui->menu_stack, "", type, rgui->selection_ptr);
menu_clear_navigation(rgui);
rgui->need_refresh = true;
}
else if ((menu_common_type_is(type) == RGUI_SETTINGS || type == RGUI_SETTINGS_CORE || type == RGUI_SETTINGS_CONFIG || type == RGUI_SETTINGS_DISK_APPEND) && action == RGUI_ACTION_OK)
{
file_list_push(rgui->menu_stack, label, type, rgui->selection_ptr);
menu_clear_navigation(rgui);
rgui->need_refresh = true;
}
else if (type == RGUI_SETTINGS_CUSTOM_VIEWPORT && action == RGUI_ACTION_OK)
{
file_list_push(rgui->menu_stack, "", type, rgui->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;
if (driver.video_data && driver.video_poke && driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data,
g_settings.video.aspect_ratio_idx);
}
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);
if (ret)
return ret;
}
break;
case RGUI_ACTION_REFRESH:
menu_clear_navigation(rgui);
rgui->need_refresh = true;
break;
case RGUI_ACTION_MESSAGE:
rgui->msg_force = true;
break;
default:
break;
}
rgui = (rgui_handle_t*)driver.menu;
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
if (rgui && rgui->need_refresh && !(menu_type == RGUI_FILE_DIRECTORY ||
menu_common_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS ||
menu_common_type_is(menu_type) == RGUI_FILE_DIRECTORY ||
menu_type == RGUI_SETTINGS_VIDEO_SOFTFILTER ||
menu_type == RGUI_SETTINGS_AUDIO_DSP_FILTER ||
menu_type == RGUI_SETTINGS_OVERLAY_PRESET ||
menu_type == RGUI_SETTINGS_CORE ||
menu_type == RGUI_SETTINGS_CONFIG ||
menu_type == RGUI_SETTINGS_DISK_APPEND ||
menu_type == RGUI_SETTINGS_OPEN_HISTORY))
{
rgui->need_refresh = false;
if (
menu_type == RGUI_SETTINGS_INPUT_OPTIONS
|| menu_type == RGUI_SETTINGS_PATH_OPTIONS
|| menu_type == RGUI_SETTINGS_OVERLAY_OPTIONS
|| menu_type == RGUI_SETTINGS_NETPLAY_OPTIONS
|| menu_type == RGUI_SETTINGS_OPTIONS
|| menu_type == RGUI_SETTINGS_DRIVERS
|| menu_type == RGUI_SETTINGS_CORE_INFO
|| menu_type == RGUI_SETTINGS_CORE_OPTIONS
|| menu_type == RGUI_SETTINGS_AUDIO_OPTIONS
|| menu_type == RGUI_SETTINGS_DISK_OPTIONS
|| menu_type == RGUI_SETTINGS_PRIVACY_OPTIONS
|| menu_type == RGUI_SETTINGS_GENERAL_OPTIONS
|| menu_type == RGUI_SETTINGS_VIDEO_OPTIONS
|| menu_type == RGUI_SETTINGS_FONT_OPTIONS
|| menu_type == RGUI_SETTINGS_SHADER_OPTIONS
|| menu_type == RGUI_SETTINGS_SHADER_PARAMETERS
|| menu_type == RGUI_SETTINGS_SHADER_PRESET_PARAMETERS
)
menu_common_entries_init(driver.menu, menu_type);
else
menu_common_entries_init(driver.menu, RGUI_SETTINGS);
}
if (driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render();
// Have to defer it so we let settings refresh.
if (rgui->push_start_screen)
{
rgui->push_start_screen = false;
file_list_push(rgui->menu_stack, "", RGUI_START_SCREEN, 0);
}
return 0;
}
static int menu_viewport_iterate(unsigned action)
{
rarch_viewport_t *custom = &g_extern.console.screen.viewports.custom_vp;
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
if (!rgui)
return 0;
unsigned menu_type = 0;
file_list_get_last(rgui->menu_stack, NULL, &menu_type);
struct retro_game_geometry *geom = &g_extern.system.av_info.geometry;
int stride_x = g_settings.video.scale_integer ?
geom->base_width : 1;
int stride_y = g_settings.video.scale_integer ?
geom->base_height : 1;
switch (action)
{
case RGUI_ACTION_UP:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
custom->y -= stride_y;
custom->height += stride_y;
}
else if (custom->height >= (unsigned)stride_y)
custom->height -= stride_y;
if (driver.video_data && driver.video_poke && driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
break;
case RGUI_ACTION_DOWN:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
custom->y += stride_y;
if (custom->height >= (unsigned)stride_y)
custom->height -= stride_y;
}
else
custom->height += stride_y;
if (driver.video_data && driver.video_poke && driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
break;
case RGUI_ACTION_LEFT:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
custom->x -= stride_x;
custom->width += stride_x;
}
else if (custom->width >= (unsigned)stride_x)
custom->width -= stride_x;
if (driver.video_data && driver.video_poke && driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
break;
case RGUI_ACTION_RIGHT:
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
custom->x += stride_x;
if (custom->width >= (unsigned)stride_x)
custom->width -= stride_x;
}
else
custom->width += stride_x;
if (driver.video_data && driver.video_poke && driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
break;
case RGUI_ACTION_CANCEL:
file_list_pop(rgui->menu_stack, &rgui->selection_ptr);
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT_2)
{
file_list_push(rgui->menu_stack, "",
RGUI_SETTINGS_CUSTOM_VIEWPORT,
rgui->selection_ptr);
}
break;
case RGUI_ACTION_OK:
file_list_pop(rgui->menu_stack, &rgui->selection_ptr);
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT
&& !g_settings.video.scale_integer)
{
file_list_push(rgui->menu_stack, "",
RGUI_SETTINGS_CUSTOM_VIEWPORT_2,
rgui->selection_ptr);
}
break;
case RGUI_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 == RGUI_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;
}
if (driver.video_data && driver.video_poke && driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
}
break;
case RGUI_ACTION_MESSAGE:
rgui->msg_force = true;
break;
default:
break;
}
file_list_get_last(rgui->menu_stack, NULL, &menu_type);
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render();
const char *base_msg = NULL;
char msg[64];
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 == RGUI_SETTINGS_CUSTOM_VIEWPORT)
base_msg = "Set Upper-Left Corner";
else if (menu_type == RGUI_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;
if (driver.video_data && driver.video_poke && driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
return 0;
}
static void menu_parse_and_resolve(unsigned menu_type)
{
const core_info_t *info = NULL;
const char *dir;
size_t i, list_size;
file_list_t *list;
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
if (!rgui)
{
RARCH_ERR("Cannot parse and resolve menu, menu handle is not initialized.\n");
return;
}
dir = NULL;
file_list_clear(rgui->selection_buf);
// parsing switch
switch (menu_type)
{
case RGUI_SETTINGS_OPEN_HISTORY:
/* History parse */
list_size = rom_history_size(rgui->history);
for (i = 0; i < list_size; i++)
{
const char *path, *core_path, *core_name;
char fill_buf[PATH_MAX];
path = NULL;
core_path = NULL;
core_name = NULL;
rom_history_get_index(rgui->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(rgui->selection_buf, fill_buf, RGUI_FILE_PLAIN, 0);
}
break;
case RGUI_SETTINGS_DEFERRED_CORE:
break;
default:
{
/* Directory parse */
file_list_get_last(rgui->menu_stack, &dir, &menu_type);
if (!*dir)
{
#if defined(GEKKO)
#ifdef HW_RVL
file_list_push(rgui->selection_buf, "sd:/", menu_type, 0);
file_list_push(rgui->selection_buf, "usb:/", menu_type, 0);
#endif
file_list_push(rgui->selection_buf, "carda:/", menu_type, 0);
file_list_push(rgui->selection_buf, "cardb:/", menu_type, 0);
#elif defined(_XBOX1)
file_list_push(rgui->selection_buf, "C:", menu_type, 0);
file_list_push(rgui->selection_buf, "D:", menu_type, 0);
file_list_push(rgui->selection_buf, "E:", menu_type, 0);
file_list_push(rgui->selection_buf, "F:", menu_type, 0);
file_list_push(rgui->selection_buf, "G:", menu_type, 0);
#elif defined(_XBOX360)
file_list_push(rgui->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(rgui->selection_buf, drive, menu_type, 0);
}
#elif defined(__CELLOS_LV2__)
file_list_push(rgui->selection_buf, "/app_home/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_hdd0/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_hdd1/", menu_type, 0);
file_list_push(rgui->selection_buf, "/host_root/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_usb000/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_usb001/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_usb002/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_usb003/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_usb004/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_usb005/", menu_type, 0);
file_list_push(rgui->selection_buf, "/dev_usb006/", menu_type, 0);
#elif defined(PSP)
file_list_push(rgui->selection_buf, "ms0:/", menu_type, 0);
file_list_push(rgui->selection_buf, "ef0:/", menu_type, 0);
file_list_push(rgui->selection_buf, "host0:/", menu_type, 0);
#else
file_list_push(rgui->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 == RGUI_SETTINGS_CORE)
exts = EXT_EXECUTABLES;
else if (menu_type == RGUI_SETTINGS_CONFIG)
exts = "cfg";
else if (menu_type == RGUI_SETTINGS_SHADER_PRESET)
exts = "cgp|glslp";
else if (menu_common_type_is(menu_type) == RGUI_SETTINGS_SHADER_OPTIONS)
exts = "cg|glsl";
else if (menu_type == RGUI_SETTINGS_VIDEO_SOFTFILTER)
exts = EXT_EXECUTABLES;
else if (menu_type == RGUI_SETTINGS_AUDIO_DSP_FILTER)
exts = "dsp";
else if (menu_type == RGUI_SETTINGS_OVERLAY_PRESET)
exts = "cfg";
else if (menu_common_type_is(menu_type) == RGUI_FILE_DIRECTORY)
exts = ""; // we ignore files anyway
else if (rgui->defer_core)
exts = rgui->core_info ? core_info_list_get_all_extensions(rgui->core_info) : "";
else if (rgui->info.valid_extensions)
{
exts = ext_buf;
if (*rgui->info.valid_extensions)
snprintf(ext_buf, sizeof(ext_buf), "%s|zip", rgui->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) == RGUI_FILE_DIRECTORY)
file_list_push(rgui->selection_buf, "