(Menu) More replacement of namespace prefix 'rgui' with 'menu'

This commit is contained in:
twinaphex 2014-06-10 02:06:10 +02:00
parent 639e6dbe33
commit 966db762cf
16 changed files with 499 additions and 499 deletions

View File

@ -534,8 +534,8 @@ static const bool stdin_cmd_enable = false;
// Number of entries that will be kept in content history file. // Number of entries that will be kept in content history file.
static const unsigned game_history_size = 100; static const unsigned game_history_size = 100;
// Show RGUI start-up screen on boot. // Show Menu start-up screen on boot.
static const bool rgui_show_start_screen = true; static const bool menu_show_start_screen = true;
// Log level for libretro cores (GET_LOG_INTERFACE). // Log level for libretro cores (GET_LOG_INTERFACE).
static const unsigned libretro_log_level = 0; static const unsigned libretro_log_level = 0;

View File

@ -512,7 +512,7 @@ static void init_menu(void)
return; return;
find_menu_driver(); find_menu_driver();
if (!(driver.menu = (rgui_handle_t*)menu_init(driver.menu_ctx))) if (!(driver.menu = (menu_handle_t*)menu_init(driver.menu_ctx)))
{ {
RARCH_ERR("Cannot initialize menu.\n"); RARCH_ERR("Cannot initialize menu.\n");
rarch_fail(1, "init_menu()"); rarch_fail(1, "init_menu()");

View File

@ -467,14 +467,14 @@ typedef struct menu_ctx_driver
#define MAX_PLAYERS 8 #define MAX_PLAYERS 8
#endif #endif
struct rgui_bind_state_port struct menu_bind_state_port
{ {
bool buttons[MENU_MAX_BUTTONS]; bool buttons[MENU_MAX_BUTTONS];
int16_t axes[MENU_MAX_AXES]; int16_t axes[MENU_MAX_AXES];
uint16_t hats[MENU_MAX_HATS]; uint16_t hats[MENU_MAX_HATS];
}; };
struct rgui_bind_axis_state struct menu_bind_axis_state
{ {
// Default axis state. // Default axis state.
int16_t rested_axes[MENU_MAX_AXES]; int16_t rested_axes[MENU_MAX_AXES];
@ -482,15 +482,15 @@ struct rgui_bind_axis_state
int16_t locked_axes[MENU_MAX_AXES]; int16_t locked_axes[MENU_MAX_AXES];
}; };
struct rgui_bind_state struct menu_bind_state
{ {
struct retro_keybind *target; struct retro_keybind *target;
int64_t timeout_end; // For keyboard binding. int64_t timeout_end; // For keyboard binding.
unsigned begin; unsigned begin;
unsigned last; unsigned last;
unsigned player; unsigned player;
struct rgui_bind_state_port state[MAX_PLAYERS]; struct menu_bind_state_port state[MAX_PLAYERS];
struct rgui_bind_axis_state axis_state[MAX_PLAYERS]; struct menu_bind_axis_state axis_state[MAX_PLAYERS];
bool skip; bool skip;
}; };
@ -545,7 +545,7 @@ typedef struct
void *history; void *history;
retro_time_t last_time; // Used to throttle RGUI in case VSync is broken. retro_time_t last_time; // Used to throttle RGUI in case VSync is broken.
struct rgui_bind_state binds; struct menu_bind_state binds;
struct struct
{ {
const char **buffer; const char **buffer;
@ -558,7 +558,7 @@ typedef struct
retro_time_t delta; retro_time_t delta;
retro_time_t target_msec; retro_time_t target_msec;
retro_time_t sleep_msec; retro_time_t sleep_msec;
} rgui_handle_t; } menu_handle_t;
enum rarch_display_type enum rarch_display_type
{ {
@ -590,7 +590,7 @@ typedef struct driver
void *video_data; void *video_data;
void *input_data; void *input_data;
#ifdef HAVE_MENU #ifdef HAVE_MENU
rgui_handle_t *menu; menu_handle_t *menu;
const menu_ctx_driver_t *menu_ctx; const menu_ctx_driver_t *menu_ctx;
#endif #endif

View File

@ -46,17 +46,17 @@
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
static inline struct gfx_shader *shader_manager_get_current_shader(void *data, unsigned type) static inline struct gfx_shader *shader_manager_get_current_shader(void *data, unsigned type)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
struct gfx_shader *shader = NULL; struct gfx_shader *shader = NULL;
if (!rgui) if (!menu)
{ {
RARCH_ERR("Cannot get current shader, menu handle is not initialized.\n"); RARCH_ERR("Cannot get current shader, menu handle is not initialized.\n");
return NULL; return NULL;
} }
if (type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS) if (type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS)
shader = (struct gfx_shader *)rgui->shader; shader = (struct gfx_shader *)menu->shader;
if (!shader && driver.video_poke && driver.video_data && driver.video_poke->get_current_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); shader = driver.video_poke->get_current_shader(driver.video_data);
@ -69,9 +69,9 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
{ {
unsigned i, last; unsigned i, last;
char tmp[256]; char tmp[256];
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
switch (menu_type) switch (menu_type)
@ -80,35 +80,35 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
case MENU_SETTINGS_SHADER_PARAMETERS: case MENU_SETTINGS_SHADER_PARAMETERS:
case MENU_SETTINGS_SHADER_PRESET_PARAMETERS: case MENU_SETTINGS_SHADER_PRESET_PARAMETERS:
{ {
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
struct gfx_shader *shader = (struct gfx_shader*)shader_manager_get_current_shader(rgui, menu_type); struct gfx_shader *shader = (struct gfx_shader*)shader_manager_get_current_shader(menu, menu_type);
if (shader) if (shader)
for (i = 0; i < shader->num_parameters; i++) for (i = 0; i < shader->num_parameters; i++)
file_list_push(rgui->selection_buf, shader->parameters[i].desc, MENU_SETTINGS_SHADER_PARAMETER_0 + i, 0); file_list_push(menu->selection_buf, shader->parameters[i].desc, MENU_SETTINGS_SHADER_PARAMETER_0 + i, 0);
rgui->parameter_shader = shader; menu->parameter_shader = shader;
break; break;
} }
case MENU_SETTINGS_SHADER_OPTIONS: case MENU_SETTINGS_SHADER_OPTIONS:
{ {
struct gfx_shader *shader = (struct gfx_shader*)rgui->shader; struct gfx_shader *shader = (struct gfx_shader*)menu->shader;
if (!shader) if (!shader)
return; return;
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Apply Shader Changes", file_list_push(menu->selection_buf, "Apply Shader Changes",
MENU_SETTINGS_SHADER_APPLY, 0); MENU_SETTINGS_SHADER_APPLY, 0);
file_list_push(rgui->selection_buf, "Default Filter", MENU_SETTINGS_SHADER_FILTER, 0); file_list_push(menu->selection_buf, "Default Filter", MENU_SETTINGS_SHADER_FILTER, 0);
file_list_push(rgui->selection_buf, "Load Shader Preset", file_list_push(menu->selection_buf, "Load Shader Preset",
MENU_SETTINGS_SHADER_PRESET, 0); MENU_SETTINGS_SHADER_PRESET, 0);
file_list_push(rgui->selection_buf, "Save As Shader Preset", file_list_push(menu->selection_buf, "Save As Shader Preset",
MENU_SETTINGS_SHADER_PRESET_SAVE, 0); MENU_SETTINGS_SHADER_PRESET_SAVE, 0);
file_list_push(rgui->selection_buf, "Parameters (Current)", file_list_push(menu->selection_buf, "Parameters (Current)",
MENU_SETTINGS_SHADER_PARAMETERS, 0); MENU_SETTINGS_SHADER_PARAMETERS, 0);
file_list_push(rgui->selection_buf, "Parameters (RGUI)", file_list_push(menu->selection_buf, "Parameters (RGUI)",
MENU_SETTINGS_SHADER_PRESET_PARAMETERS, 0); MENU_SETTINGS_SHADER_PRESET_PARAMETERS, 0);
file_list_push(rgui->selection_buf, "Shader Passes", file_list_push(menu->selection_buf, "Shader Passes",
MENU_SETTINGS_SHADER_PASSES, 0); MENU_SETTINGS_SHADER_PASSES, 0);
for (i = 0; i < shader->passes; i++) for (i = 0; i < shader->passes; i++)
@ -116,99 +116,99 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
char buf[64]; char buf[64];
snprintf(buf, sizeof(buf), "Shader #%u", i); snprintf(buf, sizeof(buf), "Shader #%u", i);
file_list_push(rgui->selection_buf, buf, file_list_push(menu->selection_buf, buf,
MENU_SETTINGS_SHADER_0 + 3 * i, 0); MENU_SETTINGS_SHADER_0 + 3 * i, 0);
snprintf(buf, sizeof(buf), "Shader #%u Filter", i); snprintf(buf, sizeof(buf), "Shader #%u Filter", i);
file_list_push(rgui->selection_buf, buf, file_list_push(menu->selection_buf, buf,
MENU_SETTINGS_SHADER_0_FILTER + 3 * i, 0); MENU_SETTINGS_SHADER_0_FILTER + 3 * i, 0);
snprintf(buf, sizeof(buf), "Shader #%u Scale", i); snprintf(buf, sizeof(buf), "Shader #%u Scale", i);
file_list_push(rgui->selection_buf, buf, file_list_push(menu->selection_buf, buf,
MENU_SETTINGS_SHADER_0_SCALE + 3 * i, 0); MENU_SETTINGS_SHADER_0_SCALE + 3 * i, 0);
} }
} }
break; break;
#endif #endif
case MENU_SETTINGS_GENERAL_OPTIONS: case MENU_SETTINGS_GENERAL_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Libretro Logging Level", MENU_SETTINGS_LIBRETRO_LOG_LEVEL, 0); file_list_push(menu->selection_buf, "Libretro Logging Level", MENU_SETTINGS_LIBRETRO_LOG_LEVEL, 0);
file_list_push(rgui->selection_buf, "Logging Verbosity", MENU_SETTINGS_LOGGING_VERBOSITY, 0); file_list_push(menu->selection_buf, "Logging Verbosity", MENU_SETTINGS_LOGGING_VERBOSITY, 0);
file_list_push(rgui->selection_buf, "Performance Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS_ENABLE, 0); file_list_push(menu->selection_buf, "Performance Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS_ENABLE, 0);
file_list_push(rgui->selection_buf, "Configuration Save On Exit", MENU_SETTINGS_CONFIG_SAVE_ON_EXIT, 0); file_list_push(menu->selection_buf, "Configuration Save On Exit", MENU_SETTINGS_CONFIG_SAVE_ON_EXIT, 0);
file_list_push(rgui->selection_buf, "Configuration Per-Core", MENU_SETTINGS_PER_CORE_CONFIG, 0); file_list_push(menu->selection_buf, "Configuration Per-Core", MENU_SETTINGS_PER_CORE_CONFIG, 0);
#ifdef HAVE_SCREENSHOTS #ifdef HAVE_SCREENSHOTS
file_list_push(rgui->selection_buf, "GPU Screenshots", MENU_SETTINGS_GPU_SCREENSHOT, 0); file_list_push(menu->selection_buf, "GPU Screenshots", MENU_SETTINGS_GPU_SCREENSHOT, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Load Dummy On Core Shutdown", MENU_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN, 0); file_list_push(menu->selection_buf, "Load Dummy On Core Shutdown", MENU_SETTINGS_LOAD_DUMMY_ON_CORE_SHUTDOWN, 0);
file_list_push(rgui->selection_buf, "Show Framerate", MENU_SETTINGS_DEBUG_TEXT, 0); file_list_push(menu->selection_buf, "Show Framerate", MENU_SETTINGS_DEBUG_TEXT, 0);
file_list_push(rgui->selection_buf, "Maximum Run Speed", MENU_SETTINGS_FASTFORWARD_RATIO, 0); file_list_push(menu->selection_buf, "Maximum Run Speed", MENU_SETTINGS_FASTFORWARD_RATIO, 0);
file_list_push(rgui->selection_buf, "Slow-Motion Ratio", MENU_SETTINGS_SLOWMOTION_RATIO, 0); file_list_push(menu->selection_buf, "Slow-Motion Ratio", MENU_SETTINGS_SLOWMOTION_RATIO, 0);
file_list_push(rgui->selection_buf, "Rewind", MENU_SETTINGS_REWIND_ENABLE, 0); file_list_push(menu->selection_buf, "Rewind", MENU_SETTINGS_REWIND_ENABLE, 0);
file_list_push(rgui->selection_buf, "Rewind Granularity", MENU_SETTINGS_REWIND_GRANULARITY, 0); file_list_push(menu->selection_buf, "Rewind Granularity", MENU_SETTINGS_REWIND_GRANULARITY, 0);
file_list_push(rgui->selection_buf, "SRAM Block Overwrite", MENU_SETTINGS_BLOCK_SRAM_OVERWRITE, 0); file_list_push(menu->selection_buf, "SRAM Block Overwrite", MENU_SETTINGS_BLOCK_SRAM_OVERWRITE, 0);
#if defined(HAVE_THREADS) #if defined(HAVE_THREADS)
file_list_push(rgui->selection_buf, "SRAM Autosave", MENU_SETTINGS_SRAM_AUTOSAVE, 0); file_list_push(menu->selection_buf, "SRAM Autosave", MENU_SETTINGS_SRAM_AUTOSAVE, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Window Compositing", MENU_SETTINGS_WINDOW_COMPOSITING_ENABLE, 0); file_list_push(menu->selection_buf, "Window Compositing", MENU_SETTINGS_WINDOW_COMPOSITING_ENABLE, 0);
file_list_push(rgui->selection_buf, "Window Unfocus Pause", MENU_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST, 0); file_list_push(menu->selection_buf, "Window Unfocus Pause", MENU_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST, 0);
file_list_push(rgui->selection_buf, "Savestate Autosave On Exit", MENU_SETTINGS_SAVESTATE_AUTO_SAVE, 0); file_list_push(menu->selection_buf, "Savestate Autosave On Exit", MENU_SETTINGS_SAVESTATE_AUTO_SAVE, 0);
file_list_push(rgui->selection_buf, "Savestate Autoload", MENU_SETTINGS_SAVESTATE_AUTO_LOAD, 0); file_list_push(menu->selection_buf, "Savestate Autoload", MENU_SETTINGS_SAVESTATE_AUTO_LOAD, 0);
break; break;
case MENU_SETTINGS_VIDEO_OPTIONS: case MENU_SETTINGS_VIDEO_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
#if defined(GEKKO) || defined(__CELLOS_LV2__) #if defined(GEKKO) || defined(__CELLOS_LV2__)
file_list_push(rgui->selection_buf, "Screen Resolution", MENU_SETTINGS_VIDEO_RESOLUTION, 0); file_list_push(menu->selection_buf, "Screen Resolution", MENU_SETTINGS_VIDEO_RESOLUTION, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Soft Filter", MENU_SETTINGS_VIDEO_SOFTFILTER, 0); file_list_push(menu->selection_buf, "Soft Filter", MENU_SETTINGS_VIDEO_SOFTFILTER, 0);
#if defined(__CELLOS_LV2__) #if defined(__CELLOS_LV2__)
file_list_push(rgui->selection_buf, "PAL60 Mode", MENU_SETTINGS_VIDEO_PAL60, 0); file_list_push(menu->selection_buf, "PAL60 Mode", MENU_SETTINGS_VIDEO_PAL60, 0);
#endif #endif
#ifndef HAVE_SHADER_MANAGER #ifndef HAVE_SHADER_MANAGER
file_list_push(rgui->selection_buf, "Default Filter", MENU_SETTINGS_VIDEO_FILTER, 0); file_list_push(menu->selection_buf, "Default Filter", MENU_SETTINGS_VIDEO_FILTER, 0);
#endif #endif
#ifdef HW_RVL #ifdef HW_RVL
file_list_push(rgui->selection_buf, "VI Trap filtering", MENU_SETTINGS_VIDEO_SOFT_FILTER, 0); file_list_push(menu->selection_buf, "VI Trap filtering", MENU_SETTINGS_VIDEO_SOFT_FILTER, 0);
#endif #endif
#if defined(HW_RVL) || defined(_XBOX360) #if defined(HW_RVL) || defined(_XBOX360)
file_list_push(rgui->selection_buf, "Gamma", MENU_SETTINGS_VIDEO_GAMMA, 0); file_list_push(menu->selection_buf, "Gamma", MENU_SETTINGS_VIDEO_GAMMA, 0);
#endif #endif
#ifdef _XBOX1 #ifdef _XBOX1
file_list_push(rgui->selection_buf, "Soft filtering", MENU_SETTINGS_SOFT_DISPLAY_FILTER, 0); file_list_push(menu->selection_buf, "Soft filtering", MENU_SETTINGS_SOFT_DISPLAY_FILTER, 0);
file_list_push(rgui->selection_buf, "Flicker filtering", MENU_SETTINGS_FLICKER_FILTER, 0); file_list_push(menu->selection_buf, "Flicker filtering", MENU_SETTINGS_FLICKER_FILTER, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Integer Scale", MENU_SETTINGS_VIDEO_INTEGER_SCALE, 0); file_list_push(menu->selection_buf, "Integer Scale", MENU_SETTINGS_VIDEO_INTEGER_SCALE, 0);
file_list_push(rgui->selection_buf, "Aspect Ratio", MENU_SETTINGS_VIDEO_ASPECT_RATIO, 0); file_list_push(menu->selection_buf, "Aspect Ratio", MENU_SETTINGS_VIDEO_ASPECT_RATIO, 0);
file_list_push(rgui->selection_buf, "Custom Ratio", MENU_SETTINGS_CUSTOM_VIEWPORT, 0); file_list_push(menu->selection_buf, "Custom Ratio", MENU_SETTINGS_CUSTOM_VIEWPORT, 0);
#if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE) #if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)
file_list_push(rgui->selection_buf, "Toggle Fullscreen", MENU_SETTINGS_TOGGLE_FULLSCREEN, 0); file_list_push(menu->selection_buf, "Toggle Fullscreen", MENU_SETTINGS_TOGGLE_FULLSCREEN, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Rotation", MENU_SETTINGS_VIDEO_ROTATION, 0); file_list_push(menu->selection_buf, "Rotation", MENU_SETTINGS_VIDEO_ROTATION, 0);
file_list_push(rgui->selection_buf, "VSync", MENU_SETTINGS_VIDEO_VSYNC, 0); file_list_push(menu->selection_buf, "VSync", MENU_SETTINGS_VIDEO_VSYNC, 0);
file_list_push(rgui->selection_buf, "Hard GPU Sync", MENU_SETTINGS_VIDEO_HARD_SYNC, 0); file_list_push(menu->selection_buf, "Hard GPU Sync", MENU_SETTINGS_VIDEO_HARD_SYNC, 0);
file_list_push(rgui->selection_buf, "Hard GPU Sync Frames", MENU_SETTINGS_VIDEO_HARD_SYNC_FRAMES, 0); file_list_push(menu->selection_buf, "Hard GPU Sync Frames", MENU_SETTINGS_VIDEO_HARD_SYNC_FRAMES, 0);
#if !defined(RARCH_MOBILE) #if !defined(RARCH_MOBILE)
file_list_push(rgui->selection_buf, "Black Frame Insertion", MENU_SETTINGS_VIDEO_BLACK_FRAME_INSERTION, 0); file_list_push(menu->selection_buf, "Black Frame Insertion", MENU_SETTINGS_VIDEO_BLACK_FRAME_INSERTION, 0);
#endif #endif
file_list_push(rgui->selection_buf, "VSync Swap Interval", MENU_SETTINGS_VIDEO_SWAP_INTERVAL, 0); file_list_push(menu->selection_buf, "VSync Swap Interval", MENU_SETTINGS_VIDEO_SWAP_INTERVAL, 0);
#if defined(HAVE_THREADS) && !defined(GEKKO) #if defined(HAVE_THREADS) && !defined(GEKKO)
file_list_push(rgui->selection_buf, "Threaded Driver", MENU_SETTINGS_VIDEO_THREADED, 0); file_list_push(menu->selection_buf, "Threaded Driver", MENU_SETTINGS_VIDEO_THREADED, 0);
#endif #endif
#if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE) #if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)
file_list_push(rgui->selection_buf, "Windowed Scale (X)", MENU_SETTINGS_VIDEO_WINDOW_SCALE_X, 0); file_list_push(menu->selection_buf, "Windowed Scale (X)", MENU_SETTINGS_VIDEO_WINDOW_SCALE_X, 0);
file_list_push(rgui->selection_buf, "Windowed Scale (Y)", MENU_SETTINGS_VIDEO_WINDOW_SCALE_Y, 0); file_list_push(menu->selection_buf, "Windowed Scale (Y)", MENU_SETTINGS_VIDEO_WINDOW_SCALE_Y, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Crop Overscan (reload)", MENU_SETTINGS_VIDEO_CROP_OVERSCAN, 0); file_list_push(menu->selection_buf, "Crop Overscan (reload)", MENU_SETTINGS_VIDEO_CROP_OVERSCAN, 0);
file_list_push(rgui->selection_buf, "Monitor Index", MENU_SETTINGS_VIDEO_MONITOR_INDEX, 0); file_list_push(menu->selection_buf, "Monitor Index", MENU_SETTINGS_VIDEO_MONITOR_INDEX, 0);
file_list_push(rgui->selection_buf, "Estimated Monitor FPS", MENU_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0); file_list_push(menu->selection_buf, "Estimated Monitor FPS", MENU_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0);
break; break;
case MENU_SETTINGS_FONT_OPTIONS: case MENU_SETTINGS_FONT_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "OSD Font Enable", MENU_SETTINGS_FONT_ENABLE, 0); file_list_push(menu->selection_buf, "OSD Font Enable", MENU_SETTINGS_FONT_ENABLE, 0);
file_list_push(rgui->selection_buf, "OSD Font Size", MENU_SETTINGS_FONT_SIZE, 0); file_list_push(menu->selection_buf, "OSD Font Size", MENU_SETTINGS_FONT_SIZE, 0);
break; break;
case MENU_SETTINGS_CORE_OPTIONS: case MENU_SETTINGS_CORE_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
if (g_extern.system.core_options) if (g_extern.system.core_options)
{ {
@ -216,62 +216,62 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
opts = core_option_size(g_extern.system.core_options); opts = core_option_size(g_extern.system.core_options);
for (i = 0; i < opts; i++) for (i = 0; i < opts; i++)
file_list_push(rgui->selection_buf, file_list_push(menu->selection_buf,
core_option_get_desc(g_extern.system.core_options, i), MENU_SETTINGS_CORE_OPTION_START + i, 0); core_option_get_desc(g_extern.system.core_options, i), MENU_SETTINGS_CORE_OPTION_START + i, 0);
} }
else else
file_list_push(rgui->selection_buf, "No options available.", MENU_SETTINGS_CORE_OPTION_NONE, 0); file_list_push(menu->selection_buf, "No options available.", MENU_SETTINGS_CORE_OPTION_NONE, 0);
break; break;
case MENU_SETTINGS_CORE_INFO: case MENU_SETTINGS_CORE_INFO:
{ {
core_info_t *info = (core_info_t*)rgui->core_info_current; core_info_t *info = (core_info_t*)menu->core_info_current;
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
if (info->data) if (info->data)
{ {
snprintf(tmp, sizeof(tmp), "Core name: %s", snprintf(tmp, sizeof(tmp), "Core name: %s",
info->display_name ? info->display_name : ""); info->display_name ? info->display_name : "");
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
if (info->authors_list) if (info->authors_list)
{ {
strlcpy(tmp, "Authors: ", sizeof(tmp)); strlcpy(tmp, "Authors: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), info->authors_list, ", "); string_list_join_concat(tmp, sizeof(tmp), info->authors_list, ", ");
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
} }
if (info->permissions_list) if (info->permissions_list)
{ {
strlcpy(tmp, "Permissions: ", sizeof(tmp)); strlcpy(tmp, "Permissions: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), info->permissions_list, ", "); string_list_join_concat(tmp, sizeof(tmp), info->permissions_list, ", ");
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
} }
if (info->supported_extensions_list) if (info->supported_extensions_list)
{ {
strlcpy(tmp, "Supported extensions: ", sizeof(tmp)); strlcpy(tmp, "Supported extensions: ", sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp), info->supported_extensions_list, ", "); string_list_join_concat(tmp, sizeof(tmp), info->supported_extensions_list, ", ");
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
} }
if (info->firmware_count > 0) if (info->firmware_count > 0)
{ {
core_info_list_update_missing_firmware(rgui->core_info, info->path, core_info_list_update_missing_firmware(menu->core_info, info->path,
g_settings.system_directory); g_settings.system_directory);
file_list_push(rgui->selection_buf, "Firmware: ", MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, "Firmware: ", MENU_SETTINGS_CORE_INFO_NONE, 0);
for (i = 0; i < info->firmware_count; i++) for (i = 0; i < info->firmware_count; i++)
{ {
if (info->firmware[i].desc) if (info->firmware[i].desc)
{ {
snprintf(tmp, sizeof(tmp), " name: %s", snprintf(tmp, sizeof(tmp), " name: %s",
info->firmware[i].desc ? info->firmware[i].desc : ""); info->firmware[i].desc ? info->firmware[i].desc : "");
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
snprintf(tmp, sizeof(tmp), " status: %s, %s", snprintf(tmp, sizeof(tmp), " status: %s, %s",
info->firmware[i].missing ? "missing" : "present", info->firmware[i].missing ? "missing" : "present",
info->firmware[i].optional ? "optional" : "required"); info->firmware[i].optional ? "optional" : "required");
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
} }
} }
} }
@ -279,159 +279,159 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
if (info->notes) if (info->notes)
{ {
snprintf(tmp, sizeof(tmp), "Core notes: "); snprintf(tmp, sizeof(tmp), "Core notes: ");
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
for (i = 0; i < info->note_list->size; i++) for (i = 0; i < info->note_list->size; i++)
{ {
snprintf(tmp, sizeof(tmp), " %s", info->note_list->elems[i].data); snprintf(tmp, sizeof(tmp), " %s", info->note_list->elems[i].data);
file_list_push(rgui->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0); file_list_push(menu->selection_buf, tmp, MENU_SETTINGS_CORE_INFO_NONE, 0);
} }
} }
} }
else else
file_list_push(rgui->selection_buf, "No information available.", MENU_SETTINGS_CORE_OPTION_NONE, 0); file_list_push(menu->selection_buf, "No information available.", MENU_SETTINGS_CORE_OPTION_NONE, 0);
} }
break; break;
case MENU_SETTINGS_OPTIONS: case MENU_SETTINGS_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "General Options", MENU_SETTINGS_GENERAL_OPTIONS, 0); file_list_push(menu->selection_buf, "General Options", MENU_SETTINGS_GENERAL_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Video Options", MENU_SETTINGS_VIDEO_OPTIONS, 0); file_list_push(menu->selection_buf, "Video Options", MENU_SETTINGS_VIDEO_OPTIONS, 0);
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
file_list_push(rgui->selection_buf, "Shader Options", MENU_SETTINGS_SHADER_OPTIONS, 0); file_list_push(menu->selection_buf, "Shader Options", MENU_SETTINGS_SHADER_OPTIONS, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Font Options", MENU_SETTINGS_FONT_OPTIONS, 0); file_list_push(menu->selection_buf, "Font Options", MENU_SETTINGS_FONT_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Audio Options", MENU_SETTINGS_AUDIO_OPTIONS, 0); file_list_push(menu->selection_buf, "Audio Options", MENU_SETTINGS_AUDIO_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Input Options", MENU_SETTINGS_INPUT_OPTIONS, 0); file_list_push(menu->selection_buf, "Input Options", MENU_SETTINGS_INPUT_OPTIONS, 0);
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
file_list_push(rgui->selection_buf, "Overlay Options", MENU_SETTINGS_OVERLAY_OPTIONS, 0); file_list_push(menu->selection_buf, "Overlay Options", MENU_SETTINGS_OVERLAY_OPTIONS, 0);
#endif #endif
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
file_list_push(rgui->selection_buf, "Netplay Options", MENU_SETTINGS_NETPLAY_OPTIONS, 0); file_list_push(menu->selection_buf, "Netplay Options", MENU_SETTINGS_NETPLAY_OPTIONS, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Path Options", MENU_SETTINGS_PATH_OPTIONS, 0); 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.main_is_init && !g_extern.libretro_dummy)
{ {
if (g_extern.system.disk_control.get_num_images) if (g_extern.system.disk_control.get_num_images)
file_list_push(rgui->selection_buf, "Disk Options", MENU_SETTINGS_DISK_OPTIONS, 0); file_list_push(menu->selection_buf, "Disk Options", MENU_SETTINGS_DISK_OPTIONS, 0);
} }
file_list_push(rgui->selection_buf, "Privacy Options", MENU_SETTINGS_PRIVACY_OPTIONS, 0); file_list_push(menu->selection_buf, "Privacy Options", MENU_SETTINGS_PRIVACY_OPTIONS, 0);
break; break;
case MENU_SETTINGS_PRIVACY_OPTIONS: case MENU_SETTINGS_PRIVACY_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
#ifdef HAVE_CAMERA #ifdef HAVE_CAMERA
file_list_push(rgui->selection_buf, "Allow Camera", MENU_SETTINGS_PRIVACY_CAMERA_ALLOW, 0); file_list_push(menu->selection_buf, "Allow Camera", MENU_SETTINGS_PRIVACY_CAMERA_ALLOW, 0);
#endif #endif
#ifdef HAVE_LOCATION #ifdef HAVE_LOCATION
file_list_push(rgui->selection_buf, "Allow Location Services", MENU_SETTINGS_PRIVACY_LOCATION_ALLOW, 0); file_list_push(menu->selection_buf, "Allow Location Services", MENU_SETTINGS_PRIVACY_LOCATION_ALLOW, 0);
#endif #endif
break; break;
case MENU_SETTINGS_DISK_OPTIONS: case MENU_SETTINGS_DISK_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Disk Index", MENU_SETTINGS_DISK_INDEX, 0); file_list_push(menu->selection_buf, "Disk Index", MENU_SETTINGS_DISK_INDEX, 0);
file_list_push(rgui->selection_buf, "Disk Image Append", MENU_SETTINGS_DISK_APPEND, 0); file_list_push(menu->selection_buf, "Disk Image Append", MENU_SETTINGS_DISK_APPEND, 0);
break; break;
case MENU_SETTINGS_OVERLAY_OPTIONS: case MENU_SETTINGS_OVERLAY_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Overlay Preset", MENU_SETTINGS_OVERLAY_PRESET, 0); file_list_push(menu->selection_buf, "Overlay Preset", MENU_SETTINGS_OVERLAY_PRESET, 0);
file_list_push(rgui->selection_buf, "Overlay Opacity", MENU_SETTINGS_OVERLAY_OPACITY, 0); file_list_push(menu->selection_buf, "Overlay Opacity", MENU_SETTINGS_OVERLAY_OPACITY, 0);
file_list_push(rgui->selection_buf, "Overlay Scale", MENU_SETTINGS_OVERLAY_SCALE, 0); file_list_push(menu->selection_buf, "Overlay Scale", MENU_SETTINGS_OVERLAY_SCALE, 0);
break; break;
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
case MENU_SETTINGS_NETPLAY_OPTIONS: case MENU_SETTINGS_NETPLAY_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Netplay Enable", MENU_SETTINGS_NETPLAY_ENABLE, 0); file_list_push(menu->selection_buf, "Netplay Enable", MENU_SETTINGS_NETPLAY_ENABLE, 0);
file_list_push(rgui->selection_buf, "Netplay Mode", MENU_SETTINGS_NETPLAY_MODE, 0); file_list_push(menu->selection_buf, "Netplay Mode", MENU_SETTINGS_NETPLAY_MODE, 0);
file_list_push(rgui->selection_buf, "Spectator Mode Enable", MENU_SETTINGS_NETPLAY_SPECTATOR_MODE_ENABLE, 0); file_list_push(menu->selection_buf, "Spectator Mode Enable", MENU_SETTINGS_NETPLAY_SPECTATOR_MODE_ENABLE, 0);
file_list_push(rgui->selection_buf, "Host IP Address", MENU_SETTINGS_NETPLAY_HOST_IP_ADDRESS, 0); file_list_push(menu->selection_buf, "Host IP Address", MENU_SETTINGS_NETPLAY_HOST_IP_ADDRESS, 0);
file_list_push(rgui->selection_buf, "TCP/UDP Port", MENU_SETTINGS_NETPLAY_TCP_UDP_PORT, 0); file_list_push(menu->selection_buf, "TCP/UDP Port", MENU_SETTINGS_NETPLAY_TCP_UDP_PORT, 0);
file_list_push(rgui->selection_buf, "Delay Frames", MENU_SETTINGS_NETPLAY_DELAY_FRAMES, 0); file_list_push(menu->selection_buf, "Delay Frames", MENU_SETTINGS_NETPLAY_DELAY_FRAMES, 0);
file_list_push(rgui->selection_buf, "Nickname", MENU_SETTINGS_NETPLAY_NICKNAME, 0); file_list_push(menu->selection_buf, "Nickname", MENU_SETTINGS_NETPLAY_NICKNAME, 0);
break; break;
#endif #endif
case MENU_SETTINGS_PATH_OPTIONS: case MENU_SETTINGS_PATH_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Browser Directory", MENU_BROWSER_DIR_PATH, 0); file_list_push(menu->selection_buf, "Browser Directory", MENU_BROWSER_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Content Directory", MENU_CONTENT_DIR_PATH, 0); file_list_push(menu->selection_buf, "Content Directory", MENU_CONTENT_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Assets Directory", MENU_ASSETS_DIR_PATH, 0); file_list_push(menu->selection_buf, "Assets Directory", MENU_ASSETS_DIR_PATH, 0);
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
file_list_push(rgui->selection_buf, "Config Directory", MENU_CONFIG_DIR_PATH, 0); file_list_push(menu->selection_buf, "Config Directory", MENU_CONFIG_DIR_PATH, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Core Directory", MENU_LIBRETRO_DIR_PATH, 0); file_list_push(menu->selection_buf, "Core Directory", MENU_LIBRETRO_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Core Info Directory", MENU_LIBRETRO_INFO_DIR_PATH, 0); file_list_push(menu->selection_buf, "Core Info Directory", MENU_LIBRETRO_INFO_DIR_PATH, 0);
#ifdef HAVE_DYLIB #ifdef HAVE_DYLIB
file_list_push(rgui->selection_buf, "Soft Filter Directory", MENU_FILTER_DIR_PATH, 0); file_list_push(menu->selection_buf, "Soft Filter Directory", MENU_FILTER_DIR_PATH, 0);
#endif #endif
file_list_push(rgui->selection_buf, "DSP Filter Directory", MENU_DSP_FILTER_DIR_PATH, 0); file_list_push(menu->selection_buf, "DSP Filter Directory", MENU_DSP_FILTER_DIR_PATH, 0);
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
file_list_push(rgui->selection_buf, "Shader Directory", MENU_SHADER_DIR_PATH, 0); file_list_push(menu->selection_buf, "Shader Directory", MENU_SHADER_DIR_PATH, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Savestate Directory", MENU_SAVESTATE_DIR_PATH, 0); file_list_push(menu->selection_buf, "Savestate Directory", MENU_SAVESTATE_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Savefile Directory", MENU_SAVEFILE_DIR_PATH, 0); file_list_push(menu->selection_buf, "Savefile Directory", MENU_SAVEFILE_DIR_PATH, 0);
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
file_list_push(rgui->selection_buf, "Overlay Directory", MENU_OVERLAY_DIR_PATH, 0); file_list_push(menu->selection_buf, "Overlay Directory", MENU_OVERLAY_DIR_PATH, 0);
#endif #endif
file_list_push(rgui->selection_buf, "System Directory", MENU_SYSTEM_DIR_PATH, 0); file_list_push(menu->selection_buf, "System Directory", MENU_SYSTEM_DIR_PATH, 0);
#ifdef HAVE_SCREENSHOTS #ifdef HAVE_SCREENSHOTS
file_list_push(rgui->selection_buf, "Screenshot Directory", MENU_SCREENSHOT_DIR_PATH, 0); file_list_push(menu->selection_buf, "Screenshot Directory", MENU_SCREENSHOT_DIR_PATH, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Autoconfig Directory", MENU_AUTOCONFIG_DIR_PATH, 0); file_list_push(menu->selection_buf, "Autoconfig Directory", MENU_AUTOCONFIG_DIR_PATH, 0);
break; break;
case MENU_SETTINGS_INPUT_OPTIONS: case MENU_SETTINGS_INPUT_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Player", MENU_SETTINGS_BIND_PLAYER, 0); file_list_push(menu->selection_buf, "Player", MENU_SETTINGS_BIND_PLAYER, 0);
file_list_push(rgui->selection_buf, "Device", MENU_SETTINGS_BIND_DEVICE, 0); file_list_push(menu->selection_buf, "Device", MENU_SETTINGS_BIND_DEVICE, 0);
file_list_push(rgui->selection_buf, "Device Type", MENU_SETTINGS_BIND_DEVICE_TYPE, 0); file_list_push(menu->selection_buf, "Device Type", MENU_SETTINGS_BIND_DEVICE_TYPE, 0);
file_list_push(rgui->selection_buf, "Analog D-pad Mode", MENU_SETTINGS_BIND_ANALOG_MODE, 0); file_list_push(menu->selection_buf, "Analog D-pad Mode", MENU_SETTINGS_BIND_ANALOG_MODE, 0);
file_list_push(rgui->selection_buf, "Input Axis Threshold", MENU_SETTINGS_INPUT_AXIS_THRESHOLD, 0); file_list_push(menu->selection_buf, "Input Axis Threshold", MENU_SETTINGS_INPUT_AXIS_THRESHOLD, 0);
file_list_push(rgui->selection_buf, "Autodetect Enable", MENU_SETTINGS_DEVICE_AUTODETECT_ENABLE, 0); file_list_push(menu->selection_buf, "Autodetect Enable", MENU_SETTINGS_DEVICE_AUTODETECT_ENABLE, 0);
file_list_push(rgui->selection_buf, "Bind Mode", MENU_SETTINGS_CUSTOM_BIND_MODE, 0); file_list_push(menu->selection_buf, "Bind Mode", MENU_SETTINGS_CUSTOM_BIND_MODE, 0);
file_list_push(rgui->selection_buf, "Configure All (RetroPad)", MENU_SETTINGS_CUSTOM_BIND_ALL, 0); file_list_push(menu->selection_buf, "Configure All (RetroPad)", MENU_SETTINGS_CUSTOM_BIND_ALL, 0);
file_list_push(rgui->selection_buf, "Default All (RetroPad)", MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, 0); file_list_push(menu->selection_buf, "Default All (RetroPad)", MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, 0);
#ifdef HAVE_OSK #ifdef HAVE_OSK
file_list_push(rgui->selection_buf, "Onscreen Keyboard Enable", MENU_SETTINGS_ONSCREEN_KEYBOARD_ENABLE, 0); file_list_push(menu->selection_buf, "Onscreen Keyboard Enable", MENU_SETTINGS_ONSCREEN_KEYBOARD_ENABLE, 0);
#endif #endif
last = (driver.input && driver.input->set_keybinds && !driver.input->get_joypad_driver) ? (MENU_SETTINGS_BIND_BEGIN + RETRO_DEVICE_ID_JOYPAD_R3) : MENU_SETTINGS_BIND_ALL_LAST; last = (driver.input && driver.input->set_keybinds && !driver.input->get_joypad_driver) ? (MENU_SETTINGS_BIND_BEGIN + RETRO_DEVICE_ID_JOYPAD_R3) : MENU_SETTINGS_BIND_ALL_LAST;
for (i = MENU_SETTINGS_BIND_BEGIN; i <= last; i++) for (i = MENU_SETTINGS_BIND_BEGIN; i <= last; i++)
file_list_push(rgui->selection_buf, input_config_bind_map[i - MENU_SETTINGS_BIND_BEGIN].desc, i, 0); file_list_push(menu->selection_buf, input_config_bind_map[i - MENU_SETTINGS_BIND_BEGIN].desc, i, 0);
break; break;
case MENU_SETTINGS_AUDIO_OPTIONS: case MENU_SETTINGS_AUDIO_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "DSP Filter", MENU_SETTINGS_AUDIO_DSP_FILTER, 0); file_list_push(menu->selection_buf, "DSP Filter", MENU_SETTINGS_AUDIO_DSP_FILTER, 0);
file_list_push(rgui->selection_buf, "Audio Mute", MENU_SETTINGS_AUDIO_MUTE, 0); file_list_push(menu->selection_buf, "Audio Mute", MENU_SETTINGS_AUDIO_MUTE, 0);
file_list_push(rgui->selection_buf, "Rate Control Delta", MENU_SETTINGS_AUDIO_CONTROL_RATE_DELTA, 0); file_list_push(menu->selection_buf, "Rate Control Delta", MENU_SETTINGS_AUDIO_CONTROL_RATE_DELTA, 0);
#ifdef __CELLOS_LV2__ #ifdef __CELLOS_LV2__
file_list_push(rgui->selection_buf, "System BGM Control", MENU_SETTINGS_CUSTOM_BGM_CONTROL_ENABLE, 0); file_list_push(menu->selection_buf, "System BGM Control", MENU_SETTINGS_CUSTOM_BGM_CONTROL_ENABLE, 0);
#endif #endif
#ifdef _XBOX1 #ifdef _XBOX1
file_list_push(rgui->selection_buf, "Volume Effect", MENU_SETTINGS_AUDIO_DSP_EFFECT, 0); file_list_push(menu->selection_buf, "Volume Effect", MENU_SETTINGS_AUDIO_DSP_EFFECT, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Volume Level", MENU_SETTINGS_AUDIO_VOLUME, 0); file_list_push(menu->selection_buf, "Volume Level", MENU_SETTINGS_AUDIO_VOLUME, 0);
break; break;
case MENU_SETTINGS_DRIVERS: case MENU_SETTINGS_DRIVERS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Video Driver", MENU_SETTINGS_DRIVER_VIDEO, 0); file_list_push(menu->selection_buf, "Video Driver", MENU_SETTINGS_DRIVER_VIDEO, 0);
file_list_push(rgui->selection_buf, "Audio Driver", MENU_SETTINGS_DRIVER_AUDIO, 0); file_list_push(menu->selection_buf, "Audio Driver", MENU_SETTINGS_DRIVER_AUDIO, 0);
file_list_push(rgui->selection_buf, "Audio Device", MENU_SETTINGS_DRIVER_AUDIO_DEVICE, 0); file_list_push(menu->selection_buf, "Audio Device", MENU_SETTINGS_DRIVER_AUDIO_DEVICE, 0);
file_list_push(rgui->selection_buf, "Audio Resampler", MENU_SETTINGS_DRIVER_AUDIO_RESAMPLER, 0); file_list_push(menu->selection_buf, "Audio Resampler", MENU_SETTINGS_DRIVER_AUDIO_RESAMPLER, 0);
file_list_push(rgui->selection_buf, "Input Driver", MENU_SETTINGS_DRIVER_INPUT, 0); file_list_push(menu->selection_buf, "Input Driver", MENU_SETTINGS_DRIVER_INPUT, 0);
#ifdef HAVE_CAMERA #ifdef HAVE_CAMERA
file_list_push(rgui->selection_buf, "Camera Driver", MENU_SETTINGS_DRIVER_CAMERA, 0); file_list_push(menu->selection_buf, "Camera Driver", MENU_SETTINGS_DRIVER_CAMERA, 0);
#endif #endif
#ifdef HAVE_LOCATION #ifdef HAVE_LOCATION
file_list_push(rgui->selection_buf, "Location Driver", MENU_SETTINGS_DRIVER_LOCATION, 0); file_list_push(menu->selection_buf, "Location Driver", MENU_SETTINGS_DRIVER_LOCATION, 0);
#endif #endif
#ifdef HAVE_MENU #ifdef HAVE_MENU
file_list_push(rgui->selection_buf, "Menu Driver", MENU_SETTINGS_DRIVER_MENU, 0); file_list_push(menu->selection_buf, "Menu Driver", MENU_SETTINGS_DRIVER_MENU, 0);
#endif #endif
break; break;
case MENU_SETTINGS_PERFORMANCE_COUNTERS: case MENU_SETTINGS_PERFORMANCE_COUNTERS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
file_list_push(rgui->selection_buf, "Frontend Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND, 0); file_list_push(menu->selection_buf, "Frontend Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND, 0);
file_list_push(rgui->selection_buf, "Core Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO, 0); file_list_push(menu->selection_buf, "Core Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO, 0);
break; break;
case MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO: case MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
{ {
const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_libretro; const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_libretro;
unsigned num = perf_ptr_libretro; unsigned num = perf_ptr_libretro;
@ -441,11 +441,11 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (counters[i] && counters[i]->ident) if (counters[i] && counters[i]->ident)
file_list_push(rgui->selection_buf, counters[i]->ident, MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN + i, 0); file_list_push(menu->selection_buf, counters[i]->ident, MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN + i, 0);
} }
break; break;
case MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND: case MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
{ {
const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_rarch; const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_rarch;
unsigned num = perf_ptr_rarch; unsigned num = perf_ptr_rarch;
@ -455,60 +455,60 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (counters[i] && counters[i]->ident) if (counters[i] && counters[i]->ident)
file_list_push(rgui->selection_buf, counters[i]->ident, MENU_SETTINGS_PERF_COUNTERS_BEGIN + i, 0); file_list_push(menu->selection_buf, counters[i]->ident, MENU_SETTINGS_PERF_COUNTERS_BEGIN + i, 0);
} }
break; break;
case MENU_SETTINGS: case MENU_SETTINGS:
file_list_clear(rgui->selection_buf); file_list_clear(menu->selection_buf);
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT) #if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
file_list_push(rgui->selection_buf, "Core", MENU_SETTINGS_CORE, 0); file_list_push(menu->selection_buf, "Core", MENU_SETTINGS_CORE, 0);
#endif #endif
if (rgui->history) if (menu->history)
file_list_push(rgui->selection_buf, "Load Content (History)", MENU_SETTINGS_OPEN_HISTORY, 0); file_list_push(menu->selection_buf, "Load Content (History)", MENU_SETTINGS_OPEN_HISTORY, 0);
if (rgui->core_info && core_info_list_num_info_files(rgui->core_info)) if (menu->core_info && core_info_list_num_info_files(menu->core_info))
file_list_push(rgui->selection_buf, "Load Content (Detect Core)", MENU_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE, 0); file_list_push(menu->selection_buf, "Load Content (Detect Core)", MENU_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE, 0);
if (rgui->info.library_name || g_extern.system.info.library_name) if (menu->info.library_name || g_extern.system.info.library_name)
{ {
char load_game_core_msg[64]; char load_game_core_msg[64];
snprintf(load_game_core_msg, sizeof(load_game_core_msg), "Load Content (%s)", 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); menu->info.library_name ? menu->info.library_name : g_extern.system.info.library_name);
file_list_push(rgui->selection_buf, load_game_core_msg, MENU_SETTINGS_OPEN_FILEBROWSER, 0); file_list_push(menu->selection_buf, load_game_core_msg, MENU_SETTINGS_OPEN_FILEBROWSER, 0);
} }
file_list_push(rgui->selection_buf, "Core Options", MENU_SETTINGS_CORE_OPTIONS, 0); file_list_push(menu->selection_buf, "Core Options", MENU_SETTINGS_CORE_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Core Information", MENU_SETTINGS_CORE_INFO, 0); file_list_push(menu->selection_buf, "Core Information", MENU_SETTINGS_CORE_INFO, 0);
file_list_push(rgui->selection_buf, "Settings", MENU_SETTINGS_OPTIONS, 0); file_list_push(menu->selection_buf, "Settings", MENU_SETTINGS_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Drivers", MENU_SETTINGS_DRIVERS, 0); file_list_push(menu->selection_buf, "Drivers", MENU_SETTINGS_DRIVERS, 0);
if (g_extern.perfcnt_enable) if (g_extern.perfcnt_enable)
file_list_push(rgui->selection_buf, "Performance Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS, 0); file_list_push(menu->selection_buf, "Performance Counters", MENU_SETTINGS_PERFORMANCE_COUNTERS, 0);
if (g_extern.main_is_init && !g_extern.libretro_dummy) if (g_extern.main_is_init && !g_extern.libretro_dummy)
{ {
file_list_push(rgui->selection_buf, "Save State", MENU_SETTINGS_SAVESTATE_SAVE, 0); file_list_push(menu->selection_buf, "Save State", MENU_SETTINGS_SAVESTATE_SAVE, 0);
file_list_push(rgui->selection_buf, "Load State", MENU_SETTINGS_SAVESTATE_LOAD, 0); file_list_push(menu->selection_buf, "Load State", MENU_SETTINGS_SAVESTATE_LOAD, 0);
#ifdef HAVE_SCREENSHOTS #ifdef HAVE_SCREENSHOTS
file_list_push(rgui->selection_buf, "Take Screenshot", MENU_SETTINGS_SCREENSHOT, 0); file_list_push(menu->selection_buf, "Take Screenshot", MENU_SETTINGS_SCREENSHOT, 0);
#endif #endif
file_list_push(rgui->selection_buf, "Resume Content", MENU_SETTINGS_RESUME_GAME, 0); file_list_push(menu->selection_buf, "Resume Content", MENU_SETTINGS_RESUME_GAME, 0);
file_list_push(rgui->selection_buf, "Restart Content", MENU_SETTINGS_RESTART_GAME, 0); file_list_push(menu->selection_buf, "Restart Content", MENU_SETTINGS_RESTART_GAME, 0);
} }
#ifndef HAVE_DYNAMIC #ifndef HAVE_DYNAMIC
file_list_push(rgui->selection_buf, "Restart RetroArch", MENU_SETTINGS_RESTART_EMULATOR, 0); file_list_push(menu->selection_buf, "Restart RetroArch", MENU_SETTINGS_RESTART_EMULATOR, 0);
#endif #endif
file_list_push(rgui->selection_buf, "RetroArch Config", MENU_SETTINGS_CONFIG, 0); file_list_push(menu->selection_buf, "RetroArch Config", MENU_SETTINGS_CONFIG, 0);
file_list_push(rgui->selection_buf, "Save New Config", MENU_SETTINGS_SAVE_CONFIG, 0); file_list_push(menu->selection_buf, "Save New Config", MENU_SETTINGS_SAVE_CONFIG, 0);
file_list_push(rgui->selection_buf, "Help", MENU_START_SCREEN, 0); file_list_push(menu->selection_buf, "Help", MENU_START_SCREEN, 0);
file_list_push(rgui->selection_buf, "Quit RetroArch", MENU_SETTINGS_QUIT_RARCH, 0); file_list_push(menu->selection_buf, "Quit RetroArch", MENU_SETTINGS_QUIT_RARCH, 0);
break; break;
} }
if (driver.menu_ctx && driver.menu_ctx->populate_entries) if (driver.menu_ctx && driver.menu_ctx->populate_entries)
driver.menu_ctx->populate_entries(rgui, menu_type); driver.menu_ctx->populate_entries(menu, menu_type);
} }
static int menu_info_screen_iterate(unsigned action) static int menu_info_screen_iterate(unsigned action)
@ -861,7 +861,7 @@ static int menu_info_screen_iterate(unsigned action)
" \n" " \n"
"When you apply shaders, the menu shader \n" "When you apply shaders, the menu shader \n"
"settings are saved to a temporary file (either \n" "settings are saved to a temporary file (either \n"
"rgui.cgp or rgui.glslp) and loaded. The file \n" "menu.cgp or menu.glslp) and loaded. The file \n"
"persists after RetroArch exits. The file is \n" "persists after RetroArch exits. The file is \n"
"saved to Shader Directory." "saved to Shader Directory."
); );
@ -1581,9 +1581,9 @@ static int menu_settings_iterate(unsigned action)
if (type == MENU_SETTINGS_CORE) if (type == MENU_SETTINGS_CORE)
label = g_settings.libretro_directory; label = g_settings.libretro_directory;
else if (type == MENU_SETTINGS_CONFIG) else if (type == MENU_SETTINGS_CONFIG)
label = g_settings.rgui_config_directory; label = g_settings.menu_config_directory;
else if (type == MENU_SETTINGS_DISK_APPEND) else if (type == MENU_SETTINGS_DISK_APPEND)
label = g_settings.rgui_content_directory; label = g_settings.menu_content_directory;
const char *dir = NULL; const char *dir = NULL;
unsigned menu_type = 0; unsigned menu_type = 0;
@ -1630,7 +1630,7 @@ static int menu_settings_iterate(unsigned action)
&& action == MENU_ACTION_OK) && action == MENU_ACTION_OK)
{ {
driver.menu->defer_core = type == MENU_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE; driver.menu->defer_core = type == MENU_SETTINGS_OPEN_FILEBROWSER_DEFERRED_CORE;
file_list_push(driver.menu->menu_stack, g_settings.rgui_content_directory, MENU_FILE_DIRECTORY, driver.menu->selection_ptr); file_list_push(driver.menu->menu_stack, g_settings.menu_content_directory, MENU_FILE_DIRECTORY, driver.menu->selection_ptr);
menu_clear_navigation(driver.menu); menu_clear_navigation(driver.menu);
driver.menu->need_refresh = true; driver.menu->need_refresh = true;
} }
@ -2160,7 +2160,7 @@ static void menu_parse_and_resolve(unsigned menu_type)
static int menu_custom_bind_iterate(void *data, unsigned action) static int menu_custom_bind_iterate(void *data, unsigned action)
{ {
char msg[256]; char msg[256];
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
(void)action; // Have to ignore action here. Only bind that should work here is Quit RetroArch or something like that. (void)action; // Have to ignore action here. Only bind that should work here is Quit RetroArch or something like that.
(void)msg; (void)msg;
@ -2168,34 +2168,34 @@ static int menu_custom_bind_iterate(void *data, unsigned action)
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render) if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render)
driver.menu_ctx->render(); driver.menu_ctx->render();
snprintf(msg, sizeof(msg), "[%s]\npress joypad\n(RETURN to skip)", input_config_bind_map[rgui->binds.begin - MENU_SETTINGS_BIND_BEGIN].desc); snprintf(msg, sizeof(msg), "[%s]\npress joypad\n(RETURN to skip)", input_config_bind_map[menu->binds.begin - MENU_SETTINGS_BIND_BEGIN].desc);
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render_messagebox) if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render_messagebox)
driver.menu_ctx->render_messagebox(msg); driver.menu_ctx->render_messagebox(msg);
struct rgui_bind_state binds = rgui->binds; struct menu_bind_state binds = menu->binds;
menu_poll_bind_state(&binds); menu_poll_bind_state(&binds);
if ((binds.skip && !rgui->binds.skip) || menu_poll_find_trigger(&rgui->binds, &binds)) if ((binds.skip && !menu->binds.skip) || menu_poll_find_trigger(&menu->binds, &binds))
{ {
binds.begin++; binds.begin++;
if (binds.begin <= binds.last) if (binds.begin <= binds.last)
binds.target++; binds.target++;
else else
file_list_pop(rgui->menu_stack, &rgui->selection_ptr); file_list_pop(menu->menu_stack, &menu->selection_ptr);
// Avoid new binds triggering things right away. // Avoid new binds triggering things right away.
rgui->trigger_state = 0; menu->trigger_state = 0;
rgui->old_input_state = -1ULL; menu->old_input_state = -1ULL;
} }
rgui->binds = binds; menu->binds = binds;
return 0; return 0;
} }
static int menu_custom_bind_iterate_keyboard(void *data, unsigned action) static int menu_custom_bind_iterate_keyboard(void *data, unsigned action)
{ {
char msg[256]; char msg[256];
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
(void)action; // Have to ignore action here. (void)action; // Have to ignore action here.
(void)msg; (void)msg;
@ -2204,10 +2204,10 @@ static int menu_custom_bind_iterate_keyboard(void *data, unsigned action)
driver.menu_ctx->render(); driver.menu_ctx->render();
int64_t current = rarch_get_time_usec(); int64_t current = rarch_get_time_usec();
int timeout = (rgui->binds.timeout_end - current) / 1000000; int timeout = (menu->binds.timeout_end - current) / 1000000;
snprintf(msg, sizeof(msg), "[%s]\npress keyboard\n(timeout %d seconds)", snprintf(msg, sizeof(msg), "[%s]\npress keyboard\n(timeout %d seconds)",
input_config_bind_map[rgui->binds.begin - MENU_SETTINGS_BIND_BEGIN].desc, timeout); input_config_bind_map[menu->binds.begin - MENU_SETTINGS_BIND_BEGIN].desc, timeout);
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render_messagebox) if (driver.video_data && driver.menu_ctx && driver.menu_ctx->render_messagebox)
driver.menu_ctx->render_messagebox(msg); driver.menu_ctx->render_messagebox(msg);
@ -2215,21 +2215,21 @@ static int menu_custom_bind_iterate_keyboard(void *data, unsigned action)
bool timed_out = false; bool timed_out = false;
if (timeout <= 0) if (timeout <= 0)
{ {
rgui->binds.begin++; menu->binds.begin++;
rgui->binds.target->key = RETROK_UNKNOWN; // Could be unsafe, but whatever. menu->binds.target->key = RETROK_UNKNOWN; // Could be unsafe, but whatever.
rgui->binds.target++; menu->binds.target++;
rgui->binds.timeout_end = rarch_get_time_usec() + MENU_KEYBOARD_BIND_TIMEOUT_SECONDS * 1000000; menu->binds.timeout_end = rarch_get_time_usec() + MENU_KEYBOARD_BIND_TIMEOUT_SECONDS * 1000000;
timed_out = true; timed_out = true;
} }
// binds.begin is updated in keyboard_press callback. // binds.begin is updated in keyboard_press callback.
if (rgui->binds.begin > rgui->binds.last) if (menu->binds.begin > menu->binds.last)
{ {
file_list_pop(rgui->menu_stack, &rgui->selection_ptr); file_list_pop(menu->menu_stack, &menu->selection_ptr);
// Avoid new binds triggering things right away. // Avoid new binds triggering things right away.
rgui->trigger_state = 0; menu->trigger_state = 0;
rgui->old_input_state = -1ULL; menu->old_input_state = -1ULL;
// We won't be getting any key events, so just cancel early. // We won't be getting any key events, so just cancel early.
if (timed_out) if (timed_out)
@ -2499,7 +2499,7 @@ static int menu_common_iterate(unsigned action)
} }
else if (menu_type == MENU_BROWSER_DIR_PATH) else if (menu_type == MENU_BROWSER_DIR_PATH)
{ {
strlcpy(g_settings.rgui_content_directory, dir, sizeof(g_settings.rgui_content_directory)); strlcpy(g_settings.menu_content_directory, dir, sizeof(g_settings.menu_content_directory));
menu_flush_stack_type(MENU_SETTINGS_PATH_OPTIONS); menu_flush_stack_type(MENU_SETTINGS_PATH_OPTIONS);
} }
else if (menu_type == MENU_CONTENT_DIR_PATH) else if (menu_type == MENU_CONTENT_DIR_PATH)
@ -2562,7 +2562,7 @@ static int menu_common_iterate(unsigned action)
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
else if (menu_type == MENU_CONFIG_DIR_PATH) else if (menu_type == MENU_CONFIG_DIR_PATH)
{ {
strlcpy(g_settings.rgui_config_directory, dir, sizeof(g_settings.rgui_config_directory)); strlcpy(g_settings.menu_config_directory, dir, sizeof(g_settings.menu_config_directory));
menu_flush_stack_type(MENU_SETTINGS_PATH_OPTIONS); menu_flush_stack_type(MENU_SETTINGS_PATH_OPTIONS);
} }
#endif #endif
@ -2674,8 +2674,8 @@ static int menu_common_iterate(unsigned action)
static void menu_common_shader_manager_init(void *data) static void menu_common_shader_manager_init(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
@ -2687,20 +2687,20 @@ static void menu_common_shader_manager_init(void *data)
else if (*g_extern.config_path) else if (*g_extern.config_path)
config_path = g_extern.config_path; config_path = g_extern.config_path;
// In a multi-config setting, we can't have conflicts on rgui.cgp/rgui.glslp. // In a multi-config setting, we can't have conflicts on menu.cgp/menu.glslp.
if (config_path) if (config_path)
{ {
fill_pathname_base(rgui->default_glslp, config_path, sizeof(rgui->default_glslp)); fill_pathname_base(menu->default_glslp, config_path, sizeof(menu->default_glslp));
path_remove_extension(rgui->default_glslp); path_remove_extension(menu->default_glslp);
strlcat(rgui->default_glslp, ".glslp", sizeof(rgui->default_glslp)); strlcat(menu->default_glslp, ".glslp", sizeof(menu->default_glslp));
fill_pathname_base(rgui->default_cgp, config_path, sizeof(rgui->default_cgp)); fill_pathname_base(menu->default_cgp, config_path, sizeof(menu->default_cgp));
path_remove_extension(rgui->default_cgp); path_remove_extension(menu->default_cgp);
strlcat(rgui->default_cgp, ".cgp", sizeof(rgui->default_cgp)); strlcat(menu->default_cgp, ".cgp", sizeof(menu->default_cgp));
} }
else else
{ {
strlcpy(rgui->default_glslp, "rgui.glslp", sizeof(rgui->default_glslp)); strlcpy(menu->default_glslp, "menu.glslp", sizeof(menu->default_glslp));
strlcpy(rgui->default_cgp, "rgui.cgp", sizeof(rgui->default_cgp)); strlcpy(menu->default_cgp, "menu.cgp", sizeof(menu->default_cgp));
} }
char cgp_path[PATH_MAX]; char cgp_path[PATH_MAX];
@ -2711,17 +2711,17 @@ static void menu_common_shader_manager_init(void *data)
conf = config_file_new(g_settings.video.shader_path); conf = config_file_new(g_settings.video.shader_path);
if (conf) if (conf)
{ {
if (gfx_shader_read_conf_cgp(conf, rgui->shader)) if (gfx_shader_read_conf_cgp(conf, menu->shader))
{ {
gfx_shader_resolve_relative(rgui->shader, g_settings.video.shader_path); gfx_shader_resolve_relative(menu->shader, g_settings.video.shader_path);
gfx_shader_resolve_parameters(conf, rgui->shader); gfx_shader_resolve_parameters(conf, menu->shader);
} }
config_file_free(conf); config_file_free(conf);
} }
} }
else if (strcmp(ext, "glsl") == 0 || strcmp(ext, "cg") == 0) else if (strcmp(ext, "glsl") == 0 || strcmp(ext, "cg") == 0)
{ {
struct gfx_shader *shader = (struct gfx_shader*)rgui->shader; struct gfx_shader *shader = (struct gfx_shader*)menu->shader;
strlcpy(shader->pass[0].source.path, g_settings.video.shader_path, strlcpy(shader->pass[0].source.path, g_settings.video.shader_path,
sizeof(shader->pass[0].source.path)); sizeof(shader->pass[0].source.path));
@ -2732,21 +2732,21 @@ static void menu_common_shader_manager_init(void *data)
const char *shader_dir = *g_settings.video.shader_dir ? const char *shader_dir = *g_settings.video.shader_dir ?
g_settings.video.shader_dir : g_settings.system_directory; g_settings.video.shader_dir : g_settings.system_directory;
fill_pathname_join(cgp_path, shader_dir, "rgui.glslp", sizeof(cgp_path)); fill_pathname_join(cgp_path, shader_dir, "menu.glslp", sizeof(cgp_path));
conf = config_file_new(cgp_path); conf = config_file_new(cgp_path);
if (!conf) if (!conf)
{ {
fill_pathname_join(cgp_path, shader_dir, "rgui.cgp", sizeof(cgp_path)); fill_pathname_join(cgp_path, shader_dir, "menu.cgp", sizeof(cgp_path));
conf = config_file_new(cgp_path); conf = config_file_new(cgp_path);
} }
if (conf) if (conf)
{ {
if (gfx_shader_read_conf_cgp(conf, rgui->shader)) if (gfx_shader_read_conf_cgp(conf, menu->shader))
{ {
gfx_shader_resolve_relative(rgui->shader, cgp_path); gfx_shader_resolve_relative(menu->shader, cgp_path);
gfx_shader_resolve_parameters(conf, rgui->shader); gfx_shader_resolve_parameters(conf, menu->shader);
} }
config_file_free(conf); config_file_free(conf);
} }
@ -2807,7 +2807,7 @@ static void menu_common_shader_manager_get_str(void *data, char *type_str, size_
*type_str = '\0'; *type_str = '\0';
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0 && type <= MENU_SETTINGS_SHADER_PARAMETER_LAST) else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0 && type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
{ {
// rgui->parameter_shader here. // menu->parameter_shader here.
if (shader) if (shader)
{ {
const struct gfx_shader_parameter *param = (const struct gfx_shader_parameter*)&shader->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0]; const struct gfx_shader_parameter *param = (const struct gfx_shader_parameter*)&shader->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
@ -2911,7 +2911,7 @@ static void menu_common_shader_manager_save_preset(const char *basename, bool ap
char cgp_path[PATH_MAX]; char cgp_path[PATH_MAX];
const char *dirs[] = { const char *dirs[] = {
g_settings.video.shader_dir, g_settings.video.shader_dir,
g_settings.rgui_config_directory, g_settings.menu_config_directory,
config_directory, config_directory,
}; };
@ -3212,7 +3212,7 @@ static int menu_common_core_setting_toggle(unsigned setting, unsigned action)
#ifdef GEKKO #ifdef GEKKO
#define MAX_GAMMA_SETTING 2 #define MAX_GAMMA_SETTING 2
static unsigned rgui_gx_resolutions[GX_RESOLUTIONS_LAST][2] = { static unsigned menu_gx_resolutions[GX_RESOLUTIONS_LAST][2] = {
{ 512, 192 }, { 512, 192 },
{ 598, 200 }, { 598, 200 },
{ 640, 200 }, { 640, 200 },
@ -3253,7 +3253,7 @@ static unsigned rgui_gx_resolutions[GX_RESOLUTIONS_LAST][2] = {
{ 640, 480 }, { 640, 480 },
}; };
static unsigned rgui_current_gx_resolution = GX_RESOLUTIONS_640_480; static unsigned menu_current_gx_resolution = GX_RESOLUTIONS_640_480;
#else #else
#define MAX_GAMMA_SETTING 1 #define MAX_GAMMA_SETTING 1
#endif #endif
@ -4117,7 +4117,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
break; break;
case MENU_BROWSER_DIR_PATH: case MENU_BROWSER_DIR_PATH:
if (action == MENU_ACTION_START) if (action == MENU_ACTION_START)
*g_settings.rgui_content_directory = '\0'; *g_settings.menu_content_directory = '\0';
break; break;
case MENU_CONTENT_DIR_PATH: case MENU_CONTENT_DIR_PATH:
if (action == MENU_ACTION_START) if (action == MENU_ACTION_START)
@ -4165,7 +4165,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
break; break;
case MENU_CONFIG_DIR_PATH: case MENU_CONFIG_DIR_PATH:
if (action == MENU_ACTION_START) if (action == MENU_ACTION_START)
*g_settings.rgui_config_directory = '\0'; *g_settings.menu_config_directory = '\0';
break; break;
case MENU_FILTER_DIR_PATH: case MENU_FILTER_DIR_PATH:
if (action == MENU_ACTION_START) if (action == MENU_ACTION_START)
@ -4350,27 +4350,27 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
case MENU_SETTINGS_VIDEO_RESOLUTION: case MENU_SETTINGS_VIDEO_RESOLUTION:
if (action == MENU_ACTION_LEFT) if (action == MENU_ACTION_LEFT)
{ {
if (rgui_current_gx_resolution > 0) if (menu_current_gx_resolution > 0)
rgui_current_gx_resolution--; menu_current_gx_resolution--;
} }
else if (action == MENU_ACTION_RIGHT) else if (action == MENU_ACTION_RIGHT)
{ {
if (rgui_current_gx_resolution < GX_RESOLUTIONS_LAST - 1) if (menu_current_gx_resolution < GX_RESOLUTIONS_LAST - 1)
{ {
#ifdef HW_RVL #ifdef HW_RVL
if ((rgui_current_gx_resolution + 1) > GX_RESOLUTIONS_640_480) if ((menu_current_gx_resolution + 1) > GX_RESOLUTIONS_640_480)
if (CONF_GetVideo() != CONF_VIDEO_PAL) if (CONF_GetVideo() != CONF_VIDEO_PAL)
return 0; return 0;
#endif #endif
rgui_current_gx_resolution++; menu_current_gx_resolution++;
} }
} }
else if (action == MENU_ACTION_OK) else if (action == MENU_ACTION_OK)
{ {
if (driver.video_data) if (driver.video_data)
gx_set_video_mode(driver.video_data, rgui_gx_resolutions[rgui_current_gx_resolution][0], gx_set_video_mode(driver.video_data, menu_gx_resolutions[menu_current_gx_resolution][0],
rgui_gx_resolutions[rgui_current_gx_resolution][1]); menu_gx_resolutions[menu_current_gx_resolution][1]);
} }
break; break;
#elif defined(__CELLOS_LV2__) #elif defined(__CELLOS_LV2__)
@ -5187,7 +5187,7 @@ static void menu_common_setting_set_label(char *type_str, size_t type_str_size,
snprintf(type_str, type_str_size, (g_settings.fps_show) ? "ON" : "OFF"); snprintf(type_str, type_str_size, (g_settings.fps_show) ? "ON" : "OFF");
break; break;
case MENU_BROWSER_DIR_PATH: case MENU_BROWSER_DIR_PATH:
strlcpy(type_str, *g_settings.rgui_content_directory ? g_settings.rgui_content_directory : "<default>", type_str_size); strlcpy(type_str, *g_settings.menu_content_directory ? g_settings.menu_content_directory : "<default>", type_str_size);
break; break;
case MENU_CONTENT_DIR_PATH: case MENU_CONTENT_DIR_PATH:
strlcpy(type_str, *g_settings.content_directory ? g_settings.content_directory : "<default>", type_str_size); strlcpy(type_str, *g_settings.content_directory ? g_settings.content_directory : "<default>", type_str_size);
@ -5218,7 +5218,7 @@ static void menu_common_setting_set_label(char *type_str, size_t type_str_size,
strlcpy(type_str, *g_settings.libretro_info_path ? g_settings.libretro_info_path : "<Core dir>", type_str_size); strlcpy(type_str, *g_settings.libretro_info_path ? g_settings.libretro_info_path : "<Core dir>", type_str_size);
break; break;
case MENU_CONFIG_DIR_PATH: case MENU_CONFIG_DIR_PATH:
strlcpy(type_str, *g_settings.rgui_config_directory ? g_settings.rgui_config_directory : "<default>", type_str_size); strlcpy(type_str, *g_settings.menu_config_directory ? g_settings.menu_config_directory : "<default>", type_str_size);
break; break;
case MENU_FILTER_DIR_PATH: case MENU_FILTER_DIR_PATH:
strlcpy(type_str, *g_settings.video.filter_dir ? g_settings.video.filter_dir : "<default>", type_str_size); strlcpy(type_str, *g_settings.video.filter_dir ? g_settings.video.filter_dir : "<default>", type_str_size);

View File

@ -193,7 +193,7 @@ typedef enum
MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END = MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN + (MAX_COUNTERS - 1), MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END = MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN + (MAX_COUNTERS - 1),
MENU_SETTINGS_PERF_COUNTERS_BEGIN, MENU_SETTINGS_PERF_COUNTERS_BEGIN,
MENU_SETTINGS_PERF_COUNTERS_END = MENU_SETTINGS_PERF_COUNTERS_BEGIN + (MAX_COUNTERS - 1) MENU_SETTINGS_PERF_COUNTERS_END = MENU_SETTINGS_PERF_COUNTERS_BEGIN + (MAX_COUNTERS - 1)
} rgui_settings_t; } menu_settings_t;
#ifdef GEKKO #ifdef GEKKO
enum enum

View File

@ -773,10 +773,10 @@ static void lakka_context_reset(void *data)
{ {
int i, j, k; int i, j, k;
char path[256], dirpath[256];; char path[256], dirpath[256];;
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
gl_t *gl = (gl_t*)driver.video_data; gl_t *gl = (gl_t*)driver.video_data;
if (!rgui) if (!menu)
return; return;
gl_font_init_first(&font_driver, &font, gl, gl_font_init_first(&font_driver, &font, gl,
@ -811,7 +811,7 @@ static void lakka_context_reset(void *data)
fill_pathname_join(dirpath, g_settings.assets_directory, "lakka", sizeof(dirpath)); fill_pathname_join(dirpath, g_settings.assets_directory, "lakka", sizeof(dirpath));
fill_pathname_slash(dirpath, sizeof(dirpath)); fill_pathname_slash(dirpath, sizeof(dirpath));
info_list = (core_info_list_t*)rgui->core_info; info_list = (core_info_list_t*)menu->core_info;
info = NULL; info = NULL;
if (info_list) if (info_list)
@ -935,10 +935,10 @@ static void lakka_init_items(int i, menu_category_t *category, core_info_t *info
static void lakka_free(void *data) static void lakka_free(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (rgui->alloc_font) if (menu->alloc_font)
free((uint8_t*)rgui->font); free((uint8_t*)menu->font);
} }
static int lakka_input_postprocess(uint64_t old_state) static int lakka_input_postprocess(uint64_t old_state)
@ -961,29 +961,29 @@ static int lakka_input_postprocess(uint64_t old_state)
static void lakka_init_core_info(void *data) static void lakka_init_core_info(void *data)
{ {
core_info_list_t *core; core_info_list_t *core;
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
core_info_list_free(rgui->core_info); core_info_list_free(menu->core_info);
rgui->core_info = NULL; menu->core_info = NULL;
rgui->core_info = (core_info_list_t*)core_info_list_new(*g_settings.libretro_directory ? g_settings.libretro_directory : "/usr/lib/libretro"); menu->core_info = (core_info_list_t*)core_info_list_new(*g_settings.libretro_directory ? g_settings.libretro_directory : "/usr/lib/libretro");
if (rgui->core_info) if (menu->core_info)
{ {
core = (core_info_list_t*)rgui->core_info; core = (core_info_list_t*)menu->core_info;
num_categories = rgui->core_info ? core->count + 1 : 1; num_categories = menu->core_info ? core->count + 1 : 1;
} }
} }
static void *lakka_init(void) static void *lakka_init(void)
{ {
int i, j; int i, j;
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui)); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
gl_t *gl = (gl_t*)driver.video_data; gl_t *gl = (gl_t*)driver.video_data;
if (!rgui || !gl) if (!menu || !gl)
return NULL; return NULL;
lakka_init_core_info(rgui); lakka_init_core_info(menu);
categories = (menu_category_t*)calloc(num_categories, sizeof(menu_category_t)); categories = (menu_category_t*)calloc(num_categories, sizeof(menu_category_t));
lakka_init_settings(); lakka_init_settings();
@ -994,7 +994,7 @@ static void *lakka_init(void)
core_info_list_t *info_list; core_info_list_t *info_list;
menu_category_t *category = (menu_category_t*)&categories[i]; menu_category_t *category = (menu_category_t*)&categories[i];
info_list = (core_info_list_t*)rgui->core_info; info_list = (core_info_list_t*)menu->core_info;
info = NULL; info = NULL;
if (info_list) if (info_list)
@ -1011,7 +1011,7 @@ static void *lakka_init(void)
lakka_init_items(i, category, info, g_settings.content_directory); lakka_init_items(i, category, info, g_settings.content_directory);
} }
return rgui; return menu;
} }
const menu_ctx_driver_t menu_ctx_lakka = { const menu_ctx_driver_t menu_ctx_lakka = {

View File

@ -141,11 +141,11 @@ static void blit_line(int x, int y, const char *message, bool green)
} }
} }
static void init_font(rgui_handle_t *rgui, const uint8_t *font_bmp_buf) static void init_font(menu_handle_t *menu, const uint8_t *font_bmp_buf)
{ {
unsigned i; unsigned i;
uint8_t *font = (uint8_t *) calloc(1, FONT_OFFSET(256)); uint8_t *font = (uint8_t *) calloc(1, FONT_OFFSET(256));
rgui->alloc_font = true; menu->alloc_font = true;
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
{ {
unsigned y = i / 16; unsigned y = i / 16;
@ -154,21 +154,21 @@ static void init_font(rgui_handle_t *rgui, const uint8_t *font_bmp_buf)
font_bmp_buf + 54 + 3 * (256 * (255 - 16 * y) + 16 * x)); font_bmp_buf + 54 + 3 * (256 * (255 - 16 * y) + 16 * x));
} }
rgui->font = font; menu->font = font;
} }
static bool rguidisp_init_font(void *data) static bool rguidisp_init_font(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
const uint8_t *font_bmp_buf = NULL; const uint8_t *font_bmp_buf = NULL;
const uint8_t *font_bin_buf = bitmap_bin; const uint8_t *font_bin_buf = bitmap_bin;
bool ret = true; bool ret = true;
if (font_bmp_buf) if (font_bmp_buf)
init_font(rgui, font_bmp_buf); init_font(menu, font_bmp_buf);
else if (font_bin_buf) else if (font_bin_buf)
rgui->font = font_bin_buf; menu->font = font_bin_buf;
else else
ret = false; ret = false;
@ -592,19 +592,19 @@ static void *rgui_init(void)
uint16_t *framebuf = menu_framebuf; uint16_t *framebuf = menu_framebuf;
size_t framebuf_pitch; size_t framebuf_pitch;
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui)); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
if (!rgui) if (!menu)
return NULL; return NULL;
rgui->frame_buf = framebuf; menu->frame_buf = framebuf;
rgui->width = 320; menu->width = 320;
rgui->height = 240; menu->height = 240;
framebuf_pitch = rgui->width * sizeof(uint16_t); framebuf_pitch = menu->width * sizeof(uint16_t);
rgui->frame_buf_pitch = framebuf_pitch; menu->frame_buf_pitch = framebuf_pitch;
bool ret = rguidisp_init_font(rgui); bool ret = rguidisp_init_font(menu);
if (!ret) if (!ret)
{ {
@ -615,15 +615,15 @@ static void *rgui_init(void)
return NULL; return NULL;
} }
return rgui; return menu;
} }
static void rgui_free(void *data) static void rgui_free(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (rgui->alloc_font) if (menu->alloc_font)
free((uint8_t*)rgui->font); free((uint8_t*)menu->font);
} }
static int rgui_input_postprocess(uint64_t old_state) static int rgui_input_postprocess(uint64_t old_state)
@ -645,21 +645,21 @@ static int rgui_input_postprocess(uint64_t old_state)
void rgui_set_texture(void *data) void rgui_set_texture(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_frame) if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_frame)
driver.video_poke->set_texture_frame(driver.video_data, menu_framebuf, driver.video_poke->set_texture_frame(driver.video_data, menu_framebuf,
false, rgui->width, rgui->height, 1.0f); false, menu->width, menu->height, 1.0f);
} }
static void rgui_init_core_info(void *data) static void rgui_init_core_info(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
core_info_list_free(rgui->core_info); core_info_list_free(menu->core_info);
rgui->core_info = NULL; menu->core_info = NULL;
if (*g_settings.libretro_directory) if (*g_settings.libretro_directory)
rgui->core_info = core_info_list_new(g_settings.libretro_directory); menu->core_info = core_info_list_new(g_settings.libretro_directory);
} }
const menu_ctx_driver_t menu_ctx_rgui = { const menu_ctx_driver_t menu_ctx_rgui = {

View File

@ -118,9 +118,9 @@ static void rmenu_render(void)
{ {
size_t begin, end; size_t begin, end;
struct font_params font_parms; struct font_params font_parms;
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu; menu_handle_t *menu = (menu_handle_t*)driver.menu;
if (!rgui) if (!menu)
return; return;
if (!render_normal) if (!render_normal)
@ -129,18 +129,18 @@ static void rmenu_render(void)
return; return;
} }
if (rgui->need_refresh && if (menu->need_refresh &&
(g_extern.lifecycle_state & (1ULL << MODE_MENU)) (g_extern.lifecycle_state & (1ULL << MODE_MENU))
&& !rgui->msg_force) && !menu->msg_force)
return; return;
if (!rgui->selection_buf) if (!menu->selection_buf)
return; return;
begin = (rgui->selection_ptr >= (ENTRIES_HEIGHT / 2)) ? (rgui->selection_ptr - (ENTRIES_HEIGHT / 2)) : 0; begin = (menu->selection_ptr >= (ENTRIES_HEIGHT / 2)) ? (menu->selection_ptr - (ENTRIES_HEIGHT / 2)) : 0;
end = ((rgui->selection_ptr + ENTRIES_HEIGHT) <= file_list_get_size(rgui->selection_buf)) ? rgui->selection_ptr + ENTRIES_HEIGHT : file_list_get_size(rgui->selection_buf); end = ((menu->selection_ptr + ENTRIES_HEIGHT) <= file_list_get_size(menu->selection_buf)) ? menu->selection_ptr + ENTRIES_HEIGHT : file_list_get_size(menu->selection_buf);
if (file_list_get_size(rgui->selection_buf) <= ENTRIES_HEIGHT) if (file_list_get_size(menu->selection_buf) <= ENTRIES_HEIGHT)
begin = 0; begin = 0;
if (end - begin > ENTRIES_HEIGHT) if (end - begin > ENTRIES_HEIGHT)
@ -152,7 +152,7 @@ static void rmenu_render(void)
const char *dir = NULL; const char *dir = NULL;
unsigned menu_type = 0; unsigned menu_type = 0;
unsigned menu_type_is = 0; unsigned menu_type_is = 0;
file_list_get_last(rgui->menu_stack, &dir, &menu_type); file_list_get_last(menu->menu_stack, &dir, &menu_type);
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is) if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is)
menu_type_is = driver.menu_ctx->backend->type_is(menu_type); menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
@ -267,11 +267,11 @@ static void rmenu_render(void)
snprintf(title, sizeof(title), "ASSETS DIR %s", dir); snprintf(title, sizeof(title), "ASSETS DIR %s", dir);
else else
{ {
if (rgui->defer_core) if (menu->defer_core)
snprintf(title, sizeof(title), "CONTENT %s", dir); snprintf(title, sizeof(title), "CONTENT %s", dir);
else else
{ {
const char *core_name = rgui->info.library_name; const char *core_name = menu->info.library_name;
if (!core_name) if (!core_name)
core_name = g_extern.system.info.library_name; core_name = g_extern.system.info.library_name;
if (!core_name) if (!core_name)
@ -292,13 +292,13 @@ static void rmenu_render(void)
driver.video_poke->set_osd_msg(driver.video_data, title_buf, &font_parms); driver.video_poke->set_osd_msg(driver.video_data, title_buf, &font_parms);
char title_msg[64]; char title_msg[64];
const char *core_name = rgui->info.library_name; const char *core_name = menu->info.library_name;
if (!core_name) if (!core_name)
core_name = g_extern.system.info.library_name; core_name = g_extern.system.info.library_name;
if (!core_name) if (!core_name)
core_name = "No Core"; core_name = "No Core";
const char *core_version = rgui->info.library_version; const char *core_version = menu->info.library_version;
if (!core_version) if (!core_version)
core_version = g_extern.system.info.library_version; core_version = g_extern.system.info.library_version;
if (!core_version) if (!core_version)
@ -322,7 +322,7 @@ static void rmenu_render(void)
{ {
const char *path = 0; const char *path = 0;
unsigned type = 0; unsigned type = 0;
file_list_get_at_offset(rgui->selection_buf, i, &path, &type); file_list_get_at_offset(menu->selection_buf, i, &path, &type);
char message[256]; char message[256];
char type_str[256]; char type_str[256];
@ -352,9 +352,9 @@ static void rmenu_render(void)
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->shader_manager_get_str) else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->shader_manager_get_str)
{ {
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0 && type <= MENU_SETTINGS_SHADER_PARAMETER_LAST) if (type >= MENU_SETTINGS_SHADER_PARAMETER_0 && type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
driver.menu_ctx->backend->shader_manager_get_str(rgui->parameter_shader, type_str, sizeof(type_str), type); driver.menu_ctx->backend->shader_manager_get_str(menu->parameter_shader, type_str, sizeof(type_str), type);
else else
driver.menu_ctx->backend->shader_manager_get_str(rgui->shader, type_str, sizeof(type_str), type); driver.menu_ctx->backend->shader_manager_get_str(menu->shader, type_str, sizeof(type_str), type);
} }
} }
else else
@ -365,7 +365,7 @@ static void rmenu_render(void)
if (type == MENU_FILE_PLAIN) if (type == MENU_FILE_PLAIN)
{ {
strlcpy(type_str, "(CORE)", sizeof(type_str)); strlcpy(type_str, "(CORE)", sizeof(type_str));
file_list_get_alt_at_offset(rgui->selection_buf, i, &path); file_list_get_alt_at_offset(menu->selection_buf, i, &path);
w = 6; w = 6;
} }
else else
@ -415,7 +415,7 @@ static void rmenu_render(void)
char entry_title_buf[256]; char entry_title_buf[256];
char type_str_buf[64]; char type_str_buf[64];
bool selected = i == rgui->selection_ptr; bool selected = i == menu->selection_ptr;
strlcpy(entry_title_buf, path, sizeof(entry_title_buf)); strlcpy(entry_title_buf, path, sizeof(entry_title_buf));
strlcpy(type_str_buf, type_str, sizeof(type_str_buf)); strlcpy(type_str_buf, type_str, sizeof(type_str_buf));
@ -427,7 +427,7 @@ static void rmenu_render(void)
snprintf(message, sizeof(message), "%c %s", selected ? '>' : ' ', entry_title_buf); snprintf(message, sizeof(message), "%c %s", selected ? '>' : ' ', entry_title_buf);
//blit_line(rgui, x, y, message, selected); //blit_line(menu, x, y, message, selected);
font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET; font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET;
font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET + (POSITION_OFFSET * j); font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET + (POSITION_OFFSET * j);
font_parms.scale = FONT_SIZE_NORMAL; font_parms.scale = FONT_SIZE_NORMAL;
@ -445,7 +445,7 @@ static void rmenu_render(void)
void rmenu_set_texture(void *data) void rmenu_set_texture(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (menu_texture_inited) if (menu_texture_inited)
return; return;
@ -453,34 +453,34 @@ void rmenu_set_texture(void *data)
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable && menu_texture && menu_texture->pixels) if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable && menu_texture && menu_texture->pixels)
{ {
driver.video_poke->set_texture_frame(driver.video_data, menu_texture->pixels, driver.video_poke->set_texture_frame(driver.video_data, menu_texture->pixels,
true, rgui->width, rgui->height, 1.0f); true, menu->width, menu->height, 1.0f);
menu_texture_inited = true; menu_texture_inited = true;
} }
} }
static void rmenu_context_reset(void *data) static void rmenu_context_reset(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
texture_image_load(driver.video_data, g_extern.menu_texture_path, menu_texture); texture_image_load(driver.video_data, g_extern.menu_texture_path, menu_texture);
rgui->width = menu_texture->width; menu->width = menu_texture->width;
rgui->height = menu_texture->height; menu->height = menu_texture->height;
menu_texture_inited = false; menu_texture_inited = false;
} }
static void *rmenu_init(void) static void *rmenu_init(void)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui)); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
if (!rgui) if (!menu)
return NULL; return NULL;
menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture)); menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture));
return rgui; return menu;
} }
static void rmenu_context_destroy(void *data) static void rmenu_context_destroy(void *data)
@ -494,10 +494,10 @@ static void rmenu_free(void *data)
static int rmenu_input_postprocess(uint64_t old_state) static int rmenu_input_postprocess(uint64_t old_state)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu; menu_handle_t *menu = (menu_handle_t*)driver.menu;
int ret = 0; int ret = 0;
if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) && if ((menu->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
g_extern.main_is_init && g_extern.main_is_init &&
!g_extern.libretro_dummy) !g_extern.libretro_dummy)
{ {
@ -510,12 +510,12 @@ static int rmenu_input_postprocess(uint64_t old_state)
static void rmenu_init_core_info(void *data) static void rmenu_init_core_info(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
core_info_list_free(rgui->core_info); core_info_list_free(menu->core_info);
rgui->core_info = NULL; menu->core_info = NULL;
if (*g_settings.libretro_directory) if (*g_settings.libretro_directory)
rgui->core_info = core_info_list_new(g_settings.libretro_directory); menu->core_info = core_info_list_new(g_settings.libretro_directory);
} }
const menu_ctx_driver_t menu_ctx_rmenu = { const menu_ctx_driver_t menu_ctx_rmenu = {

View File

@ -155,9 +155,9 @@ static void* rmenu_xui_init(void)
HRESULT hr; HRESULT hr;
TypefaceDescriptor typeface = {0}; TypefaceDescriptor typeface = {0};
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui)); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
if (!rgui) if (!menu)
return NULL; return NULL;
d3d_video_t *d3d= (d3d_video_t*)driver.video_data; d3d_video_t *d3d= (d3d_video_t*)driver.video_data;
@ -227,10 +227,10 @@ static void* rmenu_xui_init(void)
xui_msg_queue = msg_queue_new(16); xui_msg_queue = msg_queue_new(16);
return rgui; return menu;
error: error:
free(rgui); free(menu);
return NULL; return NULL;
} }
@ -668,20 +668,20 @@ static void rmenu_xui_render(void)
static void rmenu_xui_populate_entries(void *data, unsigned i) static void rmenu_xui_populate_entries(void *data, unsigned i)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
XuiListSetCurSelVisible(m_menulist, rgui->selection_ptr); XuiListSetCurSelVisible(m_menulist, menu->selection_ptr);
} }
static void rmenu_xui_navigation_clear(void *data) static void rmenu_xui_navigation_clear(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
XuiListSetCurSelVisible(m_menulist, rgui->selection_ptr); XuiListSetCurSelVisible(m_menulist, menu->selection_ptr);
} }
static void rmenu_xui_navigation_set_visible(void *data) static void rmenu_xui_navigation_set_visible(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
XuiListSetCurSelVisible(m_menulist, rgui->selection_ptr); XuiListSetCurSelVisible(m_menulist, menu->selection_ptr);
} }
static void rmenu_xui_navigation_alphabet(void *data, size_t *ptr_out) static void rmenu_xui_navigation_alphabet(void *data, size_t *ptr_out)
@ -722,12 +722,12 @@ static void rmenu_xui_list_set_selection(void *data)
static void rmenu_xui_init_core_info(void *data) static void rmenu_xui_init_core_info(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
core_info_list_free(rgui->core_info); core_info_list_free(menu->core_info);
rgui->core_info = NULL; menu->core_info = NULL;
if (*g_settings.libretro_directory) if (*g_settings.libretro_directory)
rgui->core_info = core_info_list_new(g_settings.libretro_directory); menu->core_info = core_info_list_new(g_settings.libretro_directory);
} }
const menu_ctx_driver_t menu_ctx_rmenu_xui = { const menu_ctx_driver_t menu_ctx_rmenu_xui = {

View File

@ -18,20 +18,20 @@
void menu_update_system_info(void *data, bool *load_no_rom) void menu_update_system_info(void *data, bool *load_no_rom)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
libretro_free_system_info(&rgui->info); libretro_free_system_info(&menu->info);
if (*g_settings.libretro) if (*g_settings.libretro)
{ {
libretro_get_system_info(g_settings.libretro, &rgui->info, load_no_rom); libretro_get_system_info(g_settings.libretro, &menu->info, load_no_rom);
#endif #endif
// Keep track of info for the currently selected core. // Keep track of info for the currently selected core.
if (rgui->core_info) if (menu->core_info)
{ {
if (core_info_list_get_info(rgui->core_info, rgui->core_info_current, g_settings.libretro)) if (core_info_list_get_info(menu->core_info, menu->core_info_current, g_settings.libretro))
{ {
const core_info_t *info = (const core_info_t*)rgui->core_info_current; const core_info_t *info = (const core_info_t*)menu->core_info_current;
RARCH_LOG("[Core Info]:\n"); RARCH_LOG("[Core Info]:\n");
if (info->display_name) if (info->display_name)
@ -185,15 +185,15 @@ void load_menu_game_history(unsigned game_index)
static void menu_init_history(void *data) static void menu_init_history(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
if (rgui->history) if (menu->history)
{ {
rom_history_free(rgui->history); rom_history_free(menu->history);
rgui->history = NULL; menu->history = NULL;
} }
if (*g_extern.config_path) if (*g_extern.config_path)
@ -208,27 +208,27 @@ static void menu_init_history(void *data)
} }
RARCH_LOG("[Menu]: Opening history: %s.\n", history_path); RARCH_LOG("[Menu]: Opening history: %s.\n", history_path);
rgui->history = rom_history_init(history_path, g_settings.game_history_size); menu->history = rom_history_init(history_path, g_settings.game_history_size);
} }
} }
static void menu_update_libretro_info(void *data) static void menu_update_libretro_info(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
#ifndef HAVE_DYNAMIC #ifndef HAVE_DYNAMIC
retro_get_system_info(&rgui->info); retro_get_system_info(&menu->info);
#endif #endif
core_info_list_free(rgui->core_info); core_info_list_free(menu->core_info);
rgui->core_info = NULL; menu->core_info = NULL;
if (*g_settings.libretro_directory) if (*g_settings.libretro_directory)
rgui->core_info = core_info_list_new(g_settings.libretro_directory); menu->core_info = core_info_list_new(g_settings.libretro_directory);
menu_update_system_info(rgui, NULL); menu_update_system_info(menu, NULL);
} }
void load_menu_game_prepare_dummy(void) void load_menu_game_prepare_dummy(void)
@ -306,78 +306,78 @@ bool load_menu_game(void)
void *menu_init(const void *data) void *menu_init(const void *data)
{ {
rgui_handle_t *rgui; menu_handle_t *menu;
menu_ctx_driver_t *menu_ctx = (menu_ctx_driver_t*)data; menu_ctx_driver_t *menu_ctx = (menu_ctx_driver_t*)data;
if (!menu_ctx) if (!menu_ctx)
return NULL; return NULL;
rgui = (rgui_handle_t*)menu_ctx->init(); menu = (menu_handle_t*)menu_ctx->init();
if (!rgui) if (!menu)
return NULL; return NULL;
strlcpy(g_settings.menu.driver, menu_ctx->ident, sizeof(g_settings.menu.driver)); strlcpy(g_settings.menu.driver, menu_ctx->ident, sizeof(g_settings.menu.driver));
rgui->menu_stack = (file_list_t*)calloc(1, sizeof(file_list_t)); menu->menu_stack = (file_list_t*)calloc(1, sizeof(file_list_t));
rgui->selection_buf = (file_list_t*)calloc(1, sizeof(file_list_t)); menu->selection_buf = (file_list_t*)calloc(1, sizeof(file_list_t));
rgui->core_info_current = (core_info_t*)calloc(1, sizeof(core_info_t)); menu->core_info_current = (core_info_t*)calloc(1, sizeof(core_info_t));
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
rgui->shader = (struct gfx_shader*)calloc(1, sizeof(struct gfx_shader)); menu->shader = (struct gfx_shader*)calloc(1, sizeof(struct gfx_shader));
#endif #endif
file_list_push(rgui->menu_stack, "", MENU_SETTINGS, 0); file_list_push(menu->menu_stack, "", MENU_SETTINGS, 0);
menu_clear_navigation(rgui); menu_clear_navigation(menu);
rgui->push_start_screen = g_settings.rgui_show_start_screen; menu->push_start_screen = g_settings.menu_show_start_screen;
g_settings.rgui_show_start_screen = false; g_settings.menu_show_start_screen = false;
if (menu_ctx && menu_ctx->backend && menu_ctx->backend->entries_init) if (menu_ctx && menu_ctx->backend && menu_ctx->backend->entries_init)
menu_ctx->backend->entries_init(rgui, MENU_SETTINGS); menu_ctx->backend->entries_init(menu, MENU_SETTINGS);
rgui->trigger_state = 0; menu->trigger_state = 0;
rgui->old_input_state = 0; menu->old_input_state = 0;
rgui->do_held = false; menu->do_held = false;
rgui->frame_buf_show = true; menu->frame_buf_show = true;
rgui->current_pad = 0; menu->current_pad = 0;
menu_update_libretro_info(rgui); menu_update_libretro_info(menu);
if (menu_ctx && menu_ctx->backend && menu_ctx->backend->shader_manager_init) if (menu_ctx && menu_ctx->backend && menu_ctx->backend->shader_manager_init)
menu_ctx->backend->shader_manager_init(rgui); menu_ctx->backend->shader_manager_init(menu);
menu_init_history(rgui); menu_init_history(menu);
rgui->last_time = rarch_get_time_usec(); menu->last_time = rarch_get_time_usec();
return rgui; return menu;
} }
void menu_free(void *data) void menu_free(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
if (rgui->shader) if (menu->shader)
free(rgui->shader); free(menu->shader);
rgui->shader = NULL; menu->shader = NULL;
#endif #endif
if (driver.menu_ctx && driver.menu_ctx->free) if (driver.menu_ctx && driver.menu_ctx->free)
driver.menu_ctx->free(rgui); driver.menu_ctx->free(menu);
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
libretro_free_system_info(&rgui->info); libretro_free_system_info(&menu->info);
#endif #endif
file_list_free(rgui->menu_stack); file_list_free(menu->menu_stack);
file_list_free(rgui->selection_buf); file_list_free(menu->selection_buf);
rom_history_free(rgui->history); rom_history_free(menu->history);
core_info_list_free(rgui->core_info); core_info_list_free(menu->core_info);
if (rgui->core_info_current) if (menu->core_info_current)
free(rgui->core_info_current); free(menu->core_info_current);
free(data); free(data);
} }
@ -619,8 +619,8 @@ bool menu_save_new_config(void)
char config_dir[PATH_MAX]; char config_dir[PATH_MAX];
*config_dir = '\0'; *config_dir = '\0';
if (*g_settings.rgui_config_directory) if (*g_settings.menu_config_directory)
strlcpy(config_dir, g_settings.rgui_config_directory, sizeof(config_dir)); strlcpy(config_dir, g_settings.menu_config_directory, sizeof(config_dir));
else if (*g_extern.config_path) // Fallback else if (*g_extern.config_path) // Fallback
fill_pathname_basedir(config_dir, g_extern.config_path, sizeof(config_dir)); fill_pathname_basedir(config_dir, g_extern.config_path, sizeof(config_dir));
else else

View File

@ -71,7 +71,7 @@ typedef enum
MENU_SETTINGS, MENU_SETTINGS,
MENU_INFO_SCREEN, MENU_INFO_SCREEN,
MENU_START_SCREEN, MENU_START_SCREEN,
} rgui_file_type_t; } menu_file_type_t;
typedef enum typedef enum
{ {
@ -90,7 +90,7 @@ typedef enum
MENU_ACTION_MAPPING_PREVIOUS, MENU_ACTION_MAPPING_PREVIOUS,
MENU_ACTION_MAPPING_NEXT, MENU_ACTION_MAPPING_NEXT,
MENU_ACTION_NOOP MENU_ACTION_NOOP
} rgui_action_t; } menu_action_t;
void menu_poll_bind_get_rested_axes(void *data); void menu_poll_bind_get_rested_axes(void *data);
void menu_poll_bind_state(void *data); void menu_poll_bind_state(void *data);

