Move rmenu_settings.c to settings.c + add header file

This commit is contained in:
twinaphex 2013-03-09 17:00:52 +01:00
parent 5e53be4b25
commit b827075d55
8 changed files with 432 additions and 466 deletions

View File

@ -438,7 +438,6 @@ MENU
#endif
#ifdef HAVE_RMENU
#include "../../frontend/menu/rmenu_settings.c"
#if defined(_XBOX360)
#include "../../frontend/menu/rmenu_xui.cpp"

View File

@ -21,7 +21,6 @@
#include "frontend_console.h"
#include "menu/rmenu.h"
#include "menu/rmenu_settings.h"
#if defined(__CELLOS_LV2__)
#include "platform/platform_ps3.c"
@ -312,7 +311,7 @@ begin_loop:
{
RARCH_ERR("rarch_main_init failed.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
rmenu_settings_msg(S_MSG_ROM_LOADING_ERROR, S_DELAY_180);
rarch_settings_msg(S_MSG_ROM_LOADING_ERROR, 180);
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INIT);
}

View File

@ -21,8 +21,8 @@
#include "rgui.h"
#include "utils/file_list.h"
#include "rmenu_settings.h"
#include "../../general.h"
#include "../../settings.h"
#include "../../gfx/gfx_common.h"
#ifdef HAVE_OPENGL
@ -484,7 +484,7 @@ static void render_text(rgui_handle_t *rgui)
case RGUI_SETTINGS_VIDEO_ROTATION:
{
char rotate_msg[64];
rmenu_settings_create_menu_item_label(rotate_msg, S_LBL_ROTATION, sizeof(rotate_msg));
menu_settings_create_menu_item_label(rotate_msg, S_LBL_ROTATION, sizeof(rotate_msg));
snprintf(type_str, sizeof(type_str), rotate_msg);
}
break;
@ -613,10 +613,10 @@ static int rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
case RGUI_SETTINGS_REWIND_ENABLE:
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT)
{
rmenu_settings_set(S_REWIND);
rarch_settings_set(S_REWIND);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
}
else if (action == RGUI_ACTION_START)
g_settings.rewind_enable = false;
@ -644,11 +644,11 @@ static int rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
return -1;
}
else if (action == RGUI_ACTION_START)
rmenu_settings_set_default(S_DEF_SAVE_STATE);
rarch_settings_set_default(S_DEF_SAVE_STATE);
else if (action == RGUI_ACTION_LEFT)
rmenu_settings_set(S_SAVESTATE_DECREMENT);
rarch_settings_set(S_SAVESTATE_DECREMENT);
else if (action == RGUI_ACTION_RIGHT)
rmenu_settings_set(S_SAVESTATE_INCREMENT);
rarch_settings_set(S_SAVESTATE_INCREMENT);
break;
case RGUI_SETTINGS_SCREENSHOT:
if (action == RGUI_ACTION_OK)
@ -670,7 +670,7 @@ static int rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
data + (height - 1) * (pitch >> 1),
width, height, -pitch, false);
msg_queue_push(g_extern.msg_queue, r ? "Screenshot saved" : "Screenshot failed to save", 1, S_DELAY_90);
msg_queue_push(g_extern.msg_queue, r ? "Screenshot saved" : "Screenshot failed to save", 1, 90);
}
break;
case RGUI_SETTINGS_RESTART_GAME:
@ -683,9 +683,9 @@ static int rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
break;
case RGUI_SETTINGS_VIDEO_FILTER:
if (action == RGUI_ACTION_START)
rmenu_settings_set_default(S_DEF_HW_TEXTURE_FILTER);
rarch_settings_set_default(S_DEF_HW_TEXTURE_FILTER);
else
rmenu_settings_set(S_HW_TEXTURE_FILTER);
rarch_settings_set(S_HW_TEXTURE_FILTER);
break;
#ifdef HW_RVL
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
@ -749,60 +749,60 @@ static int rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t
break;
case RGUI_SETTINGS_VIDEO_ASPECT_RATIO:
if (action == RGUI_ACTION_START)
rmenu_settings_set_default(S_DEF_ASPECT_RATIO);
rarch_settings_set_default(S_DEF_ASPECT_RATIO);
else if (action == RGUI_ACTION_LEFT)
rmenu_settings_set(S_ASPECT_RATIO_DECREMENT);
rarch_settings_set(S_ASPECT_RATIO_DECREMENT);
else if (action == RGUI_ACTION_RIGHT)
rmenu_settings_set(S_ASPECT_RATIO_INCREMENT);
rarch_settings_set(S_ASPECT_RATIO_INCREMENT);
video_set_aspect_ratio_func(g_settings.video.aspect_ratio_idx);
break;
case RGUI_SETTINGS_VIDEO_ROTATION:
if (action == RGUI_ACTION_START)
{
rmenu_settings_set_default(S_DEF_AUDIO_CONTROL_RATE);
rarch_settings_set_default(S_DEF_AUDIO_CONTROL_RATE);
video_set_rotation_func(g_extern.console.screen.orientation);
}
else if (action == RGUI_ACTION_LEFT)
{
rmenu_settings_set(S_ROTATION_DECREMENT);
rarch_settings_set(S_ROTATION_DECREMENT);
video_set_rotation_func(g_extern.console.screen.orientation);
}
else if (action == RGUI_ACTION_RIGHT)
{
rmenu_settings_set(S_ROTATION_INCREMENT);
rarch_settings_set(S_ROTATION_INCREMENT);
video_set_rotation_func(g_extern.console.screen.orientation);
}
break;
case RGUI_SETTINGS_VIDEO_OVERSCAN:
if (action == RGUI_ACTION_START)
{
rmenu_settings_set_default(S_DEF_OVERSCAN);
rarch_settings_set_default(S_DEF_OVERSCAN);
driver.video->apply_state_changes();
}
else if (action == RGUI_ACTION_LEFT)
{
rmenu_settings_set(S_OVERSCAN_DECREMENT);
rarch_settings_set(S_OVERSCAN_DECREMENT);
driver.video->apply_state_changes();
}
else if (action == RGUI_ACTION_RIGHT)
{
rmenu_settings_set(S_OVERSCAN_INCREMENT);
rarch_settings_set(S_OVERSCAN_INCREMENT);
driver.video->apply_state_changes();
}
break;
case RGUI_SETTINGS_AUDIO_MUTE:
if (action == RGUI_ACTION_START)
rmenu_settings_set_default(S_DEF_AUDIO_MUTE);
rarch_settings_set_default(S_DEF_AUDIO_MUTE);
else
rmenu_settings_set(S_AUDIO_MUTE);
rarch_settings_set(S_AUDIO_MUTE);
break;
case RGUI_SETTINGS_AUDIO_CONTROL_RATE:
if (action == RGUI_ACTION_START)
rmenu_settings_set_default(S_DEF_AUDIO_CONTROL_RATE);
rarch_settings_set_default(S_DEF_AUDIO_CONTROL_RATE);
else if (action == RGUI_ACTION_LEFT)
rmenu_settings_set(S_AUDIO_CONTROL_RATE_DECREMENT);
rarch_settings_set(S_AUDIO_CONTROL_RATE_DECREMENT);
else if (action == RGUI_ACTION_RIGHT)
rmenu_settings_set(S_AUDIO_CONTROL_RATE_INCREMENT);
rarch_settings_set(S_AUDIO_CONTROL_RATE_INCREMENT);
break;
case RGUI_SETTINGS_RESAMPLER_TYPE:
{
@ -1371,7 +1371,7 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action)
strlcpy(g_extern.fullpath, rgui->path_buf, sizeof(g_extern.fullpath));
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
rmenu_settings_msg(S_MSG_LOADING_ROM, S_DELAY_1);
rarch_settings_msg(S_MSG_LOADING_ROM, 1);
rgui->need_refresh = true; // in case of zip extract
rgui->msg_force = true;
}
@ -1652,7 +1652,7 @@ int rmenu_input_process(void *data, void *state)
if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_LOADING_ROM, 100);
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
if (g_extern.fullpath)
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);

