2012-04-21 23:13:50 +02:00
/* RetroArch - A frontend for libretro.
2013-01-01 01:37:37 +01:00
* Copyright ( C ) 2010 - 2013 - Hans - Kristian Arntzen
* Copyright ( C ) 2011 - 2013 - Daniel De Matteis
2012-01-10 23:33:44 +01:00
*
2012-04-21 23:13:50 +02:00
* RetroArch is free software : you can redistribute it and / or modify it under the terms
2012-01-10 23:33:44 +01:00
* 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 .
*
2012-04-21 23:13:50 +02:00
* RetroArch is distributed in the hope that it will be useful , but WITHOUT ANY WARRANTY ;
2012-01-10 23:33:44 +01:00
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE . See the GNU General Public License for more details .
*
2012-04-21 23:31:57 +02:00
* You should have received a copy of the GNU General Public License along with RetroArch .
2012-01-10 23:33:44 +01:00
* If not , see < http : //www.gnu.org/licenses/>.
*/
2013-01-09 17:49:43 +01:00
# include "rmenu.h"
# include "utils/file_browser.h"
2012-08-03 17:54:22 +02:00
# if defined(__CELLOS_LV2__)
2012-03-03 17:23:00 +01:00
# include <sdk_version.h>
2012-01-10 23:33:44 +01:00
2012-03-03 17:23:00 +01:00
# if(CELL_SDK_VERSION > 0x340000)
# include <sysutil/sysutil_bgmplayback.h>
# endif
2012-08-03 17:54:22 +02:00
# endif
2012-07-28 15:54:35 +02:00
# include "../../console/rarch_console.h"
2012-08-03 17:54:22 +02:00
2012-08-05 17:18:19 +02:00
# include "../../gfx/image.h"
2013-03-09 03:20:33 +01:00
# include "../../gfx/gfx_common.h"
2012-06-20 08:25:23 +02:00
# include "../../gfx/gfx_context.h"
2012-08-03 17:54:22 +02:00
2012-06-20 08:25:23 +02:00
# include "../../file.h"
2013-01-13 05:52:00 +01:00
# include "../../driver.h"
2012-06-20 08:25:23 +02:00
# include "../../general.h"
2012-01-10 23:33:44 +01:00
2013-03-02 17:55:43 +01:00
# define EXT_IMAGES "png|PNG|jpg|JPG|JPEG|jpeg"
# define EXT_SHADERS "cg|CG"
# define EXT_CGP_PRESETS "cgp|CGP"
# define EXT_INPUT_PRESETS "cfg|CFG"
enum {
MENU_ITEM_LOAD_STATE = 0 ,
MENU_ITEM_SAVE_STATE ,
MENU_ITEM_KEEP_ASPECT_RATIO ,
MENU_ITEM_OVERSCAN_AMOUNT ,
MENU_ITEM_ORIENTATION ,
# ifdef HAVE_FBO
MENU_ITEM_SCALE_FACTOR ,
# endif
MENU_ITEM_RESIZE_MODE ,
MENU_ITEM_FRAME_ADVANCE ,
MENU_ITEM_SCREENSHOT_MODE ,
MENU_ITEM_RESET ,
MENU_ITEM_RETURN_TO_GAME ,
MENU_ITEM_RETURN_TO_MENU ,
MENU_ITEM_CHANGE_LIBRETRO ,
# ifdef HAVE_MULTIMAN
MENU_ITEM_RETURN_TO_MULTIMAN ,
# endif
MENU_ITEM_QUIT_RARCH ,
MENU_ITEM_LAST
} ;
2012-01-10 23:33:44 +01:00
2012-12-17 06:44:28 +01:00
2012-05-28 22:18:50 +02:00
static bool set_libretro_core_as_launch ;
2012-02-20 22:34:11 +01:00
2013-01-07 23:29:56 +01:00
filebrowser_t * browser ;
filebrowser_t * tmpBrowser ;
2012-08-17 17:43:23 +02:00
unsigned currently_selected_controller_menu = 0 ;
2012-01-10 23:33:44 +01:00
2012-08-20 02:30:49 +02:00
static const struct retro_keybind _rmenu_nav_binds [ ] = {
2013-01-13 00:42:21 +01:00
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_UP ) | ( 1ULL < < RARCH_ANALOG_LEFT_Y_DPAD_UP ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_DOWN ) | ( 1ULL < < RARCH_ANALOG_LEFT_Y_DPAD_DOWN ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_LEFT ) | ( 1ULL < < RARCH_ANALOG_LEFT_X_DPAD_LEFT ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) | ( 1ULL < < RARCH_ANALOG_LEFT_X_DPAD_RIGHT ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_LEFT_Y_DPAD_UP ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_LEFT_Y_DPAD_DOWN ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_LEFT_X_DPAD_LEFT ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_LEFT_X_DPAD_RIGHT ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_RIGHT_Y_DPAD_UP ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_RIGHT_Y_DPAD_DOWN ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_RIGHT_X_DPAD_LEFT ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RARCH_ANALOG_RIGHT_X_DPAD_RIGHT ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_B ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_A ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_X ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_Y ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_START ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_SELECT ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_L ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_R ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_L2 ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_R2 ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_L3 ) , 0 } ,
{ 0 , 0 , NULL , ( enum retro_key ) 0 , ( 1ULL < < RETRO_DEVICE_ID_JOYPAD_R3 ) , 0 } ,
2012-08-20 02:30:49 +02:00
} ;
static const struct retro_keybind * rmenu_nav_binds [ ] = {
_rmenu_nav_binds
} ;
enum
{
RMENU_DEVICE_NAV_UP = 0 ,
RMENU_DEVICE_NAV_DOWN ,
RMENU_DEVICE_NAV_LEFT ,
RMENU_DEVICE_NAV_RIGHT ,
RMENU_DEVICE_NAV_UP_ANALOG_L ,
RMENU_DEVICE_NAV_DOWN_ANALOG_L ,
RMENU_DEVICE_NAV_LEFT_ANALOG_L ,
RMENU_DEVICE_NAV_RIGHT_ANALOG_L ,
RMENU_DEVICE_NAV_UP_ANALOG_R ,
RMENU_DEVICE_NAV_DOWN_ANALOG_R ,
RMENU_DEVICE_NAV_LEFT_ANALOG_R ,
RMENU_DEVICE_NAV_RIGHT_ANALOG_R ,
RMENU_DEVICE_NAV_B ,
RMENU_DEVICE_NAV_A ,
RMENU_DEVICE_NAV_X ,
RMENU_DEVICE_NAV_Y ,
RMENU_DEVICE_NAV_START ,
RMENU_DEVICE_NAV_SELECT ,
RMENU_DEVICE_NAV_L1 ,
RMENU_DEVICE_NAV_R1 ,
RMENU_DEVICE_NAV_L2 ,
RMENU_DEVICE_NAV_R2 ,
RMENU_DEVICE_NAV_L3 ,
RMENU_DEVICE_NAV_R3 ,
RMENU_DEVICE_NAV_LAST
} ;
2013-03-10 15:23:34 +01:00
const char drive_mappings [ ] [ 32 ] = {
# if defined(_XBOX1)
" C: " ,
" D: " ,
" E: " ,
" F: " ,
" G: "
# elif defined(__CELLOS_LV2__)
" /app_home/ " ,
" /dev_hdd0/ " ,
" /dev_hdd1/ " ,
" /host_root/ "
# endif
} ;
# if defined__CELLOS_LV2__
unsigned char drive_mapping_idx = 1 ;
# elif defined(_XBOX1)
unsigned char drive_mapping_idx = 2 ;
# else
unsigned char drive_mapping_idx = 0 ;
# endif
static const char * menu_drive_mapping_previous ( void )
{
if ( drive_mapping_idx > 0 )
drive_mapping_idx - - ;
return drive_mappings [ drive_mapping_idx ] ;
}
static const char * menu_drive_mapping_next ( void )
{
size_t arr_size = sizeof ( drive_mappings ) / sizeof ( drive_mappings [ 0 ] ) ;
if ( ( drive_mapping_idx + 1 ) < arr_size )
drive_mapping_idx + + ;
return drive_mappings [ drive_mapping_idx ] ;
}
2013-03-10 15:52:36 +01:00
# if defined(_XBOX1)
# define HARDCODE_FONT_SIZE 21
# define POSITION_X m_menuMainRomListPos_x
# define POSITION_X_CENTER (m_menuMainRomListPos_x + 350)
# define POSITION_Y_START m_menuMainRomListPos_y
# define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
# define POSITION_Y_INCREMENT 20
# define COMMENT_Y_POSITION (ypos - ((POSITION_Y_INCREMENT / 2) * 3))
# define COMMENT_TWO_Y_POSITION (ypos - ((POSITION_Y_INCREMENT / 2) * 1))
# define MSG_QUEUE_X_POSITION POSITION_X
# define MSG_QUEUE_Y_POSITION (ypos - ((POSITION_Y_INCREMENT / 2) * 7) + 5)
# define MSG_QUEUE_FONT_SIZE HARDCODE_FONT_SIZE
# define MSG_PREV_NEXT_Y_POSITION 24
# define CURRENT_PATH_Y_POSITION (m_menuMainRomListPos_y - ((POSITION_Y_INCREMENT / 2)))
# define CURRENT_PATH_FONT_SIZE 21
2013-03-10 16:29:08 +01:00
# define FONT_SIZE 21
# define NUM_ENTRY_PER_PAGE 12
2013-03-10 15:52:36 +01:00
# elif defined(__CELLOS_LV2__)
# define HARDCODE_FONT_SIZE 0.91f
# define POSITION_X 0.09f
# define POSITION_X_CENTER 0.5f
# define POSITION_Y_START 0.17f
# define POSITION_Y_INCREMENT 0.035f
# define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
# define COMMENT_TWO_Y_POSITION 0.91f
# define COMMENT_Y_POSITION 0.82f
# define MSG_QUEUE_X_POSITION g_settings.video.msg_pos_x
# define MSG_QUEUE_Y_POSITION 0.76f
# define MSG_QUEUE_FONT_SIZE 1.03f
# define MSG_PREV_NEXT_Y_POSITION 0.03f
# define CURRENT_PATH_Y_POSITION 0.15f
# define NUM_ENTRY_PER_PAGE 15
# endif
static void menu_set_default_pos ( rmenu_default_positions_t * position )
{
position - > x_position = POSITION_X ;
position - > x_position_center = POSITION_X_CENTER ;
position - > y_position = POSITION_Y_BEGIN ;
position - > comment_y_position = COMMENT_Y_POSITION ;
position - > y_position_increment = POSITION_Y_INCREMENT ;
position - > starting_y_position = POSITION_Y_START ;
position - > comment_two_y_position = COMMENT_TWO_Y_POSITION ;
position - > font_size = HARDCODE_FONT_SIZE ;
position - > msg_queue_x_position = MSG_QUEUE_X_POSITION ;
position - > msg_queue_y_position = MSG_QUEUE_Y_POSITION ;
position - > msg_queue_font_size = MSG_QUEUE_FONT_SIZE ;
position - > msg_prev_next_y_position = MSG_PREV_NEXT_Y_POSITION ;
position - > current_path_y_position = CURRENT_PATH_Y_POSITION ;
position - > entries_per_page = NUM_ENTRY_PER_PAGE ;
# if defined(_XBOX1)
position - > current_path_font_size = CURRENT_PATH_FONT_SIZE ;
position - > variable_font_size = FONT_SIZE ;
position - > core_msg_x_position = position - > x_position ;
position - > core_msg_y_position = position - > msg_prev_next_y_position + 0.01f ;
position - > core_msg_font_size = position - > font_size ;
# elif defined(__CELLOS_LV2__)
position - > current_path_font_size = g_settings . video . font_size ;
position - > variable_font_size = g_settings . video . font_size ;
position - > core_msg_x_position = 0.3f ;
position - > core_msg_y_position = 0.06f ;
position - > core_msg_font_size = COMMENT_Y_POSITION ;
# endif
}
2013-03-25 20:41:53 +01:00
/*============================================================
MENU STACK
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
typedef struct
{
unsigned char enum_id ;
unsigned char category_id ;
int ( * entry ) ( void * data , void * state ) ;
} menu ;
typedef struct
{
uint64_t input ;
uint64_t old_state ;
# ifdef HAVE_OSKUTIL
unsigned osk_param ;
bool ( * osk_init ) ( void * data ) ;
bool ( * osk_callback ) ( void * data ) ;
# endif
} rmenu_state_t ;
static rmenu_state_t rmenu_state ;
static unsigned char menu_stack_enum_array [ 10 ] ;
static unsigned stack_idx = 0 ;
static bool need_refresh = false ;
static void menu_stack_pop ( void )
{
if ( stack_idx > 1 )
{
stack_idx - - ;
need_refresh = true ;
}
}
static void menu_stack_push ( unsigned menu_id )
{
menu_stack_enum_array [ stack_idx ] = menu_id ;
stack_idx + + ;
need_refresh = true ;
}
2012-12-17 05:30:28 +01:00
/*============================================================
2013-02-17 22:02:42 +01:00
EVENT CALLBACKS ( AND RELATED )
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
2012-12-17 05:30:28 +01:00
2012-12-17 01:02:45 +01:00
static void populate_setting_item ( void * data , unsigned input )
2012-01-16 04:07:02 +01:00
{
2012-12-17 00:32:16 +01:00
item * current_item = ( item * ) data ;
2012-07-16 20:35:11 +02:00
char fname [ PATH_MAX ] ;
( void ) fname ;
2012-12-17 01:02:45 +01:00
unsigned currentsetting = input ;
current_item - > enum_id = input ;
2012-08-19 14:48:42 +02:00
2012-04-14 04:38:40 +02:00
switch ( currentsetting )
{
2012-08-03 01:57:53 +02:00
# ifdef __CELLOS_LV2__
2012-08-19 14:48:42 +02:00
case SETTING_CHANGE_RESOLUTION :
2012-11-19 04:09:16 +01:00
{
unsigned width = gfx_ctx_get_resolution_width ( g_extern . console . screen . resolutions . list [ g_extern . console . screen . resolutions . current . idx ] ) ;
unsigned height = gfx_ctx_get_resolution_height ( g_extern . console . screen . resolutions . list [ g_extern . console . screen . resolutions . current . idx ] ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Resolution " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > comment , " INFO - Change the display resolution. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %dx%d " , width , height ) ;
}
break ;
2013-01-17 12:17:02 +01:00
case SETTING_PAL60_MODE :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " PAL60 Mode " , sizeof ( current_item - > text ) ) ;
2013-03-18 18:05:15 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_PAL_TEMPORAL_ENABLE ) )
{
strlcpy ( current_item - > setting_text , " ON " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - [PAL60 Mode is set to 'ON'. \n converts frames from 60Hz to 50Hz. " , sizeof ( current_item - > comment ) ) ;
}
else
{
strlcpy ( current_item - > setting_text , " OFF " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - [PAL60 Mode is set to 'OFF'. \n frames are not converted. " , sizeof ( current_item - > comment ) ) ;
}
2013-01-17 12:17:02 +01:00
break ;
2012-08-03 01:57:53 +02:00
# endif
2012-08-03 03:24:36 +02:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-08-19 14:48:42 +02:00
case SETTING_SHADER_PRESETS :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Shader Presets (CGP) " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
fill_pathname_base ( fname , g_extern . file_state . cgp_path , sizeof ( fname ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > comment , " INFO - Select a [CG Preset] script. " , sizeof ( current_item - > comment ) ) ;
strlcpy ( current_item - > setting_text , fname , sizeof ( current_item - > setting_text ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_SHADER :
2012-11-19 04:09:16 +01:00
fill_pathname_base ( fname , g_settings . video . cg_shader_path , sizeof ( fname ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Shader #1 " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , fname , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Select a shader as [Shader #1]. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_SHADER_2 :
2012-11-19 04:09:16 +01:00
fill_pathname_base ( fname , g_settings . video . second_pass_shader , sizeof ( fname ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Shader #2 " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , fname , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Select a shader as [Shader #2]. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 03:24:36 +02:00
# endif
2013-02-01 07:42:36 +01:00
case SETTING_EMU_SKIN :
fill_pathname_base ( fname , g_extern . console . menu_texture_path , sizeof ( fname ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Menu Skin " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , fname , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Select a skin for the menu. " , sizeof ( current_item - > comment ) ) ;
2013-02-01 07:42:36 +01:00
break ;
2013-02-17 20:23:27 +01:00
case SETTING_EMU_LOW_RAM_MODE_ENABLE :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Low RAM Mode " , sizeof ( current_item - > text ) ) ;
2013-02-17 22:02:42 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE ) | |
g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING ) )
{
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , " ON " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Will load skin at startup. " , sizeof ( current_item - > comment ) ) ;
2013-02-17 22:02:42 +01:00
}
else
{
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , " OFF " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Will not load skin at startup to save up on RAM. " , sizeof ( current_item - > comment ) ) ;
2013-02-17 22:02:42 +01:00
}
2013-02-17 20:23:27 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_FONT_SIZE :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Font Size " , sizeof ( current_item - > text ) ) ;
2013-01-11 21:04:51 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %f " , g_settings . video . font_size ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > comment , " INFO - Increase or decrease the [Font Size]. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_KEEP_ASPECT_RATIO :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Aspect Ratio " , sizeof ( current_item - > text ) ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > setting_text , aspectratio_lut [ g_settings . video . aspect_ratio_idx ] . name , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > comment , " INFO - Select an [Aspect Ratio]. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_HW_TEXTURE_FILTER :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " Hardware filtering #1 " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
if ( g_settings . video . smooth )
2013-03-18 18:05:15 +01:00
{
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > setting_text , " Bilinear " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Hardware filtering #1 is set to Bilinear. " ,
sizeof ( current_item - > comment ) ) ;
}
2012-11-19 04:09:16 +01:00
else
2013-03-18 18:05:15 +01:00
{
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > setting_text , " Point " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Hardware filtering #1 is set to Point. " ,
sizeof ( current_item - > comment ) ) ;
}
2012-11-19 04:09:16 +01:00
break ;
2012-08-04 03:11:49 +02:00
# ifdef HAVE_FBO
2012-08-19 14:48:42 +02:00
case SETTING_HW_TEXTURE_FILTER_2 :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Hardware filtering #2 " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
if ( g_settings . video . second_pass_smooth )
2013-03-18 18:05:15 +01:00
{
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , " Bilinear " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Hardware filtering #2 is set to Bilinear. " ,
sizeof ( current_item - > comment ) ) ;
}
2012-11-19 04:09:16 +01:00
else
2013-03-18 18:05:15 +01:00
{
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , " Point " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Hardware filtering #2 is set to Point. " ,
sizeof ( current_item - > comment ) ) ;
}
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_SCALE_ENABLED :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > text , " FBO Mode " , sizeof ( current_item - > text ) ) ;
if ( g_settings . video . render_to_texture )
{
strlcpy ( current_item - > setting_text , " ON " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - FBO Mode is set to 'ON' - 2x shaders will look much \n better, and you can select a shader for [Shader #2]. " , sizeof ( current_item - > comment ) ) ;
}
else
{
strlcpy ( current_item - > setting_text , " OFF " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - FBO Mode is set to 'OFF'. " , sizeof ( current_item - > comment ) ) ;
}
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_SCALE_FACTOR :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Scaling Factor " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %fx (X) / %fx (Y) " , g_settings . video . fbo . scale_x , g_settings . video . fbo . scale_y ) ;
2013-03-18 18:05:15 +01:00
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " INFO - Scaling Factor is set to: '%fx (X) / %fx (Y)'. " , g_settings . video . fbo . scale_x , g_settings . video . fbo . scale_y ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-07 18:26:52 +02:00
# endif
# ifdef _XBOX1
case SETTING_FLICKER_FILTER :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Flicker Filter " , sizeof ( current_item - > text ) ) ;
2013-01-11 20:37:22 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %d " , g_extern . console . screen . flicker_filter_index ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > comment , " INFO - Toggle the [Flicker Filter]. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-07 18:26:52 +02:00
case SETTING_SOFT_DISPLAY_FILTER :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Soft Display Filter " , sizeof ( current_item - > text ) ) ;
2013-01-12 03:13:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_SOFT_FILTER_ENABLE ) ) ? " ON " : " OFF " ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > comment , " INFO - Toggle the [Soft Display Filter]. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 18:54:59 +02:00
# endif
2012-08-19 14:48:42 +02:00
case SETTING_HW_OVERSCAN_AMOUNT :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Overscan " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %f " , g_extern . console . screen . overscan_amount ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > comment , " INFO - Adjust or decrease [Overscan]. Set this to higher than 0.000 \n if the screen doesn't fit on your TV/monitor. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2013-01-13 05:52:00 +01:00
case SETTING_REFRESH_RATE :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Refresh rate " , sizeof ( current_item - > text ) ) ;
2013-01-13 05:52:00 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %fHz " , g_settings . video . refresh_rate ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > comment , " INFO - Adjust or decrease [Refresh Rate]. " , sizeof ( current_item - > comment ) ) ;
2013-01-13 05:52:00 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_THROTTLE_MODE :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Throttle Mode " , sizeof ( current_item - > text ) ) ;
2013-01-12 03:13:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_THROTTLE_ENABLE ) ) ? " ON " : " OFF " ) ;
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_THROTTLE_ENABLE ) ) ? " INFO - [Throttle Mode] is 'ON' - Vsync is enabled. " : " INFO - [Throttle Mode] is 'OFF' - Vsync is disabled. " ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_TRIPLE_BUFFERING :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Triple Buffering " , sizeof ( current_item - > text ) ) ;
2013-01-12 03:13:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_TRIPLE_BUFFERING_ENABLE ) ) ? " ON " : " OFF " ) ;
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_TRIPLE_BUFFERING_ENABLE ) ) ? " INFO - [Triple Buffering] is set to 'ON'. " : " INFO - [Triple Buffering] is set to 'OFF'. " ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_ENABLE_SCREENSHOTS :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Screenshot Option " , sizeof ( current_item - > text ) ) ;
2013-01-12 03:13:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) ) ? " ON " : " OFF " ) ;
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " INFO - Screenshots feature is set to '%s'. " , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) ) ? " ON " : " OFF " ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 18:54:59 +02:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " APPLY SHADER PRESET ON STARTUP " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Automatically load the currently selected [CG Preset] file on startup. " , sizeof ( current_item - > comment ) ) ;
2012-08-19 14:48:42 +02:00
break ;
2012-08-03 18:54:59 +02:00
# endif
2012-08-19 14:48:42 +02:00
case SETTING_DEFAULT_VIDEO_ALL :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " DEFAULTS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Set all [General Video Settings] back to their 'DEFAULT' values. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_SOUND_MODE :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Sound Output " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
switch ( g_extern . console . sound . mode )
{
case SOUND_MODE_NORMAL :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > comment , " INFO - [Sound Output] is set to 'Normal'. " , sizeof ( current_item - > comment ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , " Normal " , sizeof ( current_item - > setting_text ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 03:24:36 +02:00
# ifdef HAVE_RSOUND
2012-11-19 04:09:16 +01:00
case SOUND_MODE_RSOUND :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > comment , " INFO - [Sound Output] is set to 'RSound'. " , sizeof ( current_item - > comment ) ) ;
strlcpy ( current_item - > setting_text , " RSound " , sizeof ( current_item - > setting_text ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 03:24:36 +02:00
# endif
# ifdef HAVE_HEADSET
2012-11-19 04:09:16 +01:00
case SOUND_MODE_HEADSET :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - [Sound Output] is set to USB/Bluetooth Headset. " , sizeof ( current_item - > comment ) ) ;
strlcpy ( current_item - > setting_text , " USB/Bluetooth Headset " , sizeof ( current_item - > setting_text ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 03:24:36 +02:00
# endif
2012-11-19 04:09:16 +01:00
default :
break ;
}
break ;
2012-08-03 18:54:59 +02:00
# ifdef HAVE_RSOUND
2012-08-19 14:48:42 +02:00
case SETTING_RSOUND_SERVER_IP_ADDRESS :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " RSound Server IP Address " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , g_settings . audio . device , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Enter the IP Address of the [RSound Audio Server]. IP address \n must be an IPv4 32-bits address, eg: '192.168.1.7'. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 18:54:59 +02:00
# endif
2012-08-19 14:48:42 +02:00
case SETTING_DEFAULT_AUDIO_ALL :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " DEFAULTS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Set all [General Audio Settings] back to their 'DEFAULT' values. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2013-02-08 14:39:32 +01:00
case SETTING_RESAMPLER_TYPE :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Sound resampler " , sizeof ( current_item - > text ) ) ;
2013-02-08 14:39:32 +01:00
# ifdef HAVE_SINC
if ( strstr ( g_settings . audio . resampler , " sinc " ) )
{
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , " Sinc " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - [Sinc resampler] - slightly slower but better sound quality at high frequencies. " , sizeof ( current_item - > comment ) ) ;
2013-02-08 14:39:32 +01:00
}
else
# endif
{
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , " Hermite " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - [Hermite resampler] - faster but less accurate at high frequencies. " , sizeof ( current_item - > comment ) ) ;
2013-02-08 14:39:32 +01:00
}
break ;
2012-08-19 14:48:42 +02:00
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Current save state slot " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %d " , g_extern . state_slot ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set the currently selected savestate slot. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
/* emu-specific */
2012-08-19 14:48:42 +02:00
case SETTING_EMU_SHOW_DEBUG_INFO_MSG :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Debug info messages " , sizeof ( current_item - > text ) ) ;
2013-01-12 03:13:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_FPS_DRAW ) ) ? " ON " : " OFF " ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Show onscreen debug messages. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_EMU_SHOW_INFO_MSG :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Info messages " , sizeof ( current_item - > text ) ) ;
2013-01-12 03:13:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) ) ? " ON " : " OFF " ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Show onscreen info messages in the menu. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_EMU_REWIND_ENABLED :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Rewind option " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
if ( g_settings . rewind_enable )
2013-03-18 03:49:54 +01:00
{
strlcpy ( current_item - > setting_text , " ON " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - [Rewind] feature is set to 'ON'. " ,
sizeof ( current_item - > comment ) ) ;
}
2012-11-19 04:09:16 +01:00
else
2013-03-18 03:49:54 +01:00
{
strlcpy ( current_item - > setting_text , " OFF " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - [Rewind] feature is set to 'OFF'. " ,
sizeof ( current_item - > comment ) ) ;
}
2012-11-19 04:09:16 +01:00
break ;
2013-01-19 08:54:03 +01:00
case SETTING_EMU_REWIND_GRANULARITY :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " Rewind granularity " , sizeof ( current_item - > text ) ) ;
2013-01-19 08:54:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %d " , g_settings . rewind_granularity ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > comment , " INFO - Set the amount of frames to 'rewind'. \n Increase this to lower CPU usage. " , sizeof ( current_item - > comment ) ) ;
2013-01-19 08:54:03 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_RARCH_DEFAULT_EMU :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " Default libretro core " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
fill_pathname_base ( fname , g_settings . libretro , sizeof ( fname ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , fname , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > comment , " INFO - Select a default libretro core to launch at start-up. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-22 21:27:21 +02:00
case SETTING_QUIT_RARCH :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " Quit RetroArch and save settings " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Quits RetroArch and saves the settings. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_EMU_AUDIO_MUTE :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > text , " Mute Audio " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
if ( g_extern . audio_data . mute )
2013-03-18 18:05:15 +01:00
{
strlcpy ( current_item - > comment , " INFO - [Audio Mute] is set to 'ON'. The game audio will be muted. " , sizeof ( current_item - > comment ) ) ;
strlcpy ( current_item - > setting_text , " ON " , sizeof ( current_item - > setting_text ) ) ;
}
2012-11-19 04:09:16 +01:00
else
2013-03-18 18:05:15 +01:00
{
strlcpy ( current_item - > comment , " INFO - [Audio Mute] is set to 'OFF'. " , sizeof ( current_item - > comment ) ) ;
strlcpy ( current_item - > setting_text , " OFF " , sizeof ( current_item - > setting_text ) ) ;
}
2012-11-19 04:09:16 +01:00
break ;
2012-08-22 16:59:12 +02:00
# ifdef _XBOX1
case SETTING_EMU_AUDIO_SOUND_VOLUME_LEVEL :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > text , " Volume Level " , sizeof ( current_item - > text ) ) ;
2012-10-15 06:24:39 +02:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , g_extern . console . sound . volume_level ? " Loud " : " Normal " ) ;
2012-11-19 04:09:16 +01:00
if ( g_extern . audio_data . mute )
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Volume level is set to Loud. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
else
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Volume level is set to Normal. " , sizeof ( current_item - > comment ) ) ;
2012-08-22 16:59:12 +02:00
break ;
# endif
2012-08-19 14:48:42 +02:00
case SETTING_ENABLE_CUSTOM_BGM :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > text , " Custom BGM Option " , sizeof ( current_item - > text ) ) ;
2013-01-12 03:13:03 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_AUDIO_CUSTOM_BGM_ENABLE ) ) ? " ON " : " OFF " ) ;
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " INFO - [Custom BGM] is set to '%s'. " , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_AUDIO_CUSTOM_BGM_ENABLE ) ) ? " ON " : " OFF " ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_PATH_DEFAULT_ROM_DIRECTORY :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > text , " Startup ROM Directory " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , g_extern . console . main_wrap . default_rom_startup_dir , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Set the default Startup ROM directory path. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_PATH_SAVESTATES_DIRECTORY :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > text , " Savestate Directory " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , g_extern . console . main_wrap . default_savestate_dir , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Set the default path where all the savestate files will be saved to. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_PATH_SRAM_DIRECTORY :
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > text , " SRAM Directory " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , g_extern . console . main_wrap . default_sram_dir , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Set the default SaveRAM directory path. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-08-19 14:48:42 +02:00
case SETTING_PATH_CHEATS :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " Cheatfile Directory " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , g_settings . cheat_database , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set the default Cheatfile directory path. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-04 07:24:15 +02:00
# endif
2012-08-19 14:48:42 +02:00
case SETTING_PATH_SYSTEM :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " System Directory " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , g_settings . system_directory , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set the default [System directory] path. System files like \n BIOS files, etc. will be stored here. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_ENABLE_SRAM_PATH :
2012-08-19 15:26:35 +02:00
snprintf ( current_item - > text , sizeof ( current_item - > text ) , " Custom SRAM Dir Enable " ) ;
2013-01-13 04:12:10 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_GAME_SRAM_DIR_ENABLE ) ) ? " ON " : " OFF " ) ;
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " INFO - [Custom SRAM Dir Path] is set to '%s'. " , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_GAME_SRAM_DIR_ENABLE ) ) ? " ON " : " OFF " ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_ENABLE_STATE_PATH :
2012-08-19 15:26:35 +02:00
snprintf ( current_item - > text , sizeof ( current_item - > text ) , " Custom Savestate Dir Enable " ) ;
2013-01-13 04:12:10 +01:00
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_GAME_STATE_DIR_ENABLE ) ) ? " ON " : " OFF " ) ;
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " INFO - [Custom Savestate Dir Path] is set to '%s'. " , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_GAME_STATE_DIR_ENABLE ) ) ? " ON " : " OFF " ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_CONTROLS_SCHEME :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " Control Scheme Preset " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " INFO - Input scheme preset [%s] is selected. " , g_extern . file_state . input_cfg_path ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > setting_text , g_extern . file_state . input_cfg_path , sizeof ( current_item - > setting_text ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_CONTROLS_NUMBER :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " Controller No " , sizeof ( current_item - > text ) ) ;
2012-11-19 04:09:16 +01:00
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " Controller %d is currently selected. " , currently_selected_controller_menu + 1 ) ;
snprintf ( current_item - > setting_text , sizeof ( current_item - > setting_text ) , " %d " , currently_selected_controller_menu + 1 ) ;
break ;
2012-08-22 14:04:33 +02:00
case SETTING_DPAD_EMULATION :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " D-Pad Emulation " , sizeof ( current_item - > text ) ) ;
2013-03-13 01:07:27 +01:00
switch ( g_settings . input . dpad_emulation [ currently_selected_controller_menu ] )
{
2013-03-14 02:24:57 +01:00
case ANALOG_DPAD_NONE :
2013-03-13 01:07:27 +01:00
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " [%s] from Controller %d is mapped to D-pad. " , " None " , currently_selected_controller_menu + 1 ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > setting_text , " None " , sizeof ( current_item - > setting_text ) ) ;
2013-03-13 01:07:27 +01:00
break ;
2013-03-14 02:24:57 +01:00
case ANALOG_DPAD_LSTICK :
2013-03-13 01:07:27 +01:00
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " [%s] from Controller %d is mapped to D-pad. " , " Left Stick " , currently_selected_controller_menu + 1 ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > setting_text , " Left Stick " , sizeof ( current_item - > setting_text ) ) ;
2013-03-13 01:07:27 +01:00
break ;
2013-03-14 02:24:57 +01:00
case ANALOG_DPAD_RSTICK :
2013-03-13 01:07:27 +01:00
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " [%s] from Controller %d is mapped to D-pad. " , " Right Stick " , currently_selected_controller_menu + 1 ) ;
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > setting_text , " Right Stick " , sizeof ( current_item - > setting_text ) ) ;
2013-03-13 01:07:27 +01:00
break ;
}
2012-08-22 14:04:33 +02:00
break ;
2012-08-19 14:48:42 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L2 :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R2 :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L3 :
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R3 :
{
2012-11-19 04:09:16 +01:00
unsigned id = currentsetting - FIRST_CONTROL_BIND ;
2013-03-14 21:55:10 +01:00
struct platform_bind key_label ;
strlcpy ( key_label . desc , " Unknown " , sizeof ( key_label . desc ) ) ;
key_label . joykey = g_settings . input . binds [ currently_selected_controller_menu ] [ id ] . joykey ;
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( & key_label , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , g_settings . input . binds [ currently_selected_controller_menu ] [ id ] . desc , sizeof ( current_item - > text ) ) ;
2013-03-14 21:55:10 +01:00
snprintf ( current_item - > comment , sizeof ( current_item - > comment ) , " INFO - [%s] is mapped to action: \n [%s]. " , current_item - > text , key_label . desc ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > setting_text , key_label . desc , sizeof ( current_item - > setting_text ) ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-08-19 14:48:42 +02:00
case SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " SAVE CUSTOM CONTROLS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Save the [Custom Controls] settings to file. " , sizeof ( current_item - > comment ) ) ;
2012-08-19 14:48:42 +02:00
break ;
case SETTING_CONTROLS_DEFAULT_ALL :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " DEFAULTS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set all Controls settings to defaults. " , sizeof ( current_item - > comment ) ) ;
2012-08-19 14:48:42 +02:00
break ;
case SETTING_EMU_VIDEO_DEFAULT_ALL :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " DEFAULTS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set all Video settings to defaults. " , sizeof ( current_item - > comment ) ) ;
2012-08-19 14:48:42 +02:00
break ;
case SETTING_EMU_AUDIO_DEFAULT_ALL :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " DEFAULTS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set all Audio settings to defaults. " , sizeof ( current_item - > comment ) ) ;
2012-08-19 14:48:42 +02:00
break ;
case SETTING_PATH_DEFAULT_ALL :
2013-03-18 05:11:36 +01:00
strlcpy ( current_item - > text , " DEFAULTS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set all Path settings to defaults. " , sizeof ( current_item - > comment ) ) ;
2012-08-19 14:48:42 +02:00
break ;
case SETTING_EMU_DEFAULT_ALL :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " DEFAULTS " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( current_item - > comment , " INFO - Set all RetroArch settings to defaults. " , sizeof ( current_item - > comment ) ) ;
2012-08-19 14:48:42 +02:00
break ;
2012-08-03 18:54:59 +02:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-08-19 14:48:42 +02:00
case SETTING_SAVE_SHADER_PRESET :
2013-03-18 03:49:54 +01:00
strlcpy ( current_item - > text , " SAVE SETTINGS AS CGP PRESET " , sizeof ( current_item - > text ) ) ;
strlcpy ( current_item - > setting_text , " " , sizeof ( current_item - > setting_text ) ) ;
strlcpy ( current_item - > comment , " INFO - Save the current video settings to a [CG Preset] (CGP) file. " , sizeof ( current_item - > comment ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 18:54:59 +02:00
# endif
2012-08-19 14:48:42 +02:00
default :
2012-11-19 04:09:16 +01:00
break ;
2012-04-14 04:38:40 +02:00
}
2012-01-10 23:33:44 +01:00
}
2012-12-17 00:32:16 +01:00
static void display_menubar ( void * data )
2012-06-28 21:49:40 +02:00
{
2013-03-25 17:47:24 +01:00
char title [ 32 ] ;
2012-12-17 00:32:16 +01:00
menu * current_menu = ( menu * ) data ;
2012-11-19 04:09:16 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2013-01-07 23:29:56 +01:00
filebrowser_t * fb = browser ;
2013-03-11 20:05:05 +01:00
char msg [ 128 ] ;
font_params_t font_parms = { 0 } ;
2012-08-01 16:47:37 +02:00
2012-08-19 01:21:31 +02:00
rmenu_default_positions_t default_pos ;
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-08-01 16:47:37 +02:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . current_path_y_position ;
font_parms . scale = default_pos . current_path_font_size ;
font_parms . color = WHITE ;
2013-03-18 18:05:15 +01:00
struct platform_bind key_label_r = { 0 } ;
struct platform_bind key_label_l = { 0 } ;
2013-03-14 21:55:10 +01:00
strlcpy ( key_label_r . desc , " Unknown " , sizeof ( key_label_r . desc ) ) ;
key_label_r . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_R ;
strlcpy ( key_label_l . desc , " Unknown " , sizeof ( key_label_l . desc ) ) ;
key_label_l . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_L ;
2012-06-28 21:49:40 +02:00
2012-07-30 17:19:05 +02:00
switch ( current_menu - > enum_id )
2012-06-29 14:40:50 +02:00
{
case GENERAL_VIDEO_MENU :
2013-03-14 21:55:10 +01:00
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( & key_label_r , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
snprintf ( msg , sizeof ( msg ) , " NEXT -> [%s] " , key_label_r . desc ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-06-29 14:40:50 +02:00
break ;
case GENERAL_AUDIO_MENU :
case EMU_GENERAL_MENU :
case EMU_VIDEO_MENU :
case EMU_AUDIO_MENU :
case PATH_MENU :
2013-03-14 21:55:10 +01:00
if ( driver . input - > set_keybinds )
{
driver . input - > set_keybinds ( & key_label_r , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_l , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
}
snprintf ( msg , sizeof ( msg ) , " [%s] <- PREV | NEXT -> [%s] " , key_label_l . desc , key_label_r . desc ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-06-29 14:40:50 +02:00
break ;
case CONTROLS_MENU :
case INGAME_MENU_RESIZE :
2013-03-14 21:55:10 +01:00
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( & key_label_l , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
snprintf ( msg , sizeof ( msg ) , " [%s] <- PREV " , key_label_l . desc ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-06-29 14:40:50 +02:00
break ;
default :
break ;
}
2013-03-25 17:47:24 +01:00
switch ( current_menu - > enum_id )
{
case SHADER_CHOICE :
strlcpy ( title , " Shaders " , sizeof ( title ) ) ;
break ;
case PRESET_CHOICE :
strlcpy ( title , " Shader " , sizeof ( title ) ) ;
break ;
case BORDER_CHOICE :
strlcpy ( title , " Borders " , sizeof ( title ) ) ;
break ;
case LIBRETRO_CHOICE :
strlcpy ( title , " Libretro " , sizeof ( title ) ) ;
break ;
case INPUT_PRESET_CHOICE :
strlcpy ( title , " Input " , sizeof ( title ) ) ;
break ;
case PATH_SAVESTATES_DIR_CHOICE :
case PATH_DEFAULT_ROM_DIR_CHOICE :
# ifdef HAVE_XML
case PATH_CHEATS_DIR_CHOICE :
# endif
case PATH_SRAM_DIR_CHOICE :
case PATH_SYSTEM_DIR_CHOICE :
strlcpy ( title , " Path " , sizeof ( title ) ) ;
break ;
case INGAME_MENU :
strlcpy ( title , " Ingame Menu " , sizeof ( title ) ) ;
break ;
case INGAME_MENU_RESIZE :
strlcpy ( title , " Resize Menu " , sizeof ( title ) ) ;
break ;
case INGAME_MENU_SCREENSHOT :
strlcpy ( title , " Ingame Menu " , sizeof ( title ) ) ;
break ;
case FILE_BROWSER_MENU :
strlcpy ( title , " Filebrowser " , sizeof ( title ) ) ;
break ;
case GENERAL_VIDEO_MENU :
strlcpy ( title , " Video " , sizeof ( title ) ) ;
break ;
case GENERAL_AUDIO_MENU :
strlcpy ( title , " Audio " , sizeof ( title ) ) ;
break ;
case EMU_GENERAL_MENU :
strlcpy ( title , " Retro " , sizeof ( title ) ) ;
break ;
case EMU_VIDEO_MENU :
strlcpy ( title , " Retro Video " , sizeof ( title ) ) ;
break ;
case EMU_AUDIO_MENU :
strlcpy ( title , " Retro Audio " , sizeof ( title ) ) ;
break ;
case PATH_MENU :
strlcpy ( title , " Path " , sizeof ( title ) ) ;
break ;
case CONTROLS_MENU :
strlcpy ( title , " Controls " , sizeof ( title ) ) ;
break ;
}
2012-07-30 17:19:05 +02:00
switch ( current_menu - > enum_id )
2012-06-29 15:43:09 +02:00
{
2012-07-31 03:28:40 +02:00
case SHADER_CHOICE :
case PRESET_CHOICE :
case BORDER_CHOICE :
case LIBRETRO_CHOICE :
case INPUT_PRESET_CHOICE :
case PATH_SAVESTATES_DIR_CHOICE :
case PATH_DEFAULT_ROM_DIR_CHOICE :
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-07-31 03:28:40 +02:00
case PATH_CHEATS_DIR_CHOICE :
2012-08-04 07:24:15 +02:00
# endif
2012-07-31 03:28:40 +02:00
case PATH_SRAM_DIR_CHOICE :
2012-08-05 17:53:01 +02:00
case PATH_SYSTEM_DIR_CHOICE :
2013-01-07 23:29:56 +01:00
fb = tmpBrowser ;
2012-06-29 15:43:09 +02:00
case FILE_BROWSER_MENU :
2013-03-18 05:25:18 +01:00
snprintf ( msg , sizeof ( msg ) , " PATH: %s " , fb - > directory_path ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-06-29 15:43:09 +02:00
break ;
}
2012-11-19 04:09:16 +01:00
rarch_position_t position = { 0 } ;
device_ptr - > ctx_driver - > rmenu_draw_bg ( & position ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . core_msg_x_position ;
font_parms . y = default_pos . core_msg_y_position ;
font_parms . scale = default_pos . core_msg_font_size ;
font_parms . color = WHITE ;
2012-08-18 23:47:33 +02:00
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , g_extern . title_buf , & font_parms ) ;
2012-08-18 23:47:33 +02:00
# ifdef __CELLOS_LV2__
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = 0.05f ;
font_parms . scale = 1.4f ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
2013-03-25 17:47:24 +01:00
driver . video_poke - > set_osd_msg ( driver . video_data , title , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = 0.80f ;
font_parms . y = 0.015f ;
font_parms . scale = 0.82f ;
font_parms . color = WHITE ;
snprintf ( msg , sizeof ( msg ) , " v%s " , PACKAGE_VERSION ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-08-03 18:51:56 +02:00
# endif
2012-06-28 21:49:40 +02:00
}
2012-12-17 00:32:16 +01:00
static void browser_update ( void * data , uint64_t input , const char * extensions )
2012-07-16 09:40:26 +02:00
{
2012-12-17 00:32:16 +01:00
filebrowser_t * b = ( filebrowser_t * ) data ;
2012-07-16 09:40:26 +02:00
filebrowser_action_t action = FILEBROWSER_ACTION_NOOP ;
2012-12-17 00:32:16 +01:00
bool ret = true ;
2012-07-16 09:40:26 +02:00
2013-01-22 20:42:11 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_DOWN ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_DOWN ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_UP ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_UP ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_RIGHT ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_LEFT ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_R2 ) )
2012-08-02 01:59:05 +02:00
action = FILEBROWSER_ACTION_SCROLL_DOWN ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_L2 ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_SCROLL_UP ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_A ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_CANCEL ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-06-28 21:49:40 +02:00
{
action = FILEBROWSER_ACTION_RESET ;
2013-03-13 02:52:41 +01:00
filebrowser_set_root_and_ext ( b , NULL , default_paths . filesystem_root_dir ) ;
2012-06-28 21:49:40 +02:00
strlcpy ( b - > extensions , extensions , sizeof ( b - > extensions ) ) ;
}
if ( action ! = FILEBROWSER_ACTION_NOOP )
2012-08-01 17:22:10 +02:00
ret = filebrowser_iterate ( b , action ) ;
if ( ! ret )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " ERROR - Failed to open directory. " , 1 , 180 ) ;
2012-06-28 21:49:40 +02:00
}
2013-03-25 03:07:58 +01:00
static void browser_render ( void * data )
2012-06-28 21:49:40 +02:00
{
2012-12-17 00:32:16 +01:00
filebrowser_t * b = ( filebrowser_t * ) data ;
2012-11-19 04:09:16 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-06-28 21:49:40 +02:00
unsigned file_count = b - > current_dir . list - > size ;
2013-03-18 18:05:15 +01:00
unsigned current_index = 0 ;
unsigned page_number = 0 ;
unsigned page_base = 0 ;
unsigned i ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
rmenu_default_positions_t default_pos = { 0 } ;
2012-06-28 21:49:40 +02:00
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-06-28 21:49:40 +02:00
2012-08-19 11:57:58 +02:00
current_index = b - > current_dir . ptr ;
page_number = current_index / default_pos . entries_per_page ;
page_base = page_number * default_pos . entries_per_page ;
2012-06-28 21:49:40 +02:00
2013-03-11 20:05:05 +01:00
font_parms . scale = default_pos . variable_font_size ;
2012-12-17 00:32:16 +01:00
for ( i = page_base ; i < file_count & & i < page_base + default_pos . entries_per_page ; + + i )
2012-06-28 21:49:40 +02:00
{
2013-03-18 18:05:15 +01:00
char fname_tmp [ 128 ] ;
2012-06-28 21:49:40 +02:00
fill_pathname_base ( fname_tmp , b - > current_dir . list - > elems [ i ] . data , sizeof ( fname_tmp ) ) ;
2012-08-19 11:57:58 +02:00
default_pos . starting_y_position + = default_pos . y_position_increment ;
2012-08-03 18:51:56 +02:00
//check if this is the currently selected file
const char * current_pathname = filebrowser_get_current_path ( b ) ;
if ( strcmp ( current_pathname , b - > current_dir . list - > elems [ i ] . data ) = = 0 )
2012-08-05 17:18:19 +02:00
{
2012-11-19 04:09:16 +01:00
rarch_position_t position = { 0 } ;
2012-08-19 11:57:58 +02:00
position . x = default_pos . x_position ;
position . y = default_pos . starting_y_position ;
2012-11-19 04:09:16 +01:00
device_ptr - > ctx_driver - > rmenu_draw_panel ( & position ) ;
2012-08-05 17:18:19 +02:00
}
2012-08-03 18:51:56 +02:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . starting_y_position ;
font_parms . color = i = = current_index ? RED : b - > current_dir . list - > elems [ i ] . attr . b ? GREEN : WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , fname_tmp , & font_parms ) ;
2012-06-28 21:49:40 +02:00
}
}
2013-03-25 20:41:53 +01:00
static int select_file ( void * data , void * state )
2012-01-31 14:34:43 +01:00
{
2013-03-18 18:05:15 +01:00
char extensions [ 128 ] ;
char comment [ 128 ] ;
char path [ PATH_MAX ] ;
bool ret = true ;
2012-12-17 00:32:16 +01:00
menu * current_menu = ( menu * ) data ;
2012-12-17 05:30:28 +01:00
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
2012-12-17 05:30:28 +01:00
uint64_t input = rstate - > input ;
2013-01-07 23:29:56 +01:00
filebrowser_t * filebrowser = tmpBrowser ;
2012-08-19 01:21:31 +02:00
rmenu_default_positions_t default_pos ;
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-08-01 16:47:37 +02:00
2012-07-30 17:19:05 +02:00
switch ( current_menu - > enum_id )
2012-04-14 04:38:40 +02:00
{
case SHADER_CHOICE :
2012-08-02 17:09:41 +02:00
strlcpy ( extensions , EXT_SHADERS , sizeof ( extensions ) ) ;
2013-03-18 18:31:14 +01:00
strlcpy ( comment , " INFO - Select a shader. " , sizeof ( comment ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-14 04:38:40 +02:00
case PRESET_CHOICE :
2012-08-02 17:09:41 +02:00
strlcpy ( extensions , EXT_CGP_PRESETS , sizeof ( extensions ) ) ;
2013-03-18 18:31:14 +01:00
strlcpy ( comment , " INFO - Select a shader preset. " , sizeof ( comment ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-14 04:38:40 +02:00
case INPUT_PRESET_CHOICE :
2012-08-02 17:09:41 +02:00
strlcpy ( extensions , EXT_INPUT_PRESETS , sizeof ( extensions ) ) ;
2013-03-18 18:31:14 +01:00
strlcpy ( comment , " INFO - Select an input preset. " , sizeof ( comment ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-14 04:38:40 +02:00
case BORDER_CHOICE :
2012-08-02 17:09:41 +02:00
strlcpy ( extensions , EXT_IMAGES , sizeof ( extensions ) ) ;
2013-03-18 18:31:14 +01:00
strlcpy ( comment , " INFO - Select a border image file. " , sizeof ( comment ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-22 01:45:55 +02:00
case LIBRETRO_CHOICE :
2012-08-02 17:09:41 +02:00
strlcpy ( extensions , EXT_EXECUTABLES , sizeof ( extensions ) ) ;
2013-03-18 18:31:14 +01:00
strlcpy ( comment , " INFO - Select a Libretro core. " , sizeof ( comment ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-14 04:38:40 +02:00
}
2012-01-31 14:34:43 +01:00
2012-12-17 01:30:38 +01:00
browser_update ( filebrowser , input , extensions ) ;
2012-02-22 19:49:22 +01:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-07-31 05:04:47 +02:00
{
2013-03-13 02:52:41 +01:00
if ( filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_PATH_ISDIR ) )
2012-12-17 01:30:38 +01:00
ret = filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_OK ) ;
2012-07-31 05:04:47 +02:00
else
2012-04-14 04:38:40 +02:00
{
2013-03-18 03:49:54 +01:00
strlcpy ( path , filebrowser_get_current_path ( filebrowser ) , sizeof ( path ) ) ;
2012-11-19 04:09:16 +01:00
2012-08-02 17:09:41 +02:00
switch ( current_menu - > enum_id )
{
2012-08-03 18:27:38 +02:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-07-31 05:04:47 +02:00
case SHADER_CHOICE :
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_FIRST_SHADER ) )
2012-08-02 17:09:41 +02:00
{
2013-01-10 18:44:34 +01:00
strlcpy ( g_settings . video . cg_shader_path , path , sizeof ( g_settings . video . cg_shader_path ) ) ;
if ( g_settings . video . shader_type ! = RARCH_SHADER_NONE )
{
driver . video - > set_shader ( driver . video_data , ( enum rarch_shader_type ) g_settings . video . shader_type , path , RARCH_SHADER_INDEX_PASS0 ) ;
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - Shader successfully loaded. " , 1 , 180 ) ;
2013-01-10 18:44:34 +01:00
}
else
RARCH_ERR ( " Shaders are unsupported on this platform. \n " ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_LOAD_FIRST_SHADER ) ;
2013-01-10 18:44:34 +01:00
}
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_SECOND_SHADER ) )
2013-01-10 18:44:34 +01:00
{
strlcpy ( g_settings . video . second_pass_shader , path , sizeof ( g_settings . video . second_pass_shader ) ) ;
if ( g_settings . video . shader_type ! = RARCH_SHADER_NONE )
{
driver . video - > set_shader ( driver . video_data , ( enum rarch_shader_type ) g_settings . video . shader_type , path , RARCH_SHADER_INDEX_PASS1 ) ;
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - Shader successfully loaded. " , 1 , 180 ) ;
2013-01-10 18:44:34 +01:00
}
else
RARCH_ERR ( " Shaders are unsupported on this platform. \n " ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_LOAD_SECOND_SHADER ) ;
2012-08-02 17:09:41 +02:00
}
break ;
case PRESET_CHOICE :
2012-10-15 06:24:39 +02:00
strlcpy ( g_extern . file_state . cgp_path , path , sizeof ( g_extern . file_state . cgp_path ) ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_fbo_state )
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_DEINIT ) ;
2012-08-03 18:27:38 +02:00
# ifdef HAVE_OPENGL
2012-08-02 17:09:41 +02:00
gl_cg_reinit ( path ) ;
2012-08-03 18:27:38 +02:00
# endif
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_fbo_state )
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_INIT ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-08-02 17:09:41 +02:00
case INPUT_PRESET_CHOICE :
2012-10-15 06:24:39 +02:00
strlcpy ( g_extern . file_state . input_cfg_path , path , sizeof ( g_extern . file_state . input_cfg_path ) ) ;
2012-08-02 17:09:41 +02:00
config_read_keybinds ( path ) ;
break ;
case BORDER_CHOICE :
2013-02-01 07:42:36 +01:00
# ifdef __CELLOS_LV2__
texture_image_border_load ( path ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( g_extern . console . menu_texture_path , path , sizeof ( g_extern . console . menu_texture_path ) ) ;
2013-02-01 07:42:36 +01:00
# endif
2012-08-02 17:09:41 +02:00
break ;
case LIBRETRO_CHOICE :
strlcpy ( g_settings . libretro , path , sizeof ( g_settings . libretro ) ) ;
2012-11-19 04:09:16 +01:00
2012-08-02 17:09:41 +02:00
if ( set_libretro_core_as_launch )
{
2013-01-11 08:15:23 +01:00
strlcpy ( g_extern . fullpath , path , sizeof ( g_extern . fullpath ) ) ;
2012-08-02 17:09:41 +02:00
set_libretro_core_as_launch = false ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXIT ) ;
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXITSPAWN ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2012-08-02 17:09:41 +02:00
}
2012-08-22 01:45:48 +02:00
else
{
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - You need to restart RetroArch. " , 1 , 180 ) ;
2012-08-22 01:45:48 +02:00
}
2012-08-02 17:09:41 +02:00
break ;
}
2012-11-19 04:09:16 +01:00
2012-08-20 18:17:08 +02:00
menu_stack_pop ( ) ;
2012-04-14 04:38:40 +02:00
}
2012-08-01 17:22:10 +02:00
if ( ! ret )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - You need to restart RetroArch. " , 1 , 180 ) ;
2012-07-31 05:04:47 +02:00
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_X ) )
2012-08-20 18:17:08 +02:00
menu_stack_pop ( ) ;
2012-01-31 14:34:43 +01:00
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-06-29 15:43:09 +02:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . comment_y_position ;
font_parms . scale = default_pos . font_size ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , comment , & font_parms ) ;
2013-03-18 18:05:15 +01:00
struct platform_bind key_label_x = { 0 } ;
struct platform_bind key_label_start = { 0 } ;
2013-03-14 21:55:10 +01:00
strlcpy ( key_label_x . desc , " Unknown " , sizeof ( key_label_x . desc ) ) ;
key_label_x . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_X ;
strlcpy ( key_label_start . desc , " Unknown " , sizeof ( key_label_start . desc ) ) ;
key_label_start . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_START ;
if ( driver . input - > set_keybinds )
{
driver . input - > set_keybinds ( & key_label_x , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_start , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
}
snprintf ( comment , sizeof ( comment ) , " [%s] - return to settings [%s] - Reset Startdir " , key_label_x . desc , key_label_start . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . comment_two_y_position ;
font_parms . color = YELLOW ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , comment , & font_parms ) ;
2012-12-17 00:32:16 +01:00
2013-03-25 03:07:58 +01:00
browser_render ( filebrowser ) ;
2012-12-17 01:30:38 +01:00
2013-01-11 03:58:43 +01:00
return 0 ;
2012-01-31 14:34:43 +01:00
}
2013-03-25 20:41:53 +01:00
static int select_directory ( void * data , void * state )
2012-01-31 14:34:43 +01:00
{
2012-12-17 00:32:16 +01:00
menu * current_menu = ( menu * ) data ;
2012-12-17 05:30:28 +01:00
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
2012-12-17 05:30:28 +01:00
uint64_t input = rstate - > input ;
2013-03-18 18:05:15 +01:00
char path [ PATH_MAX ] ;
char msg [ 256 ] ;
2012-08-01 17:22:10 +02:00
bool ret = true ;
2012-01-31 14:34:43 +01:00
2013-01-07 23:29:56 +01:00
filebrowser_t * filebrowser = tmpBrowser ;
2012-08-19 00:29:38 +02:00
rmenu_default_positions_t default_pos ;
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-08-01 16:47:37 +02:00
2013-03-13 02:52:41 +01:00
bool is_dir = filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_PATH_ISDIR ) ;
2012-12-17 01:30:38 +01:00
browser_update ( filebrowser , input , " empty " ) ;
2012-02-22 19:49:22 +01:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_Y ) )
2012-07-31 05:04:47 +02:00
{
if ( is_dir )
2012-04-14 04:38:40 +02:00
{
2013-03-18 03:49:54 +01:00
strlcpy ( path , filebrowser_get_current_path ( filebrowser ) , sizeof ( path ) ) ;
2012-11-19 04:09:16 +01:00
2012-08-02 17:09:41 +02:00
switch ( current_menu - > enum_id )
{
2012-04-14 04:38:40 +02:00
case PATH_SAVESTATES_DIR_CHOICE :
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_savestate_dir , path , sizeof ( g_extern . console . main_wrap . default_savestate_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case PATH_SRAM_DIR_CHOICE :
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_sram_dir , path , sizeof ( g_extern . console . main_wrap . default_sram_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_rom_startup_dir , path , sizeof ( g_extern . console . main_wrap . default_rom_startup_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-08-02 17:09:41 +02:00
case PATH_CHEATS_DIR_CHOICE :
strlcpy ( g_settings . cheat_database , path , sizeof ( g_settings . cheat_database ) ) ;
break ;
2012-08-04 07:24:15 +02:00
# endif
2012-08-05 17:53:01 +02:00
case PATH_SYSTEM_DIR_CHOICE :
strlcpy ( g_settings . system_directory , path , sizeof ( g_settings . system_directory ) ) ;
break ;
2012-08-02 17:09:41 +02:00
}
2012-08-20 18:17:08 +02:00
menu_stack_pop ( ) ;
2012-04-14 04:38:40 +02:00
}
2012-07-31 05:04:47 +02:00
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_X ) )
2012-07-31 05:04:47 +02:00
{
strlcpy ( path , default_paths . port_dir , sizeof ( path ) ) ;
switch ( current_menu - > enum_id )
2012-04-14 04:38:40 +02:00
{
2012-07-31 05:04:47 +02:00
case PATH_SAVESTATES_DIR_CHOICE :
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_savestate_dir , path , sizeof ( g_extern . console . main_wrap . default_savestate_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case PATH_SRAM_DIR_CHOICE :
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_sram_dir , path , sizeof ( g_extern . console . main_wrap . default_sram_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_rom_startup_dir , path , sizeof ( g_extern . console . main_wrap . default_rom_startup_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-08-02 17:09:41 +02:00
case PATH_CHEATS_DIR_CHOICE :
strlcpy ( g_settings . cheat_database , path , sizeof ( g_settings . cheat_database ) ) ;
break ;
2012-08-04 07:24:15 +02:00
# endif
2012-08-05 17:53:01 +02:00
case PATH_SYSTEM_DIR_CHOICE :
strlcpy ( g_settings . system_directory , path , sizeof ( g_settings . system_directory ) ) ;
break ;
2012-04-14 04:38:40 +02:00
}
2012-07-31 05:04:47 +02:00
2012-08-20 18:17:08 +02:00
menu_stack_pop ( ) ;
2012-07-31 05:04:47 +02:00
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-07-31 05:04:47 +02:00
{
if ( is_dir )
2012-12-17 01:30:38 +01:00
ret = filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_OK ) ;
2012-04-14 04:38:40 +02:00
}
2012-08-01 17:22:10 +02:00
if ( ! ret )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " ERROR - Failed to open directory. " , 1 , 180 ) ;
2012-08-01 17:22:10 +02:00
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-06-29 15:43:09 +02:00
2013-03-18 18:05:15 +01:00
struct platform_bind key_label_b = { 0 } ;
struct platform_bind key_label_x = { 0 } ;
struct platform_bind key_label_y = { 0 } ;
struct platform_bind key_label_start = { 0 } ;
2013-03-14 21:55:10 +01:00
strlcpy ( key_label_b . desc , " Unknown " , sizeof ( key_label_b . desc ) ) ;
key_label_b . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_B ;
strlcpy ( key_label_x . desc , " Unknown " , sizeof ( key_label_x . desc ) ) ;
key_label_x . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_X ;
strlcpy ( key_label_y . desc , " Unknown " , sizeof ( key_label_y . desc ) ) ;
key_label_y . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_Y ;
strlcpy ( key_label_start . desc , " Unknown " , sizeof ( key_label_start . desc ) ) ;
key_label_start . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_START ;
if ( driver . input - > set_keybinds )
{
driver . input - > set_keybinds ( & key_label_x , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_y , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_b , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_start , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
}
snprintf ( msg , sizeof ( msg ) , " [%s] - Enter dir | [%s] - Go back " , key_label_b . desc , key_label_x . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . comment_two_y_position ;
font_parms . scale = default_pos . font_size ;
font_parms . color = YELLOW ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-08-02 15:52:31 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] - Reset to startdir " , key_label_start . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . comment_two_y_position + ( default_pos . y_position_increment * 1 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-08-02 15:52:31 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " INFO - Browse to a directory and assign it as the path by \n pressing [%s]. " , key_label_y . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . comment_y_position ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-12-17 00:32:16 +01:00
2013-03-25 03:07:58 +01:00
browser_render ( filebrowser ) ;
2012-12-17 01:30:38 +01:00
2013-01-11 03:58:43 +01:00
return 0 ;
2012-01-31 14:34:43 +01:00
}
2013-03-14 15:01:36 +01:00
static void set_keybind_digital ( unsigned default_retro_joypad_id , uint64_t input )
2012-02-29 09:15:59 +01:00
{
2013-03-14 15:01:36 +01:00
if ( ! driver . input - > set_keybinds )
return ;
2013-03-14 02:24:57 +01:00
unsigned keybind_action = KEYBINDS_ACTION_NONE ;
2012-04-11 02:42:27 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2013-03-14 15:01:36 +01:00
keybind_action = ( 1ULL < < KEYBINDS_ACTION_DECREMENT_BIND ) ;
2012-04-11 02:42:27 +02:00
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2013-03-14 15:01:36 +01:00
keybind_action = ( 1ULL < < KEYBINDS_ACTION_INCREMENT_BIND ) ;
2012-04-11 02:42:27 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-03-14 15:01:36 +01:00
keybind_action = ( 1ULL < < KEYBINDS_ACTION_SET_DEFAULT_BIND ) ;
2012-04-13 04:31:18 +02:00
2013-03-14 15:01:36 +01:00
if ( keybind_action )
driver . input - > set_keybinds ( driver . input_data , NULL , currently_selected_controller_menu ,
default_retro_joypad_id , keybind_action ) ;
2012-02-29 09:15:59 +01:00
}
2012-12-17 06:44:28 +01:00
# if defined(HAVE_OSKUTIL)
2012-08-03 03:24:36 +02:00
# ifdef __CELLOS_LV2__
2012-03-01 14:22:16 +01:00
2012-12-17 06:44:28 +01:00
static bool osk_callback_enter_rsound ( void * data )
{
2013-01-17 10:40:35 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_OSK_ENTRY_SUCCESS ) )
2012-04-14 04:38:40 +02:00
{
2013-01-17 10:40:35 +01:00
RARCH_LOG ( " OSK - Applying input data. \n " ) ;
char tmp_str [ 256 ] ;
int num = wcstombs ( tmp_str , g_extern . console . misc . oskutil_handle . text_buf , sizeof ( tmp_str ) ) ;
tmp_str [ num ] = 0 ;
2013-03-18 03:49:54 +01:00
strlcpy ( g_settings . audio . device , tmp_str , sizeof ( g_settings . audio . device ) ) ;
2013-01-17 10:40:35 +01:00
goto do_exit ;
2012-04-14 04:38:40 +02:00
}
2013-01-17 10:40:35 +01:00
else if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_OSK_ENTRY_FAIL ) )
goto do_exit ;
2012-12-17 06:44:28 +01:00
return false ;
2013-01-17 10:40:35 +01:00
do_exit :
g_extern . lifecycle_mode_state & = ~ ( ( 1ULL < < MODE_OSK_DRAW ) | ( 1ULL < < MODE_OSK_ENTRY_SUCCESS ) |
( 1ULL < < MODE_OSK_ENTRY_FAIL ) ) ;
return true ;
2012-12-17 06:44:28 +01:00
}
static bool osk_callback_enter_rsound_init ( void * data )
{
oskutil_write_initial_message ( & g_extern . console . misc . oskutil_handle , L " 192.168.1.1 " ) ;
oskutil_write_message ( & g_extern . console . misc . oskutil_handle , L " Enter IP address for the RSound Server. " ) ;
oskutil_start ( & g_extern . console . misc . oskutil_handle ) ;
return true ;
}
static bool osk_callback_enter_filename ( void * data )
{
2013-01-17 10:40:35 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_OSK_ENTRY_SUCCESS ) )
2012-04-14 04:38:40 +02:00
{
2013-01-17 10:40:35 +01:00
RARCH_LOG ( " OSK - Applying input data. \n " ) ;
char tmp_str [ 256 ] ;
char filepath [ PATH_MAX ] ;
int num = wcstombs ( tmp_str , g_extern . console . misc . oskutil_handle . text_buf , sizeof ( tmp_str ) ) ;
tmp_str [ num ] = 0 ;
switch ( rmenu_state . osk_param )
2012-04-14 04:38:40 +02:00
{
case CONFIG_FILE :
break ;
2012-08-02 17:09:41 +02:00
case SHADER_PRESET_FILE :
2013-01-17 10:40:35 +01:00
snprintf ( filepath , sizeof ( filepath ) , " %s/%s.cgp " , default_paths . cgp_dir , tmp_str ) ;
RARCH_LOG ( " [osk_callback_enter_filename]: filepath is: %s. \n " , filepath ) ;
struct gl_cg_cgp_info current_settings ;
2013-02-11 08:57:40 +01:00
memset ( & current_settings , 0 , sizeof ( current_settings ) ) ;
2013-01-17 10:40:35 +01:00
current_settings . shader [ 0 ] = g_settings . video . cg_shader_path ;
current_settings . shader [ 1 ] = g_settings . video . second_pass_shader ;
current_settings . filter_linear [ 0 ] = g_settings . video . smooth ;
current_settings . filter_linear [ 1 ] = g_settings . video . second_pass_smooth ;
current_settings . render_to_texture = true ;
current_settings . fbo_scale = g_settings . video . fbo . scale_x ; //fbo.scale_x and y are the same anyway
gl_cg_save_cgp ( filepath , & current_settings ) ;
2012-08-02 17:09:41 +02:00
break ;
case INPUT_PRESET_FILE :
2013-01-17 10:40:35 +01:00
snprintf ( filepath , sizeof ( filepath ) , " %s/%s.cfg " , default_paths . input_presets_dir , tmp_str ) ;
RARCH_LOG ( " [osk_callback_enter_filename]: filepath is: %s. \n " , filepath ) ;
config_save_keybinds ( filepath ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-14 04:38:40 +02:00
}
2012-03-01 14:22:16 +01:00
2013-01-17 10:40:35 +01:00
goto do_exit ;
2012-04-14 04:38:40 +02:00
}
2013-01-17 10:40:35 +01:00
else if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_OSK_ENTRY_FAIL ) )
goto do_exit ;
2012-03-01 14:22:16 +01:00
2012-12-17 06:44:28 +01:00
return false ;
2013-01-17 10:40:35 +01:00
do_exit :
g_extern . lifecycle_mode_state & = ~ ( ( 1ULL < < MODE_OSK_DRAW ) | ( 1ULL < < MODE_OSK_ENTRY_SUCCESS ) |
( 1ULL < < MODE_OSK_ENTRY_FAIL ) ) ;
return true ;
2012-12-17 06:44:28 +01:00
}
2012-03-01 14:22:16 +01:00
2012-12-17 06:44:28 +01:00
static bool osk_callback_enter_filename_init ( void * data )
{
oskutil_write_initial_message ( & g_extern . console . misc . oskutil_handle , L " example " ) ;
2013-01-17 10:40:35 +01:00
oskutil_write_message ( & g_extern . console . misc . oskutil_handle , L " Enter filename for preset " ) ;
2012-12-17 06:44:28 +01:00
oskutil_start ( & g_extern . console . misc . oskutil_handle ) ;
return true ;
2012-03-01 14:22:16 +01:00
}
2012-12-17 06:44:28 +01:00
# endif
2012-08-03 03:24:36 +02:00
# endif
2012-07-31 16:06:34 +02:00
2013-01-11 03:58:43 +01:00
static int set_setting_action ( void * data , unsigned switchvalue , uint64_t input )
2012-01-16 04:07:02 +01:00
{
2012-12-17 00:32:16 +01:00
( void ) data ;
2012-11-19 04:09:16 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2013-01-07 23:29:56 +01:00
filebrowser_t * filebrowser = tmpBrowser ;
2013-02-17 22:02:42 +01:00
2012-07-30 17:19:05 +02:00
switch ( switchvalue )
{
2012-08-03 03:24:36 +02:00
# ifdef __CELLOS_LV2__
2012-11-19 04:09:16 +01:00
case SETTING_CHANGE_RESOLUTION :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_RESOLUTION_NEXT ) ;
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_RESOLUTION_PREVIOUS ) ;
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
{
if ( g_extern . console . screen . resolutions . list [ g_extern . console . screen . resolutions . current . idx ] = = CELL_VIDEO_OUT_RESOLUTION_576 )
{
if ( gfx_ctx_check_resolution ( CELL_VIDEO_OUT_RESOLUTION_576 ) )
2013-01-17 12:17:02 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_VIDEO_PAL_ENABLE ) ;
2012-11-19 04:09:16 +01:00
}
else
{
2013-01-17 12:17:02 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_PAL_ENABLE ) ;
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_PAL_TEMPORAL_ENABLE ) ;
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_PAL_VSYNC_BLOCK ) ;
2012-11-19 04:09:16 +01:00
}
2013-01-17 12:17:02 +01:00
driver . video - > restart ( ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2013-01-17 12:17:02 +01:00
case SETTING_PAL60_MODE :
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_PAL_ENABLE ) )
2012-11-19 04:09:16 +01:00
{
2013-01-17 12:17:02 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_PAL_TEMPORAL_ENABLE ) )
{
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_PAL_TEMPORAL_ENABLE ) ;
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_PAL_VSYNC_BLOCK ) ;
}
else
{
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_VIDEO_PAL_TEMPORAL_ENABLE ) ;
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_VIDEO_PAL_VSYNC_BLOCK ) ;
}
driver . video - > restart ( ) ;
2012-11-19 04:09:16 +01:00
}
2013-01-17 12:17:02 +01:00
}
2012-11-19 04:09:16 +01:00
2013-01-17 12:17:02 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_PAL_ENABLE ) )
{
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_PAL_TEMPORAL_ENABLE ) ;
2013-02-17 22:02:42 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_PAL_VSYNC_BLOCK ) ;
2013-01-17 12:17:02 +01:00
driver . video - > restart ( ) ;
2012-11-19 04:09:16 +01:00
}
2013-01-17 12:17:02 +01:00
}
break ;
2012-08-03 03:24:36 +02:00
# endif
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-11-19 04:09:16 +01:00
case SETTING_SHADER_PRESETS :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-01-05 23:49:58 +01:00
if ( g_extern . main_is_init )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( PRESET_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , EXT_CGP_PRESETS , default_paths . cgp_dir ) ;
2012-11-19 04:09:16 +01:00
}
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
strlcpy ( g_extern . file_state . cgp_path , " " , sizeof ( g_extern . file_state . cgp_path ) ) ;
break ;
case SETTING_SHADER :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( SHADER_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , EXT_SHADERS , default_paths . shader_dir ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_FIRST_SHADER ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
strlcpy ( g_settings . video . cg_shader_path , default_paths . shader_file , sizeof ( g_settings . video . cg_shader_path ) ) ;
2013-01-07 17:22:51 +01:00
if ( g_settings . video . shader_type ! = RARCH_SHADER_NONE )
2013-01-07 16:46:26 +01:00
{
2013-01-08 04:07:30 +01:00
driver . video - > set_shader ( driver . video_data , ( enum rarch_shader_type ) g_settings . video . shader_type , NULL , RARCH_SHADER_INDEX_PASS0 ) ;
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - Shader successfully loaded. " , 1 , 180 ) ;
2013-01-07 16:46:26 +01:00
}
else
RARCH_ERR ( " Shaders are unsupported on this platform. \n " ) ;
2012-11-19 04:09:16 +01:00
}
break ;
case SETTING_SHADER_2 :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( SHADER_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , EXT_SHADERS , default_paths . shader_dir ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_SECOND_SHADER ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
strlcpy ( g_settings . video . second_pass_shader , default_paths . shader_file , sizeof ( g_settings . video . second_pass_shader ) ) ;
2013-01-07 17:22:51 +01:00
if ( g_settings . video . shader_type ! = RARCH_SHADER_NONE )
2013-01-07 16:46:26 +01:00
{
2013-01-08 04:07:30 +01:00
driver . video - > set_shader ( driver . video_data , ( enum rarch_shader_type ) g_settings . video . shader_type , NULL , RARCH_SHADER_INDEX_PASS1 ) ;
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - Shader successfully loaded. " , 1 , 180 ) ;
2013-01-07 16:46:26 +01:00
}
else
RARCH_ERR ( " Shaders are unsupported on this platform. \n " ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2013-02-01 07:42:36 +01:00
case SETTING_EMU_SKIN :
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
{
menu_stack_push ( BORDER_CHOICE ) ;
filebrowser_set_root_and_ext ( filebrowser , EXT_IMAGES , default_paths . border_dir ) ;
}
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
{
if ( ! texture_image_load ( default_paths . menu_border_file , & g_extern . console . menu_texture ) )
{
RARCH_ERR ( " Failed to load texture image for menu. \n " ) ;
return false ;
}
}
break ;
2012-08-03 03:24:36 +02:00
# endif
2013-02-17 22:01:08 +01:00
case SETTING_EMU_LOW_RAM_MODE_ENABLE :
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
{
if ( ! ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING ) ) )
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE ) ;
else
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING ) ;
2013-02-17 22:02:42 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - You need to restart RetroArch. " , 1 , 180 ) ;
2013-02-17 22:01:08 +01:00
}
}
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
{
if ( ! ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE ) ) )
{
2013-02-17 22:02:42 +01:00
if ( ! ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING ) ) )
{
2013-02-17 22:01:08 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE ) ;
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE_PENDING ) ;
2013-02-17 22:02:42 +01:00
2013-02-17 22:01:08 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - You need to restart RetroArch. " , 1 , 180 ) ;
2013-02-17 22:02:42 +01:00
}
2013-02-17 22:01:08 +01:00
}
}
break ;
2012-11-19 04:09:16 +01:00
case SETTING_FONT_SIZE :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
2013-01-11 21:04:51 +01:00
if ( g_settings . video . font_size > 0 )
g_settings . video . font_size - = 0.01f ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-01-11 21:04:51 +01:00
if ( ( g_settings . video . font_size < 2.0f ) )
g_settings . video . font_size + = 0.01f ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-11 21:04:51 +01:00
g_settings . video . font_size = 1.0f ;
2012-11-19 04:09:16 +01:00
break ;
case SETTING_KEEP_ASPECT_RATIO :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_ASPECT_RATIO_DECREMENT ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_aspect_ratio )
driver . video_poke - > set_aspect_ratio ( driver . video_data , g_settings . video . aspect_ratio_idx ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_ASPECT_RATIO_INCREMENT ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_aspect_ratio )
driver . video_poke - > set_aspect_ratio ( driver . video_data , g_settings . video . aspect_ratio_idx ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_ASPECT_RATIO ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_aspect_ratio )
driver . video_poke - > set_aspect_ratio ( driver . video_data , g_settings . video . aspect_ratio_idx ) ;
2012-11-19 04:09:16 +01:00
}
break ;
case SETTING_HW_TEXTURE_FILTER :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_HW_TEXTURE_FILTER ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_filtering )
driver . video_poke - > set_filtering ( driver . video_data , 1 , g_settings . video . smooth ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_HW_TEXTURE_FILTER ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_filtering )
driver . video_poke - > set_filtering ( driver . video_data , 1 , g_settings . video . smooth ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-08-04 03:11:49 +02:00
# ifdef HAVE_FBO
2012-11-19 04:09:16 +01:00
case SETTING_HW_TEXTURE_FILTER_2 :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_HW_TEXTURE_FILTER_2 ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_filtering )
driver . video_poke - > set_filtering ( driver . video_data , 2 , g_settings . video . second_pass_smooth ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_HW_TEXTURE_FILTER_2 ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_filtering )
driver . video_poke - > set_filtering ( driver . video_data , 2 , g_settings . video . second_pass_smooth ) ;
2012-11-19 04:09:16 +01:00
}
break ;
case SETTING_SCALE_ENABLED :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_SCALE_ENABLED ) ;
2012-11-19 00:01:25 +01:00
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_fbo_state )
{
if ( g_settings . video . render_to_texture )
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_INIT ) ;
else
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_DEINIT ) ;
}
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_SCALE_ENABLED ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_fbo_state )
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_REINIT ) ;
2012-11-19 04:09:16 +01:00
}
break ;
case SETTING_SCALE_FACTOR :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
2012-11-18 21:50:27 +01:00
if ( g_settings . video . render_to_texture )
2012-11-19 04:09:16 +01:00
{
2012-10-15 06:24:39 +02:00
bool should_decrement = g_settings . video . fbo . scale_x > MIN_SCALING_FACTOR ;
2012-11-19 04:09:16 +01:00
2012-08-02 17:09:41 +02:00
if ( should_decrement )
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_SCALE_FACTOR_DECREMENT ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_fbo_state )
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_REINIT ) ;
2012-08-02 17:09:41 +02:00
}
}
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
if ( g_settings . video . render_to_texture )
{
bool should_increment = g_settings . video . fbo . scale_x < MAX_SCALING_FACTOR ;
if ( should_increment )
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_SCALE_FACTOR_INCREMENT ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_fbo_state )
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_REINIT ) ;
2012-11-19 04:09:16 +01:00
}
}
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_SCALE_FACTOR ) ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_fbo_state )
driver . video_poke - > set_fbo_state ( driver . video_data , FBO_REINIT ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-08-07 18:26:52 +02:00
# endif
# ifdef _XBOX1
case SETTING_FLICKER_FILTER :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
2013-01-11 19:44:13 +01:00
if ( g_extern . console . screen . flicker_filter_index > 0 )
g_extern . console . screen . flicker_filter_index - - ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) )
2012-11-19 04:09:16 +01:00
{
2013-01-11 19:44:13 +01:00
if ( g_extern . console . screen . flicker_filter_index < 5 )
g_extern . console . screen . flicker_filter_index + + ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-11 19:44:13 +01:00
g_extern . console . screen . flicker_filter_index = 0 ;
2012-08-07 18:26:52 +02:00
break ;
case SETTING_SOFT_DISPLAY_FILTER :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2013-01-11 19:44:13 +01:00
{
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_SOFT_FILTER_ENABLE ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_SOFT_FILTER_ENABLE ) ;
2013-01-11 19:44:13 +01:00
else
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_VIDEO_SOFT_FILTER_ENABLE ) ;
2013-01-11 19:44:13 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_VIDEO_SOFT_FILTER_ENABLE ) ;
2012-08-07 18:26:52 +02:00
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-10-15 06:24:39 +02:00
case SETTING_HW_OVERSCAN_AMOUNT :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_OVERSCAN_DECREMENT ) ;
2013-03-10 20:13:06 +01:00
if ( driver . video_poke - > apply_state_changes )
driver . video_poke - > apply_state_changes ( driver . video_data ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_OVERSCAN_INCREMENT ) ;
2013-03-10 20:13:06 +01:00
if ( driver . video_poke - > apply_state_changes )
driver . video_poke - > apply_state_changes ( driver . video_data ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_OVERSCAN ) ;
2013-03-10 20:13:06 +01:00
if ( driver . video_poke - > apply_state_changes )
driver . video_poke - > apply_state_changes ( driver . video_data ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2013-01-13 05:52:00 +01:00
case SETTING_REFRESH_RATE :
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_REFRESH_RATE_DECREMENT ) ;
2013-01-13 05:52:00 +01:00
driver_set_monitor_refresh_rate ( g_settings . video . refresh_rate ) ;
}
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_REFRESH_RATE_INCREMENT ) ;
2013-01-13 05:52:00 +01:00
driver_set_monitor_refresh_rate ( g_settings . video . refresh_rate ) ;
}
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_REFRESH_RATE ) ;
2013-01-13 05:52:00 +01:00
driver_set_monitor_refresh_rate ( g_settings . video . refresh_rate ) ;
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_THROTTLE_MODE :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-01-17 12:17:02 +01:00
if ( ! ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_PAL_VSYNC_BLOCK ) ) )
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_THROTTLE ) ;
2013-01-17 12:17:02 +01:00
device_ptr - > ctx_driver - > swap_interval ( ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_THROTTLE_ENABLE ) ) ? true : false ) ;
}
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-01-17 12:17:02 +01:00
if ( ! ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_PAL_VSYNC_BLOCK ) ) )
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_THROTTLE ) ;
2013-01-17 12:17:02 +01:00
device_ptr - > ctx_driver - > swap_interval ( ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_THROTTLE_ENABLE ) ) ? true : false ) ;
}
2012-11-19 04:09:16 +01:00
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_TRIPLE_BUFFERING :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_TRIPLE_BUFFERING ) ;
2013-01-07 17:48:45 +01:00
driver . video - > restart ( ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_TRIPLE_BUFFERING ) ;
2012-11-19 04:09:16 +01:00
2013-01-12 03:13:03 +01:00
if ( ! ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_TRIPLE_BUFFERING_ENABLE ) ) )
2013-01-07 17:48:45 +01:00
driver . video - > restart ( ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_ENABLE_SCREENSHOTS :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) ;
2013-01-11 19:44:13 +01:00
else
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) ;
device_ptr - > ctx_driver - > rmenu_screenshot_enable ( ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) ) ? true : false ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) ;
device_ptr - > ctx_driver - > rmenu_screenshot_enable ( ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_VIDEO_SCREENSHOTS_ENABLE ) ) ? true : false ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-08-03 03:24:36 +02:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-10-15 06:24:39 +02:00
case SETTING_SAVE_SHADER_PRESET :
2012-12-17 06:44:28 +01:00
# ifdef HAVE_OSKUTIL
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-12-17 06:44:28 +01:00
{
2013-02-10 22:45:25 +01:00
if ( g_extern . main_is_init )
{
rmenu_state . osk_param = SHADER_PRESET_FILE ;
rmenu_state . osk_init = osk_callback_enter_filename_init ;
rmenu_state . osk_callback = osk_callback_enter_filename ;
}
2012-12-17 06:44:28 +01:00
}
# endif
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP :
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 03:24:36 +02:00
# endif
2012-10-15 06:24:39 +02:00
case SETTING_DEFAULT_VIDEO_ALL :
2013-02-10 22:45:25 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
{
2013-02-13 20:00:24 +01:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2013-02-10 22:45:25 +01:00
set_setting_action ( NULL , SETTING_SHADER , 1ULL < < RMENU_DEVICE_NAV_START ) ;
set_setting_action ( NULL , SETTING_SHADER_2 , 1ULL < < RMENU_DEVICE_NAV_START ) ;
2013-02-13 20:00:24 +01:00
# endif
2013-02-10 22:45:25 +01:00
}
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_SOUND_MODE :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
if ( g_extern . console . sound . mode ! = SOUND_MODE_NORMAL )
g_extern . console . sound . mode - - ;
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
if ( g_extern . console . sound . mode < ( SOUND_MODE_LAST - 1 ) )
g_extern . console . sound . mode + + ;
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_UP ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_DOWN ) ) )
2012-11-19 04:09:16 +01:00
{
2012-08-03 18:27:38 +02:00
# ifdef HAVE_RSOUND
2012-11-19 04:09:16 +01:00
if ( g_extern . console . sound . mode ! = SOUND_MODE_RSOUND )
2013-01-17 14:21:49 +01:00
rarch_rsound_stop ( ) ;
2012-11-19 04:09:16 +01:00
else
2013-01-17 14:21:49 +01:00
rarch_rsound_start ( g_settings . audio . device ) ;
2012-08-03 18:27:38 +02:00
# endif
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
g_extern . console . sound . mode = SOUND_MODE_NORMAL ;
2012-08-03 18:27:38 +02:00
# ifdef HAVE_RSOUND
2013-01-17 14:21:49 +01:00
rarch_rsound_stop ( ) ;
2012-08-03 18:27:38 +02:00
# endif
2012-11-19 04:09:16 +01:00
}
break ;
2012-08-03 03:24:36 +02:00
# ifdef HAVE_RSOUND
2012-10-15 06:24:39 +02:00
case SETTING_RSOUND_SERVER_IP_ADDRESS :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2012-12-17 06:44:28 +01:00
# ifdef HAVE_OSKUTIL
rmenu_state . osk_init = osk_callback_enter_rsound_init ;
2013-01-17 10:40:35 +01:00
rmenu_state . osk_callback = osk_callback_enter_rsound ;
2012-12-17 06:44:28 +01:00
# endif
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
strlcpy ( g_settings . audio . device , " 0.0.0.0 " , sizeof ( g_settings . audio . device ) ) ;
break ;
2012-08-03 03:24:36 +02:00
# endif
2012-10-15 06:24:39 +02:00
case SETTING_DEFAULT_AUDIO_ALL :
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_SAVESTATE_DECREMENT ) ;
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_SAVESTATE_INCREMENT ) ;
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_SAVE_STATE ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_EMU_SHOW_DEBUG_INFO_MSG :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_INFO_DEBUG_MSG_TOGGLE ) ;
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_INFO_DEBUG_MSG ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_EMU_SHOW_INFO_MSG :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_INFO_MSG_TOGGLE ) ;
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_INFO_MSG ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_EMU_REWIND_ENABLED :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_REWIND ) ;
2012-11-19 04:09:16 +01:00
2013-03-18 03:49:54 +01:00
if ( g_settings . rewind_enable )
rarch_init_rewind ( ) ;
else
rarch_deinit_rewind ( ) ;
2012-11-19 04:09:16 +01:00
}
2013-03-18 03:49:54 +01:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-03-18 03:49:54 +01:00
{
if ( g_settings . rewind_enable )
{
g_settings . rewind_enable = false ;
rarch_deinit_rewind ( ) ;
}
}
2012-11-19 04:09:16 +01:00
break ;
2013-01-19 08:54:03 +01:00
case SETTING_EMU_REWIND_GRANULARITY :
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
{
if ( g_settings . rewind_granularity > 1 )
g_settings . rewind_granularity - - ;
}
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
g_settings . rewind_granularity + + ;
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
g_settings . rewind_granularity = 1 ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_RARCH_DEFAULT_EMU :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( LIBRETRO_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , EXT_EXECUTABLES , default_paths . core_dir ) ;
2013-01-22 20:50:05 +01:00
set_libretro_core_as_launch = true ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_QUIT_RARCH :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state & = ~ ( ( 1ULL < < MODE_GAME ) ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXIT ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2012-11-19 04:09:16 +01:00
}
break ;
2013-02-08 14:39:32 +01:00
case SETTING_RESAMPLER_TYPE :
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
{
# ifdef HAVE_SINC
if ( strstr ( g_settings . audio . resampler , " hermite " ) )
2013-03-18 03:49:54 +01:00
strlcpy ( g_settings . audio . resampler , " sinc " , sizeof ( g_settings . audio . resampler ) ) ;
2013-02-08 14:39:32 +01:00
else
# endif
2013-03-18 03:49:54 +01:00
strlcpy ( g_settings . audio . resampler , " hermite " , sizeof ( g_settings . audio . resampler ) ) ;
2013-02-08 14:39:32 +01:00
if ( g_extern . main_is_init )
{
2013-02-08 16:43:55 +01:00
if ( ! rarch_resampler_realloc ( & g_extern . audio_data . resampler_data , & g_extern . audio_data . resampler ,
2013-02-16 20:45:13 +01:00
g_settings . audio . resampler , g_extern . audio_data . orig_src_ratio = = 0.0 ? 1.0 : g_extern . audio_data . orig_src_ratio ) )
2013-02-08 14:39:32 +01:00
{
2013-02-08 16:43:55 +01:00
RARCH_ERR ( " Failed to initialize resampler \" %s \" . \n " , g_settings . audio . resampler ) ;
g_extern . audio_active = false ;
2013-02-08 14:39:32 +01:00
}
}
}
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
{
2013-02-08 16:43:55 +01:00
# ifdef HAVE_SINC
2013-03-18 03:49:54 +01:00
strlcpy ( g_settings . audio . resampler , " sinc " , sizeof ( g_settings . audio . resampler ) ) ;
2013-02-08 16:43:55 +01:00
# else
2013-03-18 03:49:54 +01:00
strlcpy ( g_settings . audio . resampler , " hermite " , sizeof ( g_settings . audio . resampler ) ) ;
2013-02-08 16:43:55 +01:00
# endif
2013-02-17 22:02:42 +01:00
2013-02-08 14:39:32 +01:00
if ( g_extern . main_is_init )
{
2013-02-08 16:43:55 +01:00
if ( ! rarch_resampler_realloc ( & g_extern . audio_data . resampler_data , & g_extern . audio_data . resampler ,
2013-02-16 20:45:13 +01:00
g_settings . audio . resampler , g_extern . audio_data . orig_src_ratio = = 0.0 ? 1.0 : g_extern . audio_data . orig_src_ratio ) )
2013-02-08 14:39:32 +01:00
{
2013-02-08 16:43:55 +01:00
RARCH_ERR ( " Failed to initialize resampler \" %s \" . \n " , g_settings . audio . resampler ) ;
g_extern . audio_active = false ;
2013-02-08 14:39:32 +01:00
}
}
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_EMU_AUDIO_MUTE :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_AUDIO_MUTE ) ;
2012-07-17 01:06:13 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_AUDIO_MUTE ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-22 16:59:12 +02:00
# ifdef _XBOX1
case SETTING_EMU_AUDIO_SOUND_VOLUME_LEVEL :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
g_extern . console . sound . volume_level = ! g_extern . console . sound . volume_level ;
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - You need to restart RetroArch. " , 1 , 180 ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
g_extern . console . sound . volume_level = 0 ;
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " INFO - You need to restart RetroArch. " , 1 , 180 ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-08-22 16:59:12 +02:00
# endif
2012-10-15 06:24:39 +02:00
case SETTING_ENABLE_CUSTOM_BGM :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2012-03-03 17:23:00 +01:00
# if(CELL_SDK_VERSION > 0x340000)
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_AUDIO_CUSTOM_BGM_ENABLE ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_AUDIO_CUSTOM_BGM_ENABLE ) ;
2013-01-11 19:44:13 +01:00
else
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_AUDIO_CUSTOM_BGM_ENABLE ) ;
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_AUDIO_CUSTOM_BGM_ENABLE ) )
2012-11-19 04:09:16 +01:00
cellSysutilEnableBgmPlayback ( ) ;
else
cellSysutilDisableBgmPlayback ( ) ;
2012-03-03 17:23:00 +01:00
# endif
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2012-03-03 17:23:00 +01:00
# if(CELL_SDK_VERSION > 0x340000)
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_AUDIO_CUSTOM_BGM_ENABLE ) ;
2012-03-03 17:23:00 +01:00
# endif
2012-11-19 04:09:16 +01:00
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_EMU_VIDEO_DEFAULT_ALL :
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_EMU_AUDIO_DEFAULT_ALL :
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_PATH_DEFAULT_ROM_DIRECTORY :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( PATH_DEFAULT_ROM_DIR_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_rom_startup_dir , default_paths . filesystem_root_dir , sizeof ( g_extern . console . main_wrap . default_rom_startup_dir ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_PATH_SAVESTATES_DIRECTORY :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( PATH_SAVESTATES_DIR_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-11-19 04:09:16 +01:00
}
2012-01-30 17:18:31 +01:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_savestate_dir , default_paths . savestate_dir , sizeof ( g_extern . console . main_wrap . default_savestate_dir ) ) ;
2012-01-30 17:18:31 +01:00
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_PATH_SRAM_DIRECTORY :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( PATH_SRAM_DIR_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_sram_dir , default_paths . sram_dir , sizeof ( g_extern . console . main_wrap . default_sram_dir ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-10-15 06:24:39 +02:00
case SETTING_PATH_CHEATS :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( PATH_CHEATS_DIR_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
strlcpy ( g_settings . cheat_database , default_paths . port_dir , sizeof ( g_settings . cheat_database ) ) ;
break ;
2012-08-04 07:24:15 +02:00
# endif
2012-10-15 06:24:39 +02:00
case SETTING_PATH_SYSTEM :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( PATH_SYSTEM_DIR_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , " empty " , default_paths . system_dir ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
strlcpy ( g_settings . system_directory , default_paths . system_dir , sizeof ( g_settings . system_directory ) ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_ENABLE_SRAM_PATH :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) )
2013-01-13 04:12:10 +01:00
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_GAME_SRAM_DIR_ENABLE ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_LOAD_GAME_SRAM_DIR_ENABLE ) ;
else
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_GAME_SRAM_DIR_ENABLE ) ;
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-13 04:12:10 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_GAME_SRAM_DIR_ENABLE ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_ENABLE_STATE_PATH :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) )
2013-01-13 04:12:10 +01:00
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_GAME_STATE_DIR_ENABLE ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_LOAD_GAME_STATE_DIR_ENABLE ) ;
else
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_GAME_STATE_DIR_ENABLE ) ;
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-01-13 04:12:10 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_GAME_STATE_DIR_ENABLE ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_PATH_DEFAULT_ALL :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) ) )
2012-11-19 04:09:16 +01:00
{
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_rom_startup_dir , " / " , sizeof ( g_extern . console . main_wrap . default_rom_startup_dir ) ) ;
strlcpy ( g_extern . console . main_wrap . default_savestate_dir , default_paths . port_dir , sizeof ( g_extern . console . main_wrap . default_savestate_dir ) ) ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-11-19 04:09:16 +01:00
strlcpy ( g_settings . cheat_database , default_paths . port_dir , sizeof ( g_settings . cheat_database ) ) ;
2012-08-04 07:24:15 +02:00
# endif
2013-01-13 04:12:10 +01:00
strlcpy ( g_extern . console . main_wrap . default_sram_dir , " " , sizeof ( g_extern . console . main_wrap . default_sram_dir ) ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_SCHEME :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( INPUT_PRESET_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , EXT_INPUT_PRESETS , default_paths . input_presets_dir ) ;
2012-11-19 04:09:16 +01:00
}
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_NUMBER :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
if ( currently_selected_controller_menu ! = 0 )
currently_selected_controller_menu - - ;
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
if ( currently_selected_controller_menu < 6 )
currently_selected_controller_menu + + ;
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
currently_selected_controller_menu = 0 ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_DPAD_EMULATION :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
2013-03-14 02:24:57 +01:00
if ( driver . input - > set_keybinds )
2012-11-19 04:09:16 +01:00
{
2013-03-14 02:24:57 +01:00
unsigned keybind_action = 0 ;
switch ( g_settings . input . dpad_emulation [ currently_selected_controller_menu ] )
{
case ANALOG_DPAD_NONE :
break ;
case ANALOG_DPAD_LSTICK :
keybind_action = ( 1ULL < < KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE ) ;
break ;
case ANALOG_DPAD_RSTICK :
keybind_action = ( 1ULL < < KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK ) ;
break ;
default :
break ;
}
if ( keybind_action )
driver . input - > set_keybinds ( driver . input_data , g_settings . input . device [ currently_selected_controller_menu ] , currently_selected_controller_menu , 0 , keybind_action ) ;
2012-11-19 04:09:16 +01:00
}
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-14 02:24:57 +01:00
if ( driver . input - > set_keybinds )
2012-11-19 04:09:16 +01:00
{
2013-03-14 02:24:57 +01:00
unsigned keybind_action = 0 ;
switch ( g_settings . input . dpad_emulation [ currently_selected_controller_menu ] )
{
case ANALOG_DPAD_NONE :
keybind_action = ( 1ULL < < KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK ) ;
break ;
case ANALOG_DPAD_LSTICK :
keybind_action = ( 1ULL < < KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK ) ;
break ;
case ANALOG_DPAD_RSTICK :
break ;
}
if ( keybind_action )
driver . input - > set_keybinds ( driver . input_data , g_settings . input . device [ currently_selected_controller_menu ] , currently_selected_controller_menu , 0 , keybind_action ) ;
2012-11-19 04:09:16 +01:00
}
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2013-03-14 02:24:57 +01:00
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( driver . input_data , g_settings . input . device [ currently_selected_controller_menu ] , currently_selected_controller_menu , 0 , ( 1ULL < < KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_UP , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_DOWN , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_LEFT , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_RIGHT , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_A , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_B , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_X , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_Y , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_SELECT , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_START , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_L , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_R , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L2 :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_L2 , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R2 :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_R2 , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L3 :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_L3 , input ) ;
break ;
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R3 :
2012-11-19 04:09:16 +01:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_R3 , input ) ;
break ;
2012-12-17 06:44:28 +01:00
# ifdef HAVE_OSKUTIL
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) ) )
2012-12-17 06:44:28 +01:00
{
rmenu_state_t * rstate = ( rmenu_state_t * ) & rmenu_state ;
rstate - > osk_param = INPUT_PRESET_FILE ;
rstate - > osk_init = osk_callback_enter_filename_init ;
2013-01-17 10:40:35 +01:00
rstate - > osk_callback = osk_callback_enter_filename ;
2012-12-17 06:44:28 +01:00
}
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-10-15 06:24:39 +02:00
case SETTING_CONTROLS_DEFAULT_ALL :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) ) )
2013-03-14 02:24:57 +01:00
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( driver . input_data , g_settings . input . device [ currently_selected_controller_menu ] , currently_selected_controller_menu , 0 ,
( 1ULL < < KEYBINDS_ACTION_SET_DEFAULT_BINDS ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-07-30 17:19:05 +02:00
}
2013-01-11 03:58:43 +01:00
return 0 ;
2012-01-16 04:07:02 +01:00
}
2012-01-10 23:33:44 +01:00
2012-12-17 05:30:28 +01:00
static int select_setting ( void * data , void * state )
2012-06-19 03:44:17 +02:00
{
2013-03-25 18:36:15 +01:00
static uint8_t first_setting = FIRST_VIDEO_SETTING ;
static uint8_t selected = 0 ;
static uint8_t page_number = 0 ;
uint8_t max_settings = 0 ;
2013-03-25 17:47:24 +01:00
2012-12-17 00:32:16 +01:00
menu * current_menu = ( menu * ) data ;
2012-12-17 05:30:28 +01:00
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
2012-12-17 05:30:28 +01:00
uint64_t input = rstate - > input ;
2013-01-11 03:58:43 +01:00
int ret = 0 ;
2012-12-17 05:30:28 +01:00
2012-11-19 04:09:16 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2013-03-25 17:47:24 +01:00
switch ( current_menu - > enum_id )
{
case GENERAL_VIDEO_MENU :
first_setting = FIRST_VIDEO_SETTING ;
max_settings = MAX_NO_OF_VIDEO_SETTINGS ;
break ;
case GENERAL_AUDIO_MENU :
first_setting = FIRST_AUDIO_SETTING ;
max_settings = MAX_NO_OF_AUDIO_SETTINGS ;
break ;
case EMU_GENERAL_MENU :
first_setting = FIRST_EMU_SETTING ;
max_settings = MAX_NO_OF_EMU_SETTINGS ;
break ;
case EMU_VIDEO_MENU :
first_setting = FIRST_EMU_VIDEO_SETTING ;
max_settings = MAX_NO_OF_EMU_VIDEO_SETTINGS ;
break ;
case EMU_AUDIO_MENU :
first_setting = FIRST_EMU_AUDIO_SETTING ;
max_settings = MAX_NO_OF_EMU_AUDIO_SETTINGS ;
break ;
case PATH_MENU :
first_setting = FIRST_PATH_SETTING ;
max_settings = MAX_NO_OF_PATH_SETTINGS ;
break ;
case CONTROLS_MENU :
first_setting = FIRST_CONTROLS_SETTING_PAGE_1 ;
max_settings = MAX_NO_OF_CONTROLS_SETTINGS ;
break ;
}
item * items = ( item * ) malloc ( max_settings * sizeof ( * items ) ) ;
2012-08-19 00:29:38 +02:00
rmenu_default_positions_t default_pos ;
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-08-01 16:47:37 +02:00
2013-03-25 18:36:15 +01:00
char msg [ 256 ] ;
uint8_t i = 0 ;
uint8_t j = 0 ;
uint8_t item_page = 0 ;
2013-03-25 17:47:24 +01:00
for ( i = first_setting ; i < max_settings ; i + + )
2012-08-19 18:03:50 +02:00
{
2012-12-17 01:02:45 +01:00
populate_setting_item ( & items [ i ] , i ) ;
2012-08-19 18:03:50 +02:00
2012-08-20 18:44:24 +02:00
if ( ! ( j < default_pos . entries_per_page ) )
2012-08-19 18:03:50 +02:00
{
2012-08-20 18:44:24 +02:00
j = 0 ;
2013-03-25 18:36:15 +01:00
item_page + + ;
2012-08-19 18:03:50 +02:00
}
2012-08-20 18:44:24 +02:00
2013-03-25 18:36:15 +01:00
items [ i ] . page = item_page ;
2012-08-20 18:44:24 +02:00
j + + ;
2012-08-19 18:03:50 +02:00
}
2012-06-28 21:03:14 +02:00
/* back to ROM menu if CIRCLE is pressed */
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_L1 ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_A ) ) )
2013-03-25 17:47:24 +01:00
{
switch ( current_menu - > enum_id )
{
case GENERAL_VIDEO_MENU :
break ;
case GENERAL_AUDIO_MENU :
selected = FIRST_VIDEO_SETTING ;
break ;
case EMU_GENERAL_MENU :
selected = FIRST_AUDIO_SETTING ;
break ;
case EMU_VIDEO_MENU :
selected = FIRST_EMU_SETTING ;
break ;
case EMU_AUDIO_MENU :
selected = FIRST_EMU_VIDEO_SETTING ;
break ;
case PATH_MENU :
selected = FIRST_EMU_AUDIO_SETTING ;
break ;
case CONTROLS_MENU :
selected = FIRST_PATH_SETTING ;
break ;
default :
break ;
}
2012-12-17 01:02:45 +01:00
menu_stack_pop ( ) ;
2013-03-25 17:47:24 +01:00
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_R1 ) )
2012-12-17 01:02:45 +01:00
{
switch ( current_menu - > enum_id )
{
case GENERAL_VIDEO_MENU :
2013-03-25 17:47:24 +01:00
if ( current_menu - > enum_id = = GENERAL_VIDEO_MENU )
selected = FIRST_AUDIO_SETTING ;
2012-12-17 01:02:45 +01:00
case GENERAL_AUDIO_MENU :
2013-03-25 17:47:24 +01:00
if ( current_menu - > enum_id = = GENERAL_AUDIO_MENU )
selected = FIRST_EMU_SETTING ;
2012-12-17 01:02:45 +01:00
case EMU_GENERAL_MENU :
2013-03-25 17:47:24 +01:00
if ( current_menu - > enum_id = = EMU_GENERAL_MENU )
selected = FIRST_EMU_VIDEO_SETTING ;
2012-12-17 01:02:45 +01:00
case EMU_VIDEO_MENU :
2013-03-25 17:47:24 +01:00
if ( current_menu - > enum_id = = EMU_VIDEO_MENU )
selected = FIRST_EMU_AUDIO_SETTING ;
2012-12-17 01:02:45 +01:00
case EMU_AUDIO_MENU :
2013-03-25 17:47:24 +01:00
if ( current_menu - > enum_id = = EMU_AUDIO_MENU )
selected = FIRST_PATH_SETTING ;
2012-12-17 01:02:45 +01:00
case PATH_MENU :
2013-03-25 17:47:24 +01:00
if ( current_menu - > enum_id = = PATH_MENU )
selected = FIRST_CONTROLS_SETTING_PAGE_1 ;
2012-12-17 01:02:45 +01:00
menu_stack_push ( current_menu - > enum_id + 1 ) ;
break ;
case CONTROLS_MENU :
default :
break ;
}
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_DOWN ) )
2012-12-17 01:02:45 +01:00
{
2013-03-25 17:47:24 +01:00
selected + + ;
2012-12-17 01:02:45 +01:00
2013-03-25 17:47:24 +01:00
if ( selected > = max_settings )
selected = first_setting ;
2013-03-25 18:36:15 +01:00
if ( items [ selected ] . page ! = page_number )
page_number = items [ selected ] . page ;
2012-12-17 01:02:45 +01:00
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_UP ) )
2012-12-17 01:02:45 +01:00
{
2013-03-25 17:47:24 +01:00
if ( selected = = first_setting )
selected = max_settings - 1 ;
2012-12-17 01:02:45 +01:00
else
2013-03-25 17:47:24 +01:00
selected - - ;
2012-06-28 21:03:14 +02:00
2013-03-25 18:36:15 +01:00
if ( items [ selected ] . page ! = page_number )
page_number = items [ selected ] . page ;
2012-12-17 01:02:45 +01:00
}
2012-06-28 21:03:14 +02:00
2013-03-25 17:47:24 +01:00
ret = set_setting_action ( current_menu , selected , input ) ;
2012-01-10 23:33:44 +01:00
2013-01-11 03:58:43 +01:00
if ( ret ! = 0 )
return ret ;
2012-06-29 14:40:50 +02:00
2013-01-11 03:58:43 +01:00
display_menubar ( current_menu ) ;
2012-08-19 18:03:50 +02:00
2013-03-25 17:47:24 +01:00
for ( i = first_setting ; i < max_settings ; i + + )
2012-04-14 04:38:40 +02:00
{
2013-03-25 18:36:15 +01:00
if ( items [ i ] . page = = page_number )
2012-04-14 04:38:40 +02:00
{
2012-08-19 15:57:01 +02:00
default_pos . starting_y_position + = default_pos . y_position_increment ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . starting_y_position ;
font_parms . scale = default_pos . variable_font_size ;
2013-03-25 17:47:24 +01:00
font_parms . color = selected = = items [ i ] . enum_id ? YELLOW : WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , items [ i ] . text , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , items [ i ] . setting_text , & font_parms ) ;
2012-08-18 23:47:33 +02:00
2013-03-25 17:47:24 +01:00
if ( selected = = items [ i ] . enum_id )
2012-08-05 17:18:19 +02:00
{
2012-11-19 04:09:16 +01:00
rarch_position_t position = { 0 } ;
2012-08-19 00:29:38 +02:00
position . x = default_pos . x_position ;
2012-08-19 16:05:00 +02:00
position . y = default_pos . starting_y_position ;
2012-08-18 23:47:33 +02:00
2012-11-19 04:09:16 +01:00
device_ptr - > ctx_driver - > rmenu_draw_panel ( & position ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . comment_y_position ;
font_parms . scale = default_pos . font_size ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , items [ i ] . comment , & font_parms ) ;
2012-08-05 17:18:19 +02:00
}
2012-04-14 04:38:40 +02:00
}
}
2012-01-10 23:33:44 +01:00
2012-08-20 19:04:22 +02:00
free ( items ) ;
2013-03-18 18:05:15 +01:00
struct platform_bind key_label_l3 = { 0 } ;
struct platform_bind key_label_r3 = { 0 } ;
struct platform_bind key_label_start = { 0 } ;
2013-03-14 21:55:10 +01:00
strlcpy ( key_label_l3 . desc , " Unknown " , sizeof ( key_label_l3 . desc ) ) ;
key_label_l3 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_L3 ;
strlcpy ( key_label_r3 . desc , " Unknown " , sizeof ( key_label_r3 . desc ) ) ;
key_label_r3 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_R3 ;
strlcpy ( key_label_start . desc , " Unknown " , sizeof ( key_label_start . desc ) ) ;
key_label_start . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_START ;
if ( driver . input - > set_keybinds )
{
driver . input - > set_keybinds ( & key_label_l3 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_r3 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_start , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
}
snprintf ( msg , sizeof ( msg ) , " [%s] + [%s] - Resume game " , key_label_l3 . desc , key_label_r3 . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . comment_two_y_position ;
font_parms . scale = default_pos . font_size ;
font_parms . color = YELLOW ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] - Reset to default " , key_label_start . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . comment_two_y_position + ( default_pos . y_position_increment * 1 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-12-17 00:32:16 +01:00
2013-01-11 03:58:43 +01:00
return 0 ;
2012-01-10 23:33:44 +01:00
}
2013-03-25 20:41:53 +01:00
static int select_rom ( void * data , void * state )
2012-06-19 03:44:17 +02:00
{
2012-12-17 05:30:28 +01:00
menu * current_menu = ( menu * ) data ;
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
2012-12-17 05:30:28 +01:00
uint64_t input = rstate - > input ;
char msg [ 128 ] ;
rmenu_default_positions_t default_pos ;
2013-01-07 23:29:56 +01:00
filebrowser_t * filebrowser = browser ;
2012-12-17 05:30:28 +01:00
2013-03-18 18:05:15 +01:00
struct platform_bind key_label_b = { 0 } ;
struct platform_bind key_label_l3 = { 0 } ;
struct platform_bind key_label_r3 = { 0 } ;
struct platform_bind key_label_select = { 0 } ;
2013-03-14 21:55:10 +01:00
strlcpy ( key_label_b . desc , " Unknown " , sizeof ( key_label_b . desc ) ) ;
key_label_b . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_B ;
strlcpy ( key_label_l3 . desc , " Unknown " , sizeof ( key_label_l3 . desc ) ) ;
key_label_l3 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_L3 ;
strlcpy ( key_label_r3 . desc , " Unknown " , sizeof ( key_label_r3 . desc ) ) ;
key_label_r3 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_R3 ;
strlcpy ( key_label_select . desc , " Unknown " , sizeof ( key_label_select . desc ) ) ;
key_label_select . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_SELECT ;
if ( driver . input - > set_keybinds )
{
driver . input - > set_keybinds ( & key_label_l3 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_r3 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_select , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_b , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
}
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-12-17 05:30:28 +01:00
2013-01-09 07:07:46 +01:00
browser_update ( filebrowser , input , g_extern . system . valid_extensions ) ;
2012-08-01 17:22:10 +02:00
2012-12-17 01:02:45 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_SELECT ) )
menu_stack_push ( GENERAL_VIDEO_MENU ) ;
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-04-14 05:24:09 +02:00
{
2013-03-13 02:52:41 +01:00
if ( filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_PATH_ISDIR ) )
2012-12-17 01:02:45 +01:00
{
bool ret = filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_OK ) ;
2012-08-01 17:22:10 +02:00
2012-12-17 01:02:45 +01:00
if ( ! ret )
2013-03-23 19:34:38 +01:00
msg_queue_push ( g_extern . msg_queue , " ERROR - Failed to open directory. " , 1 , 180 ) ;
2012-12-17 01:02:45 +01:00
}
else
2013-01-22 01:12:02 +01:00
{
strlcpy ( g_extern . fullpath , filebrowser_get_current_path ( filebrowser ) , sizeof ( g_extern . fullpath ) ) ;
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_GAME ) ;
}
2012-12-17 01:02:45 +01:00
}
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_L1 ) )
{
2013-03-10 15:23:34 +01:00
const char * drive_map = menu_drive_mapping_previous ( ) ;
2012-12-17 01:02:45 +01:00
if ( drive_map ! = NULL )
{
2013-01-09 07:07:46 +01:00
filebrowser_set_root_and_ext ( filebrowser , g_extern . system . valid_extensions , drive_map ) ;
browser_update ( filebrowser , 1ULL < < RMENU_DEVICE_NAV_B , g_extern . system . valid_extensions ) ;
2012-12-17 01:02:45 +01:00
}
}
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_R1 ) )
{
2013-03-10 15:23:34 +01:00
const char * drive_map = menu_drive_mapping_next ( ) ;
2012-12-17 01:02:45 +01:00
if ( drive_map ! = NULL )
{
2013-01-09 07:07:46 +01:00
filebrowser_set_root_and_ext ( filebrowser , g_extern . system . valid_extensions , drive_map ) ;
browser_update ( filebrowser , 1ULL < < RMENU_DEVICE_NAV_B , g_extern . system . valid_extensions ) ;
2012-12-17 01:02:45 +01:00
}
}
2012-08-01 17:22:10 +02:00
2013-03-13 02:52:41 +01:00
if ( filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_PATH_ISDIR ) )
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " INFO - Press [%s] to enter the directory. " , key_label_b . desc ) ;
2012-07-30 01:35:11 +02:00
else
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " INFO - Press [%s] to load the game. " , key_label_b . desc ) ;
2012-08-02 01:59:05 +02:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . comment_y_position ;
font_parms . scale = default_pos . font_size ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-04-14 05:24:09 +02:00
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-04-10 01:00:25 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] + [%s] - resume game " , key_label_l3 . desc , key_label_r3 . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . comment_two_y_position ;
font_parms . color = YELLOW ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-08-20 20:48:21 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] - Settings " , key_label_select . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . comment_two_y_position + ( default_pos . y_position_increment * 1 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-12-17 00:32:16 +01:00
2013-03-25 03:07:58 +01:00
browser_render ( filebrowser ) ;
2012-12-17 01:30:38 +01:00
2013-01-11 03:58:43 +01:00
return 0 ;
2012-01-10 23:33:44 +01:00
}
2013-03-25 20:41:53 +01:00
static int ingame_menu_resize ( void * data , void * state )
2012-06-28 14:10:05 +02:00
{
2012-12-17 00:32:16 +01:00
menu * current_menu = ( menu * ) data ;
2012-12-17 05:30:28 +01:00
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
2012-12-17 05:30:28 +01:00
uint64_t input = rstate - > input ;
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-06-28 14:10:05 +02:00
2012-08-19 01:21:31 +02:00
rmenu_default_positions_t default_pos ;
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-06-28 14:10:05 +02:00
2012-10-15 06:24:39 +02:00
g_settings . video . aspect_ratio_idx = ASPECT_RATIO_CUSTOM ;
2013-03-10 02:58:55 +01:00
if ( driver . video_poke - > set_aspect_ratio )
driver . video_poke - > set_aspect_ratio ( driver . video_data , g_settings . video . aspect_ratio_idx ) ;
2012-06-28 14:10:05 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT_ANALOG_L ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-10-15 06:24:39 +02:00
if ( g_extern . console . screen . viewports . custom_vp . x > = 4 )
2012-08-06 15:15:58 +02:00
# endif
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . x - = 4 ;
2012-08-07 16:26:12 +02:00
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) & & ( input & ~ ( 1ULL < < RMENU_DEVICE_NAV_LEFT_ANALOG_L ) ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-10-15 06:24:39 +02:00
if ( g_extern . console . screen . viewports . custom_vp . x > 0 )
2012-08-06 15:15:58 +02:00
# endif
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . x - = 1 ;
2012-08-07 16:26:12 +02:00
}
2012-08-01 02:56:15 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT_ANALOG_L ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . x + = 4 ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) & & ( input & ~ ( 1ULL < < RMENU_DEVICE_NAV_RIGHT_ANALOG_L ) ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . x + = 1 ;
2012-06-28 14:10:05 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_UP_ANALOG_L ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . y + = 4 ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_UP ) & & ( input & ~ ( 1ULL < < RMENU_DEVICE_NAV_UP_ANALOG_L ) ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . y + = 1 ;
2012-08-01 02:56:15 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_DOWN_ANALOG_L ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-10-15 06:24:39 +02:00
if ( g_extern . console . screen . viewports . custom_vp . y > = 4 )
2012-08-06 15:15:58 +02:00
# endif
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . y - = 4 ;
2012-08-07 16:26:12 +02:00
}
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_DOWN ) & & ( input & ~ ( 1ULL < < RMENU_DEVICE_NAV_DOWN_ANALOG_L ) ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-10-15 06:24:39 +02:00
if ( g_extern . console . screen . viewports . custom_vp . y > 0 )
2012-08-06 15:15:58 +02:00
# endif
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . y - = 1 ;
2012-08-07 16:26:12 +02:00
}
2012-06-28 14:10:05 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT_ANALOG_R ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . width - = 4 ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_L1 ) & & ( input & & ~ ( 1ULL < < RMENU_DEVICE_NAV_LEFT_ANALOG_R ) ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . width - = 1 ;
2012-08-01 02:56:15 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT_ANALOG_R ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . width + = 4 ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_R1 ) & & ( input & ~ ( 1ULL < < RMENU_DEVICE_NAV_RIGHT_ANALOG_R ) ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . width + = 1 ;
2012-06-28 14:10:05 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_UP_ANALOG_R ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . height + = 4 ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_L2 ) & & ( input & ~ ( 1ULL < < RMENU_DEVICE_NAV_UP_ANALOG_R ) ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . height + = 1 ;
2012-08-01 02:56:15 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_DOWN_ANALOG_R ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . height - = 4 ;
2012-12-14 17:42:01 +01:00
else if ( input & ( 1ULL < < RMENU_DEVICE_NAV_R2 ) & & ( input & ~ ( 1ULL < < RMENU_DEVICE_NAV_DOWN_ANALOG_R ) ) )
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . height - = 1 ;
2012-06-28 14:10:05 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_X ) )
2012-06-28 14:10:05 +02:00
{
2012-10-15 06:24:39 +02:00
g_extern . console . screen . viewports . custom_vp . x = 0 ;
g_extern . console . screen . viewports . custom_vp . y = 0 ;
g_extern . console . screen . viewports . custom_vp . width = device_ptr - > win_width ;
g_extern . console . screen . viewports . custom_vp . height = device_ptr - > win_height ;
2012-06-28 14:10:05 +02:00
}
2012-06-28 21:03:14 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_A ) )
2012-08-20 02:30:49 +02:00
{
2012-08-20 18:17:08 +02:00
menu_stack_pop ( ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_DRAW ) ;
2012-08-20 02:30:49 +02:00
}
2012-06-28 14:10:05 +02:00
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_Y ) ) )
2013-01-10 19:43:00 +01:00
{
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_DRAW ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_MENU_DRAW ) ;
2013-01-10 19:43:00 +01:00
else
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_DRAW ) ;
2013-01-10 19:43:00 +01:00
}
2012-08-20 02:30:49 +02:00
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_DRAW ) )
2012-06-28 14:10:05 +02:00
{
2013-03-18 18:05:15 +01:00
char viewport_x [ 32 ] ;
char viewport_y [ 32 ] ;
char viewport_w [ 32 ] ;
char viewport_h [ 32 ] ;
char msg [ 128 ] ;
struct platform_bind key_label_b = { 0 } ;
struct platform_bind key_label_a = { 0 } ;
struct platform_bind key_label_y = { 0 } ;
struct platform_bind key_label_x = { 0 } ;
struct platform_bind key_label_l1 = { 0 } ;
struct platform_bind key_label_l2 = { 0 } ;
struct platform_bind key_label_r1 = { 0 } ;
struct platform_bind key_label_r2 = { 0 } ;
struct platform_bind key_label_select = { 0 } ;
struct platform_bind key_label_dpad_left = { 0 } ;
struct platform_bind key_label_dpad_right = { 0 } ;
struct platform_bind key_label_dpad_up = { 0 } ;
struct platform_bind key_label_dpad_down = { 0 } ;
2013-03-14 21:55:10 +01:00
strlcpy ( key_label_b . desc , " Unknown " , sizeof ( key_label_b . desc ) ) ;
key_label_b . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_B ;
strlcpy ( key_label_a . desc , " Unknown " , sizeof ( key_label_a . desc ) ) ;
key_label_a . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_A ;
strlcpy ( key_label_x . desc , " Unknown " , sizeof ( key_label_x . desc ) ) ;
key_label_x . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_X ;
strlcpy ( key_label_y . desc , " Unknown " , sizeof ( key_label_y . desc ) ) ;
key_label_y . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_Y ;
strlcpy ( key_label_l1 . desc , " Unknown " , sizeof ( key_label_l1 . desc ) ) ;
key_label_l1 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_L ;
strlcpy ( key_label_r1 . desc , " Unknown " , sizeof ( key_label_r1 . desc ) ) ;
key_label_r1 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_R ;
strlcpy ( key_label_l2 . desc , " Unknown " , sizeof ( key_label_l2 . desc ) ) ;
key_label_l2 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_L2 ;
strlcpy ( key_label_r2 . desc , " Unknown " , sizeof ( key_label_r2 . desc ) ) ;
key_label_r2 . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_R2 ;
strlcpy ( key_label_select . desc , " Unknown " , sizeof ( key_label_select . desc ) ) ;
key_label_select . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_SELECT ;
strlcpy ( key_label_dpad_left . desc , " Unknown " , sizeof ( key_label_dpad_left . desc ) ) ;
key_label_dpad_left . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_LEFT ;
strlcpy ( key_label_dpad_right . desc , " Unknown " , sizeof ( key_label_dpad_left . desc ) ) ;
key_label_dpad_right . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_RIGHT ;
strlcpy ( key_label_dpad_up . desc , " Unknown " , sizeof ( key_label_dpad_up . desc ) ) ;
key_label_dpad_up . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_UP ;
strlcpy ( key_label_dpad_down . desc , " Unknown " , sizeof ( key_label_dpad_down . desc ) ) ;
key_label_dpad_down . joykey = 1ULL < < RETRO_DEVICE_ID_JOYPAD_DOWN ;
if ( driver . input - > set_keybinds )
{
driver . input - > set_keybinds ( & key_label_l1 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_r1 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_l2 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_r2 , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_select , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_b , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_a , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_y , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_x , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_dpad_left , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
driver . input - > set_keybinds ( & key_label_dpad_right , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
2013-03-15 02:26:34 +01:00
driver . input - > set_keybinds ( & key_label_dpad_up , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
2013-03-14 21:55:10 +01:00
driver . input - > set_keybinds ( & key_label_dpad_down , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
}
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-06-29 14:40:50 +02:00
2012-10-15 06:24:39 +02:00
snprintf ( viewport_x , sizeof ( viewport_x ) , " Viewport X: #%d " , g_extern . console . screen . viewports . custom_vp . x ) ;
snprintf ( viewport_y , sizeof ( viewport_y ) , " Viewport Y: #%d " , g_extern . console . screen . viewports . custom_vp . y ) ;
snprintf ( viewport_w , sizeof ( viewport_w ) , " Viewport W: #%d " , g_extern . console . screen . viewports . custom_vp . width ) ;
snprintf ( viewport_h , sizeof ( viewport_h ) , " Viewport H: #%d " , g_extern . console . screen . viewports . custom_vp . height ) ;
2012-06-28 14:10:05 +02:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position ;
font_parms . scale = default_pos . font_size ;
font_parms . color = GREEN ;
2012-06-28 14:10:05 +02:00
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , viewport_x , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 1 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , viewport_y , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 2 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , viewport_w , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 3 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , viewport_h , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 4 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " CONTROLS: " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_dpad_left . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 5 ) ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 5 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport X-- " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_dpad_right . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 6 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport X++ " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_dpad_up . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 7 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport Y++ " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_dpad_down . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 8 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport Y-- " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_l1 . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 9 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport W-- " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_r1 . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 10 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport W++ " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_l2 . desc ) ;
2012-06-28 14:10:05 +02:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 11 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport H++ " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_r2 . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 12 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Viewport H-- " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_x . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 13 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Reset To Defaults " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_y . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 14 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " - Show Game " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , key_label_a . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * 15 ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( device_ptr , msg , & font_parms ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position_center ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( device_ptr , " - Go back " , & font_parms ) ;
2012-06-28 14:10:05 +02:00
2013-03-14 21:55:10 +01:00
snprintf ( msg , sizeof ( msg ) , " Press [%s] to reset to defaults. " , key_label_x . desc ) ;
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . comment_y_position ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
2012-06-28 14:10:05 +02:00
}
2012-12-17 00:32:16 +01:00
2013-01-11 03:58:43 +01:00
return 0 ;
2012-06-28 14:10:05 +02:00
}
2013-03-25 20:41:53 +01:00
static int ingame_menu_screenshot ( void * data , void * state )
2012-06-28 14:10:05 +02:00
{
2012-12-17 05:30:28 +01:00
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
uint64_t input = rstate - > input ;
2013-02-17 22:02:42 +01:00
2012-11-19 04:09:16 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-12-17 00:32:16 +01:00
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_MENU_DRAW ) ;
2012-07-30 16:24:28 +02:00
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_INGAME ) )
2012-06-28 14:10:05 +02:00
{
2013-01-10 20:29:07 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_A ) )
2012-06-28 14:10:05 +02:00
{
2012-08-20 18:17:08 +02:00
menu_stack_pop ( ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_DRAW ) ;
2012-06-28 14:10:05 +02:00
}
2012-08-20 02:45:31 +02:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-12-17 00:32:16 +01:00
if ( device_ptr - > ctx_driver - > rmenu_screenshot_dump )
device_ptr - > ctx_driver - > rmenu_screenshot_dump ( NULL ) ;
2012-06-28 14:10:05 +02:00
}
2012-12-17 00:32:16 +01:00
2013-01-11 03:58:43 +01:00
return 0 ;
2012-06-28 14:10:05 +02:00
}
2012-08-22 15:39:39 +02:00
# define MENU_ITEM_SELECTED(index) (menuitem_colors[index])
2013-03-25 20:41:53 +01:00
static int ingame_menu ( void * data , void * state )
2012-02-13 21:37:32 +01:00
{
2012-12-17 05:30:28 +01:00
menu * current_menu = ( menu * ) data ;
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
2013-01-11 03:58:43 +01:00
int ret = 0 ;
2012-12-17 05:30:28 +01:00
uint64_t input = rstate - > input ;
2012-11-19 04:09:16 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-12-17 00:32:16 +01:00
char strw_buffer [ 256 ] ;
2012-08-17 17:43:23 +02:00
unsigned menuitem_colors [ MENU_ITEM_LAST ] ;
2013-01-06 17:00:46 +01:00
static unsigned menu_idx = 0 ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
2012-02-13 21:37:32 +01:00
2013-01-07 23:29:56 +01:00
filebrowser_t * filebrowser = tmpBrowser ;
2012-08-19 01:21:31 +02:00
rmenu_default_positions_t default_pos ;
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-02-13 21:37:32 +01:00
2012-04-14 05:24:09 +02:00
for ( int i = 0 ; i < MENU_ITEM_LAST ; i + + )
2012-08-22 15:39:39 +02:00
menuitem_colors [ i ] = WHITE ;
2012-02-22 19:49:22 +01:00
2013-01-06 17:00:46 +01:00
menuitem_colors [ menu_idx ] = RED ;
2012-02-13 21:37:32 +01:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_A ) )
2013-01-11 03:58:43 +01:00
{
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_GAME ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
}
2012-02-13 21:37:32 +01:00
2013-01-06 17:00:46 +01:00
switch ( menu_idx )
2012-11-19 04:09:16 +01:00
{
case MENU_ITEM_LOAD_STATE :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
{
rarch_load_state ( ) ;
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_GAME ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
rarch_state_slot_decrease ( ) ;
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) )
2012-11-19 04:09:16 +01:00
rarch_state_slot_increase ( ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Load from current state slot. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_SAVE_STATE :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
{
rarch_save_state ( ) ;
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_GAME ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
rarch_state_slot_decrease ( ) ;
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) )
2012-11-19 04:09:16 +01:00
rarch_state_slot_increase ( ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Save to current state slot. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_KEEP_ASPECT_RATIO :
2013-01-11 03:58:43 +01:00
ret = set_setting_action ( current_menu , SETTING_KEEP_ASPECT_RATIO , input ) ;
if ( ret ! = 0 )
return ret ;
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Change the aspect ratio of the screen. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_OVERSCAN_AMOUNT :
2013-01-11 03:58:43 +01:00
ret = set_setting_action ( current_menu , SETTING_HW_OVERSCAN_AMOUNT , input ) ;
if ( ret ! = 0 )
return ret ;
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Change overscan correction. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_ORIENTATION :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_LEFT ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_ROTATION_DECREMENT ) ;
2013-01-07 17:48:45 +01:00
driver . video - > set_rotation ( NULL , g_extern . console . screen . orientation ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_ROTATION_INCREMENT ) ;
2013-01-07 17:48:45 +01:00
driver . video - > set_rotation ( NULL , g_extern . console . screen . orientation ) ;
2012-11-19 04:09:16 +01:00
}
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_START ) )
2012-11-19 04:09:16 +01:00
{
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_DEF_ROTATION ) ;
2013-01-07 17:48:45 +01:00
driver . video - > set_rotation ( NULL , g_extern . console . screen . orientation ) ;
2012-11-19 04:09:16 +01:00
}
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Change orientation of the screen. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 18:27:38 +02:00
# ifdef HAVE_FBO
2012-11-19 04:09:16 +01:00
case MENU_ITEM_SCALE_FACTOR :
2013-01-11 03:58:43 +01:00
ret = set_setting_action ( current_menu , SETTING_SCALE_FACTOR , input ) ;
if ( ret ! = 0 )
return ret ;
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Change scaling of the screen. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-11-19 04:09:16 +01:00
case MENU_ITEM_FRAME_ADVANCE :
2012-12-14 17:42:01 +01:00
if ( ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_R2 ) ) | | ( input & ( 1ULL < < RMENU_DEVICE_NAV_L2 ) ) )
2012-11-19 04:09:16 +01:00
{
2012-12-15 02:13:58 +01:00
g_extern . lifecycle_state | = ( 1ULL < < RARCH_FRAMEADVANCE ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-03-23 17:21:42 +01:00
settings_set ( 1ULL < < S_FRAME_ADVANCE ) ;
2013-01-06 17:00:46 +01:00
menu_idx = MENU_ITEM_FRAME_ADVANCE ;
2013-01-11 06:05:05 +01:00
return - 1 ;
2012-11-19 04:09:16 +01:00
}
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Press a button to step one frame. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_RESIZE_MODE :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
menu_stack_push ( INGAME_MENU_RESIZE ) ;
2013-03-18 03:49:54 +01:00
strlcpy ( strw_buffer , " Allows you to resize the screen. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_SCREENSHOT_MODE :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
menu_stack_push ( INGAME_MENU_SCREENSHOT ) ;
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Take a screenshot. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_RETURN_TO_GAME :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2013-01-11 03:58:43 +01:00
{
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_GAME ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
}
2012-11-19 04:09:16 +01:00
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Return to the game. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_RESET :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
{
rarch_game_reset ( ) ;
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_GAME ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2012-11-19 04:09:16 +01:00
}
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Reset the game. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_RETURN_TO_MENU :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
{
2013-01-06 17:00:46 +01:00
menu_idx = 0 ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
return 0 ;
2012-11-19 04:09:16 +01:00
}
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Return to the menu. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
case MENU_ITEM_CHANGE_LIBRETRO :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
{
menu_stack_push ( LIBRETRO_CHOICE ) ;
2012-12-17 01:30:38 +01:00
filebrowser_set_root_and_ext ( filebrowser , EXT_EXECUTABLES , default_paths . core_dir ) ;
2012-11-19 04:09:16 +01:00
set_libretro_core_as_launch = true ;
}
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Choose another libretro core. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-05-30 16:30:25 +02:00
# ifdef HAVE_MULTIMAN
2012-11-19 04:09:16 +01:00
case MENU_ITEM_RETURN_TO_MULTIMAN :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2012-11-19 04:09:16 +01:00
{
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_GAME ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXIT ) ;
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXITSPAWN ) ;
2013-03-23 05:17:39 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXITSPAWN_MULTIMAN ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2012-11-19 04:09:16 +01:00
}
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Quit RetroArch and return to multiMAN. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
2012-05-30 16:30:25 +02:00
# endif
2012-11-19 04:09:16 +01:00
case MENU_ITEM_QUIT_RARCH :
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_B ) )
2013-01-10 22:42:12 +01:00
{
2013-01-13 03:34:55 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_GAME ) ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXIT ) ;
2013-01-12 04:44:11 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_INGAME_EXIT ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2013-01-10 22:42:12 +01:00
}
2012-02-13 21:37:32 +01:00
2013-03-18 18:05:15 +01:00
strlcpy ( strw_buffer , " Quit RetroArch. " , sizeof ( strw_buffer ) ) ;
2012-11-19 04:09:16 +01:00
break ;
}
2012-02-13 21:37:32 +01:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_UP ) )
2012-06-30 14:04:34 +02:00
{
2013-01-06 17:00:46 +01:00
if ( menu_idx > 0 )
menu_idx - - ;
2012-08-20 21:45:34 +02:00
else
2013-01-06 17:00:46 +01:00
menu_idx = MENU_ITEM_LAST - 1 ;
2012-06-30 14:04:34 +02:00
}
2012-02-13 21:37:32 +01:00
2012-12-14 17:42:01 +01:00
if ( input & ( 1ULL < < RMENU_DEVICE_NAV_DOWN ) )
2012-06-30 14:04:34 +02:00
{
2013-01-06 17:00:46 +01:00
if ( menu_idx < ( MENU_ITEM_LAST - 1 ) )
menu_idx + + ;
2012-08-20 21:45:34 +02:00
else
2013-01-06 17:00:46 +01:00
menu_idx = 0 ;
2012-06-30 14:04:34 +02:00
}
2012-02-13 21:37:32 +01:00
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-02-13 21:37:32 +01:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . x_position ;
font_parms . y = default_pos . comment_y_position ;
font_parms . scale = default_pos . font_size ;
font_parms . color = WHITE ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , strw_buffer , & font_parms ) ;
2012-12-17 00:32:16 +01:00
2013-03-23 18:11:03 +01:00
snprintf ( strw_buffer , sizeof ( strw_buffer ) , " Load State #%d " , g_extern . state_slot ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_LOAD_STATE ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , strw_buffer , & font_parms ) ;
2012-02-13 21:37:32 +01:00
2013-03-23 18:11:03 +01:00
snprintf ( strw_buffer , sizeof ( strw_buffer ) , " Save State #%d " , g_extern . state_slot ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_SAVE_STATE ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_SAVE_STATE ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , strw_buffer , & font_parms ) ;
2012-02-13 21:37:32 +01:00
2013-03-23 18:11:03 +01:00
snprintf ( strw_buffer , sizeof ( strw_buffer ) , " Aspect Ratio: %s " ,
aspectratio_lut [ g_settings . video . aspect_ratio_idx ] . name ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_KEEP_ASPECT_RATIO ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_KEEP_ASPECT_RATIO ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , strw_buffer , & font_parms ) ;
2012-02-13 21:37:32 +01:00
2012-10-15 06:24:39 +02:00
snprintf ( strw_buffer , sizeof ( strw_buffer ) , " Overscan: %f " , g_extern . console . screen . overscan_amount ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_OVERSCAN_AMOUNT ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_OVERSCAN_AMOUNT ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , strw_buffer , & font_parms ) ;
2012-02-13 21:37:32 +01:00
2013-03-23 18:11:03 +01:00
snprintf ( strw_buffer , sizeof ( strw_buffer ) , " Rotation: %s " , rotation_lut [ g_extern . console . screen . orientation ] ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_ORIENTATION ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_ORIENTATION ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , strw_buffer , & font_parms ) ;
2012-02-13 21:37:32 +01:00
2012-08-03 18:27:38 +02:00
# ifdef HAVE_FBO
2013-03-23 18:11:03 +01:00
snprintf ( strw_buffer , sizeof ( strw_buffer ) , " Scale Factor: %f (X) / %f (Y) " ,
g_settings . video . fbo . scale_x , g_settings . video . fbo . scale_y ) ;
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_SCALE_FACTOR ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_SCALE_FACTOR ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , strw_buffer , & font_parms ) ;
2012-08-03 18:27:38 +02:00
# endif
2012-02-25 20:11:57 +01:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_RESIZE_MODE ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_RESIZE_MODE ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Resize Mode " , & font_parms ) ;
2012-02-28 14:42:29 +01:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_FRAME_ADVANCE ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_FRAME_ADVANCE ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Frame Advance " , & font_parms ) ;
2012-02-13 21:37:32 +01:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_SCREENSHOT_MODE ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_SCREENSHOT_MODE ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Screenshot Mode " , & font_parms ) ;
2012-02-13 21:37:32 +01:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_RESET ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_RESET ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Reset " , & font_parms ) ;
2012-04-14 05:24:09 +02:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_RETURN_TO_GAME ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_GAME ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Return To Game " , & font_parms ) ;
2012-04-14 05:24:09 +02:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_RETURN_TO_MENU ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_MENU ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Return To Menu " , & font_parms ) ;
2012-04-14 05:24:09 +02:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_CHANGE_LIBRETRO ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_CHANGE_LIBRETRO ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Change libretro core " , & font_parms ) ;
2012-04-10 01:00:25 +02:00
2012-05-30 16:30:25 +02:00
# ifdef HAVE_MULTIMAN
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_RETURN_TO_MULTIMAN ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_MULTIMAN ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Return to multiMAN " , & font_parms ) ;
2012-05-30 16:30:25 +02:00
# endif
2012-02-22 19:49:22 +01:00
2013-03-11 20:05:05 +01:00
font_parms . y = default_pos . y_position + ( default_pos . y_position_increment * MENU_ITEM_QUIT_RARCH ) ;
font_parms . color = MENU_ITEM_SELECTED ( MENU_ITEM_QUIT_RARCH ) ;
2013-03-11 21:42:02 +01:00
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , " Quit RetroArch " , & font_parms ) ;
2012-04-14 05:24:09 +02:00
2012-11-19 04:09:16 +01:00
rarch_position_t position = { 0 } ;
2012-08-19 01:21:31 +02:00
position . x = default_pos . x_position ;
2013-01-06 17:00:46 +01:00
position . y = ( default_pos . y_position + ( default_pos . y_position_increment * menu_idx ) ) ;
2012-11-19 04:09:16 +01:00
device_ptr - > ctx_driver - > rmenu_draw_panel ( & position ) ;
2012-12-17 00:32:16 +01:00
2013-01-11 03:58:43 +01:00
return 0 ;
2012-02-13 21:37:32 +01:00
}
2013-03-25 20:41:53 +01:00
static void menu_input_poll ( void * data , void * state )
2012-08-18 01:13:00 +02:00
{
2012-12-17 05:30:28 +01:00
menu * current_menu = ( menu * ) data ;
//first button input frame
uint64_t input_state_first_frame = 0 ;
uint64_t input_state = 0 ;
static bool first_held = false ;
2013-01-07 18:18:44 +01:00
driver . input - > poll ( NULL ) ;
2012-12-17 05:30:28 +01:00
for ( unsigned i = 0 ; i < RMENU_DEVICE_NAV_LAST ; i + + )
2013-01-07 18:18:44 +01:00
input_state | = driver . input - > input_state ( NULL , rmenu_nav_binds , 0 ,
2012-12-17 05:30:28 +01:00
RETRO_DEVICE_JOYPAD , 0 , i ) ? ( 1ULL < < i ) : 0 ;
//set first button input frame as trigger
2013-01-19 21:34:46 +01:00
rmenu_state . input = input_state & ~ ( rmenu_state . old_state ) ;
2012-12-17 05:30:28 +01:00
//hold onto first button input frame
input_state_first_frame = input_state ;
//second button input frame
input_state = 0 ;
2013-01-07 18:18:44 +01:00
driver . input - > poll ( NULL ) ;
2012-12-17 05:30:28 +01:00
for ( unsigned i = 0 ; i < RMENU_DEVICE_NAV_LAST ; i + + )
{
2013-01-07 18:18:44 +01:00
input_state | = driver . input - > input_state ( NULL , rmenu_nav_binds , 0 ,
2012-12-17 05:30:28 +01:00
RETRO_DEVICE_JOYPAD , 0 , i ) ? ( 1ULL < < i ) : 0 ;
}
bool analog_sticks_pressed = ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_LEFT_ANALOG_L ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT_ANALOG_L ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_UP_ANALOG_L ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_DOWN_ANALOG_L ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_LEFT_ANALOG_R ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_RIGHT_ANALOG_R ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_UP_ANALOG_R ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_DOWN_ANALOG_R ) ) ;
bool shoulder_buttons_pressed = ( ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_L2 ) ) | | ( input_state & ( 1ULL < < RMENU_DEVICE_NAV_R2 ) ) ) & & current_menu - > category_id ! = CATEGORY_SETTINGS ;
bool do_held = analog_sticks_pressed | | shoulder_buttons_pressed ;
if ( do_held )
{
if ( ! first_held )
{
first_held = true ;
2013-01-07 23:58:00 -05:00
g_extern . delay_timer [ 1 ] = g_extern . frame_count + 7 ;
2012-12-17 05:30:28 +01:00
}
2013-01-07 23:58:00 -05:00
if ( ! ( g_extern . frame_count < g_extern . delay_timer [ 1 ] ) )
2012-12-17 05:30:28 +01:00
{
first_held = false ;
2013-01-19 21:34:46 +01:00
rmenu_state . input = input_state ; //second input frame set as current frame
2012-12-17 05:30:28 +01:00
}
}
2013-01-19 21:34:46 +01:00
rmenu_state . old_state = input_state_first_frame ;
2012-12-17 05:30:28 +01:00
}
2013-03-25 20:41:53 +01:00
static int menu_input_process ( void * data , void * state )
2012-12-17 05:30:28 +01:00
{
( void ) data ;
2013-03-18 18:05:15 +01:00
bool quit = false ;
bool resize = false ;
unsigned width ;
unsigned height ;
unsigned frame_count ;
2013-01-11 03:58:43 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-12-17 05:30:28 +01:00
rmenu_state_t * rstate = ( rmenu_state_t * ) state ;
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_LOAD_GAME ) )
2013-01-10 08:46:46 +01:00
{
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
2013-03-23 19:34:38 +01:00
{
char tmp [ PATH_MAX ] ;
char str [ PATH_MAX ] ;
fill_pathname_base ( tmp , g_extern . fullpath , sizeof ( tmp ) ) ;
snprintf ( str , sizeof ( str ) , " INFO - Loading %s... " , tmp ) ;
msg_queue_push ( g_extern . msg_queue , str , 1 , 1 ) ;
}
2013-01-10 08:46:46 +01:00
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_INIT ) ;
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_LOAD_GAME ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2013-01-10 08:46:46 +01:00
}
2013-03-11 02:07:50 +01:00
if ( ! ( g_extern . frame_count < g_extern . delay_timer [ 0 ] ) )
2012-12-17 05:30:28 +01:00
{
2013-03-11 02:07:50 +01:00
bool return_to_game_enable = ( ( ( rstate - > old_state & ( 1ULL < < RMENU_DEVICE_NAV_L3 ) ) & & ( rstate - > old_state & ( 1ULL < < RMENU_DEVICE_NAV_R3 ) ) & & g_extern . main_is_init ) ) ;
if ( return_to_game_enable )
{
if ( ! ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_INGAME ) ) )
{
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_GAME ) ;
return - 1 ;
}
}
2013-01-11 03:58:43 +01:00
}
frame_count = 0 ;
device_ptr - > ctx_driver - > check_window ( & quit , & resize , & width , & height , frame_count ) ;
if ( quit )
{
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXIT ) ;
2013-01-11 03:58:43 +01:00
return - 1 ;
2012-12-17 05:30:28 +01:00
}
2013-01-11 03:58:43 +01:00
return 0 ;
2012-12-17 05:30:28 +01:00
}
2013-03-25 20:19:43 +01:00
/*============================================================
RMENU API
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
void menu_init ( void )
{
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
rmenu_state . input = 0 ;
rmenu_state . old_state = 0 ;
2013-03-25 21:01:04 +01:00
browser = ( filebrowser_t * ) filebrowser_init ( g_extern . console . main_wrap . default_rom_startup_dir , g_extern . system . valid_extensions ) ;
tmpBrowser = ( filebrowser_t * ) filebrowser_init ( default_paths . filesystem_root_dir , " " ) ;
filebrowser_set_root_and_ext ( browser , g_extern . system . valid_extensions , g_extern . console . main_wrap . default_rom_startup_dir ) ;
filebrowser_set_root_and_ext ( tmpBrowser , NULL , default_paths . filesystem_root_dir ) ;
menu_stack_push ( FILE_BROWSER_MENU ) ;
2012-11-19 04:09:16 +01:00
device_ptr - > ctx_driver - > rmenu_init ( ) ;
2012-08-17 18:22:28 +02:00
}
2012-07-30 01:35:11 +02:00
2012-12-17 00:32:16 +01:00
void menu_free ( void )
2012-08-17 18:22:28 +02:00
{
2013-03-25 21:01:04 +01:00
filebrowser_free ( browser ) ;
filebrowser_free ( tmpBrowser ) ;
2012-08-17 18:22:28 +02:00
}
2013-03-09 16:22:11 +01:00
bool menu_iterate ( void )
2012-01-10 23:33:44 +01:00
{
2012-12-15 16:39:30 +01:00
const char * msg ;
2013-03-11 20:05:05 +01:00
font_params_t font_parms = { 0 } ;
2012-12-15 16:39:30 +01:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2013-01-19 21:34:46 +01:00
static menu current_menu ;
2012-08-22 01:16:15 +02:00
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_PREINIT ) )
2012-04-11 02:42:27 +02:00
{
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_INGAME ) )
2012-12-15 16:39:30 +01:00
menu_stack_push ( INGAME_MENU ) ;
2012-08-22 01:16:15 +02:00
2013-03-25 20:41:53 +01:00
need_refresh = true ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_MENU_DRAW ) ;
2013-01-31 19:56:12 +01:00
# ifndef __CELLOS_LV2__
2012-12-15 16:39:30 +01:00
device_ptr - > ctx_driver - > rmenu_init ( ) ;
2013-01-31 19:56:12 +01:00
# endif
2013-01-17 17:11:02 +01:00
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_MENU_PREINIT ) ;
2012-12-15 16:39:30 +01:00
}
2012-08-01 02:56:15 +02:00
2012-12-15 16:39:30 +01:00
g_extern . frame_count + + ;
2012-08-01 02:56:15 +02:00
2013-03-25 20:41:53 +01:00
if ( need_refresh )
{
unsigned menu_id = menu_stack_enum_array [ stack_idx - 1 ] ;
switch ( menu_id )
{
case INGAME_MENU :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_INGAME_MENU ;
current_menu . entry = ingame_menu ;
break ;
case INGAME_MENU_RESIZE :
current_menu . enum_id = INGAME_MENU_RESIZE ;
current_menu . category_id = CATEGORY_INGAME_MENU ;
current_menu . entry = ingame_menu_resize ;
break ;
case INGAME_MENU_SCREENSHOT :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_INGAME_MENU ;
current_menu . entry = ingame_menu_screenshot ;
break ;
case FILE_BROWSER_MENU :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_FILEBROWSER ;
current_menu . entry = select_rom ;
break ;
case LIBRETRO_CHOICE :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_FILEBROWSER ;
current_menu . entry = select_file ;
break ;
case PRESET_CHOICE :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_FILEBROWSER ;
current_menu . entry = select_file ;
break ;
case INPUT_PRESET_CHOICE :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_FILEBROWSER ;
current_menu . entry = select_file ;
break ;
case SHADER_CHOICE :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_FILEBROWSER ;
current_menu . entry = select_file ;
break ;
case BORDER_CHOICE :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_FILEBROWSER ;
current_menu . entry = select_file ;
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
case PATH_SAVESTATES_DIR_CHOICE :
case PATH_SRAM_DIR_CHOICE :
# ifdef HAVE_XML
case PATH_CHEATS_DIR_CHOICE :
# endif
case PATH_SYSTEM_DIR_CHOICE :
current_menu . enum_id = menu_id ;
current_menu . category_id = CATEGORY_FILEBROWSER ;
current_menu . entry = select_directory ;
break ;
case GENERAL_VIDEO_MENU :
current_menu . enum_id = GENERAL_VIDEO_MENU ;
current_menu . category_id = CATEGORY_SETTINGS ;
current_menu . entry = select_setting ;
break ;
case GENERAL_AUDIO_MENU :
current_menu . enum_id = GENERAL_AUDIO_MENU ;
current_menu . category_id = CATEGORY_SETTINGS ;
current_menu . entry = select_setting ;
break ;
case EMU_GENERAL_MENU :
current_menu . enum_id = EMU_GENERAL_MENU ;
current_menu . category_id = CATEGORY_SETTINGS ;
current_menu . entry = select_setting ;
break ;
case EMU_VIDEO_MENU :
current_menu . enum_id = EMU_VIDEO_MENU ;
current_menu . category_id = CATEGORY_SETTINGS ;
current_menu . entry = select_setting ;
break ;
case EMU_AUDIO_MENU :
current_menu . enum_id = EMU_AUDIO_MENU ;
current_menu . category_id = CATEGORY_SETTINGS ;
current_menu . entry = select_setting ;
break ;
case PATH_MENU :
current_menu . enum_id = PATH_MENU ;
current_menu . category_id = CATEGORY_SETTINGS ;
current_menu . entry = select_setting ;
break ;
case CONTROLS_MENU :
current_menu . enum_id = CONTROLS_MENU ;
current_menu . category_id = CATEGORY_SETTINGS ;
current_menu . entry = select_setting ;
break ;
}
need_refresh = false ;
}
2012-08-01 02:56:15 +02:00
2012-12-17 05:30:28 +01:00
rmenu_default_positions_t default_pos ;
2013-03-10 15:52:36 +01:00
menu_set_default_pos ( & default_pos ) ;
2012-06-28 17:11:22 +02:00
2013-02-17 22:02:42 +01:00
if ( ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_LOW_RAM_MODE_ENABLE ) ) )
{
2013-02-17 22:01:08 +01:00
# if defined(HAVE_OPENGL)
2013-02-17 22:02:42 +01:00
glClear ( GL_COLOR_BUFFER_BIT ) ;
2013-02-17 22:01:08 +01:00
# elif defined(HAVE_D3D8) || defined(HAVE_D3D9)
2013-02-17 22:02:42 +01:00
xdk_d3d_video_t * d3d = ( xdk_d3d_video_t * ) driver . video_data ;
LPDIRECT3DDEVICE d3dr = ( LPDIRECT3DDEVICE ) d3d - > d3d_render_device ;
d3dr - > Clear ( 0 , NULL , D3DCLEAR_TARGET , 0xff000000 , 1.0f , 0 ) ;
2013-02-17 22:01:08 +01:00
# endif
2013-02-17 22:02:42 +01:00
}
else
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_DRAW ) )
2013-03-10 03:53:25 +01:00
{
if ( driver . video_poke - > set_blend )
driver . video_poke - > set_blend ( driver . video_data , true ) ;
}
2012-06-28 14:10:05 +02:00
2013-02-17 22:02:42 +01:00
rarch_render_cached_frame ( ) ;
}
2012-06-28 14:10:05 +02:00
2013-03-25 03:07:58 +01:00
menu_input_poll ( & current_menu , & rmenu_state ) ;
2012-12-17 00:32:16 +01:00
2012-12-17 06:44:28 +01:00
# ifdef HAVE_OSKUTIL
2013-01-17 10:40:35 +01:00
if ( rmenu_state . osk_init ! = NULL )
{
if ( rmenu_state . osk_init ( & rmenu_state ) )
rmenu_state . osk_init = NULL ;
}
2012-12-17 06:44:28 +01:00
2013-01-17 10:40:35 +01:00
if ( rmenu_state . osk_callback ! = NULL )
{
if ( rmenu_state . osk_callback ( & rmenu_state ) )
rmenu_state . osk_callback = NULL ;
}
2012-12-17 06:44:28 +01:00
# endif
2013-01-11 03:58:43 +01:00
int input_entry_ret = 0 ;
int input_process_ret = 0 ;
2012-12-17 00:32:16 +01:00
2012-12-17 05:30:28 +01:00
if ( current_menu . entry )
2013-01-11 03:58:43 +01:00
input_entry_ret = current_menu . entry ( & current_menu , & rmenu_state ) ;
2012-11-19 04:09:16 +01:00
2013-03-25 03:07:58 +01:00
input_process_ret = menu_input_process ( & current_menu , & rmenu_state ) ;
2012-04-11 02:42:27 +02:00
2012-12-15 16:39:30 +01:00
msg = msg_queue_pull ( g_extern . msg_queue ) ;
2012-05-28 22:18:50 +02:00
2013-03-11 20:05:05 +01:00
font_parms . x = default_pos . msg_queue_x_position ;
font_parms . y = default_pos . msg_queue_y_position ;
font_parms . scale = default_pos . msg_queue_font_size ;
font_parms . color = WHITE ;
2013-01-12 03:13:03 +01:00
if ( msg & & ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) ) )
2013-03-11 21:42:02 +01:00
{
if ( driver . video_poke - > set_osd_msg )
driver . video_poke - > set_osd_msg ( driver . video_data , msg , & font_parms ) ;
}
2012-08-03 19:36:11 +02:00
2012-12-15 16:39:30 +01:00
device_ptr - > ctx_driver - > swap_buffers ( ) ;
2012-12-18 08:20:28 +01:00
2013-01-12 03:13:03 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_DRAW ) )
2013-03-10 03:53:25 +01:00
{
if ( driver . video_poke - > set_blend )
driver . video_poke - > set_blend ( driver . video_data , false ) ;
}
2012-04-11 02:42:27 +02:00
2013-01-12 04:44:11 +01:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_INGAME_EXIT ) & &
g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_INGAME ) )
{
menu_stack_pop ( ) ;
g_extern . lifecycle_mode_state & = ~ ( ( 1ULL < < MODE_MENU_INGAME ) | ( 1ULL < < MODE_MENU_INGAME_EXIT ) ) ;
}
2013-01-11 03:58:43 +01:00
if ( input_entry_ret ! = 0 | | input_process_ret ! = 0 )
2013-01-10 08:46:46 +01:00
goto deinit ;
2012-12-15 16:39:30 +01:00
return true ;
deinit :
2013-03-11 02:07:50 +01:00
// set a timer delay so that we don't instantly switch back to the menu when
// press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks)
if ( ! ( g_extern . lifecycle_state & ( 1ULL < < RARCH_FRAMEADVANCE ) ) )
g_extern . delay_timer [ 0 ] = g_extern . frame_count + 30 ;
2013-01-12 03:13:03 +01:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_MENU_DRAW ) ;
2012-12-15 16:39:30 +01:00
2013-01-31 19:56:12 +01:00
# ifndef __CELLOS_LV2__
2012-12-15 16:39:30 +01:00
device_ptr - > ctx_driver - > rmenu_free ( ) ;
2013-01-31 19:56:12 +01:00
# endif
2012-12-15 16:39:30 +01:00
return false ;
2012-01-10 23:33:44 +01:00
}