View File

@ -30,71 +30,71 @@
void menu_key_start_line(void *data, const char *label, input_keyboard_line_complete_t cb) void menu_key_start_line(void *data, const char *label, input_keyboard_line_complete_t cb)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
rgui->keyboard.display = true; menu->keyboard.display = true;
rgui->keyboard.label = label; menu->keyboard.label = label;
rgui->keyboard.buffer = input_keyboard_start_line(rgui, cb); menu->keyboard.buffer = input_keyboard_start_line(menu, cb);
} }
static void menu_key_end_line(void *data) static void menu_key_end_line(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return; return;
rgui->keyboard.display = false; menu->keyboard.display = false;
rgui->keyboard.label = NULL; menu->keyboard.label = NULL;
rgui->old_input_state = -1ULL; // Avoid triggering states on pressing return. menu->old_input_state = -1ULL; // Avoid triggering states on pressing return.
} }
static void menu_search_callback(void *userdata, const char *str) static void menu_search_callback(void *userdata, const char *str)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)userdata; menu_handle_t *menu = (menu_handle_t*)userdata;
if (str && *str) if (str && *str)
file_list_search(rgui->selection_buf, str, &rgui->selection_ptr); file_list_search(menu->selection_buf, str, &menu->selection_ptr);
menu_key_end_line(rgui); menu_key_end_line(menu);
} }
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
void netplay_port_callback(void *userdata, const char *str) void netplay_port_callback(void *userdata, const char *str)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)userdata; menu_handle_t *menu = (menu_handle_t*)userdata;
if (str && *str) if (str && *str)
g_extern.netplay_port = strtoul(str, NULL, 0); g_extern.netplay_port = strtoul(str, NULL, 0);
menu_key_end_line(rgui); menu_key_end_line(menu);
} }
void netplay_ipaddress_callback(void *userdata, const char *str) void netplay_ipaddress_callback(void *userdata, const char *str)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)userdata; menu_handle_t *menu = (menu_handle_t*)userdata;
if (str && *str) if (str && *str)
strlcpy(g_extern.netplay_server, str, sizeof(g_extern.netplay_server)); strlcpy(g_extern.netplay_server, str, sizeof(g_extern.netplay_server));
menu_key_end_line(rgui); menu_key_end_line(menu);
} }
void netplay_nickname_callback(void *userdata, const char *str) void netplay_nickname_callback(void *userdata, const char *str)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)userdata; menu_handle_t *menu = (menu_handle_t*)userdata;
if (str && *str) if (str && *str)
strlcpy(g_extern.netplay_nick, str, sizeof(g_extern.netplay_nick)); strlcpy(g_extern.netplay_nick, str, sizeof(g_extern.netplay_nick));
menu_key_end_line(rgui); menu_key_end_line(menu);
} }
#endif #endif
void audio_device_callback(void *userdata, const char *str) void audio_device_callback(void *userdata, const char *str)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)userdata; menu_handle_t *menu = (menu_handle_t*)userdata;
if (!rgui) if (!menu)
{ {
RARCH_ERR("Cannot invoke audio device setting callback, menu handle is not initialized.\n"); RARCH_ERR("Cannot invoke audio device setting callback, menu handle is not initialized.\n");
return; return;
@ -102,15 +102,15 @@ void audio_device_callback(void *userdata, const char *str)
if (str && *str) if (str && *str)
strlcpy(g_settings.audio.device, str, sizeof(g_settings.audio.device)); strlcpy(g_settings.audio.device, str, sizeof(g_settings.audio.device));
menu_key_end_line(rgui); menu_key_end_line(menu);
} }
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
void preset_filename_callback(void *userdata, const char *str) void preset_filename_callback(void *userdata, const char *str)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)userdata; menu_handle_t *menu = (menu_handle_t*)userdata;
if (!rgui) if (!menu)
{ {
RARCH_ERR("Cannot invoke preset setting callback, menu handle is not initialized.\n"); RARCH_ERR("Cannot invoke preset setting callback, menu handle is not initialized.\n");
return; return;
@ -118,7 +118,7 @@ void preset_filename_callback(void *userdata, const char *str)
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->shader_manager_save_preset) if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->shader_manager_save_preset)
driver.menu_ctx->backend->shader_manager_save_preset(str && *str ? str : NULL, false); driver.menu_ctx->backend->shader_manager_save_preset(str && *str ? str : NULL, false);
menu_key_end_line(rgui); menu_key_end_line(menu);
} }
#endif #endif
@ -144,7 +144,7 @@ void menu_key_event(bool down, unsigned keycode, uint32_t character, uint16_t mo
void menu_poll_bind_state(void *data) void menu_poll_bind_state(void *data)
{ {
struct rgui_bind_state *state = (struct rgui_bind_state*)data; struct menu_bind_state *state = (struct menu_bind_state*)data;
if (!state) if (!state)
return; return;
@ -184,7 +184,7 @@ void menu_poll_bind_get_rested_axes(void *data)
{ {
unsigned i, a; unsigned i, a;
const rarch_joypad_driver_t *joypad = NULL; const rarch_joypad_driver_t *joypad = NULL;
struct rgui_bind_state *state = (struct rgui_bind_state*)data; struct menu_bind_state *state = (struct menu_bind_state*)data;
if (!state) if (!state)
return; return;
@ -203,11 +203,11 @@ void menu_poll_bind_get_rested_axes(void *data)
state->axis_state[i].rested_axes[a] = input_joypad_axis_raw(joypad, i, a); state->axis_state[i].rested_axes[a] = input_joypad_axis_raw(joypad, i, a);
} }
static bool menu_poll_find_trigger_pad(struct rgui_bind_state *state, struct rgui_bind_state *new_state, unsigned p) static bool menu_poll_find_trigger_pad(struct menu_bind_state *state, struct menu_bind_state *new_state, unsigned p)
{ {
unsigned a, b, h; unsigned a, b, h;
const struct rgui_bind_state_port *n = (const struct rgui_bind_state_port*)&new_state->state[p]; const struct menu_bind_state_port *n = (const struct menu_bind_state_port*)&new_state->state[p];
const struct rgui_bind_state_port *o = (const struct rgui_bind_state_port*)&state->state[p]; const struct menu_bind_state_port *o = (const struct menu_bind_state_port*)&state->state[p];
for (b = 0; b < MENU_MAX_BUTTONS; b++) for (b = 0; b < MENU_MAX_BUTTONS; b++)
{ {
@ -268,9 +268,9 @@ static bool menu_poll_find_trigger_pad(struct rgui_bind_state *state, struct rgu
bool menu_poll_find_trigger(void *data1, void *data2) bool menu_poll_find_trigger(void *data1, void *data2)
{ {
unsigned i; unsigned i;
struct rgui_bind_state *state, *new_state; struct menu_bind_state *state, *new_state;
state = (struct rgui_bind_state*)data1; state = (struct menu_bind_state*)data1;
new_state = (struct rgui_bind_state*)data2; new_state = (struct menu_bind_state*)data2;
if (!state || !new_state) if (!state || !new_state)
return false; return false;
@ -288,16 +288,16 @@ bool menu_poll_find_trigger(void *data1, void *data2)
bool menu_custom_bind_keyboard_cb(void *data, unsigned code) bool menu_custom_bind_keyboard_cb(void *data, unsigned code)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui) if (!menu)
return false; return false;
rgui->binds.target->key = (enum retro_key)code; menu->binds.target->key = (enum retro_key)code;
rgui->binds.begin++; menu->binds.begin++;
rgui->binds.target++; menu->binds.target++;
rgui->binds.timeout_end = rarch_get_time_usec() + MENU_KEYBOARD_BIND_TIMEOUT_SECONDS * 1000000; menu->binds.timeout_end = rarch_get_time_usec() + MENU_KEYBOARD_BIND_TIMEOUT_SECONDS * 1000000;
return rgui->binds.begin <= rgui->binds.last; return menu->binds.begin <= menu->binds.last;
} }
uint64_t menu_input(void) uint64_t menu_input(void)

View File

@ -25,79 +25,79 @@
void menu_clear_navigation(void *data) void menu_clear_navigation(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
rgui->selection_ptr = 0; menu->selection_ptr = 0;
if (driver.menu_ctx && driver.menu_ctx->navigation_clear) if (driver.menu_ctx && driver.menu_ctx->navigation_clear)
driver.menu_ctx->navigation_clear(rgui); driver.menu_ctx->navigation_clear(menu);
} }
void menu_decrement_navigation(void *data) void menu_decrement_navigation(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
rgui->selection_ptr--; menu->selection_ptr--;
if (driver.menu_ctx && driver.menu_ctx->navigation_decrement) if (driver.menu_ctx && driver.menu_ctx->navigation_decrement)
driver.menu_ctx->navigation_decrement(rgui); driver.menu_ctx->navigation_decrement(menu);
} }
void menu_increment_navigation(void *data) void menu_increment_navigation(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
rgui->selection_ptr++; menu->selection_ptr++;
if (driver.menu_ctx && driver.menu_ctx->navigation_increment) if (driver.menu_ctx && driver.menu_ctx->navigation_increment)
driver.menu_ctx->navigation_increment(rgui); driver.menu_ctx->navigation_increment(menu);
} }
void menu_set_navigation(void *data, size_t i) void menu_set_navigation(void *data, size_t i)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
rgui->selection_ptr = i; menu->selection_ptr = i;
if (driver.menu_ctx && driver.menu_ctx->navigation_set) if (driver.menu_ctx && driver.menu_ctx->navigation_set)
driver.menu_ctx->navigation_set(rgui); driver.menu_ctx->navigation_set(menu);
} }
void menu_set_navigation_last(void *data) void menu_set_navigation_last(void *data)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
rgui->selection_ptr = file_list_get_size(rgui->selection_buf) - 1; menu->selection_ptr = file_list_get_size(menu->selection_buf) - 1;
if (driver.menu_ctx && driver.menu_ctx->navigation_set_last) if (driver.menu_ctx && driver.menu_ctx->navigation_set_last)
driver.menu_ctx->navigation_set_last(rgui); driver.menu_ctx->navigation_set_last(menu);
} }
void menu_descend_alphabet(void *data, size_t *ptr_out) void menu_descend_alphabet(void *data, size_t *ptr_out)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui->scroll_indices_size) if (!menu->scroll_indices_size)
return; return;
size_t ptr = *ptr_out; size_t ptr = *ptr_out;
if (ptr == 0) if (ptr == 0)
return; return;
size_t i = rgui->scroll_indices_size - 1; size_t i = menu->scroll_indices_size - 1;
while (i && rgui->scroll_indices[i - 1] >= ptr) while (i && menu->scroll_indices[i - 1] >= ptr)
i--; i--;
*ptr_out = rgui->scroll_indices[i - 1]; *ptr_out = menu->scroll_indices[i - 1];
if (driver.menu_ctx && driver.menu_ctx->navigation_descend_alphabet) if (driver.menu_ctx && driver.menu_ctx->navigation_descend_alphabet)
driver.menu_ctx->navigation_descend_alphabet(rgui, ptr_out); driver.menu_ctx->navigation_descend_alphabet(menu, ptr_out);
} }
void menu_ascend_alphabet(void *data, size_t *ptr_out) void menu_ascend_alphabet(void *data, size_t *ptr_out)
{ {
rgui_handle_t *rgui = (rgui_handle_t*)data; menu_handle_t *menu = (menu_handle_t*)data;
if (!rgui->scroll_indices_size) if (!menu->scroll_indices_size)
return; return;
size_t ptr = *ptr_out; size_t ptr = *ptr_out;
if (ptr == rgui->scroll_indices[rgui->scroll_indices_size - 1]) if (ptr == menu->scroll_indices[menu->scroll_indices_size - 1])
return; return;
size_t i = 0; size_t i = 0;
while (i < rgui->scroll_indices_size - 1 && rgui->scroll_indices[i + 1] <= ptr) while (i < menu->scroll_indices_size - 1 && menu->scroll_indices[i + 1] <= ptr)
i++; i++;
*ptr_out = rgui->scroll_indices[i + 1]; *ptr_out = menu->scroll_indices[i + 1];
if (driver.menu_ctx && driver.menu_ctx->navigation_descend_alphabet) if (driver.menu_ctx && driver.menu_ctx->navigation_descend_alphabet)
driver.menu_ctx->navigation_descend_alphabet(rgui, ptr_out); driver.menu_ctx->navigation_descend_alphabet(menu, ptr_out);
} }