View File

@ -29,7 +29,6 @@
#include "../../console/rarch_console.h"
#include "../../console/rarch_console_input.h"
#include "rmenu_settings.h"
#include "../../gfx/image.h"
@ -39,6 +38,7 @@
#include "../../file.h"
#include "../../driver.h"
#include "../../general.h"
#include "../../settings.h"
#define EXT_IMAGES "png|PNG|jpg|JPG|JPEG|jpeg"
#define EXT_SHADERS "cg|CG"
@ -625,7 +625,7 @@ static void browser_update(void *data, uint64_t input, const char *extensions)
ret = filebrowser_iterate(b, action);
if(!ret)
rmenu_settings_msg(S_MSG_DIR_LOADING_ERROR, S_DELAY_180);
rarch_settings_msg(S_MSG_DIR_LOADING_ERROR, 180);
}
void browser_render(void *data)
@ -724,7 +724,7 @@ int select_file(void *data, void *state)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, path, RARCH_SHADER_INDEX_PASS0);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180);
}
else
RARCH_ERR("Shaders are unsupported on this platform.\n");
@ -740,7 +740,7 @@ int select_file(void *data, void *state)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, path, RARCH_SHADER_INDEX_PASS1);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180);
}
else
RARCH_ERR("Shaders are unsupported on this platform.\n");
@ -782,7 +782,7 @@ int select_file(void *data, void *state)
else
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
}
break;
}
@ -791,7 +791,7 @@ int select_file(void *data, void *state)
}
if(!ret)
rmenu_settings_msg(S_MSG_DIR_LOADING_ERROR, S_DELAY_180);
rarch_settings_msg(S_MSG_DIR_LOADING_ERROR, 180);
}
else if (input & (1ULL << RMENU_DEVICE_NAV_X))
menu_stack_pop();
@ -889,7 +889,7 @@ int select_directory(void *data, void *state)
}
if(!ret)
rmenu_settings_msg(S_MSG_DIR_LOADING_ERROR, S_DELAY_180);
rarch_settings_msg(S_MSG_DIR_LOADING_ERROR, 180);
display_menubar(current_menu);
@ -1028,9 +1028,9 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
#ifdef __CELLOS_LV2__
case SETTING_CHANGE_RESOLUTION:
if(input & (1ULL << RMENU_DEVICE_NAV_RIGHT))
rmenu_settings_set(S_RESOLUTION_NEXT);
rarch_settings_set(S_RESOLUTION_NEXT);
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
rmenu_settings_set(S_RESOLUTION_PREVIOUS);
rarch_settings_set(S_RESOLUTION_PREVIOUS);
if(input & (1ULL << RMENU_DEVICE_NAV_B))
{
if (g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx] == CELL_VIDEO_OUT_RESOLUTION_576)
@ -1106,7 +1106,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, NULL, RARCH_SHADER_INDEX_PASS0);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180);
}
else
RARCH_ERR("Shaders are unsupported on this platform.\n");
@ -1126,7 +1126,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, NULL, RARCH_SHADER_INDEX_PASS1);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180);
}
else
RARCH_ERR("Shaders are unsupported on this platform.\n");
@ -1159,7 +1159,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
}
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
@ -1172,7 +1172,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
}
}
}
@ -1194,29 +1194,29 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
case SETTING_KEEP_ASPECT_RATIO:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
{
rmenu_settings_set(S_ASPECT_RATIO_DECREMENT);
rarch_settings_set(S_ASPECT_RATIO_DECREMENT);
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
}
if(input & (1ULL << RMENU_DEVICE_NAV_RIGHT))
{
rmenu_settings_set(S_ASPECT_RATIO_INCREMENT);
rarch_settings_set(S_ASPECT_RATIO_INCREMENT);
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set_default(S_DEF_ASPECT_RATIO);
rarch_settings_set_default(S_DEF_ASPECT_RATIO);
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
}
break;
case SETTING_HW_TEXTURE_FILTER:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_HW_TEXTURE_FILTER);
rarch_settings_set(S_HW_TEXTURE_FILTER);
device_ptr->ctx_driver->set_filtering(1, g_settings.video.smooth);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set(S_DEF_HW_TEXTURE_FILTER);
rarch_settings_set(S_DEF_HW_TEXTURE_FILTER);
device_ptr->ctx_driver->set_filtering(1, g_settings.video.smooth);
}
break;
@ -1224,19 +1224,19 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
case SETTING_HW_TEXTURE_FILTER_2:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_HW_TEXTURE_FILTER_2);
rarch_settings_set(S_HW_TEXTURE_FILTER_2);
device_ptr->ctx_driver->set_filtering(2, g_settings.video.second_pass_smooth);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set(S_DEF_HW_TEXTURE_FILTER_2);
rarch_settings_set(S_DEF_HW_TEXTURE_FILTER_2);
device_ptr->ctx_driver->set_filtering(2, g_settings.video.second_pass_smooth);
}
break;
case SETTING_SCALE_ENABLED:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_SCALE_ENABLED);
rarch_settings_set(S_SCALE_ENABLED);
if(g_settings.video.render_to_texture)
device_ptr->ctx_driver->set_fbo(FBO_INIT);
@ -1245,7 +1245,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set_default(S_DEF_SCALE_ENABLED);
rarch_settings_set_default(S_DEF_SCALE_ENABLED);
device_ptr->ctx_driver->set_fbo(FBO_REINIT);
}
break;
@ -1258,7 +1258,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
if(should_decrement)
{
rmenu_settings_set(S_SCALE_FACTOR_DECREMENT);
rarch_settings_set(S_SCALE_FACTOR_DECREMENT);
device_ptr->ctx_driver->set_fbo(FBO_REINIT);
}
}
@ -1270,14 +1270,14 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
bool should_increment = g_settings.video.fbo.scale_x < MAX_SCALING_FACTOR;
if(should_increment)
{
rmenu_settings_set(S_SCALE_FACTOR_INCREMENT);
rarch_settings_set(S_SCALE_FACTOR_INCREMENT);
device_ptr->ctx_driver->set_fbo(FBO_REINIT);
}
}
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set_default(S_DEF_SCALE_FACTOR);
rarch_settings_set_default(S_DEF_SCALE_FACTOR);
device_ptr->ctx_driver->set_fbo(FBO_REINIT);
}
break;
@ -1312,34 +1312,34 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
case SETTING_HW_OVERSCAN_AMOUNT:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
{
rmenu_settings_set(S_OVERSCAN_DECREMENT);
rarch_settings_set(S_OVERSCAN_DECREMENT);
gfx_ctx_set_overscan();
}
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_OVERSCAN_INCREMENT);
rarch_settings_set(S_OVERSCAN_INCREMENT);
gfx_ctx_set_overscan();
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set_default(S_DEF_OVERSCAN);
rarch_settings_set_default(S_DEF_OVERSCAN);
gfx_ctx_set_overscan();
}
break;
case SETTING_REFRESH_RATE:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
{
rmenu_settings_set(S_REFRESH_RATE_DECREMENT);
rarch_settings_set(S_REFRESH_RATE_DECREMENT);
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
}
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_REFRESH_RATE_INCREMENT);
rarch_settings_set(S_REFRESH_RATE_INCREMENT);
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set_default(S_DEF_REFRESH_RATE);
rarch_settings_set_default(S_DEF_REFRESH_RATE);
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
}
break;
@ -1348,7 +1348,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
{
if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_PAL_VSYNC_BLOCK)))
{
rmenu_settings_set(S_THROTTLE);
rarch_settings_set(S_THROTTLE);
device_ptr->ctx_driver->swap_interval((g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE)) ? true : false);
}
}
@ -1356,7 +1356,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
{
if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_PAL_VSYNC_BLOCK)))
{
rmenu_settings_set_default(S_DEF_THROTTLE);
rarch_settings_set_default(S_DEF_THROTTLE);
device_ptr->ctx_driver->swap_interval((g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE)) ? true : false);
}
}
@ -1364,12 +1364,12 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
case SETTING_TRIPLE_BUFFERING:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_TRIPLE_BUFFERING);
rarch_settings_set(S_TRIPLE_BUFFERING);
driver.video->restart();
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set_default(S_DEF_TRIPLE_BUFFERING);
rarch_settings_set_default(S_DEF_TRIPLE_BUFFERING);
if(!(g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)))
driver.video->restart();
@ -1461,31 +1461,31 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
break;
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
rmenu_settings_set(S_SAVESTATE_DECREMENT);
rarch_settings_set(S_SAVESTATE_DECREMENT);
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
rmenu_settings_set(S_SAVESTATE_INCREMENT);
rarch_settings_set(S_SAVESTATE_INCREMENT);
if(input & (1ULL << RMENU_DEVICE_NAV_START))
rmenu_settings_set_default(S_DEF_SAVE_STATE);
rarch_settings_set_default(S_DEF_SAVE_STATE);
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
rmenu_settings_set(S_INFO_DEBUG_MSG_TOGGLE);
rarch_settings_set(S_INFO_DEBUG_MSG_TOGGLE);
if(input & (1ULL << RMENU_DEVICE_NAV_START))
rmenu_settings_set_default(S_DEF_INFO_DEBUG_MSG);
rarch_settings_set_default(S_DEF_INFO_DEBUG_MSG);
break;
case SETTING_EMU_SHOW_INFO_MSG:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
rmenu_settings_set(S_INFO_MSG_TOGGLE);
rarch_settings_set(S_INFO_MSG_TOGGLE);
if(input & (1ULL << RMENU_DEVICE_NAV_START))
rmenu_settings_set_default(S_DEF_INFO_MSG);
rarch_settings_set_default(S_DEF_INFO_MSG);
break;
case SETTING_EMU_REWIND_ENABLED:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_REWIND);
rarch_settings_set(S_REWIND);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
g_settings.rewind_enable = false;
@ -1562,10 +1562,10 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
break;
case SETTING_EMU_AUDIO_MUTE:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
rmenu_settings_set(S_AUDIO_MUTE);
rarch_settings_set(S_AUDIO_MUTE);
if(input & (1ULL << RMENU_DEVICE_NAV_START))
rmenu_settings_set_default(S_DEF_AUDIO_MUTE);
rarch_settings_set_default(S_DEF_AUDIO_MUTE);
break;
#ifdef _XBOX1
case SETTING_EMU_AUDIO_SOUND_VOLUME_LEVEL:
@ -1573,14 +1573,14 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
{
g_extern.console.sound.volume_level = !g_extern.console.sound.volume_level;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
g_extern.console.sound.volume_level = 0;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
}
break;
#endif
@ -1961,7 +1961,7 @@ int select_rom(void *data, void *state)
bool ret = filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
if(!ret)
rmenu_settings_msg(S_MSG_DIR_LOADING_ERROR, S_DELAY_180);
rarch_settings_msg(S_MSG_DIR_LOADING_ERROR, 180);
}
else
{
@ -2297,19 +2297,19 @@ int ingame_menu(void *data, void *state)
case MENU_ITEM_ORIENTATION:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
{
rmenu_settings_set(S_ROTATION_DECREMENT);
rarch_settings_set(S_ROTATION_DECREMENT);
driver.video->set_rotation(NULL, g_extern.console.screen.orientation);
}
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rmenu_settings_set(S_ROTATION_INCREMENT);
rarch_settings_set(S_ROTATION_INCREMENT);
driver.video->set_rotation(NULL, g_extern.console.screen.orientation);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
rmenu_settings_set_default(S_DEF_ROTATION);
rarch_settings_set_default(S_DEF_ROTATION);
driver.video->set_rotation(NULL, g_extern.console.screen.orientation);
}
snprintf(strw_buffer, sizeof(strw_buffer), "Press [%s] to reset back to default values.", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_START));
@ -2329,7 +2329,7 @@ int ingame_menu(void *data, void *state)
{
g_extern.lifecycle_state |= (1ULL << RARCH_FRAMEADVANCE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
rmenu_settings_set(S_FRAME_ADVANCE);
rarch_settings_set(S_FRAME_ADVANCE);
menu_idx = MENU_ITEM_FRAME_ADVANCE;
return -1;
}
@ -2432,23 +2432,23 @@ int ingame_menu(void *data, void *state)
device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, strw_buffer);
rmenu_settings_create_menu_item_label(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, default_pos.y_position, default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_LOAD_STATE), strw_buffer);
rmenu_settings_create_menu_item_label(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SAVE_STATE), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SAVE_STATE), strw_buffer);
rmenu_settings_create_menu_item_label(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
menu_settings_create_menu_item_label(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_KEEP_ASPECT_RATIO)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_KEEP_ASPECT_RATIO), strw_buffer);
snprintf(strw_buffer, sizeof(strw_buffer), "Overscan: %f", g_extern.console.screen.overscan_amount);
device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_OVERSCAN_AMOUNT)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_OVERSCAN_AMOUNT), strw_buffer);
rmenu_settings_create_menu_item_label(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
menu_settings_create_menu_item_label(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_ORIENTATION)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_ORIENTATION), strw_buffer);
#ifdef HAVE_FBO
rmenu_settings_create_menu_item_label(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
menu_settings_create_menu_item_label(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SCALE_FACTOR)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SCALE_FACTOR), strw_buffer);
#endif
@ -2552,7 +2552,7 @@ int rmenu_input_process(void *data, void *state)
if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_LOADING_ROM, 100);
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);

View File

@ -1,312 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
* Copyright (C) 2011-2013 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include "../../general.h"
#include "rmenu_settings.h"
void rmenu_settings_set(unsigned setting)
{
switch(setting)
{
case S_ASPECT_RATIO_DECREMENT:
if(g_settings.video.aspect_ratio_idx > 0)
g_settings.video.aspect_ratio_idx--;
break;
case S_ASPECT_RATIO_INCREMENT:
if(g_settings.video.aspect_ratio_idx < LAST_ASPECT_RATIO)
g_settings.video.aspect_ratio_idx++;
break;
case S_AUDIO_MUTE:
g_extern.audio_data.mute = !g_extern.audio_data.mute;
break;
case S_AUDIO_CONTROL_RATE_DECREMENT:
if (g_settings.audio.rate_control_delta > 0.0)
g_settings.audio.rate_control_delta -= 0.001;
if (g_settings.audio.rate_control_delta == 0.0)
g_settings.audio.rate_control = false;
else
g_settings.audio.rate_control = true;
break;
case S_AUDIO_CONTROL_RATE_INCREMENT:
if (g_settings.audio.rate_control_delta < 0.2)
g_settings.audio.rate_control_delta += 0.001;
g_settings.audio.rate_control = true;
break;
case S_FRAME_ADVANCE:
g_extern.lifecycle_state |= (1ULL << RARCH_FRAMEADVANCE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
break;
case S_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth;
break;
case S_HW_TEXTURE_FILTER_2:
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
break;
case S_OVERSCAN_DECREMENT:
g_extern.console.screen.overscan_amount -= 0.01f;
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
if(g_extern.console.screen.overscan_amount == 0.0f)
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
break;
case S_OVERSCAN_INCREMENT:
g_extern.console.screen.overscan_amount += 0.01f;
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
if(g_extern.console.screen.overscan_amount == 0.0f)
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
break;
case S_RESOLUTION_PREVIOUS:
if (g_extern.console.screen.resolutions.current.idx)
{
g_extern.console.screen.resolutions.current.idx--;
g_extern.console.screen.resolutions.current.id = g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
}
break;
case S_RESOLUTION_NEXT:
if (g_extern.console.screen.resolutions.current.idx + 1 < g_extern.console.screen.resolutions.count)
{
g_extern.console.screen.resolutions.current.idx++;
g_extern.console.screen.resolutions.current.id = g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
}
break;
case S_ROTATION_DECREMENT:
if(g_extern.console.screen.orientation > 0)
g_extern.console.screen.orientation--;
break;
case S_ROTATION_INCREMENT:
if(g_extern.console.screen.orientation < LAST_ORIENTATION)
g_extern.console.screen.orientation++;
break;
case S_REWIND:
g_settings.rewind_enable = !g_settings.rewind_enable;
break;
case S_SAVESTATE_DECREMENT:
if(g_extern.state_slot != 0)
g_extern.state_slot--;
break;
case S_SAVESTATE_INCREMENT:
g_extern.state_slot++;
break;
case S_SCALE_ENABLED:
g_settings.video.render_to_texture = !g_settings.video.render_to_texture;
break;
case S_SCALE_FACTOR_DECREMENT:
g_settings.video.fbo.scale_x -= 1.0f;
g_settings.video.fbo.scale_y -= 1.0f;
break;
case S_SCALE_FACTOR_INCREMENT:
g_settings.video.fbo.scale_x += 1.0f;
g_settings.video.fbo.scale_y += 1.0f;
break;
case S_THROTTLE:
if(!g_extern.system.force_nonblock)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_THROTTLE_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_THROTTLE_ENABLE);
}
break;
case S_TRIPLE_BUFFERING:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
break;
case S_REFRESH_RATE_DECREMENT:
g_settings.video.refresh_rate -= 0.01f;
break;
case S_REFRESH_RATE_INCREMENT:
g_settings.video.refresh_rate += 0.01f;
break;
case S_INFO_DEBUG_MSG_TOGGLE:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW);
break;
case S_INFO_MSG_TOGGLE:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INFO_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
break;
default:
RARCH_WARN("rmenu_settings_set - unhandled action.\n");
}
}
void rmenu_settings_set_default(unsigned setting)
{
switch(setting)
{
case S_DEF_ASPECT_RATIO:
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_4_3;
break;
case S_DEF_AUDIO_MUTE:
g_extern.audio_data.mute = false;
break;
case S_DEF_AUDIO_CONTROL_RATE:
#ifdef GEKKO
g_settings.audio.rate_control_delta = 0.006;
g_settings.audio.rate_control = true;
#else
g_settings.audio.rate_control_delta = 0.0;
g_settings.audio.rate_control = false;
#endif
break;
case S_DEF_HW_TEXTURE_FILTER:
g_settings.video.smooth = 1;
break;
case S_DEF_HW_TEXTURE_FILTER_2:
g_settings.video.second_pass_smooth = 1;
break;
case S_DEF_OVERSCAN:
g_extern.console.screen.overscan_amount = 0.0f;
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
break;
case S_DEF_ROTATION:
g_extern.console.screen.orientation = ORIENTATION_NORMAL;
break;
case S_DEF_THROTTLE:
if(!g_extern.system.force_nonblock)
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_THROTTLE_ENABLE);
break;
case S_DEF_TRIPLE_BUFFERING:
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
break;
case S_DEF_SAVE_STATE:
g_extern.state_slot = 0;
break;
case S_DEF_SCALE_ENABLED:
g_settings.video.render_to_texture = true;
g_settings.video.fbo.scale_x = 2.0f;
g_settings.video.fbo.scale_y = 2.0f;
break;
case S_DEF_SCALE_FACTOR:
g_settings.video.fbo.scale_x = 2.0f;
g_settings.video.fbo.scale_y = 2.0f;
break;
case S_DEF_REFRESH_RATE:
#if defined(RARCH_CONSOLE)
g_settings.video.refresh_rate = 59.92;
#else
g_settings.video.refresh_rate = 59.95;
#endif
break;
case S_DEF_INFO_DEBUG_MSG:
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
break;
case S_DEF_INFO_MSG:
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
break;
default:
RARCH_WARN("rmenu_settings_set_default: unhandled action.\n");
}
}
void rmenu_settings_msg(unsigned setting, unsigned delay)
{
char str[PATH_MAX], tmp[PATH_MAX];
msg_queue_clear(g_extern.msg_queue);
(void)tmp;
switch(setting)
{
case S_MSG_CACHE_PARTITION:
snprintf(str, sizeof(str), "INFO - All the contents of the ZIP files you have selected\nare extracted to this partition.");
break;
case S_MSG_CHANGE_CONTROLS:
snprintf(str, sizeof(str), "INFO - Press LEFT/RIGHT to change the controls, and press\n[RetroPad Start] to reset a button to default values.");
break;
case S_MSG_LOADING_ROM:
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
break;
case S_MSG_DIR_LOADING_ERROR:
snprintf(str, sizeof(str), "ERROR - Failed to open selected directory.");
break;
case S_MSG_ROM_LOADING_ERROR:
snprintf(str, sizeof(str), "ERROR - An error occurred during ROM loading.");
break;
case S_MSG_NOT_IMPLEMENTED:
snprintf(str, sizeof(str), "TODO - Not yet implemented.");
break;
case S_MSG_RESIZE_SCREEN:
snprintf(str, sizeof(str), "INFO - Resize the screen by moving around the two analog sticks.\nPress [RetroPad X] to reset to default values, and [RetroPad A] to go back.\nTo select the resized screen mode, set Aspect Ratio to: 'Custom'.");
break;
case S_MSG_RESTART_RARCH:
snprintf(str, sizeof(str), "INFO - You need to restart RetroArch.");
break;
case S_MSG_SELECT_LIBRETRO_CORE:
snprintf(str, sizeof(str), "INFO - Select a Libretro core from the menu.");
break;
case S_MSG_SELECT_SHADER:
snprintf(str, sizeof(str), "INFO - Select a shader from the menu.");
break;
case S_MSG_SHADER_LOADING_SUCCEEDED:
snprintf(str, sizeof(str), "INFO - Shader successfully loaded.");
break;
}
msg_queue_push(g_extern.msg_queue, str, 1, delay);
}
void rmenu_settings_create_menu_item_label_w(wchar_t *strwbuf, unsigned setting, size_t size)
{
char str[PATH_MAX];
rmenu_settings_create_menu_item_label(str, setting, sizeof(str));
convert_char_to_wchar(strwbuf, str, size);
}
void rmenu_settings_create_menu_item_label(char * str, unsigned setting, size_t size)
{
switch (setting)
{
case S_LBL_ASPECT_RATIO:
snprintf(str, size, "Aspect Ratio: %s", aspectratio_lut[g_settings.video.aspect_ratio_idx].name);
break;
case S_LBL_SHADER:
snprintf(str, size, "Shader #1: %s", g_settings.video.cg_shader_path);
break;
case S_LBL_SHADER_2:
snprintf(str, size, "Shader #2: %s", g_settings.video.second_pass_shader);
break;
case S_LBL_RARCH_VERSION:
snprintf(str, size, "RetroArch %s", PACKAGE_VERSION);
break;
case S_LBL_SCALE_FACTOR:
snprintf(str, size, "Scale Factor: %f (X) / %f (Y)", g_settings.video.fbo.scale_x, g_settings.video.fbo.scale_y);
break;
case S_LBL_ROTATION:
snprintf(str, size, "Rotation: %s", rotation_lut[g_extern.console.screen.orientation]);
break;
case S_LBL_LOAD_STATE_SLOT:
snprintf(str, size, "Load State #%d", g_extern.state_slot);
break;
case S_LBL_SAVE_STATE_SLOT:
snprintf(str, size, "Save State #%d", g_extern.state_slot);
break;
case S_LBL_REWIND_GRANULARITY:
snprintf(str, size, "Rewind granularity: %d", g_settings.rewind_granularity);
break;
}
}

View File

@ -24,7 +24,6 @@
#include "utils/file_browser.h"
#include "../../console/rarch_console.h"
#include "rmenu_settings.h"
#include "../../gfx/gfx_common.h"
#include "../../gfx/gfx_context.h"
@ -32,6 +31,7 @@
#include "../../message.h"
#include "../../general.h"
#include "../../settings.h"
enum {
MENU_XUI_ITEM_LOAD_STATE = 0,
@ -59,6 +59,14 @@ char str_buffer[PATH_MAX];
static int process_input_ret = 0;
static unsigned input_loop = 0;
static void menu_settings_create_menu_item_label_w(wchar_t *strwbuf, unsigned setting, size_t size)
{
char str[PATH_MAX];
menu_settings_create_menu_item_label(str, setting, sizeof(str));
convert_char_to_wchar(strwbuf, str, size);
}
enum
{
RMENU_DEVICE_NAV_UP = 0,
@ -171,7 +179,7 @@ static void browser_update(filebrowser_t * b, uint64_t input, const char *extens
ret = filebrowser_iterate(b, action);
if(!ret)
rmenu_settings_msg(S_MSG_DIR_LOADING_ERROR, S_DELAY_180);
rarch_settings_msg(S_MSG_DIR_LOADING_ERROR, 180);
}
HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
@ -400,13 +408,13 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Hardware filtering shader #1: Linear interpolation" : L"Hardware filtering shader #1: Point filtering");
m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER_2, g_settings.video.second_pass_smooth ? L"Hardware filtering shader #2: Linear interpolation" : L"Hardware filtering shader #2: Point filtering");
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_settings.video.render_to_texture ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SHADER, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER_2, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SHADER_2, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SHADER_2, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_EMU_REWIND_GRANULARITY, strw_buffer);
m_settingslist.SetText(SETTING_ENABLE_SRAM_PATH, (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME_SRAM_DIR_ENABLE)) ? L"SRAM Path Enable: ON" : L"SRAM Path Enable: OFF");
m_settingslist.SetText(SETTING_ENABLE_STATE_PATH, (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME_STATE_DIR_ENABLE)) ? L"Savestate Path Enable: ON" : L"Savestate Path Enable: OFF");
@ -428,16 +436,16 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
switch(current_index)
{
case SETTING_EMU_REWIND_ENABLED:
rmenu_settings_set(S_REWIND);
rarch_settings_set(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
break;
case SETTING_EMU_REWIND_GRANULARITY:
g_settings.rewind_granularity++;
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_EMU_REWIND_GRANULARITY, strw_buffer);
break;
case SETTING_ENABLE_SRAM_PATH:
@ -502,7 +510,7 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
hCur = app.hShaderBrowser;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
rarch_settings_msg(S_MSG_SELECT_SHADER, 180);
NavigateForward(app.hShaderBrowser);
break;
@ -515,7 +523,7 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
hCur = app.hShaderBrowser;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
rarch_settings_msg(S_MSG_SELECT_SHADER, 180);
NavigateForward(app.hShaderBrowser);
break;
@ -556,17 +564,17 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
switch(current_index)
{
case SETTING_EMU_REWIND_ENABLED:
rmenu_settings_set(S_REWIND);
rarch_settings_set(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
break;
case SETTING_EMU_REWIND_GRANULARITY:
if (g_settings.rewind_granularity > 1)
g_settings.rewind_granularity--;
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_EMU_REWIND_GRANULARITY, strw_buffer);
break;
case SETTING_ENABLE_SRAM_PATH:
@ -626,9 +634,9 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
{
if((g_settings.video.fbo.scale_x > MIN_SCALING_FACTOR))
{
rmenu_settings_set(S_SCALE_FACTOR_DECREMENT);
rarch_settings_set(S_SCALE_FACTOR_DECREMENT);
device_ptr->ctx_driver->set_fbo(FBO_REINIT);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
}
}
@ -695,16 +703,16 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
break;
case SETTING_EMU_REWIND_ENABLED:
rmenu_settings_set(S_REWIND);
rarch_settings_set(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
rarch_settings_msg(S_MSG_RESTART_RARCH, 180);
break;
case SETTING_EMU_REWIND_GRANULARITY:
g_settings.rewind_granularity++;
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_EMU_REWIND_GRANULARITY, strw_buffer);
break;
case SETTING_ENABLE_SRAM_PATH:
@ -726,9 +734,9 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
{
if((g_settings.video.fbo.scale_x < MAX_SCALING_FACTOR))
{
rmenu_settings_set(S_SCALE_FACTOR_INCREMENT);
rarch_settings_set(S_SCALE_FACTOR_INCREMENT);
device_ptr->ctx_driver->set_fbo(FBO_REINIT);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
m_settingslist.SetText(SETTING_SCALE_FACTOR, strw_buffer);
}
}
@ -781,16 +789,16 @@ HRESULT CRetroArchQuickMenu::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
GetChildById(L"XuiQuickMenuList", &m_quickmenulist);
GetChildById(L"XuiBackButton", &m_back);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ORIENTATION, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ASPECT_RATIO, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_LOAD_STATE, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_SAVE_STATE, strw_buffer);
return 0;
@ -811,18 +819,18 @@ HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pContr
case MENU_XUI_ITEM_LOAD_STATE:
case MENU_XUI_ITEM_SAVE_STATE:
rarch_state_slot_decrease();
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_LOAD_STATE, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_SAVE_STATE, strw_buffer);
break;
case MENU_XUI_ITEM_ASPECT_RATIO:
rmenu_settings_set(S_ASPECT_RATIO_DECREMENT);
rarch_settings_set(S_ASPECT_RATIO_DECREMENT);
aspectratio_changed = true;
break;
case MENU_XUI_ITEM_ORIENTATION:
rmenu_settings_set(S_ROTATION_DECREMENT);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
rarch_settings_set(S_ROTATION_DECREMENT);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ORIENTATION, strw_buffer);
driver.video->set_rotation(driver.video_data, g_extern.console.screen.orientation);
break;
@ -836,18 +844,18 @@ HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pContr
case MENU_XUI_ITEM_LOAD_STATE:
case MENU_XUI_ITEM_SAVE_STATE:
rarch_state_slot_increase();
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_LOAD_STATE, strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_SAVE_STATE, strw_buffer);
break;
case MENU_XUI_ITEM_ASPECT_RATIO:
rmenu_settings_set(S_ASPECT_RATIO_INCREMENT);
rarch_settings_set(S_ASPECT_RATIO_INCREMENT);
aspectratio_changed = true;
break;
case MENU_XUI_ITEM_ORIENTATION:
rmenu_settings_set(S_ROTATION_INCREMENT);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
rarch_settings_set(S_ROTATION_INCREMENT);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ORIENTATION, strw_buffer);
driver.video->set_rotation(driver.video_data, g_extern.console.screen.orientation);
break;
@ -863,7 +871,7 @@ HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pContr
if(aspectratio_changed)
{
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ASPECT_RATIO, strw_buffer);
}
@ -913,31 +921,31 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
}
break;
case MENU_XUI_ITEM_ASPECT_RATIO:
rmenu_settings_set_default(S_DEF_ASPECT_RATIO);
rarch_settings_set_default(S_DEF_ASPECT_RATIO);
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ASPECT_RATIO, strw_buffer);
break;
case MENU_XUI_ITEM_ORIENTATION:
rmenu_settings_set_default(S_DEF_ROTATION);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
rarch_settings_set_default(S_DEF_ROTATION);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ORIENTATION, strw_buffer);
driver.video->set_rotation(driver.video_data, g_extern.console.screen.orientation);
break;
case MENU_XUI_ITEM_RESIZE_MODE:
input_loop = INPUT_LOOP_RESIZE_MODE;
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_XUI_ITEM_ASPECT_RATIO, strw_buffer);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_RESIZE_SCREEN, S_DELAY_270);
rarch_settings_msg(S_MSG_RESIZE_SCREEN, 270);
break;
case MENU_XUI_ITEM_FRAME_ADVANCE:
if (g_extern.main_is_init)
{
g_extern.lifecycle_state |= (1ULL << RARCH_FRAMEADVANCE);
rmenu_settings_set(S_FRAME_ADVANCE);
rarch_settings_set(S_FRAME_ADVANCE);
process_input_ret = -1;
}
break;
@ -1005,7 +1013,7 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, g_settings.video.cg_shader_path, RARCH_SHADER_INDEX_PASS0);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180);
XuiSceneNavigateBack(hCur, app.hMainScene, XUSER_INDEX_ANY);
}
else
@ -1020,7 +1028,7 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, g_settings.video.second_pass_shader, RARCH_SHADER_INDEX_PASS1);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, 180);
}
else
RARCH_ERR("Shaders are unsupported on this platform.\n");
@ -1099,7 +1107,7 @@ HRESULT CRetroArchMain::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
convert_char_to_wchar(strw_buffer, g_extern.title_buf, sizeof(strw_buffer));
m_core.SetText(strw_buffer);
rmenu_settings_create_menu_item_label_w(strw_buffer, S_LBL_RARCH_VERSION, sizeof(strw_buffer));
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_RARCH_VERSION, sizeof(strw_buffer));
m_title.SetText(strw_buffer);
return 0;
@ -1144,7 +1152,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
hCur = app.hControlsMenu;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_CHANGE_CONTROLS, S_DELAY_180);
rarch_settings_msg(S_MSG_CHANGE_CONTROLS, 180);
NavigateForward(app.hControlsMenu);
}
@ -1157,7 +1165,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
hCur = app.hCoreBrowser;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_SELECT_LIBRETRO_CORE, S_DELAY_180);
rarch_settings_msg(S_MSG_SELECT_LIBRETRO_CORE, 180);
NavigateForward(app.hCoreBrowser);
}
@ -1312,7 +1320,7 @@ bool menu_iterate(void)
if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
rmenu_settings_msg(S_MSG_LOADING_ROM, 100);
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);

View File

@ -1,5 +1,6 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
* Copyright (C) 2011-2013 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
@ -14,6 +15,7 @@
*/
#include "general.h"
#include "settings.h"
#include "conf/config_file.h"
#include "conf/config_file_macros.h"
#include "compat/strl.h"
@ -1321,3 +1323,284 @@ bool config_save_keybinds(const char *path)
return true;
}
void rarch_settings_set(unsigned setting)
{
switch(setting)
{
case S_ASPECT_RATIO_DECREMENT:
if(g_settings.video.aspect_ratio_idx > 0)
g_settings.video.aspect_ratio_idx--;
break;
case S_ASPECT_RATIO_INCREMENT:
if(g_settings.video.aspect_ratio_idx < LAST_ASPECT_RATIO)
g_settings.video.aspect_ratio_idx++;
break;
case S_AUDIO_MUTE:
g_extern.audio_data.mute = !g_extern.audio_data.mute;
break;
case S_AUDIO_CONTROL_RATE_DECREMENT:
if (g_settings.audio.rate_control_delta > 0.0)
g_settings.audio.rate_control_delta -= 0.001;
if (g_settings.audio.rate_control_delta == 0.0)
g_settings.audio.rate_control = false;
else
g_settings.audio.rate_control = true;
break;
case S_AUDIO_CONTROL_RATE_INCREMENT:
if (g_settings.audio.rate_control_delta < 0.2)
g_settings.audio.rate_control_delta += 0.001;
g_settings.audio.rate_control = true;
break;
case S_FRAME_ADVANCE:
g_extern.lifecycle_state |= (1ULL << RARCH_FRAMEADVANCE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
break;
case S_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth;
break;
case S_HW_TEXTURE_FILTER_2:
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
break;
case S_OVERSCAN_DECREMENT:
g_extern.console.screen.overscan_amount -= 0.01f;
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
if(g_extern.console.screen.overscan_amount == 0.0f)
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
break;
case S_OVERSCAN_INCREMENT:
g_extern.console.screen.overscan_amount += 0.01f;
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
if(g_extern.console.screen.overscan_amount == 0.0f)
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
break;
case S_RESOLUTION_PREVIOUS:
if (g_extern.console.screen.resolutions.current.idx)
{
g_extern.console.screen.resolutions.current.idx--;
g_extern.console.screen.resolutions.current.id = g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
}
break;
case S_RESOLUTION_NEXT:
if (g_extern.console.screen.resolutions.current.idx + 1 < g_extern.console.screen.resolutions.count)
{
g_extern.console.screen.resolutions.current.idx++;
g_extern.console.screen.resolutions.current.id = g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
}
break;
case S_ROTATION_DECREMENT:
if(g_extern.console.screen.orientation > 0)
g_extern.console.screen.orientation--;
break;
case S_ROTATION_INCREMENT:
if(g_extern.console.screen.orientation < LAST_ORIENTATION)
g_extern.console.screen.orientation++;
break;
case S_REWIND:
g_settings.rewind_enable = !g_settings.rewind_enable;
break;
case S_SAVESTATE_DECREMENT:
if(g_extern.state_slot != 0)
g_extern.state_slot--;
break;
case S_SAVESTATE_INCREMENT:
g_extern.state_slot++;
break;
case S_SCALE_ENABLED:
g_settings.video.render_to_texture = !g_settings.video.render_to_texture;
break;
case S_SCALE_FACTOR_DECREMENT:
g_settings.video.fbo.scale_x -= 1.0f;
g_settings.video.fbo.scale_y -= 1.0f;
break;
case S_SCALE_FACTOR_INCREMENT:
g_settings.video.fbo.scale_x += 1.0f;
g_settings.video.fbo.scale_y += 1.0f;
break;
case S_THROTTLE:
if(!g_extern.system.force_nonblock)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_THROTTLE_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_THROTTLE_ENABLE);
}
break;
case S_TRIPLE_BUFFERING:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
break;
case S_REFRESH_RATE_DECREMENT:
g_settings.video.refresh_rate -= 0.01f;
break;
case S_REFRESH_RATE_INCREMENT:
g_settings.video.refresh_rate += 0.01f;
break;
case S_INFO_DEBUG_MSG_TOGGLE:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW);
break;
case S_INFO_MSG_TOGGLE:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INFO_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
break;
default:
RARCH_WARN("rarch_settings_set - unhandled action.\n");
}
}
void rarch_settings_set_default(unsigned setting)
{
switch(setting)
{
case S_DEF_ASPECT_RATIO:
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_4_3;
break;
case S_DEF_AUDIO_MUTE:
g_extern.audio_data.mute = false;
break;
case S_DEF_AUDIO_CONTROL_RATE:
#ifdef GEKKO
g_settings.audio.rate_control_delta = 0.006;
g_settings.audio.rate_control = true;
#else
g_settings.audio.rate_control_delta = 0.0;
g_settings.audio.rate_control = false;
#endif
break;
case S_DEF_HW_TEXTURE_FILTER:
g_settings.video.smooth = 1;
break;
case S_DEF_HW_TEXTURE_FILTER_2:
g_settings.video.second_pass_smooth = 1;
break;
case S_DEF_OVERSCAN:
g_extern.console.screen.overscan_amount = 0.0f;
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_OVERSCAN_ENABLE);
break;
case S_DEF_ROTATION:
g_extern.console.screen.orientation = ORIENTATION_NORMAL;
break;
case S_DEF_THROTTLE:
if(!g_extern.system.force_nonblock)
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_THROTTLE_ENABLE);
break;
case S_DEF_TRIPLE_BUFFERING:
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
break;
case S_DEF_SAVE_STATE:
g_extern.state_slot = 0;
break;
case S_DEF_SCALE_ENABLED:
g_settings.video.render_to_texture = true;
g_settings.video.fbo.scale_x = 2.0f;
g_settings.video.fbo.scale_y = 2.0f;
break;
case S_DEF_SCALE_FACTOR:
g_settings.video.fbo.scale_x = 2.0f;
g_settings.video.fbo.scale_y = 2.0f;
break;
case S_DEF_REFRESH_RATE:
#if defined(RARCH_CONSOLE)
g_settings.video.refresh_rate = 59.92;
#else
g_settings.video.refresh_rate = 59.95;
#endif
break;
case S_DEF_INFO_DEBUG_MSG:
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
break;
case S_DEF_INFO_MSG:
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
break;
default:
RARCH_WARN("rarch_settings_set_default: unhandled action.\n");
}
}
void rarch_settings_msg(unsigned setting, unsigned delay)
{
char str[PATH_MAX], tmp[PATH_MAX];
msg_queue_clear(g_extern.msg_queue);
(void)tmp;
switch(setting)
{
case S_MSG_CACHE_PARTITION:
snprintf(str, sizeof(str), "INFO - All the contents of the ZIP files you have selected\nare extracted to this partition.");
break;
case S_MSG_CHANGE_CONTROLS:
snprintf(str, sizeof(str), "INFO - Press LEFT/RIGHT to change the controls, and press\n[RetroPad Start] to reset a button to default values.");
break;
case S_MSG_LOADING_ROM:
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
break;
case S_MSG_DIR_LOADING_ERROR:
snprintf(str, sizeof(str), "ERROR - Failed to open selected directory.");
break;
case S_MSG_ROM_LOADING_ERROR:
snprintf(str, sizeof(str), "ERROR - An error occurred during ROM loading.");
break;
case S_MSG_NOT_IMPLEMENTED:
snprintf(str, sizeof(str), "TODO - Not yet implemented.");
break;
case S_MSG_RESIZE_SCREEN:
snprintf(str, sizeof(str), "INFO - Resize the screen by moving around the two analog sticks.\nPress [RetroPad X] to reset to default values, and [RetroPad A] to go back.\nTo select the resized screen mode, set Aspect Ratio to: 'Custom'.");
break;
case S_MSG_RESTART_RARCH:
snprintf(str, sizeof(str), "INFO - You need to restart RetroArch.");
break;
case S_MSG_SELECT_LIBRETRO_CORE:
snprintf(str, sizeof(str), "INFO - Select a Libretro core from the menu.");
break;
case S_MSG_SELECT_SHADER:
snprintf(str, sizeof(str), "INFO - Select a shader from the menu.");
break;
case S_MSG_SHADER_LOADING_SUCCEEDED:
snprintf(str, sizeof(str), "INFO - Shader successfully loaded.");
break;
}
msg_queue_push(g_extern.msg_queue, str, 1, delay);
}
void menu_settings_create_menu_item_label(char * str, unsigned setting, size_t size)
{
switch (setting)
{
case S_LBL_ASPECT_RATIO:
snprintf(str, size, "Aspect Ratio: %s", aspectratio_lut[g_settings.video.aspect_ratio_idx].name);
break;
case S_LBL_SHADER:
snprintf(str, size, "Shader #1: %s", g_settings.video.cg_shader_path);
break;
case S_LBL_SHADER_2:
snprintf(str, size, "Shader #2: %s", g_settings.video.second_pass_shader);
break;
case S_LBL_RARCH_VERSION:
snprintf(str, size, "RetroArch %s", PACKAGE_VERSION);
break;
case S_LBL_SCALE_FACTOR:
snprintf(str, size, "Scale Factor: %f (X) / %f (Y)", g_settings.video.fbo.scale_x, g_settings.video.fbo.scale_y);
break;
case S_LBL_ROTATION:
snprintf(str, size, "Rotation: %s", rotation_lut[g_extern.console.screen.orientation]);
break;
case S_LBL_LOAD_STATE_SLOT:
snprintf(str, size, "Load State #%d", g_extern.state_slot);
break;
case S_LBL_SAVE_STATE_SLOT:
snprintf(str, size, "Save State #%d", g_extern.state_slot);
break;
case S_LBL_REWIND_GRANULARITY:
snprintf(str, size, "Rewind granularity: %d", g_settings.rewind_granularity);
break;
}
}

View File

@ -14,18 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONSOLE_SETTINGS_H
#define CONSOLE_SETTINGS_H
enum
{
S_DELAY_0 = 0,
S_DELAY_1 = 1,
S_DELAY_45 = 45,
S_DELAY_90 = 90,
S_DELAY_180 = 180,
S_DELAY_270 = 270
};
#ifndef __RARCH_SETTINGS_H
#define __RARCH_SETTINGS_H
enum
{
@ -104,11 +94,10 @@ enum
S_LBL_REWIND_GRANULARITY,
};
void rmenu_settings_set(unsigned setting);
void rmenu_settings_set_default(unsigned setting);
void rmenu_settings_msg(unsigned setting, unsigned delay);
void rarch_settings_set(unsigned setting);
void rarch_settings_set_default(unsigned setting);
void rarch_settings_msg(unsigned setting, unsigned delay);
void rmenu_settings_create_menu_item_label(char * str, unsigned setting, size_t size);
void rmenu_settings_create_menu_item_label_w(wchar_t *strwbuf, unsigned setting, size_t size);
void menu_settings_create_menu_item_label(char * str, unsigned setting, size_t size);
#endif