View File

@ -332,9 +332,9 @@ struct settings
char content_directory[PATH_MAX]; char content_directory[PATH_MAX];
char assets_directory[PATH_MAX]; char assets_directory[PATH_MAX];
#if defined(HAVE_MENU) #if defined(HAVE_MENU)
char rgui_content_directory[PATH_MAX]; char menu_content_directory[PATH_MAX];
char rgui_config_directory[PATH_MAX]; char menu_config_directory[PATH_MAX];
bool rgui_show_start_screen; bool menu_show_start_screen;
#endif #endif
bool fps_show; bool fps_show;
bool load_dummy_on_core_shutdown; bool load_dummy_on_core_shutdown;

View File

@ -339,7 +339,7 @@ void config_set_defaults(void)
g_settings.libretro_log_level = libretro_log_level; g_settings.libretro_log_level = libretro_log_level;
#ifdef HAVE_MENU #ifdef HAVE_MENU
g_settings.rgui_show_start_screen = rgui_show_start_screen; g_settings.menu_show_start_screen = menu_show_start_screen;
#endif #endif
#ifdef HAVE_LOCATION #ifdef HAVE_LOCATION
@ -423,8 +423,8 @@ void config_set_defaults(void)
*g_settings.audio.filter_dir = '\0'; *g_settings.audio.filter_dir = '\0';
*g_settings.audio.dsp_plugin = '\0'; *g_settings.audio.dsp_plugin = '\0';
#ifdef HAVE_MENU #ifdef HAVE_MENU
*g_settings.rgui_content_directory = '\0'; *g_settings.menu_content_directory = '\0';
*g_settings.rgui_config_directory = '\0'; *g_settings.menu_config_directory = '\0';
#endif #endif
g_settings.core_specific_config = default_core_specific_config; g_settings.core_specific_config = default_core_specific_config;
@ -526,10 +526,10 @@ static void config_load_core_specific(void)
return; return;
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (*g_settings.rgui_config_directory) if (*g_settings.menu_config_directory)
{ {
path_resolve_realpath(g_settings.rgui_config_directory, sizeof(g_settings.rgui_config_directory)); path_resolve_realpath(g_settings.menu_config_directory, sizeof(g_settings.menu_config_directory));
strlcpy(g_extern.core_specific_config_path, g_settings.rgui_config_directory, sizeof(g_extern.core_specific_config_path)); strlcpy(g_extern.core_specific_config_path, g_settings.menu_config_directory, sizeof(g_extern.core_specific_config_path));
} }
else else
#endif #endif
@ -1027,13 +1027,13 @@ bool config_load_file(const char *path, bool set_defaults)
if (!strcmp(g_settings.assets_directory, "default")) if (!strcmp(g_settings.assets_directory, "default"))
*g_settings.assets_directory = '\0'; *g_settings.assets_directory = '\0';
#ifdef HAVE_MENU #ifdef HAVE_MENU
CONFIG_GET_PATH(rgui_content_directory, "rgui_browser_directory"); CONFIG_GET_PATH(menu_content_directory, "rgui_browser_directory");
if (!strcmp(g_settings.rgui_content_directory, "default")) if (!strcmp(g_settings.menu_content_directory, "default"))
*g_settings.rgui_content_directory = '\0'; *g_settings.menu_content_directory = '\0';
CONFIG_GET_PATH(rgui_config_directory, "rgui_config_directory"); CONFIG_GET_PATH(menu_config_directory, "rgui_config_directory");
if (!strcmp(g_settings.rgui_config_directory, "default")) if (!strcmp(g_settings.menu_config_directory, "default"))
*g_settings.rgui_config_directory = '\0'; *g_settings.menu_config_directory = '\0';
CONFIG_GET_BOOL(rgui_show_start_screen, "rgui_show_start_screen"); CONFIG_GET_BOOL(menu_show_start_screen, "rgui_show_start_screen");
#endif #endif
CONFIG_GET_INT(libretro_log_level, "libretro_log_level"); CONFIG_GET_INT(libretro_log_level, "libretro_log_level");
@ -1422,9 +1422,9 @@ bool config_save_file(const char *path)
config_set_path(conf, "content_directory", *g_settings.content_directory ? g_settings.content_directory : "default"); config_set_path(conf, "content_directory", *g_settings.content_directory ? g_settings.content_directory : "default");
config_set_path(conf, "assets_directory", *g_settings.assets_directory ? g_settings.assets_directory : "default"); config_set_path(conf, "assets_directory", *g_settings.assets_directory ? g_settings.assets_directory : "default");
#ifdef HAVE_MENU #ifdef HAVE_MENU
config_set_path(conf, "rgui_browser_directory", *g_settings.rgui_content_directory ? g_settings.rgui_content_directory : "default"); config_set_path(conf, "rgui_browser_directory", *g_settings.menu_content_directory ? g_settings.menu_content_directory : "default");
config_set_path(conf, "rgui_config_directory", *g_settings.rgui_config_directory ? g_settings.rgui_config_directory : "default"); config_set_path(conf, "rgui_config_directory", *g_settings.menu_config_directory ? g_settings.menu_config_directory : "default");
config_set_bool(conf, "rgui_show_start_screen", g_settings.rgui_show_start_screen); config_set_bool(conf, "rgui_show_start_screen", g_settings.menu_show_start_screen);
#endif #endif
config_set_path(conf, "game_history_path", g_settings.game_history_path); config_set_path(conf, "game_history_path", g_settings.game_history_path);

View File

@ -493,10 +493,10 @@ const rarch_setting_t* setting_data_get_list(void)
START_GROUP("Paths") START_GROUP("Paths")
START_SUB_GROUP("Paths") START_SUB_GROUP("Paths")
#ifdef HAVE_MENU #ifdef HAVE_MENU
CONFIG_PATH(g_settings.rgui_content_directory, "rgui_browser_directory", "Content Directory", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR) CONFIG_PATH(g_settings.menu_content_directory, "rgui_browser_directory", "Content Directory", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
CONFIG_PATH(g_settings.assets_directory, "assets_directory", "Assets Directory", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR) CONFIG_PATH(g_settings.assets_directory, "assets_directory", "Assets Directory", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
CONFIG_PATH(g_settings.rgui_config_directory, "rgui_config_directory", "Config Directory", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR) CONFIG_PATH(g_settings.menu_config_directory, "rgui_config_directory", "Config Directory", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)
CONFIG_BOOL(g_settings.rgui_show_start_screen, "rgui_show_start_screen", "Show Start Screen", rgui_show_start_screen) CONFIG_BOOL(g_settings.menu_show_start_screen, "rgui_show_start_screen", "Show Start Screen", menu_show_start_screen)
#endif #endif
CONFIG_PATH(g_settings.libretro, "libretro_path", "Libretro Path", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY) CONFIG_PATH(g_settings.libretro, "libretro_path", "Libretro Path", DEFAULT_ME_YO) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY)
CONFIG_PATH(g_settings.libretro_info_path, "libretro_info_path", "Core Info Directory", default_libretro_info_path) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR) CONFIG_PATH(g_settings.libretro_info_path, "libretro_info_path", "Core Info Directory", default_libretro_info_path) WITH_FLAGS(SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR)