2012-04-21 23:13:50 +02:00
/* RetroArch - A frontend for libretro.
2012-01-10 23:33:44 +01:00
* Copyright ( C ) 2010 - 2012 - Hans - Kristian Arntzen
* Copyright ( C ) 2011 - 2012 - Daniel De Matteis
*
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/>.
*/
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-16 04:07:02 +01:00
# include <cell/sysmodule.h>
2012-01-10 23:33:44 +01:00
# include <sysutil/sysutil_screenshot.h>
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-06-20 08:25:23 +02:00
# include "../../console/fileio/file_browser.h"
2012-01-10 23:33:44 +01:00
2012-07-28 15:54:35 +02:00
# include "../../console/rarch_console.h"
# include "../../console/rarch_console_rom_ext.h"
# include "../../console/rarch_console_input.h"
# include "../../console/rarch_console_config.h"
2012-07-28 16:10:31 +02:00
# include "../../console/rarch_console_settings.h"
2012-08-03 17:54:22 +02:00
2012-08-05 17:18:19 +02:00
# include "../../gfx/image.h"
2012-08-03 17:54:22 +02:00
# ifdef HAVE_RSOUND
2012-07-30 00:58:47 +02:00
# include "../../console/rarch_console_rsound.h"
2012-08-03 17:54:22 +02:00
# endif
2012-07-28 16:10:31 +02:00
# include "../../console/rarch_console_video.h"
2012-01-25 03:11:21 +01:00
2012-07-25 19:03:01 +02:00
# ifdef HAVE_ZLIB
2012-07-28 15:54:35 +02:00
# include "../../console/rarch_console_rzlib.h"
2012-07-25 19:03:01 +02:00
# endif
2012-08-03 17:54:22 +02:00
# if defined(HAVE_OPENGL)
2012-06-20 08:25:23 +02:00
# include "../../gfx/gl_common.h"
# include "../../gfx/gl_font.h"
2012-08-03 17:54:22 +02:00
# endif
2012-06-20 08:25:23 +02:00
# include "../../gfx/gfx_context.h"
2012-08-03 17:54:22 +02:00
# if defined(__CELLOS_LV2__)
2012-06-20 08:25:23 +02:00
# include "../../gfx/context/ps3_ctx.h"
2012-08-03 19:36:11 +02:00
# elif defined(_XBOX)
# include "../../gfx/context/xdk_ctx.h"
2012-08-03 17:54:22 +02:00
# endif
# if defined(HAVE_CG)
2012-06-20 08:25:23 +02:00
# include "../../gfx/shader_cg.h"
2012-08-03 17:54:22 +02:00
# endif
2012-01-11 22:27:07 +01:00
2012-06-20 08:25:23 +02:00
# include "../../file.h"
# include "../../general.h"
2012-01-10 23:33:44 +01:00
2012-08-03 21:22:43 +02:00
# include "rmenu.h"
# include "rmenu_entries.h"
2012-01-10 23:33:44 +01:00
2012-06-30 14:04:34 +02:00
# define INPUT_SCALE 2
# define MENU_ITEM_SELECTED(index) (menuitem_colors[index])
2012-01-10 23:33:44 +01:00
2012-08-03 18:27:38 +02:00
# ifdef _XBOX1
# include "../../gfx/fonts/xdk1_xfonts.h"
2012-08-04 05:10:49 +02:00
# define ROM_PANEL_WIDTH 510
2012-08-03 18:27:38 +02:00
# define ROM_PANEL_HEIGHT 20
int xpos , ypos ;
2012-08-05 17:18:19 +02:00
texture_image m_menuMainRomSelectPanel ;
texture_image m_menuMainBG ;
2012-08-03 18:27:38 +02:00
// Rom list coords
int m_menuMainRomListPos_x ;
int m_menuMainRomListPos_y ;
# endif
2012-06-28 22:55:55 +02:00
menu menuStack [ 10 ] ;
2012-01-16 04:07:02 +01:00
int menuStackindex = 0 ;
2012-05-28 22:18:50 +02:00
static bool set_libretro_core_as_launch ;
2012-02-20 22:34:11 +01:00
2012-07-16 08:44:13 +02:00
filebrowser_t browser ;
filebrowser_t tmpBrowser ;
2012-06-28 21:03:14 +02:00
unsigned set_shader = 0 ;
2012-08-17 17:43:23 +02:00
unsigned currently_selected_controller_menu = 0 ;
2012-08-03 06:34:33 +02:00
char m_title [ 256 ] ;
2012-01-10 23:33:44 +01:00
2012-08-02 17:09:41 +02:00
static uint64_t old_state = 0 ;
2012-06-30 14:04:34 +02:00
typedef enum {
SETTINGS_ACTION_DOWN ,
SETTINGS_ACTION_UP ,
SETTINGS_ACTION_TAB_PREVIOUS ,
SETTINGS_ACTION_TAB_NEXT ,
SETTINGS_ACTION_NOOP
} settings_action_t ;
typedef enum {
MENU_ROMSELECT_ACTION_OK ,
MENU_ROMSELECT_ACTION_GOTO_SETTINGS ,
MENU_ROMSELECT_ACTION_NOOP ,
} menu_romselect_action_t ;
2012-07-30 16:24:28 +02:00
static void set_setting_label_write_on_or_off ( item * items , bool cond , unsigned currentsetting )
2012-06-29 12:27:17 +02:00
{
if ( cond )
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " ON " ) ;
2012-06-29 12:27:17 +02:00
else
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " OFF " ) ;
2012-06-29 12:27:17 +02:00
}
2012-07-30 16:24:28 +02:00
static void set_setting_label_color ( item * items , bool cond , unsigned currentsetting )
2012-06-29 12:27:17 +02:00
{
if ( cond )
2012-07-30 16:24:28 +02:00
items [ currentsetting ] . text_color = GREEN ;
2012-06-29 12:27:17 +02:00
else
2012-07-30 16:24:28 +02:00
items [ currentsetting ] . text_color = ORANGE ;
2012-06-29 12:27:17 +02:00
}
2012-07-30 17:19:05 +02:00
static void set_setting_label ( menu * current_menu , item * items , unsigned currentsetting )
2012-01-16 04:07:02 +01:00
{
2012-07-16 20:35:11 +02:00
char fname [ PATH_MAX ] ;
( void ) fname ;
2012-04-14 04:38:40 +02:00
switch ( currentsetting )
{
2012-08-03 01:57:53 +02:00
# ifdef __CELLOS_LV2__
2012-04-14 04:38:40 +02:00
case SETTING_CHANGE_RESOLUTION :
2012-08-10 04:47:58 +02:00
{
unsigned width = gfx_ctx_get_resolution_width ( g_console . supported_resolutions [ g_console . current_resolution_index ] ) ;
unsigned height = gfx_ctx_get_resolution_height ( g_console . supported_resolutions [ g_console . current_resolution_index ] ) ;
set_setting_label_color ( items , g_console . initial_resolution_id = = g_console . supported_resolutions [ g_console . current_resolution_index ] , currentsetting ) ;
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %dx%d " , width , height ) ;
}
2012-04-14 04:38:40 +02: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-04-14 04:38:40 +02:00
case SETTING_SHADER_PRESETS :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , true , currentsetting ) ;
2012-07-16 20:35:11 +02:00
fill_pathname_base ( fname , g_console . cgp_path , sizeof ( fname ) ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , fname ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_SHADER :
2012-07-16 20:35:11 +02:00
fill_pathname_base ( fname , g_settings . video . cg_shader_path , sizeof ( fname ) ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %s " , fname ) ;
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , strcmp ( g_settings . video . cg_shader_path , default_paths . shader_file ) = = 0 , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_SHADER_2 :
2012-07-16 20:35:11 +02:00
fill_pathname_base ( fname , g_settings . video . second_pass_shader , sizeof ( fname ) ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %s " , fname ) ;
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , strcmp ( g_settings . video . second_pass_shader , default_paths . shader_file ) = = 0 ,
currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-08-03 03:24:36 +02:00
# endif
2012-04-14 04:38:40 +02:00
case SETTING_FONT_SIZE :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_console . menu_font_size = = 1.0f , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %f " , g_console . menu_font_size ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_KEEP_ASPECT_RATIO :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_console . aspect_ratio_index = = ASPECT_RATIO_4_3 , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , aspectratio_lut [ g_console . aspect_ratio_index ] . name ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_HW_TEXTURE_FILTER :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_settings . video . smooth , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_settings . video . smooth )
2012-08-04 05:10:49 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Bilinear " ) ;
2012-04-14 04:38:40 +02:00
else
2012-08-04 05:10:49 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Point " ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-08-04 03:11:49 +02:00
# ifdef HAVE_FBO
2012-04-14 04:38:40 +02:00
case SETTING_HW_TEXTURE_FILTER_2 :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_settings . video . second_pass_smooth , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_settings . video . second_pass_smooth )
2012-08-04 05:10:49 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Bilinear " ) ;
2012-04-14 04:38:40 +02:00
else
2012-08-04 05:10:49 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Point " ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_SCALE_ENABLED :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . fbo_enabled , currentsetting ) ;
set_setting_label_color ( items , g_console . fbo_enabled , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_SCALE_FACTOR :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_settings . video . fbo_scale_x = = 2.0f , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %fx (X) / %fx (Y) " , g_settings . video . fbo_scale_x , g_settings . video . fbo_scale_y ) ;
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [Custom Scaling Factor] is set to: '%fx (X) / %fx (Y)'. " , g_settings . video . fbo_scale_x , g_settings . video . fbo_scale_y ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-08-07 18:26:52 +02:00
# endif
# ifdef _XBOX1
case SETTING_FLICKER_FILTER :
set_setting_label_color ( items , g_console . flicker_filter = = 0 , currentsetting ) ;
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %d " , g_console . flicker_filter ) ;
break ;
case SETTING_SOFT_DISPLAY_FILTER :
set_setting_label_write_on_or_off ( items , g_console . soft_display_filter_enable , currentsetting ) ;
set_setting_label_color ( items , g_console . soft_display_filter_enable , currentsetting ) ;
break ;
2012-08-03 18:54:59 +02:00
# endif
2012-04-14 04:38:40 +02:00
case SETTING_HW_OVERSCAN_AMOUNT :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_console . overscan_amount = = 0.0f , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %f " , g_console . overscan_amount ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_THROTTLE_MODE :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . throttle_enable , currentsetting ) ;
set_setting_label_color ( items , g_console . throttle_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_TRIPLE_BUFFERING :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . triple_buffering_enable , currentsetting ) ;
set_setting_label_color ( items , g_console . triple_buffering_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_ENABLE_SCREENSHOTS :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . screenshots_enable , currentsetting ) ;
set_setting_label_color ( items , g_console . screenshots_enable , currentsetting ) ;
2012-04-14 04:38:40 +02: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 :
# endif
2012-04-14 04:38:40 +02:00
case SETTING_DEFAULT_VIDEO_ALL :
break ;
case SETTING_SOUND_MODE :
switch ( g_console . sound_mode )
{
2012-08-02 17:09:41 +02:00
case SOUND_MODE_NORMAL :
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) ,
2012-08-04 05:10:49 +02:00
" INFO - [Sound Output] is set to 'Normal'. " ) ;
2012-08-02 17:09:41 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Normal " ) ;
items [ currentsetting ] . text_color = GREEN ;
break ;
2012-08-03 03:24:36 +02:00
# ifdef HAVE_RSOUND
2012-08-02 17:09:41 +02:00
case SOUND_MODE_RSOUND :
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) ,
2012-08-04 05:10:49 +02:00
" INFO - [Sound Output] is set to 'RSound'. " ) ;
2012-08-02 17:09:41 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " RSound " ) ;
items [ currentsetting ] . text_color = ORANGE ;
break ;
2012-08-03 03:24:36 +02:00
# endif
# ifdef HAVE_HEADSET
2012-08-02 17:09:41 +02:00
case SOUND_MODE_HEADSET :
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) ,
2012-08-04 05:10:49 +02:00
" INFO - [Sound Output] is set to 'USB/Bluetooth Headset'. " ) ;
2012-08-02 17:09:41 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " USB/Bluetooth Headset " ) ;
items [ currentsetting ] . text_color = ORANGE ;
break ;
2012-08-03 03:24:36 +02:00
# endif
2012-08-02 17:09:41 +02:00
default :
break ;
}
2012-04-14 04:38:40 +02:00
break ;
2012-08-03 18:54:59 +02:00
# ifdef HAVE_RSOUND
2012-04-14 04:38:40 +02:00
case SETTING_RSOUND_SERVER_IP_ADDRESS :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , strcmp ( g_settings . audio . device , " 0.0.0.0 " ) = = 0 , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , g_settings . audio . device ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-08-03 18:54:59 +02:00
# endif
2012-04-14 04:38:40 +02:00
case SETTING_DEFAULT_AUDIO_ALL :
break ;
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_extern . state_slot = = 0 , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %d " , g_extern . state_slot ) ;
2012-04-14 04:38:40 +02:00
break ;
/* emu-specific */
2012-08-05 18:42:54 +02:00
case SETTING_EMU_SHOW_DEBUG_INFO_MSG :
set_setting_label_write_on_or_off ( items , g_console . fps_info_msg_enable , currentsetting ) ;
set_setting_label_color ( items , g_console . fps_info_msg_enable , currentsetting ) ;
break ;
2012-05-28 22:43:08 +02:00
case SETTING_EMU_SHOW_INFO_MSG :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . info_msg_enable , currentsetting ) ;
set_setting_label_color ( items , g_console . info_msg_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_EMU_REWIND_ENABLED :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_settings . rewind_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_settings . rewind_enable )
{
2012-08-02 17:09:41 +02:00
items [ currentsetting ] . text_color = ORANGE ;
2012-08-04 05:10:49 +02:00
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [Rewind] feature is set to 'ON'. " ) ;
2012-04-14 04:38:40 +02:00
}
else
{
2012-08-02 17:09:41 +02:00
items [ currentsetting ] . text_color = GREEN ;
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [Rewind] feature is set to 'OFF'. " ) ;
2012-04-14 04:38:40 +02:00
}
break ;
2012-08-02 17:09:41 +02:00
case SETTING_ZIP_EXTRACT :
set_setting_label_color ( items , g_console . zip_extract_mode = = ZIP_EXTRACT_TO_CURRENT_DIR , currentsetting ) ;
switch ( g_console . zip_extract_mode )
{
case ZIP_EXTRACT_TO_CURRENT_DIR :
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Current dir " ) ;
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [ZIP Extract Mode] is set to 'Current dir'. \n ZIP files are extracted to the current directory. " ) ;
break ;
case ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE :
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Current dir and load first file " ) ;
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [ZIP Extract Mode] is set to 'Current dir and load first file'. \n ZIP files are extracted to the current directory, and the first game is automatically loaded. " ) ;
break ;
case ZIP_EXTRACT_TO_CACHE_DIR :
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " Cache dir " ) ;
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [ZIP Extract Mode] is set to 'Cache dir'. \n ZIP files are extracted to the cache directory (dev_hdd1). " ) ;
break ;
}
break ;
2012-04-21 23:25:32 +02:00
case SETTING_RARCH_DEFAULT_EMU :
2012-08-02 17:09:41 +02:00
fill_pathname_base ( fname , g_settings . libretro , sizeof ( fname ) ) ;
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %s " , fname ) ;
items [ currentsetting ] . text_color = GREEN ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_EMU_AUDIO_MUTE :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_extern . audio_data . mute , currentsetting ) ;
set_setting_label_color ( items , ! g_extern . audio_data . mute , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_extern . audio_data . mute )
2012-08-02 17:09:41 +02:00
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [Audio Mute] feature is set to 'ON'. The game audio will be muted. " ) ;
2012-04-14 04:38:40 +02:00
else
2012-08-02 17:09:41 +02:00
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [Audio Mute] feature is set to 'OFF'. " ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_ENABLE_CUSTOM_BGM :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . custom_bgm_enable , currentsetting ) ;
set_setting_label_color ( items , g_console . custom_bgm_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_PATH_DEFAULT_ROM_DIRECTORY :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , ! ( strcmp ( g_console . default_rom_startup_dir , " / " ) ) , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , g_console . default_rom_startup_dir ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_PATH_SAVESTATES_DIRECTORY :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , ! ( strcmp ( g_console . default_savestate_dir , default_paths . port_dir ) ) , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , g_console . default_savestate_dir ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_PATH_SRAM_DIRECTORY :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , ! ( strcmp ( g_console . default_sram_dir , default_paths . port_dir ) ) , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , g_console . default_sram_dir ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-04-14 04:38:40 +02:00
case SETTING_PATH_CHEATS :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , ! ( strcmp ( g_settings . cheat_database , default_paths . port_dir ) ) , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , g_settings . cheat_database ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-08-04 07:24:15 +02:00
# endif
2012-07-10 04:00:04 +02:00
case SETTING_PATH_SYSTEM :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , ! ( strcmp ( g_settings . system_directory , default_paths . system_dir ) ) , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , g_settings . system_directory ) ;
2012-07-10 04:00:04 +02:00
break ;
2012-04-14 04:38:40 +02:00
case SETTING_ENABLE_SRAM_PATH :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . default_sram_dir_enable , currentsetting ) ;
set_setting_label_color ( items , ! g_console . default_sram_dir_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_ENABLE_STATE_PATH :
2012-08-02 17:09:41 +02:00
set_setting_label_write_on_or_off ( items , g_console . default_savestate_dir_enable , currentsetting ) ;
set_setting_label_color ( items , ! g_console . default_savestate_dir_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_CONTROLS_SCHEME :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , strcmp ( g_console . input_cfg_path , " " ) = = 0 , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - Input scheme preset [%s] is selected. " , g_console . input_cfg_path ) ;
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , g_console . input_cfg_path ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_CONTROLS_NUMBER :
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , currently_selected_controller_menu = = 0 , currentsetting ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " Controller %d is currently selected. " , currently_selected_controller_menu + 1 ) ;
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , " %d " , currently_selected_controller_menu + 1 ) ;
2012-04-14 04:38:40 +02:00
break ;
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 :
2012-05-07 22:25:56 +02:00
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-04-14 04:38:40 +02:00
{
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , g_settings . input . binds [ currently_selected_controller_menu ] [ currentsetting - ( FIRST_CONTROL_BIND ) ] . joykey = = rarch_default_keybind_lut [ currentsetting - FIRST_CONTROL_BIND ] , currentsetting ) ;
2012-06-29 12:27:17 +02:00
const char * value = rarch_input_find_platform_key_label ( g_settings . input . binds [ currently_selected_controller_menu ] [ currentsetting - ( FIRST_CONTROL_BIND ) ] . joykey ) ;
unsigned id = currentsetting - FIRST_CONTROL_BIND ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . text , sizeof ( items [ currentsetting ] . text ) , rarch_input_get_default_keybind_name ( id ) ) ;
2012-08-04 05:10:49 +02:00
snprintf ( items [ currentsetting ] . comment , sizeof ( items [ currentsetting ] . comment ) , " INFO - [%s] is mapped to action: \n [%s]. " , items [ currentsetting ] . text , value ) ;
2012-07-30 16:24:28 +02:00
snprintf ( items [ currentsetting ] . setting_text , sizeof ( items [ currentsetting ] . setting_text ) , value ) ;
2012-04-14 04:38:40 +02:00
}
break ;
case SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS :
case SETTING_CONTROLS_DEFAULT_ALL :
2012-06-29 12:27:17 +02:00
case SETTING_EMU_VIDEO_DEFAULT_ALL :
case SETTING_EMU_AUDIO_DEFAULT_ALL :
case SETTING_PATH_DEFAULT_ALL :
case SETTING_EMU_DEFAULT_ALL :
2012-08-03 18:54:59 +02:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-06-29 12:27:17 +02:00
case SETTING_SAVE_SHADER_PRESET :
2012-08-03 18:54:59 +02:00
# endif
2012-08-02 17:09:41 +02:00
set_setting_label_color ( items , current_menu - > selected = = currentsetting , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
default :
break ;
}
2012-01-10 23:33:44 +01:00
}
2012-06-28 21:49:40 +02:00
static void menu_stack_decrement ( void )
{
2012-07-30 17:54:11 +02:00
if ( menuStackindex > 0 )
menuStackindex - - ;
2012-06-28 21:49:40 +02:00
}
2012-07-30 17:54:11 +02:00
menu * menu_stack_get_current_ptr ( void )
2012-06-28 21:49:40 +02:00
{
2012-07-30 17:54:11 +02:00
menu * current_menu = & menuStack [ menuStackindex ] ;
return current_menu ;
2012-06-28 21:49:40 +02:00
}
2012-07-30 17:19:05 +02:00
static void menu_stack_refresh ( item * items , menu * current_menu )
2012-01-16 04:07:02 +01:00
{
2012-04-11 02:42:27 +02:00
int page , i , j ;
2012-08-03 17:54:22 +02:00
float y_position ;
float increment_step = POSITION_Y_INCREMENT ;
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-04-11 02:42:27 +02:00
page = 0 ;
j = 0 ;
2012-08-03 17:54:22 +02:00
y_position = POSITION_Y_BEGIN ;
2012-04-11 02:42:27 +02:00
2012-07-30 17:19:05 +02:00
for ( i = current_menu - > first_setting ; i < current_menu - > max_settings ; i + + )
2012-04-11 02:42:27 +02:00
{
if ( ! ( j < ( NUM_ENTRY_PER_PAGE ) ) )
{
j = 0 ;
2012-08-03 17:54:22 +02:00
y_position = POSITION_Y_BEGIN ;
2012-08-02 17:09:41 +02:00
page + + ;
2012-04-11 02:42:27 +02:00
}
2012-08-01 16:47:37 +02:00
items [ i ] . text_xpos = x_position ;
2012-08-03 17:54:22 +02:00
items [ i ] . text_ypos = y_position ;
2012-06-29 13:30:04 +02:00
items [ i ] . page = page ;
2012-07-30 17:19:05 +02:00
set_setting_label ( current_menu , items , i ) ;
2012-08-03 17:54:22 +02:00
y_position + = increment_step ;
2012-04-11 02:42:27 +02:00
j + + ;
}
2012-01-10 23:33:44 +01:00
}
2012-07-30 17:54:11 +02:00
static void menu_stack_push ( item * items , unsigned menu_id )
2012-01-10 23:33:44 +01:00
{
2012-07-30 17:54:11 +02:00
static bool first_push_do_not_increment = true ;
2012-07-30 21:20:42 +02:00
bool do_refresh = true ;
2012-07-30 17:54:11 +02:00
if ( ! first_push_do_not_increment )
menuStackindex + + ;
else
first_push_do_not_increment = false ;
menu * current_menu = menu_stack_get_current_ptr ( ) ;
2012-07-30 17:19:05 +02:00
2012-06-28 21:49:40 +02:00
switch ( menu_id )
{
case INGAME_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Ingame Menu " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_INGAME_MENU ;
2012-06-29 13:30:04 +02:00
break ;
2012-06-28 21:49:40 +02:00
case INGAME_MENU_RESIZE :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Resize Menu " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = INGAME_MENU_RESIZE ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_INGAME_MENU ;
2012-06-29 14:40:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case INGAME_MENU_SCREENSHOT :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Ingame Menu " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_INGAME_MENU ;
2012-06-28 21:49:40 +02:00
break ;
case FILE_BROWSER_MENU :
2012-08-04 21:43:46 +02:00
strlcpy ( current_menu - > title , " Filebrowser " , sizeof ( current_menu - > title ) ) ;
2012-07-30 17:19:05 +02:00
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_FILEBROWSER ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case LIBRETRO_CHOICE :
2012-08-04 21:43:46 +02:00
strlcpy ( current_menu - > title , " Libretro " , sizeof ( current_menu - > title ) ) ;
2012-07-30 17:19:05 +02:00
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_FILEBROWSER ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case PRESET_CHOICE :
2012-08-04 21:43:46 +02:00
strlcpy ( current_menu - > title , " Shader " , sizeof ( current_menu - > title ) ) ;
2012-07-30 17:19:05 +02:00
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_FILEBROWSER ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case INPUT_PRESET_CHOICE :
2012-08-04 21:43:46 +02:00
strlcpy ( current_menu - > title , " Input " , sizeof ( current_menu - > title ) ) ;
2012-07-30 17:19:05 +02:00
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_FILEBROWSER ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case SHADER_CHOICE :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Shaders " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_FILEBROWSER ;
2012-06-29 11:44:50 +02:00
break ;
case BORDER_CHOICE :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Borders " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_FILEBROWSER ;
2012-06-29 11:44:50 +02:00
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
case PATH_SAVESTATES_DIR_CHOICE :
2012-06-28 21:49:40 +02:00
case PATH_SRAM_DIR_CHOICE :
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-06-28 21:49:40 +02:00
case PATH_CHEATS_DIR_CHOICE :
2012-08-04 07:24:15 +02:00
# endif
2012-07-10 04:00:04 +02:00
case PATH_SYSTEM_DIR_CHOICE :
2012-08-04 21:43:46 +02:00
strlcpy ( current_menu - > title , " Path " , sizeof ( current_menu - > title ) ) ;
2012-07-30 17:19:05 +02:00
current_menu - > enum_id = menu_id ;
current_menu - > selected = 0 ;
current_menu - > page = 0 ;
current_menu - > category_id = CATEGORY_FILEBROWSER ;
2012-06-28 21:49:40 +02:00
break ;
case GENERAL_VIDEO_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Video " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = GENERAL_VIDEO_MENU ;
current_menu - > selected = FIRST_VIDEO_SETTING ;
current_menu - > page = 0 ;
current_menu - > first_setting = FIRST_VIDEO_SETTING ;
current_menu - > max_settings = MAX_NO_OF_VIDEO_SETTINGS ;
current_menu - > category_id = CATEGORY_SETTINGS ;
2012-06-28 21:49:40 +02:00
break ;
case GENERAL_AUDIO_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Audio " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = GENERAL_AUDIO_MENU ;
current_menu - > selected = FIRST_AUDIO_SETTING ;
current_menu - > page = 0 ;
current_menu - > first_setting = FIRST_AUDIO_SETTING ;
current_menu - > max_settings = MAX_NO_OF_AUDIO_SETTINGS ;
current_menu - > category_id = CATEGORY_SETTINGS ;
2012-06-28 21:49:40 +02:00
break ;
case EMU_GENERAL_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Retro " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = EMU_GENERAL_MENU ;
current_menu - > selected = FIRST_EMU_SETTING ;
current_menu - > page = 0 ;
current_menu - > first_setting = FIRST_EMU_SETTING ;
current_menu - > max_settings = MAX_NO_OF_EMU_SETTINGS ;
current_menu - > category_id = CATEGORY_SETTINGS ;
2012-06-28 21:49:40 +02:00
break ;
case EMU_VIDEO_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Retro Video " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = EMU_VIDEO_MENU ;
current_menu - > selected = FIRST_EMU_VIDEO_SETTING ;
current_menu - > page = 0 ;
current_menu - > first_setting = FIRST_EMU_VIDEO_SETTING ;
current_menu - > max_settings = MAX_NO_OF_EMU_VIDEO_SETTINGS ;
current_menu - > category_id = CATEGORY_SETTINGS ;
2012-06-28 21:49:40 +02:00
break ;
case EMU_AUDIO_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Retro Audio " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = EMU_AUDIO_MENU ;
current_menu - > selected = FIRST_EMU_AUDIO_SETTING ;
current_menu - > page = 0 ;
current_menu - > first_setting = FIRST_EMU_AUDIO_SETTING ;
current_menu - > max_settings = MAX_NO_OF_EMU_AUDIO_SETTINGS ;
current_menu - > category_id = CATEGORY_SETTINGS ;
2012-06-28 21:49:40 +02:00
break ;
case PATH_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Path " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = PATH_MENU ;
current_menu - > selected = FIRST_PATH_SETTING ;
current_menu - > page = 0 ;
current_menu - > first_setting = FIRST_PATH_SETTING ;
current_menu - > max_settings = MAX_NO_OF_PATH_SETTINGS ;
current_menu - > category_id = CATEGORY_SETTINGS ;
2012-06-28 21:49:40 +02:00
break ;
case CONTROLS_MENU :
2012-07-30 17:19:05 +02:00
strlcpy ( current_menu - > title , " Controls " , sizeof ( current_menu - > title ) ) ;
current_menu - > enum_id = CONTROLS_MENU ;
current_menu - > selected = FIRST_CONTROLS_SETTING_PAGE_1 ;
current_menu - > page = 0 ;
current_menu - > first_setting = FIRST_CONTROLS_SETTING_PAGE_1 ;
current_menu - > max_settings = MAX_NO_OF_CONTROLS_SETTINGS ;
current_menu - > category_id = CATEGORY_SETTINGS ;
2012-06-28 21:49:40 +02:00
break ;
default :
2012-07-30 21:20:42 +02:00
do_refresh = false ;
2012-06-28 21:49:40 +02:00
break ;
}
2012-07-30 21:20:42 +02:00
if ( do_refresh )
2012-07-30 23:27:16 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-01-10 23:33:44 +01:00
}
2012-07-30 17:19:05 +02:00
static void display_menubar ( menu * current_menu )
2012-06-28 21:49:40 +02:00
{
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
filebrowser_t * fb = & browser ;
char current_path [ 256 ] , rarch_version [ 128 ] ;
2012-08-01 16:47:37 +02:00
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-08-03 17:54:22 +02:00
float font_size = HARDCODE_FONT_SIZE ;
2012-08-04 16:53:34 +02:00
float current_path_y_position = CURRENT_PATH_Y_POSITION ;
2012-08-05 03:00:38 +02:00
float current_path_font_size = CURRENT_PATH_FONT_SIZE ;
2012-08-04 16:53:34 +02:00
float msg_prev_next_y_position = MSG_PREV_NEXT_Y_POSITION ;
2012-08-01 16:47:37 +02:00
2012-07-31 03:26:00 +02:00
snprintf ( rarch_version , sizeof ( rarch_version ) , " v%s " , PACKAGE_VERSION ) ;
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 :
2012-08-04 16:53:34 +02:00
render_msg_place_func ( x_position , msg_prev_next_y_position , font_size , WHITE , " NEXT -> " ) ;
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 :
2012-08-04 16:53:34 +02:00
render_msg_place_func ( x_position , msg_prev_next_y_position , font_size , WHITE , " <- PREV | NEXT -> " ) ;
2012-06-29 14:40:50 +02:00
break ;
case CONTROLS_MENU :
case INGAME_MENU_RESIZE :
2012-06-29 15:43:09 +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-06-29 15:43:09 +02:00
case PATH_CHEATS_DIR_CHOICE :
2012-08-04 07:24:15 +02:00
# endif
2012-06-29 15:43:09 +02:00
case PATH_SRAM_DIR_CHOICE :
2012-08-05 17:53:01 +02:00
case PATH_SYSTEM_DIR_CHOICE :
2012-08-04 16:53:34 +02:00
render_msg_place_func ( x_position , msg_prev_next_y_position , font_size , WHITE , " <- PREV " ) ;
2012-06-29 14:40:50 +02:00
break ;
default :
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 :
2012-07-31 03:28:40 +02:00
fb = & tmpBrowser ;
2012-06-29 15:43:09 +02:00
case FILE_BROWSER_MENU :
2012-07-31 16:06:34 +02:00
snprintf ( current_path , sizeof ( current_path ) , " PATH: %s " , filebrowser_get_current_dir ( fb ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , current_path_y_position , current_path_font_size , WHITE , current_path ) ;
2012-06-29 15:43:09 +02:00
break ;
default :
break ;
}
2012-08-03 18:51:56 +02:00
# ifdef _XBOX1
//Render background image
2012-08-05 17:18:19 +02:00
m_menuMainBG . x = 0 ;
m_menuMainBG . y = 0 ;
texture_image_render ( & m_menuMainBG ) ;
2012-08-03 18:51:56 +02:00
# else
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , 0.05f , 1.4f , WHITE , current_menu - > title ) ;
2012-08-03 06:34:33 +02:00
render_msg_place_func ( 0.3f , 0.06f , 0.82f , WHITE , m_title ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( 0.80f , 0.015f , 0.82f , WHITE , rarch_version ) ;
2012-08-03 18:51:56 +02:00
# endif
2012-06-28 21:49:40 +02:00
}
2012-08-01 02:56:15 +02:00
static void browser_update ( filebrowser_t * b , uint64_t input , const char * extensions )
2012-07-16 09:40:26 +02:00
{
2012-08-01 17:22:10 +02:00
bool ret = true ;
2012-07-16 09:40:26 +02:00
filebrowser_action_t action = FILEBROWSER_ACTION_NOOP ;
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_DOWN ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_DOWN ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_UP ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_UP ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_RIGHT ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_LEFT ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R2 ) )
2012-08-02 01:59:05 +02:00
action = FILEBROWSER_ACTION_SCROLL_DOWN ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L2 ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_SCROLL_UP ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) )
2012-07-16 09:40:26 +02:00
action = FILEBROWSER_ACTION_CANCEL ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-06-28 21:49:40 +02:00
{
action = FILEBROWSER_ACTION_RESET ;
2012-08-05 04:43:21 +02:00
filebrowser_set_root ( b , 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 )
rarch_settings_msg ( S_MSG_DIR_LOADING_ERROR , S_DELAY_180 ) ;
2012-06-28 21:49:40 +02:00
}
2012-07-29 22:34:03 +02:00
static void browser_render ( filebrowser_t * b , float current_x , float current_y , float y_spacing )
2012-06-28 21:49:40 +02:00
{
2012-07-31 03:26:00 +02: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 ;
2012-08-03 18:27:38 +02:00
unsigned int current_index , page_number , page_base , i ;
2012-06-28 21:49:40 +02:00
float currentX , currentY , ySpacing ;
current_index = b - > current_dir . ptr ;
page_number = current_index / NUM_ENTRY_PER_PAGE ;
page_base = page_number * NUM_ENTRY_PER_PAGE ;
2012-07-29 22:34:03 +02:00
currentX = current_x ;
currentY = current_y ;
ySpacing = y_spacing ;
2012-06-28 21:49:40 +02:00
for ( i = page_base ; i < file_count & & i < page_base + NUM_ENTRY_PER_PAGE ; + + i )
{
char fname_tmp [ 256 ] ;
fill_pathname_base ( fname_tmp , b - > current_dir . list - > elems [ i ] . data , sizeof ( fname_tmp ) ) ;
currentY = currentY + ySpacing ;
2012-08-03 18:51:56 +02:00
# ifdef _XBOX1
//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
{
m_menuMainRomSelectPanel . x = currentX ;
m_menuMainRomSelectPanel . y = currentY ;
m_menuMainRomSelectPanel . width = ROM_PANEL_WIDTH ;
m_menuMainRomSelectPanel . height = ROM_PANEL_HEIGHT ;
texture_image_render ( & m_menuMainRomSelectPanel ) ;
}
2012-08-03 18:51:56 +02:00
render_msg_place_func ( currentX , currentY , 0 , 0 , fname_tmp ) ;
# else
2012-07-31 03:26:00 +02:00
render_msg_place_func ( currentX , currentY , FONT_SIZE , i = = current_index ? RED : b - > current_dir . list - > elems [ i ] . attr . b ? GREEN : WHITE , fname_tmp ) ;
2012-08-03 18:51:56 +02:00
# endif
2012-06-28 21:49:40 +02:00
}
}
2012-08-03 18:27:38 +02:00
# ifdef __CELLOS_LV2__
2012-02-20 20:24:23 +01:00
static void apply_scaling ( unsigned init_mode )
{
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-05-26 17:35:40 +02:00
2012-04-11 02:42:27 +02:00
switch ( init_mode )
{
case FBO_DEINIT :
2012-07-31 03:26:00 +02:00
gl_deinit_fbo ( device_ptr ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-11 02:42:27 +02:00
case FBO_INIT :
2012-08-02 17:09:41 +02:00
gl_init_fbo ( device_ptr , RARCH_SCALE_BASE * INPUT_SCALE ,
RARCH_SCALE_BASE * INPUT_SCALE ) ;
break ;
2012-04-11 02:42:27 +02:00
case FBO_REINIT :
2012-08-02 17:09:41 +02:00
gl_deinit_fbo ( device_ptr ) ;
gl_init_fbo ( device_ptr , RARCH_SCALE_BASE * INPUT_SCALE ,
2012-04-21 23:25:32 +02:00
RARCH_SCALE_BASE * INPUT_SCALE ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-04-11 02:42:27 +02:00
}
2012-02-20 20:24:23 +01:00
}
2012-08-03 18:27:38 +02:00
# endif
2012-02-20 20:24:23 +01:00
2012-08-01 02:56:15 +02:00
static void select_file ( item * items , menu * current_menu , uint64_t input )
2012-01-31 14:34:43 +01:00
{
2012-07-31 03:26:00 +02:00
char extensions [ 256 ] , object [ 256 ] , comment [ 256 ] , comment_two [ 256 ] , path [ PATH_MAX ] ;
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-01-31 14:34:43 +01:00
2012-08-01 17:22:10 +02:00
bool ret = true ;
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-08-03 17:54:22 +02:00
float comment_y_position = COMMENT_Y_POSITION ;
2012-08-04 16:53:34 +02:00
float comment_two_y_position = COMMENT_TWO_Y_POSITION ;
2012-08-03 17:54:22 +02:00
float font_size = HARDCODE_FONT_SIZE ;
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 ) ) ;
strlcpy ( object , " Shader " , sizeof ( object ) ) ;
2012-08-04 05:26:46 +02:00
snprintf ( comment , sizeof ( comment ) , " INFO - Select a shader by pressing [%s]. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
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 ) ) ;
strlcpy ( object , " Shader preset " , sizeof ( object ) ) ;
2012-08-04 05:26:46 +02:00
snprintf ( comment , sizeof ( comment ) , " INFO - Select a shader preset by pressing [%s]. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
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 ) ) ;
strlcpy ( object , " Input preset " , sizeof ( object ) ) ;
2012-08-04 05:26:46 +02:00
snprintf ( comment , sizeof ( comment ) , " INFO - Select an input preset by pressing [%s]. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
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 ) ) ;
strlcpy ( object , " Border image file " , sizeof ( object ) ) ;
2012-08-04 05:26:46 +02:00
snprintf ( comment , sizeof ( comment ) , " INFO - Select a border image file by pressing [%s]. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
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 ) ) ;
strlcpy ( object , " Libretro core " , sizeof ( object ) ) ;
2012-08-04 05:26:46 +02:00
snprintf ( comment , sizeof ( comment ) , " INFO - Select a Libretro core by pressing [%s]. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
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-07-31 16:06:34 +02:00
browser_update ( & tmpBrowser , input , extensions ) ;
2012-02-22 19:49:22 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-07-31 05:04:47 +02:00
{
bool is_dir = filebrowser_get_current_path_isdir ( & tmpBrowser ) ;
if ( is_dir )
2012-08-01 17:22:10 +02:00
ret = filebrowser_iterate ( & tmpBrowser , FILEBROWSER_ACTION_OK ) ;
2012-07-31 05:04:47 +02:00
else
2012-04-14 04:38:40 +02:00
{
2012-07-31 05:04:47 +02:00
snprintf ( path , sizeof ( path ) , filebrowser_get_current_path ( & tmpBrowser ) ) ;
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 :
rarch_load_shader ( set_shader + 1 , path ) ;
2012-08-02 17:09:41 +02:00
switch ( set_shader + 1 )
{
2012-07-31 05:04:47 +02:00
case 1 :
strlcpy ( g_settings . video . cg_shader_path , path , sizeof ( g_settings . video . cg_shader_path ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case 2 :
2012-07-31 05:04:47 +02:00
strlcpy ( g_settings . video . second_pass_shader , path , sizeof ( g_settings . video . second_pass_shader ) ) ;
2012-08-02 17:09:41 +02:00
break ;
}
menu_stack_refresh ( items , current_menu ) ;
break ;
case PRESET_CHOICE :
strlcpy ( g_console . cgp_path , path , sizeof ( g_console . cgp_path ) ) ;
apply_scaling ( 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
2012-08-02 17:09:41 +02:00
apply_scaling ( FBO_INIT ) ;
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-08-02 17:09:41 +02:00
case INPUT_PRESET_CHOICE :
strlcpy ( g_console . input_cfg_path , path , sizeof ( g_console . input_cfg_path ) ) ;
config_read_keybinds ( path ) ;
menu_stack_refresh ( items , current_menu ) ;
break ;
case BORDER_CHOICE :
break ;
case LIBRETRO_CHOICE :
strlcpy ( g_settings . libretro , path , sizeof ( g_settings . libretro ) ) ;
if ( set_libretro_core_as_launch )
{
2012-07-31 05:04:47 +02:00
strlcpy ( g_console . launch_app_on_exit , path , sizeof ( g_console . launch_app_on_exit ) ) ;
2012-08-02 17:09:41 +02:00
set_libretro_core_as_launch = false ;
rarch_settings_change ( S_RETURN_TO_LAUNCHER ) ;
}
break ;
}
menu_stack_decrement ( ) ;
2012-04-14 04:38:40 +02:00
}
2012-08-01 17:22:10 +02:00
if ( ! ret )
rarch_settings_msg ( S_MSG_DIR_LOADING_ERROR , S_DELAY_180 ) ;
2012-07-31 05:04:47 +02:00
}
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_X ) )
2012-07-31 05:04:47 +02:00
menu_stack_decrement ( ) ;
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
2012-08-02 05:49:37 +02:00
snprintf ( comment_two , sizeof ( comment_two ) , " [%s] - return to settings [%s] - Reset Startdir " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_X ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) ;
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , comment_two_y_position , font_size , YELLOW , comment_two ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , comment_y_position , font_size , WHITE , comment ) ;
2012-01-31 14:34:43 +01:00
}
2012-08-01 02:56:15 +02:00
static void select_directory ( item * items , menu * current_menu , uint64_t input )
2012-01-31 14:34:43 +01:00
{
2012-08-02 15:52:31 +02:00
char path [ 1024 ] , msg [ 256 ] ;
2012-08-01 17:22:10 +02:00
bool ret = true ;
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-01-31 14:34:43 +01:00
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-08-03 17:54:22 +02:00
float comment_y_position = COMMENT_Y_POSITION ;
2012-08-04 16:53:34 +02:00
float y_position_increment = POSITION_Y_INCREMENT ;
float comment_two_y_position = COMMENT_TWO_Y_POSITION ;
2012-08-03 17:54:22 +02:00
float font_size = HARDCODE_FONT_SIZE ;
2012-08-01 16:47:37 +02:00
2012-07-31 05:04:47 +02:00
bool is_dir = filebrowser_get_current_path_isdir ( & tmpBrowser ) ;
2012-07-31 16:06:34 +02:00
browser_update ( & tmpBrowser , input , " empty " ) ;
2012-02-22 19:49:22 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_Y ) )
2012-07-31 05:04:47 +02:00
{
if ( is_dir )
2012-04-14 04:38:40 +02:00
{
2012-07-31 05:04:47 +02:00
snprintf ( path , sizeof ( path ) , filebrowser_get_current_path ( & tmpBrowser ) ) ;
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 :
2012-05-22 18:51:06 +02:00
strlcpy ( g_console . default_savestate_dir , path , sizeof ( g_console . default_savestate_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case PATH_SRAM_DIR_CHOICE :
2012-07-31 05:04:47 +02:00
strlcpy ( g_console . default_sram_dir , path , sizeof ( g_console . default_sram_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
strlcpy ( g_console . default_rom_startup_dir , path , sizeof ( g_console . default_rom_startup_dir ) ) ;
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
}
menu_stack_decrement ( ) ;
2012-04-14 04:38:40 +02:00
}
2012-07-31 05:04:47 +02:00
}
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_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 :
strlcpy ( g_console . default_savestate_dir , path , sizeof ( g_console . default_savestate_dir ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case PATH_SRAM_DIR_CHOICE :
strlcpy ( g_console . default_sram_dir , path , sizeof ( g_console . default_sram_dir ) ) ;
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
strlcpy ( g_console . default_rom_startup_dir , path , sizeof ( g_console . default_rom_startup_dir ) ) ;
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
menu_stack_decrement ( ) ;
}
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-07-31 05:04:47 +02:00
{
if ( is_dir )
2012-08-01 17:22:10 +02:00
ret = filebrowser_iterate ( & tmpBrowser , FILEBROWSER_ACTION_OK ) ;
2012-04-14 04:38:40 +02:00
}
2012-08-01 17:22:10 +02:00
if ( ! ret )
rarch_settings_msg ( S_MSG_DIR_LOADING_ERROR , S_DELAY_180 ) ;
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-06-29 15:43:09 +02:00
2012-08-04 17:30:31 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] - Enter dir | [%s] - Go back " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_X ) ) ;
2012-08-02 15:52:31 +02:00
render_msg_place_func ( x_position , comment_two_y_position , font_size , YELLOW , msg ) ;
snprintf ( msg , sizeof ( msg ) , " [%s] - Reset to startdir " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) ;
2012-08-04 16:53:34 +02:00
render_msg_place_func ( x_position , comment_two_y_position + ( y_position_increment * 1 ) , FONT_SIZE , YELLOW , msg ) ;
2012-08-02 15:52:31 +02:00
snprintf ( msg , sizeof ( msg ) , " INFO - Browse to a directory and assign it as the path by \n pressing [%s]. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_Y ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , comment_y_position , font_size , WHITE , msg ) ;
2012-01-31 14:34:43 +01:00
}
2012-08-01 02:56:15 +02:00
static void set_keybind_digital ( uint64_t default_retro_joypad_id , uint64_t input )
2012-02-29 09:15:59 +01:00
{
2012-04-13 04:31:18 +02:00
unsigned keybind_action = KEYBIND_NOACTION ;
2012-04-11 02:42:27 +02:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-04-13 04:31:18 +02:00
keybind_action = KEYBIND_DECREMENT ;
2012-04-11 02:42:27 +02:00
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-04-13 04:31:18 +02:00
keybind_action = KEYBIND_INCREMENT ;
2012-04-11 02:42:27 +02:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-04-13 04:31:18 +02:00
keybind_action = KEYBIND_DEFAULT ;
2012-04-21 23:25:32 +02:00
rarch_input_set_keybind ( currently_selected_controller_menu , keybind_action , default_retro_joypad_id ) ;
2012-02-29 09:15:59 +01:00
}
2012-08-03 03:24:36 +02:00
# ifdef __CELLOS_LV2__
2012-04-21 23:25:32 +02:00
static void rarch_filename_input_and_save ( unsigned filename_type )
2012-03-01 14:22:16 +01:00
{
2012-04-14 04:38:40 +02:00
bool filename_entered = false ;
2012-05-28 17:34:58 +02:00
char filename_tmp [ 256 ] , filepath [ PATH_MAX ] ;
2012-04-14 04:38:40 +02:00
oskutil_write_initial_message ( & g_console . oskutil_handle , L " example " ) ;
oskutil_write_message ( & g_console . oskutil_handle , L " Enter filename for preset (with no file extension) " ) ;
2012-03-01 14:22:16 +01:00
2012-04-14 04:38:40 +02:00
oskutil_start ( & g_console . oskutil_handle ) ;
2012-03-01 14:22:16 +01:00
2012-04-14 04:38:40 +02:00
while ( OSK_IS_RUNNING ( g_console . oskutil_handle ) )
{
2012-06-28 14:10:05 +02:00
gfx_ctx_clear ( ) ;
2012-05-27 16:23:01 +02:00
gfx_ctx_swap_buffers ( ) ;
# ifdef HAVE_SYSUTILS
2012-04-14 04:38:40 +02:00
cellSysutilCheckCallback ( ) ;
2012-05-27 16:23:01 +02:00
# endif
2012-04-14 04:38:40 +02:00
}
if ( g_console . oskutil_handle . text_can_be_fetched )
{
2012-05-28 17:28:29 +02:00
strlcpy ( filename_tmp , OUTPUT_TEXT_STRING ( g_console . oskutil_handle ) , sizeof ( filename_tmp ) ) ;
2012-08-02 17:09:41 +02:00
2012-04-14 04:38:40 +02:00
switch ( filename_type )
{
case CONFIG_FILE :
break ;
2012-08-02 17:09:41 +02:00
case SHADER_PRESET_FILE :
snprintf ( filepath , sizeof ( filepath ) , " %s/%s.cgp " , default_paths . cgp_dir , filename_tmp ) ;
break ;
case INPUT_PRESET_FILE :
snprintf ( filepath , sizeof ( filepath ) , " %s/%s.cfg " , default_paths . input_presets_dir , filename_tmp ) ;
break ;
2012-04-14 04:38:40 +02:00
}
2012-03-01 14:22:16 +01:00
2012-04-14 04:38:40 +02:00
filename_entered = true ;
}
2012-03-01 14:22:16 +01:00
2012-04-14 04:38:40 +02:00
if ( filename_entered )
{
2012-07-31 05:04:47 +02:00
char filetitle_tmp [ 256 ] ;
2012-04-14 04:38:40 +02:00
oskutil_write_initial_message ( & g_console . oskutil_handle , L " Example file title " ) ;
oskutil_write_message ( & g_console . oskutil_handle , L " Enter title for preset " ) ;
oskutil_start ( & g_console . oskutil_handle ) ;
2012-03-01 14:22:16 +01:00
2012-04-14 04:38:40 +02:00
while ( OSK_IS_RUNNING ( g_console . oskutil_handle ) )
{
/* OSK Util gets updated */
2012-06-28 14:10:05 +02:00
gfx_ctx_clear ( ) ;
2012-08-02 17:09:41 +02:00
gfx_ctx_swap_buffers ( ) ;
2012-05-27 16:23:01 +02:00
# ifdef HAVE_SYSUTILS
cellSysutilCheckCallback ( ) ;
# endif
2012-04-14 04:38:40 +02:00
}
if ( g_console . oskutil_handle . text_can_be_fetched )
snprintf ( filetitle_tmp , sizeof ( filetitle_tmp ) , " %s " , OUTPUT_TEXT_STRING ( g_console . oskutil_handle ) ) ;
else
snprintf ( filetitle_tmp , sizeof ( filetitle_tmp ) , " %s " , " Custom " ) ;
switch ( filename_type )
{
case CONFIG_FILE :
break ;
case SHADER_PRESET_FILE :
{
2012-08-02 17:09:41 +02:00
struct gl_cg_cgp_info current_settings ;
2012-04-14 04:38:40 +02: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 ) ;
}
break ;
case INPUT_PRESET_FILE :
config_save_keybinds ( filepath ) ;
break ;
}
}
2012-03-01 14:22:16 +01:00
}
2012-08-03 03:24:36 +02:00
# endif
2012-07-31 16:06:34 +02:00
2012-08-01 02:56:15 +02:00
static void producesettingentry ( menu * current_menu , item * items , unsigned switchvalue , uint64_t input )
2012-01-16 04:07:02 +01:00
{
2012-07-30 17:19:05 +02:00
switch ( switchvalue )
{
2012-08-03 03:24:36 +02:00
# ifdef __CELLOS_LV2__
2012-07-30 17:19:05 +02:00
case SETTING_CHANGE_RESOLUTION :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) )
2012-07-30 17:19:05 +02:00
rarch_settings_change ( S_RESOLUTION_NEXT ) ;
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
rarch_settings_change ( S_RESOLUTION_PREVIOUS ) ;
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-07-30 17:19:05 +02:00
{
if ( g_console . supported_resolutions [ g_console . current_resolution_index ] = = CELL_VIDEO_OUT_RESOLUTION_576 )
2012-05-29 15:25:39 +02:00
{
2012-07-30 17:19:05 +02:00
if ( gfx_ctx_check_resolution ( CELL_VIDEO_OUT_RESOLUTION_576 ) )
{
//ps3graphics_set_pal60hz(Settings.PS3PALTemporalMode60Hz);
2012-08-03 18:27:38 +02:00
video_ptr . restart ( ) ;
2012-07-30 17:19:05 +02:00
}
2012-05-29 15:25:39 +02:00
}
else
{
2012-07-30 17:19:05 +02:00
//ps3graphics_set_pal60hz(0);
2012-08-03 18:27:38 +02:00
video_ptr . restart ( ) ;
2012-01-16 04:07:02 +01:00
}
2012-07-30 17:19:05 +02:00
}
break ;
/*
case SETTING_PAL60_MODE :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
if ( Graphics - > GetCurrentResolution ( ) = = CELL_VIDEO_OUT_RESOLUTION_576 )
{
if ( Graphics - > CheckResolution ( CELL_VIDEO_OUT_RESOLUTION_576 ) )
{
Settings . PS3PALTemporalMode60Hz = ! Settings . PS3PALTemporalMode60Hz ;
Graphics - > SetPAL60Hz ( Settings . PS3PALTemporalMode60Hz ) ;
Graphics - > SwitchResolution ( Graphics - > GetCurrentResolution ( ) , Settings . PS3PALTemporalMode60Hz , Settings . TripleBuffering ) ;
}
}
}
break ;
*/
2012-08-03 03:24:36 +02:00
# endif
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-07-30 17:19:05 +02:00
case SETTING_SHADER_PRESETS :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
if ( g_console . emulator_initialized )
2012-05-29 01:27:45 +02:00
{
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , PRESET_CHOICE ) ;
2012-08-02 17:09:41 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , EXT_CGP_PRESETS , default_paths . cgp_dir ) ;
2012-05-29 01:27:45 +02:00
}
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
strlcpy ( g_console . cgp_path , " " , sizeof ( g_console . cgp_path ) ) ;
break ;
case SETTING_SHADER :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , SHADER_CHOICE ) ;
2012-07-30 23:27:16 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , EXT_SHADERS , default_paths . shader_dir ) ;
2012-05-29 15:25:39 +02:00
set_shader = 0 ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_load_shader ( 1 , NULL ) ;
2012-07-23 18:17:50 +02:00
strlcpy ( g_settings . video . cg_shader_path , default_paths . shader_file , sizeof ( g_settings . video . cg_shader_path ) ) ;
2012-07-30 17:19:05 +02:00
menu_stack_refresh ( items , current_menu ) ;
}
break ;
case SETTING_SHADER_2 :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , SHADER_CHOICE ) ;
2012-07-30 23:27:16 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , EXT_SHADERS , default_paths . shader_dir ) ;
2012-05-29 15:25:39 +02:00
set_shader = 1 ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_load_shader ( 2 , NULL ) ;
2012-07-23 18:17:50 +02:00
strlcpy ( g_settings . video . second_pass_shader , default_paths . shader_file , sizeof ( g_settings . video . second_pass_shader ) ) ;
2012-07-30 17:19:05 +02:00
menu_stack_refresh ( items , current_menu ) ;
}
break ;
2012-08-03 03:24:36 +02:00
# endif
2012-07-30 17:19:05 +02:00
case SETTING_FONT_SIZE :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
{
if ( g_console . menu_font_size > 0 )
g_console . menu_font_size - = 0.01f ;
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
if ( ( g_console . menu_font_size < 2.0f ) )
g_console . menu_font_size + = 0.01f ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
g_console . menu_font_size = 1.0f ;
break ;
case SETTING_KEEP_ASPECT_RATIO :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_ASPECT_RATIO_DECREMENT ) ;
2012-05-29 22:22:47 +02:00
gfx_ctx_set_aspect_ratio ( NULL , g_console . aspect_ratio_index ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_ASPECT_RATIO_INCREMENT ) ;
2012-05-29 22:22:47 +02:00
gfx_ctx_set_aspect_ratio ( NULL , g_console . aspect_ratio_index ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_default ( S_DEF_ASPECT_RATIO ) ;
2012-05-29 22:22:47 +02:00
gfx_ctx_set_aspect_ratio ( NULL , g_console . aspect_ratio_index ) ;
2012-07-30 17:19:05 +02:00
}
break ;
case SETTING_HW_TEXTURE_FILTER :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_HW_TEXTURE_FILTER ) ;
2012-06-28 21:03:14 +02:00
gfx_ctx_set_filtering ( 1 , g_settings . video . smooth ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_DEF_HW_TEXTURE_FILTER ) ;
2012-06-28 21:03:14 +02:00
gfx_ctx_set_filtering ( 1 , g_settings . video . smooth ) ;
2012-07-30 17:19:05 +02:00
}
break ;
2012-08-04 03:11:49 +02:00
# ifdef HAVE_FBO
2012-07-30 17:19:05 +02:00
case SETTING_HW_TEXTURE_FILTER_2 :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_HW_TEXTURE_FILTER_2 ) ;
gfx_ctx_set_filtering ( 2 , g_settings . video . second_pass_smooth ) ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_DEF_HW_TEXTURE_FILTER_2 ) ;
gfx_ctx_set_filtering ( 2 , g_settings . video . second_pass_smooth ) ;
}
break ;
case SETTING_SCALE_ENABLED :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_SCALE_ENABLED ) ;
gfx_ctx_set_fbo ( g_console . fbo_enabled ) ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_default ( S_DEF_SCALE_ENABLED ) ;
apply_scaling ( FBO_DEINIT ) ;
apply_scaling ( FBO_INIT ) ;
}
break ;
case SETTING_SCALE_FACTOR :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
if ( g_console . fbo_enabled )
2012-07-31 05:04:47 +02:00
{
2012-08-02 17:09:41 +02:00
bool should_decrement = g_settings . video . fbo_scale_x > MIN_SCALING_FACTOR ;
if ( should_decrement )
{
rarch_settings_change ( S_SCALE_FACTOR_DECREMENT ) ;
apply_scaling ( FBO_REINIT ) ;
}
}
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
if ( g_console . fbo_enabled )
2012-05-29 15:25:39 +02:00
{
2012-07-30 17:19:05 +02:00
bool should_increment = g_settings . video . fbo_scale_x < MAX_SCALING_FACTOR ;
if ( should_increment )
{
rarch_settings_change ( S_SCALE_FACTOR_INCREMENT ) ;
apply_scaling ( FBO_REINIT ) ;
}
2012-05-29 15:25:39 +02:00
}
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_default ( S_DEF_SCALE_FACTOR ) ;
2012-05-29 15:25:39 +02:00
apply_scaling ( FBO_DEINIT ) ;
apply_scaling ( FBO_INIT ) ;
2012-07-30 17:19:05 +02:00
}
break ;
2012-08-07 18:26:52 +02:00
# endif
# ifdef _XBOX1
case SETTING_FLICKER_FILTER :
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
{
if ( g_console . flicker_filter > 0 )
g_console . flicker_filter - - ;
}
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) )
{
if ( g_console . flicker_filter < 5 )
g_console . flicker_filter + + ;
}
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
{
g_console . flicker_filter = 0 ;
}
break ;
case SETTING_SOFT_DISPLAY_FILTER :
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
{
g_console . soft_display_filter_enable = ! g_console . soft_display_filter_enable ;
}
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
{
g_console . soft_display_filter_enable = true ;
}
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-07-30 17:19:05 +02:00
case SETTING_HW_OVERSCAN_AMOUNT :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_OVERSCAN_DECREMENT ) ;
gfx_ctx_set_overscan ( ) ;
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_OVERSCAN_INCREMENT ) ;
gfx_ctx_set_overscan ( ) ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_default ( S_DEF_OVERSCAN ) ;
gfx_ctx_set_overscan ( ) ;
}
break ;
case SETTING_THROTTLE_MODE :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_THROTTLE ) ;
gfx_ctx_set_swap_interval ( g_console . throttle_enable , true ) ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_default ( S_DEF_THROTTLE ) ;
gfx_ctx_set_swap_interval ( g_console . throttle_enable , true ) ;
}
break ;
case SETTING_TRIPLE_BUFFERING :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_TRIPLE_BUFFERING ) ;
2012-08-03 18:27:38 +02:00
video_ptr . restart ( ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
2012-07-31 16:06:34 +02:00
bool old_buffer_input = g_console . triple_buffering_enable ;
2012-07-30 17:19:05 +02:00
rarch_settings_default ( S_DEF_TRIPLE_BUFFERING ) ;
2012-07-31 16:06:34 +02:00
if ( ! old_buffer_input )
2012-08-03 18:27:38 +02:00
video_ptr . restart ( ) ;
2012-07-30 17:19:05 +02:00
}
break ;
case SETTING_ENABLE_SCREENSHOTS :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-01-16 15:45:55 +01:00
# if(CELL_SDK_VERSION > 0x340000)
2012-07-30 17:19:05 +02:00
g_console . screenshots_enable = ! g_console . screenshots_enable ;
2012-05-29 15:25:39 +02:00
if ( g_console . screenshots_enable )
{
2012-07-30 17:19:05 +02:00
cellSysmoduleLoadModule ( CELL_SYSMODULE_SYSUTIL_SCREENSHOT ) ;
CellScreenShotSetParam screenshot_param = { 0 , 0 , 0 , 0 } ;
2012-01-16 15:45:55 +01:00
2012-07-30 17:19:05 +02:00
screenshot_param . photo_title = " RetroArch PS3 " ;
screenshot_param . game_title = " RetroArch PS3 " ;
cellScreenShotSetParameter ( & screenshot_param ) ;
cellScreenShotEnable ( ) ;
2012-05-29 15:25:39 +02:00
}
else
{
2012-07-30 17:19:05 +02:00
cellScreenShotDisable ( ) ;
cellSysmoduleUnloadModule ( CELL_SYSMODULE_SYSUTIL_SCREENSHOT ) ;
2012-05-29 15:25:39 +02:00
}
2012-01-16 15:45:55 +01:00
# endif
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
2012-01-16 15:45:55 +01:00
# if(CELL_SDK_VERSION > 0x340000)
2012-07-30 17:19:05 +02:00
g_console . screenshots_enable = true ;
2012-01-16 15:45:55 +01:00
# endif
2012-07-30 17:19:05 +02:00
}
break ;
2012-08-03 03:24:36 +02:00
# if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
2012-07-30 17:19:05 +02:00
case SETTING_SAVE_SHADER_PRESET :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
rarch_filename_input_and_save ( SHADER_PRESET_FILE ) ;
break ;
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP :
break ;
2012-08-03 03:24:36 +02:00
# endif
2012-07-30 17:19:05 +02:00
case SETTING_DEFAULT_VIDEO_ALL :
break ;
case SETTING_SOUND_MODE :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
{
if ( g_console . sound_mode ! = SOUND_MODE_NORMAL )
g_console . sound_mode - - ;
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-03 18:27:38 +02:00
if ( g_console . sound_mode < ( SOUND_MODE_LAST - 1 ) )
2012-07-30 17:19:05 +02:00
g_console . sound_mode + + ;
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_UP ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_DOWN ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-03 18:27:38 +02:00
# ifdef HAVE_RSOUND
2012-07-30 17:19:05 +02:00
if ( g_console . sound_mode ! = SOUND_MODE_RSOUND )
rarch_console_rsound_stop ( ) ;
2012-05-29 15:25:39 +02:00
else
2012-07-30 17:19:05 +02:00
rarch_console_rsound_start ( g_settings . audio . device ) ;
2012-08-03 18:27:38 +02:00
# endif
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
g_console . sound_mode = SOUND_MODE_NORMAL ;
2012-08-03 18:27:38 +02:00
# ifdef HAVE_RSOUND
2012-05-29 15:25:39 +02:00
rarch_console_rsound_stop ( ) ;
2012-08-03 18:27:38 +02:00
# endif
2012-07-30 17:19:05 +02:00
}
break ;
2012-08-03 03:24:36 +02:00
# ifdef HAVE_RSOUND
2012-07-30 17:19:05 +02:00
case SETTING_RSOUND_SERVER_IP_ADDRESS :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
oskutil_write_initial_message ( & g_console . oskutil_handle , L " 192.168.1.1 " ) ;
2012-05-29 15:25:39 +02:00
oskutil_write_message ( & g_console . oskutil_handle , L " Enter IP address for the RSound Server. " ) ;
oskutil_start ( & g_console . oskutil_handle ) ;
while ( OSK_IS_RUNNING ( g_console . oskutil_handle ) )
{
2012-07-30 17:19:05 +02:00
gfx_ctx_clear ( ) ;
gfx_ctx_swap_buffers ( ) ;
2012-05-27 16:23:01 +02:00
# ifdef HAVE_SYSUTILS
2012-07-30 17:19:05 +02:00
cellSysutilCheckCallback ( ) ;
2012-05-27 16:23:01 +02:00
# endif
2012-05-29 15:25:39 +02:00
}
2012-03-03 11:46:46 +01:00
2012-05-29 15:25:39 +02:00
if ( g_console . oskutil_handle . text_can_be_fetched )
2012-07-30 17:19:05 +02:00
strlcpy ( g_settings . audio . device , OUTPUT_TEXT_STRING ( g_console . oskutil_handle ) , sizeof ( g_settings . audio . device ) ) ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02: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-07-30 17:19:05 +02:00
case SETTING_DEFAULT_AUDIO_ALL :
break ;
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
rarch_settings_change ( S_SAVESTATE_DECREMENT ) ;
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
rarch_settings_change ( S_SAVESTATE_INCREMENT ) ;
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
rarch_settings_default ( S_DEF_SAVE_STATE ) ;
break ;
2012-08-05 18:42:54 +02:00
case SETTING_EMU_SHOW_DEBUG_INFO_MSG :
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
g_console . fps_info_msg_enable = ! g_console . fps_info_msg_enable ;
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
g_console . fps_info_msg_enable = false ;
break ;
2012-07-30 17:19:05 +02:00
case SETTING_EMU_SHOW_INFO_MSG :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
g_console . info_msg_enable = ! g_console . info_msg_enable ;
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
g_console . info_msg_enable = true ;
break ;
case SETTING_EMU_REWIND_ENABLED :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
rarch_settings_change ( S_REWIND ) ;
2012-01-21 06:06:01 +01:00
2012-05-29 15:25:39 +02:00
if ( g_console . info_msg_enable )
2012-07-30 17:19:05 +02:00
rarch_settings_msg ( S_MSG_RESTART_RARCH , S_DELAY_180 ) ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
g_settings . rewind_enable = false ;
break ;
case SETTING_ZIP_EXTRACT :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) )
2012-07-30 17:19:05 +02:00
{
if ( g_console . zip_extract_mode > 0 )
g_console . zip_extract_mode - - ;
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
if ( g_console . zip_extract_mode < ZIP_EXTRACT_TO_CACHE_DIR )
g_console . zip_extract_mode + + ;
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
g_console . zip_extract_mode = ZIP_EXTRACT_TO_CURRENT_DIR ;
}
break ;
case SETTING_RARCH_DEFAULT_EMU :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
menu_stack_push ( items , LIBRETRO_CHOICE ) ;
2012-07-31 05:04:47 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , EXT_EXECUTABLES , default_paths . core_dir ) ;
set_libretro_core_as_launch = false ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
}
break ;
case SETTING_EMU_AUDIO_MUTE :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-08-02 17:09:41 +02:00
rarch_settings_change ( S_AUDIO_MUTE ) ;
2012-07-17 01:06:13 +02:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-08-02 17:09:41 +02:00
rarch_settings_default ( S_DEF_AUDIO_MUTE ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_ENABLE_CUSTOM_BGM :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-03-03 17:23:00 +01:00
# if(CELL_SDK_VERSION > 0x340000)
2012-07-30 17:19:05 +02:00
g_console . custom_bgm_enable = ! g_console . custom_bgm_enable ;
2012-05-29 15:25:39 +02:00
if ( g_console . custom_bgm_enable )
2012-07-30 17:19:05 +02:00
cellSysutilEnableBgmPlayback ( ) ;
2012-05-29 15:25:39 +02:00
else
2012-07-30 17:19:05 +02:00
cellSysutilDisableBgmPlayback ( ) ;
2012-03-03 17:23:00 +01:00
# endif
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
2012-03-03 17:23:00 +01:00
# if(CELL_SDK_VERSION > 0x340000)
2012-07-30 17:19:05 +02:00
g_console . custom_bgm_enable = true ;
2012-03-03 17:23:00 +01:00
# endif
2012-07-30 17:19:05 +02:00
}
break ;
case SETTING_EMU_VIDEO_DEFAULT_ALL :
break ;
case SETTING_EMU_AUDIO_DEFAULT_ALL :
break ;
case SETTING_PATH_DEFAULT_ROM_DIRECTORY :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , PATH_DEFAULT_ROM_DIR_CHOICE ) ;
2012-08-05 04:43:21 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-07-30 17:19:05 +02:00
}
2012-01-30 15:16:29 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-08-05 04:43:21 +02:00
strlcpy ( g_console . default_rom_startup_dir , default_paths . filesystem_root_dir , sizeof ( g_console . default_rom_startup_dir ) ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_PATH_SAVESTATES_DIRECTORY :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , PATH_SAVESTATES_DIR_CHOICE ) ;
2012-08-05 04:43:21 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-07-30 17:19:05 +02:00
}
2012-01-30 17:18:31 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
strlcpy ( g_console . default_savestate_dir , default_paths . savestate_dir , sizeof ( g_console . default_savestate_dir ) ) ;
2012-01-30 17:18:31 +01:00
2012-07-30 17:19:05 +02:00
break ;
case SETTING_PATH_SRAM_DIRECTORY :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , PATH_SRAM_DIR_CHOICE ) ;
2012-08-05 04:43:21 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-07-30 17:19:05 +02:00
}
2012-01-30 17:18:31 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
strlcpy ( g_console . default_sram_dir , default_paths . sram_dir , sizeof ( g_console . default_sram_dir ) ) ;
break ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-07-30 17:19:05 +02:00
case SETTING_PATH_CHEATS :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
menu_stack_push ( items , PATH_CHEATS_DIR_CHOICE ) ;
2012-08-05 04:43:21 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , " empty " , default_paths . filesystem_root_dir ) ;
2012-07-30 17:19:05 +02:00
}
2012-01-30 15:16:29 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-08-02 17:09:41 +02:00
strlcpy ( g_settings . cheat_database , default_paths . port_dir , sizeof ( g_settings . cheat_database ) ) ;
2012-07-30 17:19:05 +02:00
break ;
2012-08-04 07:24:15 +02:00
# endif
2012-07-30 17:19:05 +02:00
case SETTING_PATH_SYSTEM :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
menu_stack_push ( items , PATH_SYSTEM_DIR_CHOICE ) ;
2012-08-05 04:56:27 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , " empty " , default_paths . system_dir ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-10 04:00:04 +02:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-08-02 17:09:41 +02:00
strlcpy ( g_settings . system_directory , default_paths . system_dir , sizeof ( g_settings . system_directory ) ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_ENABLE_SRAM_PATH :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
g_console . default_sram_dir_enable = ! g_console . default_sram_dir_enable ;
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
g_console . default_sram_dir_enable = true ;
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
break ;
case SETTING_ENABLE_STATE_PATH :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
g_console . default_savestate_dir_enable = ! g_console . default_savestate_dir_enable ;
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
g_console . default_savestate_dir_enable = true ;
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
break ;
case SETTING_PATH_DEFAULT_ALL :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
strlcpy ( g_console . default_rom_startup_dir , " / " , sizeof ( g_console . default_rom_startup_dir ) ) ;
2012-07-31 05:04:47 +02:00
strlcpy ( g_console . default_savestate_dir , default_paths . port_dir , sizeof ( g_console . default_savestate_dir ) ) ;
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-07-31 05:04:47 +02:00
strlcpy ( g_settings . cheat_database , default_paths . port_dir , sizeof ( g_settings . cheat_database ) ) ;
2012-08-04 07:24:15 +02:00
# endif
2012-07-31 05:04:47 +02:00
strlcpy ( g_console . default_sram_dir , " " , sizeof ( g_console . default_sram_dir ) ) ;
2012-01-30 17:18:31 +01:00
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
break ;
case SETTING_CONTROLS_SCHEME :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
menu_stack_push ( items , INPUT_PRESET_CHOICE ) ;
2012-07-31 05:04:47 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , EXT_INPUT_PRESETS , default_paths . input_presets_dir ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
menu_stack_refresh ( items , current_menu ) ;
break ;
case SETTING_CONTROLS_NUMBER :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
if ( currently_selected_controller_menu ! = 0 )
currently_selected_controller_menu - - ;
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
if ( currently_selected_controller_menu < 6 )
currently_selected_controller_menu + + ;
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-07-30 17:19:05 +02:00
currently_selected_controller_menu = 0 ;
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_UP , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_DOWN , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_LEFT , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_RIGHT , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_A , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_B , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_X , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_Y , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_SELECT , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_START , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_L , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_R , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L2 :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_L2 , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R2 :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_R2 , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L3 :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_L3 , input ) ;
2012-07-30 17:19:05 +02:00
break ;
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R3 :
2012-07-31 16:06:34 +02:00
set_keybind_digital ( RETRO_DEVICE_ID_JOYPAD_R3 , input ) ;
2012-07-30 17:19:05 +02:00
break ;
2012-08-03 18:27:38 +02:00
# ifdef __CELLOS_LV2__
2012-07-30 17:19:05 +02:00
case SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) )
2012-08-02 17:09:41 +02:00
rarch_filename_input_and_save ( INPUT_PRESET_FILE ) ;
2012-07-30 17:19:05 +02:00
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-07-30 17:19:05 +02:00
case SETTING_CONTROLS_DEFAULT_ALL :
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) )
2012-07-30 17:19:05 +02:00
{
2012-08-02 17:09:41 +02:00
rarch_input_set_default_keybinds ( currently_selected_controller_menu ) ;
2012-07-31 05:04:47 +02:00
menu_stack_refresh ( items , current_menu ) ;
2012-07-30 17:19:05 +02:00
}
break ;
}
2012-01-16 04:07:02 +01:00
2012-07-30 17:19:05 +02:00
set_setting_label ( current_menu , items , switchvalue ) ;
2012-01-16 04:07:02 +01:00
}
2012-01-10 23:33:44 +01:00
2012-07-30 17:19:05 +02:00
static void settings_iterate ( menu * current_menu , item * items , settings_action_t action )
2012-01-10 23:33:44 +01:00
{
2012-06-19 03:44:17 +02:00
switch ( action )
{
case SETTINGS_ACTION_DOWN :
2012-07-30 17:19:05 +02:00
current_menu - > selected + + ;
2012-08-02 17:09:41 +02:00
if ( current_menu - > selected > = current_menu - > max_settings )
2012-07-30 17:19:05 +02:00
current_menu - > selected = current_menu - > first_setting ;
2012-08-02 17:09:41 +02:00
if ( items [ current_menu - > selected ] . page ! = current_menu - > page )
2012-07-30 17:19:05 +02:00
current_menu - > page = items [ current_menu - > selected ] . page ;
2012-06-19 03:44:17 +02:00
break ;
case SETTINGS_ACTION_UP :
2012-07-30 17:19:05 +02:00
if ( current_menu - > selected = = current_menu - > first_setting )
current_menu - > selected = current_menu - > max_settings - 1 ;
2012-08-02 17:09:41 +02:00
else
2012-07-30 17:19:05 +02:00
current_menu - > selected - - ;
2012-08-02 17:09:41 +02:00
if ( items [ current_menu - > selected ] . page ! = current_menu - > page )
2012-07-30 17:19:05 +02:00
current_menu - > page = items [ current_menu - > selected ] . page ;
2012-06-19 03:44:17 +02:00
break ;
case SETTINGS_ACTION_TAB_PREVIOUS :
2012-08-02 17:09:41 +02:00
menu_stack_decrement ( ) ;
2012-06-19 03:44:17 +02:00
break ;
case SETTINGS_ACTION_TAB_NEXT :
2012-07-30 17:19:05 +02:00
switch ( current_menu - > enum_id )
2012-08-02 17:09:41 +02:00
{
2012-04-14 04:38:40 +02:00
case GENERAL_VIDEO_MENU :
2012-08-02 17:09:41 +02:00
case GENERAL_AUDIO_MENU :
case EMU_GENERAL_MENU :
case EMU_VIDEO_MENU :
case EMU_AUDIO_MENU :
case PATH_MENU :
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , current_menu - > enum_id + 1 ) ;
2012-08-02 17:09:41 +02:00
break ;
case CONTROLS_MENU :
2012-06-28 21:03:14 +02:00
default :
2012-08-02 17:09:41 +02:00
break ;
}
2012-06-19 03:44:17 +02:00
break ;
2012-06-30 14:04:34 +02:00
default :
break ;
2012-06-19 03:44:17 +02:00
}
}
2012-01-10 23:33:44 +01:00
2012-08-01 02:56:15 +02:00
static void select_setting ( item * items , menu * current_menu , uint64_t input )
2012-06-19 03:44:17 +02:00
{
2012-06-28 13:11:07 +02:00
unsigned i ;
2012-08-02 05:49:37 +02:00
char msg [ 256 ] ;
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-01-10 23:33:44 +01:00
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-08-04 05:10:49 +02:00
float x_position_center = POSITION_X_CENTER ;
2012-08-04 17:21:49 +02:00
float y_position_increment = POSITION_Y_INCREMENT ;
2012-08-03 17:54:22 +02:00
float comment_y_position = COMMENT_Y_POSITION ;
2012-08-04 16:53:34 +02:00
float comment_two_y_position = COMMENT_TWO_Y_POSITION ;
2012-08-03 17:54:22 +02:00
float font_size = HARDCODE_FONT_SIZE ;
2012-08-01 16:47:37 +02:00
2012-06-28 21:03:14 +02:00
settings_action_t action = SETTINGS_ACTION_NOOP ;
/* back to ROM menu if CIRCLE is pressed */
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) ) )
2012-06-28 21:03:14 +02:00
action = SETTINGS_ACTION_TAB_PREVIOUS ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R ) )
2012-06-28 21:03:14 +02:00
action = SETTINGS_ACTION_TAB_NEXT ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_DOWN ) )
2012-06-28 21:03:14 +02:00
action = SETTINGS_ACTION_DOWN ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_UP ) )
2012-06-28 21:03:14 +02:00
action = SETTINGS_ACTION_UP ;
if ( action ! = SETTINGS_ACTION_NOOP )
2012-08-03 03:46:01 +02:00
settings_iterate ( current_menu , items , action ) ;
2012-06-28 21:03:14 +02:00
2012-07-31 16:06:34 +02:00
producesettingentry ( current_menu , items , current_menu - > selected , input ) ;
2012-01-10 23:33:44 +01:00
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-06-29 14:40:50 +02:00
2012-07-30 17:19:05 +02:00
for ( i = current_menu - > first_setting ; i < current_menu - > max_settings ; i + + )
2012-04-14 04:38:40 +02:00
{
2012-07-30 17:19:05 +02:00
if ( items [ i ] . page = = current_menu - > page )
2012-04-14 04:38:40 +02:00
{
2012-07-31 03:26:00 +02:00
render_msg_place_func ( items [ i ] . text_xpos , items [ i ] . text_ypos , FONT_SIZE , current_menu - > selected = = items [ i ] . enum_id ? YELLOW : items [ i ] . item_color , items [ i ] . text ) ;
2012-08-02 17:09:41 +02:00
render_msg_place_func ( x_position_center , items [ i ] . text_ypos , FONT_SIZE , items [ i ] . text_color , items [ i ] . setting_text ) ;
2012-08-04 03:11:49 +02:00
# ifdef _XBOX1
if ( current_menu - > selected = = items [ i ] . enum_id )
2012-08-05 17:18:19 +02:00
{
m_menuMainRomSelectPanel . x = x_position ;
m_menuMainRomSelectPanel . y = items [ i ] . text_ypos ;
m_menuMainRomSelectPanel . width = ROM_PANEL_WIDTH ;
m_menuMainRomSelectPanel . height = ROM_PANEL_HEIGHT ;
texture_image_render ( & m_menuMainRomSelectPanel ) ;
}
2012-08-04 03:11:49 +02:00
# endif
2012-04-14 04:38:40 +02:00
}
}
2012-01-10 23:33:44 +01:00
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , comment_y_position , font_size , WHITE , items [ current_menu - > selected ] . comment ) ;
2012-01-10 23:33:44 +01:00
2012-08-04 16:53:34 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] + [%s] - resume game | [%s] - go forward " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_L3 ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_R3 ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_R ) ) ;
2012-08-02 05:49:37 +02:00
render_msg_place_func ( x_position , comment_two_y_position , FONT_SIZE , YELLOW , msg ) ;
snprintf ( msg , sizeof ( msg ) , " [%s] - default | [%s]/[%s] - go back " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_L ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) ) ;
2012-08-04 17:21:49 +02:00
render_msg_place_func ( x_position , comment_two_y_position + ( y_position_increment * 1 ) , FONT_SIZE , YELLOW , msg ) ;
2012-01-10 23:33:44 +01:00
}
2012-07-30 16:24:28 +02:00
static void menu_romselect_iterate ( filebrowser_t * filebrowser , item * items , menu_romselect_action_t action )
2012-06-19 03:44:17 +02:00
{
2012-08-01 17:22:10 +02:00
bool ret = true ;
2012-06-19 03:44:17 +02:00
switch ( action )
2012-04-14 05:24:09 +02:00
{
2012-06-19 03:44:17 +02:00
case MENU_ROMSELECT_ACTION_OK :
2012-06-23 18:01:21 +02:00
if ( filebrowser_get_current_path_isdir ( filebrowser ) )
2012-08-01 17:22:10 +02:00
ret = filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_OK ) ;
2012-06-28 18:10:04 +02:00
else
2012-07-28 19:17:34 +02:00
rarch_console_load_game_wrap ( filebrowser_get_current_path ( filebrowser ) , g_console . zip_extract_mode , S_DELAY_45 ) ;
2012-06-19 03:44:17 +02:00
break ;
case MENU_ROMSELECT_ACTION_GOTO_SETTINGS :
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , GENERAL_VIDEO_MENU ) ;
2012-06-19 03:44:17 +02:00
break ;
2012-06-30 14:04:34 +02:00
default :
break ;
2012-06-19 03:44:17 +02:00
}
2012-08-01 17:22:10 +02:00
if ( ! ret )
rarch_settings_msg ( S_MSG_DIR_LOADING_ERROR , S_DELAY_180 ) ;
2012-06-19 03:44:17 +02:00
}
2012-08-01 02:56:15 +02:00
static void select_rom ( item * items , menu * current_menu , uint64_t input )
2012-06-19 03:44:17 +02:00
{
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-06-19 03:44:17 +02:00
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-08-03 17:54:22 +02:00
float comment_y_position = COMMENT_Y_POSITION ;
2012-08-04 16:53:34 +02:00
float y_position_increment = POSITION_Y_INCREMENT ;
float comment_two_y_position = COMMENT_TWO_Y_POSITION ;
2012-08-03 17:54:22 +02:00
float font_size = HARDCODE_FONT_SIZE ;
2012-08-01 16:47:37 +02:00
2012-07-31 16:06:34 +02:00
browser_update ( & browser , input , rarch_console_get_rom_ext ( ) ) ;
2012-07-16 09:53:27 +02:00
2012-06-28 21:03:14 +02:00
menu_romselect_action_t action = MENU_ROMSELECT_ACTION_NOOP ;
2012-06-19 03:44:17 +02:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_SELECT ) )
2012-06-28 21:03:14 +02:00
action = MENU_ROMSELECT_ACTION_GOTO_SETTINGS ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-06-28 21:03:14 +02:00
action = MENU_ROMSELECT_ACTION_OK ;
2012-06-19 03:44:17 +02:00
2012-06-28 21:03:14 +02:00
if ( action ! = MENU_ROMSELECT_ACTION_NOOP )
2012-07-30 16:24:28 +02:00
menu_romselect_iterate ( & browser , items , action ) ;
2012-04-09 14:32:56 +02:00
2012-07-30 01:35:11 +02:00
bool is_dir = filebrowser_get_current_path_isdir ( & browser ) ;
2012-08-02 01:59:05 +02:00
char msg [ 128 ] , msg2 [ 128 ] ;
2012-07-30 01:35:11 +02:00
if ( is_dir )
2012-04-14 05:24:09 +02:00
{
2012-07-30 01:35:11 +02:00
const char * current_path = filebrowser_get_current_path ( & browser ) ;
2012-08-02 01:59:05 +02:00
snprintf ( msg , sizeof ( msg ) , " INFO - Press [%s] to enter the directory. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-04-14 05:24:09 +02:00
}
2012-07-30 01:35:11 +02:00
else
2012-08-02 01:59:05 +02:00
snprintf ( msg , sizeof ( msg ) , " INFO - Press [%s] to load the game. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , comment_y_position , font_size , WHITE , msg ) ;
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
2012-08-02 01:59:05 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] + [%s] - resume game " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_L3 ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_R3 ) ) ;
snprintf ( msg2 , sizeof ( msg2 ) , " [%s] - Settings " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_SELECT ) ) ;
render_msg_place_func ( x_position , comment_two_y_position , FONT_SIZE , YELLOW , msg ) ;
2012-08-04 16:53:34 +02:00
render_msg_place_func ( x_position , comment_two_y_position + ( y_position_increment * 1 ) , FONT_SIZE , YELLOW , msg2 ) ;
2012-01-10 23:33:44 +01:00
}
2012-02-13 21:37:32 +01:00
2012-08-01 02:56:15 +02:00
static void ingame_menu_resize ( item * items , menu * current_menu , uint64_t input )
2012-06-28 14:10:05 +02:00
{
2012-07-30 16:24:28 +02:00
( void ) items ;
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-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-08-04 05:10:49 +02:00
float x_position_center = POSITION_X_CENTER ;
2012-08-03 17:54:22 +02:00
float font_size = HARDCODE_FONT_SIZE ;
2012-08-01 16:47:37 +02:00
2012-08-03 17:54:22 +02:00
float y_position = POSITION_Y_BEGIN ;
float y_position_increment = POSITION_Y_INCREMENT ;
float comment_y_position = COMMENT_Y_POSITION ;
2012-06-28 14:10:05 +02:00
g_console . aspect_ratio_index = ASPECT_RATIO_CUSTOM ;
gfx_ctx_set_aspect_ratio ( NULL , g_console . aspect_ratio_index ) ;
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-08-06 15:08:10 +02:00
if ( g_console . viewports . custom_vp . x > = 4 )
2012-08-06 15:15:58 +02:00
# endif
2012-08-07 16:26:12 +02:00
{
2012-08-06 15:08:10 +02:00
g_console . viewports . custom_vp . x - = 4 ;
2012-08-07 16:26:12 +02:00
}
}
2012-08-01 02:56:15 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-08-06 15:08:10 +02:00
if ( g_console . viewports . custom_vp . x > 0 )
2012-08-06 15:15:58 +02:00
# endif
2012-08-07 16:26:12 +02:00
{
2012-08-06 15:08:10 +02:00
g_console . viewports . custom_vp . x - = 1 ;
2012-08-07 16:26:12 +02:00
}
}
2012-08-01 02:56:15 +02:00
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT ) )
2012-08-01 02:56:15 +02:00
g_console . viewports . custom_vp . x + = 4 ;
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . x + = 1 ;
2012-06-28 14:10:05 +02:00
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_UP ) )
2012-08-01 02:56:15 +02:00
g_console . viewports . custom_vp . y + = 4 ;
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_UP ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . y + = 1 ;
2012-08-01 02:56:15 +02:00
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-08-06 15:08:10 +02:00
if ( g_console . viewports . custom_vp . y > = 4 )
2012-08-06 15:15:58 +02:00
# endif
2012-08-07 16:26:12 +02:00
{
2012-08-06 15:08:10 +02:00
g_console . viewports . custom_vp . y - = 4 ;
2012-08-07 16:26:12 +02:00
}
}
2012-07-31 16:06:34 +02:00
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_DOWN ) )
2012-08-07 16:26:12 +02:00
{
# ifdef _XBOX
2012-08-06 15:08:10 +02:00
if ( g_console . viewports . custom_vp . y > 0 )
2012-08-06 15:15:58 +02:00
# endif
2012-08-07 16:26:12 +02:00
{
2012-08-06 15:08:10 +02:00
g_console . viewports . custom_vp . y - = 1 ;
2012-08-07 16:26:12 +02:00
}
}
2012-06-28 14:10:05 +02:00
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT ) )
2012-08-01 02:56:15 +02:00
g_console . viewports . custom_vp . width - = 4 ;
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . width - = 1 ;
2012-08-01 02:56:15 +02:00
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_RIGHT ) )
2012-08-01 02:56:15 +02:00
g_console . viewports . custom_vp . width + = 4 ;
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . width + = 1 ;
2012-06-28 14:10:05 +02:00
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_UP ) )
2012-08-01 02:56:15 +02:00
g_console . viewports . custom_vp . height + = 4 ;
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L2 ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . height + = 1 ;
2012-08-01 02:56:15 +02:00
2012-08-01 06:17:25 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_DOWN ) )
2012-08-01 02:56:15 +02:00
g_console . viewports . custom_vp . height - = 4 ;
else if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R2 ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . height - = 1 ;
2012-06-28 14:10:05 +02:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_X ) )
2012-06-28 14:10:05 +02:00
{
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . x = 0 ;
g_console . viewports . custom_vp . y = 0 ;
2012-07-31 03:26:00 +02:00
g_console . viewports . custom_vp . width = device_ptr - > win_width ;
g_console . 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-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) )
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-06-28 14:10:05 +02:00
2012-08-01 02:56:15 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_Y ) ) & & ( old_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_Y ) ) ) { }
2012-07-16 20:11:39 +02:00
else
2012-06-28 14:10:05 +02:00
{
2012-07-31 03:26:00 +02:00
char viewport_x [ 64 ] , viewport_y [ 64 ] , viewport_w [ 64 ] , viewport_h [ 64 ] ;
2012-08-02 05:49:37 +02:00
char msg [ 256 ] ;
2012-07-30 17:19:05 +02:00
display_menubar ( current_menu ) ;
2012-06-29 14:40:50 +02:00
2012-07-31 03:26:00 +02:00
snprintf ( viewport_x , sizeof ( viewport_x ) , " Viewport X: #%d " , g_console . viewports . custom_vp . x ) ;
snprintf ( viewport_y , sizeof ( viewport_y ) , " Viewport Y: #%d " , g_console . viewports . custom_vp . y ) ;
2012-08-04 16:53:34 +02:00
snprintf ( viewport_w , sizeof ( viewport_w ) , " Viewport W: #%d " , g_console . viewports . custom_vp . width ) ;
2012-08-04 17:30:31 +02:00
snprintf ( viewport_h , sizeof ( viewport_h ) , " Viewport H: #%d " , g_console . viewports . custom_vp . height ) ;
2012-06-28 14:10:05 +02:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , y_position , font_size , GREEN , viewport_x ) ;
render_msg_place_func ( x_position , y_position + ( y_position_increment * 1 ) , font_size , GREEN , viewport_y ) ;
render_msg_place_func ( x_position , y_position + ( y_position_increment * 2 ) , font_size , GREEN , viewport_w ) ;
render_msg_place_func ( x_position , y_position + ( y_position_increment * 3 ) , font_size , GREEN , viewport_h ) ;
2012-06-28 14:10:05 +02:00
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 4 ) , font_size , WHITE , " CONTROLS: " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 5 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 5 ) , font_size , WHITE , " - Viewport X -- " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 6 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 6 ) , font_size , WHITE , " - Viewport X ++ " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_UP ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_UP ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 7 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 7 ) , font_size , WHITE , " - Viewport Y ++ " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_DOWN ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 8 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 8 ) , font_size , WHITE , " - Viewport Y -- " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_L ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 9 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 9 ) , font_size , WHITE , " - Viewport W -- " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_R ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_RIGHT ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 10 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 10 ) , font_size , WHITE , " - Viewport W ++ " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_L2 ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_UP ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 11 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 11 ) , font_size , WHITE , " - Viewport H ++ " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] or [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_R2 ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_DOWN ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 12 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 12 ) , font_size , WHITE , " - Viewport H -- " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_X ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 13 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 13 ) , font_size , WHITE , " - Reset To Defaults " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_Y ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 14 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 14 ) , font_size , WHITE , " - Show Game " ) ;
2012-06-28 14:10:05 +02:00
2012-08-02 05:49:37 +02:00
snprintf ( msg , sizeof ( msg ) , " [%s] " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) ) ;
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * 15 ) , font_size , WHITE , msg ) ;
render_msg_place_func ( x_position_center , y_position + ( y_position_increment * 15 ) , font_size , WHITE , " - Go back " ) ;
2012-06-28 14:10:05 +02:00
2012-08-05 03:00:38 +02:00
snprintf ( msg , sizeof ( msg ) , " Allows you to resize the screen. \n Press [%s] to reset to defaults, and [%s] to go back. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_X ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) ) ;
render_msg_place_func ( x_position , comment_y_position , font_size , WHITE , msg ) ;
2012-06-28 14:10:05 +02:00
}
}
2012-08-01 02:56:15 +02:00
static void ingame_menu_screenshot ( item * items , menu * current_menu , uint64_t input )
2012-06-28 14:10:05 +02:00
{
2012-07-30 16:24:28 +02:00
( void ) items ;
2012-07-30 17:19:05 +02:00
( void ) current_menu ;
2012-07-30 16:24:28 +02:00
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
if ( g_console . ingame_menu_enable )
{
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) )
2012-06-28 14:10:05 +02:00
{
2012-08-03 18:27:38 +02:00
menu_stack_decrement ( ) ;
# ifdef __CELLOS_LV2__
device_ptr - > menu_render = true ;
# endif
2012-06-28 14:10:05 +02:00
}
}
}
2012-08-01 02:56:15 +02:00
static void ingame_menu ( item * items , menu * current_menu , uint64_t input )
2012-02-13 21:37:32 +01:00
{
2012-07-31 03:26:00 +02:00
char comment [ 256 ] , overscan_msg [ 64 ] ;
2012-08-03 17:54:22 +02:00
char strw_buffer [ 256 ] ;
2012-08-17 17:43:23 +02:00
unsigned menuitem_colors [ MENU_ITEM_LAST ] ;
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-02-13 21:37:32 +01:00
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
2012-08-03 17:54:22 +02:00
float y_position = POSITION_Y_BEGIN ;
float comment_y_position = COMMENT_Y_POSITION ;
float font_size = HARDCODE_FONT_SIZE ;
2012-08-01 16:47:37 +02:00
2012-08-03 17:54:22 +02:00
float y_position_increment = POSITION_Y_INCREMENT ;
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 + + )
menuitem_colors [ i ] = GREEN ;
2012-02-22 19:49:22 +01:00
2012-04-14 05:24:09 +02:00
menuitem_colors [ g_console . ingame_menu_item ] = RED ;
2012-02-13 21:37:32 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) )
2012-06-30 14:04:34 +02:00
rarch_settings_change ( S_RETURN_TO_GAME ) ;
2012-02-13 21:37:32 +01:00
2012-04-14 05:24:09 +02:00
switch ( g_console . ingame_menu_item )
{
case MENU_ITEM_LOAD_STATE :
2012-08-02 17:09:41 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
{
2012-04-21 23:25:32 +02:00
rarch_load_state ( ) ;
2012-05-29 01:57:33 +02:00
rarch_settings_change ( S_RETURN_TO_GAME ) ;
2012-08-02 17:09:41 +02:00
}
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_decrease ( ) ;
2012-08-02 17:09:41 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_increase ( ) ;
2012-08-02 17:09:41 +02:00
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] / [%s] to change slots. \n Press [%s] to load the state from the current state slot. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case MENU_ITEM_SAVE_STATE :
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
{
2012-04-21 23:25:32 +02:00
rarch_save_state ( ) ;
2012-05-29 01:57:33 +02:00
rarch_settings_change ( S_RETURN_TO_GAME ) ;
2012-08-02 17:09:41 +02:00
}
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_decrease ( ) ;
2012-08-02 17:09:41 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_increase ( ) ;
2012-08-02 17:09:41 +02:00
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] / [%s] to change slots. \n Press [%s] to save the state to the current state slot. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case MENU_ITEM_KEEP_ASPECT_RATIO :
2012-07-31 16:06:34 +02:00
producesettingentry ( current_menu , items , SETTING_KEEP_ASPECT_RATIO , input ) ;
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] / [%s] to change the [Aspect Ratio]. \n Press [%s] to reset back to default values. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case MENU_ITEM_OVERSCAN_AMOUNT :
2012-07-31 16:06:34 +02:00
producesettingentry ( current_menu , items , SETTING_HW_OVERSCAN_AMOUNT , input ) ;
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] / [%s] to change the [Overscan] settings. \n Press [%s] to reset back to default values. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) ;
2012-08-02 17:09:41 +02:00
break ;
case MENU_ITEM_ORIENTATION :
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) )
{
2012-05-29 22:22:47 +02:00
rarch_settings_change ( S_ROTATION_DECREMENT ) ;
2012-08-03 18:27:38 +02:00
video_ptr . set_rotation ( NULL , g_console . screen_orientation ) ;
2012-08-02 17:09:41 +02:00
}
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) )
2012-08-02 17:09:41 +02:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_change ( S_ROTATION_INCREMENT ) ;
2012-08-03 18:27:38 +02:00
video_ptr . set_rotation ( NULL , g_console . screen_orientation ) ;
2012-08-02 17:09:41 +02:00
}
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) )
2012-08-02 17:09:41 +02:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_default ( S_DEF_ROTATION ) ;
2012-08-03 18:27:38 +02:00
video_ptr . set_rotation ( NULL , g_console . screen_orientation ) ;
2012-08-02 17:09:41 +02:00
}
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] / [%s] to change the [Orientation] settings. \n Press [%s] to reset back to default values. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) ;
2012-08-02 17:09:41 +02:00
break ;
2012-08-03 18:27:38 +02:00
# ifdef HAVE_FBO
2012-04-14 05:24:09 +02:00
case MENU_ITEM_SCALE_FACTOR :
2012-08-02 17:09:41 +02:00
producesettingentry ( current_menu , items , SETTING_SCALE_FACTOR , input ) ;
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] / [%s] to change the [Scaling] settings. \n Press [%s] to reset back to default values. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_LEFT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_RIGHT ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_START ) ) ;
2012-04-14 05:24:09 +02:00
break ;
2012-08-03 18:27:38 +02:00
# endif
2012-04-14 05:24:09 +02:00
case MENU_ITEM_FRAME_ADVANCE :
2012-08-02 17:09:41 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R2 ) ) | | ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L2 ) ) )
2012-04-14 05:24:09 +02:00
{
2012-08-02 17:09:41 +02:00
rarch_settings_change ( S_FRAME_ADVANCE ) ;
2012-04-14 05:24:09 +02:00
g_console . ingame_menu_item = MENU_ITEM_FRAME_ADVANCE ;
}
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s], [%s] or [%s] to step one frame. \n Pressing the button rapidly will advance the frame more slowly. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_L2 ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_R2 ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RESIZE_MODE :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , INGAME_MENU_RESIZE ) ;
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Allows you to resize the screen. \n Press [%s] to reset to defaults, and [%s] to go back. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_X ) , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_SCREENSHOT_MODE :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , INGAME_MENU_SCREENSHOT ) ;
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Allows you to take a screenshot without any text. \n Press [%s] to go back to the in-game menu. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_A ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RETURN_TO_GAME :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-08-02 17:09:41 +02:00
rarch_settings_change ( S_RETURN_TO_GAME ) ;
2012-02-13 21:37:32 +01:00
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] to return to the game. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RESET :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-04-14 05:24:09 +02:00
{
2012-08-02 17:09:41 +02:00
rarch_settings_change ( S_RETURN_TO_GAME ) ;
2012-04-21 23:25:32 +02:00
rarch_game_reset ( ) ;
2012-04-14 05:24:09 +02:00
}
2012-08-02 01:59:05 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] to reset the game. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RETURN_TO_MENU :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-04-14 05:24:09 +02:00
{
2012-08-02 17:09:41 +02:00
rarch_settings_change ( S_RETURN_TO_MENU ) ;
2012-04-14 05:24:09 +02:00
}
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] to return to the ROM Browser. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-04-14 05:24:09 +02:00
break ;
2012-04-22 01:45:55 +02:00
case MENU_ITEM_CHANGE_LIBRETRO :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-04-14 05:24:09 +02:00
{
2012-07-30 17:54:11 +02:00
menu_stack_push ( items , LIBRETRO_CHOICE ) ;
2012-07-30 23:27:16 +02:00
filebrowser_set_root_and_ext ( & tmpBrowser , EXT_EXECUTABLES , default_paths . core_dir ) ;
2012-05-28 22:18:50 +02:00
set_libretro_core_as_launch = true ;
2012-04-14 05:24:09 +02:00
}
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] to choose another core. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-04-14 05:24:09 +02:00
break ;
2012-05-30 16:30:25 +02:00
# ifdef HAVE_MULTIMAN
2012-04-14 05:24:09 +02:00
case MENU_ITEM_RETURN_TO_MULTIMAN :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-04-14 05:24:09 +02:00
{
2012-08-18 18:25:38 +02:00
RARCH_LOG ( " Boot Multiman: %s. \n " , default_paths . multiman_self_file ) ;
strlcpy ( g_console . launch_app_on_exit , default_paths . multiman_self_file ,
sizeof ( g_console . launch_app_on_exit ) ) ;
rarch_settings_change ( S_RETURN_TO_LAUNCHER ) ;
2012-04-14 05:24:09 +02:00
}
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] to quit RetroArch and return to multiMAN. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-04-14 05:24:09 +02:00
break ;
2012-05-30 16:30:25 +02:00
# endif
2012-05-29 22:36:17 +02:00
case MENU_ITEM_RETURN_TO_DASHBOARD :
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) )
2012-08-02 17:09:41 +02:00
rarch_settings_change ( S_RETURN_TO_DASHBOARD ) ;
2012-02-13 21:37:32 +01:00
2012-08-04 03:28:31 +02:00
snprintf ( comment , sizeof ( comment ) , " Press [%s] to quit RetroArch. " , rarch_input_find_platform_key_label ( 1 < < RETRO_DEVICE_ID_JOYPAD_B ) ) ;
2012-04-14 05:24:09 +02:00
break ;
}
2012-02-13 21:37:32 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_UP ) )
2012-06-30 14:04:34 +02:00
{
if ( g_console . ingame_menu_item > 0 )
g_console . ingame_menu_item - - ;
}
2012-02-13 21:37:32 +01:00
2012-07-31 16:06:34 +02:00
if ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_DOWN ) )
2012-06-30 14:04:34 +02:00
{
if ( g_console . ingame_menu_item < ( MENU_ITEM_LAST - 1 ) )
g_console . ingame_menu_item + + ;
}
2012-02-13 21:37:32 +01:00
2012-07-31 16:06:34 +02:00
if ( ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L3 ) ) & & ( input & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R3 ) ) )
2012-06-30 14:04:34 +02:00
rarch_settings_change ( S_RETURN_TO_GAME ) ;
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
2012-05-29 22:22:47 +02:00
rarch_settings_create_menu_item_label ( strw_buffer , S_LBL_LOAD_STATE_SLOT , sizeof ( strw_buffer ) ) ;
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , y_position , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_LOAD_STATE ) , strw_buffer ) ;
2012-02-13 21:37:32 +01:00
2012-05-29 22:22:47 +02:00
rarch_settings_create_menu_item_label ( strw_buffer , S_LBL_SAVE_STATE_SLOT , sizeof ( strw_buffer ) ) ;
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , y_position + ( y_position_increment * MENU_ITEM_SAVE_STATE ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_SAVE_STATE ) , strw_buffer ) ;
2012-02-13 21:37:32 +01:00
2012-05-29 22:22:47 +02:00
rarch_settings_create_menu_item_label ( strw_buffer , S_LBL_ASPECT_RATIO , sizeof ( strw_buffer ) ) ;
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_KEEP_ASPECT_RATIO ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_KEEP_ASPECT_RATIO ) , strw_buffer ) ;
2012-02-13 21:37:32 +01:00
2012-07-31 03:26:00 +02:00
snprintf ( overscan_msg , sizeof ( overscan_msg ) , " Overscan: %f " , g_console . overscan_amount ) ;
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_OVERSCAN_AMOUNT ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_OVERSCAN_AMOUNT ) , overscan_msg ) ;
2012-02-13 21:37:32 +01:00
2012-05-29 22:22:47 +02:00
rarch_settings_create_menu_item_label ( strw_buffer , S_LBL_ROTATION , sizeof ( strw_buffer ) ) ;
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_ORIENTATION ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_ORIENTATION ) , strw_buffer ) ;
2012-02-13 21:37:32 +01:00
2012-08-03 18:27:38 +02:00
# ifdef HAVE_FBO
2012-05-29 22:22:47 +02:00
rarch_settings_create_menu_item_label ( strw_buffer , S_LBL_SCALE_FACTOR , sizeof ( strw_buffer ) ) ;
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_SCALE_FACTOR ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_SCALE_FACTOR ) , strw_buffer ) ;
2012-08-03 18:27:38 +02:00
# endif
2012-02-25 20:11:57 +01:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_RESIZE_MODE ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RESIZE_MODE ) , " Resize Mode " ) ;
2012-02-28 14:42:29 +01:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_FRAME_ADVANCE ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_FRAME_ADVANCE ) , " Frame Advance " ) ;
2012-02-13 21:37:32 +01:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_SCREENSHOT_MODE ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_SCREENSHOT_MODE ) , " Screenshot Mode " ) ;
2012-02-13 21:37:32 +01:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_RESET ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RESET ) , " Reset " ) ;
2012-04-14 05:24:09 +02:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_RETURN_TO_GAME ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_GAME ) , " Return to Game " ) ;
2012-04-14 05:24:09 +02:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_RETURN_TO_MENU ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_MENU ) , " Return to Menu " ) ;
2012-04-14 05:24:09 +02:00
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_CHANGE_LIBRETRO ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_CHANGE_LIBRETRO ) , " Change libretro core " ) ;
2012-04-10 01:00:25 +02:00
2012-05-30 16:30:25 +02:00
# ifdef HAVE_MULTIMAN
2012-08-01 16:47:37 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_RETURN_TO_MULTIMAN ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_MULTIMAN ) , " Return to multiMAN " ) ;
2012-05-30 16:30:25 +02:00
# endif
2012-02-22 19:49:22 +01:00
2012-08-04 05:37:02 +02:00
render_msg_place_func ( x_position , ( y_position + ( y_position_increment * MENU_ITEM_RETURN_TO_DASHBOARD ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_DASHBOARD ) , " Return to Dashboard " ) ;
2012-04-14 05:24:09 +02:00
2012-08-05 03:00:38 +02:00
render_msg_place_func ( x_position , comment_y_position , font_size , WHITE , comment ) ;
2012-08-04 03:11:49 +02:00
# ifdef _XBOX1
2012-08-05 17:18:19 +02:00
m_menuMainRomSelectPanel . x = x_position ;
m_menuMainRomSelectPanel . y = ( y_position + ( y_position_increment * g_console . ingame_menu_item ) ) ;
m_menuMainRomSelectPanel . width = ROM_PANEL_WIDTH ;
m_menuMainRomSelectPanel . height = ROM_PANEL_HEIGHT ;
texture_image_render ( & m_menuMainRomSelectPanel ) ;
2012-08-04 03:11:49 +02:00
# endif
2012-02-13 21:37:32 +01:00
}
2012-08-18 01:13:00 +02:00
static void rmenu_filebrowser_init ( void )
{
menu_stack_push ( rmenu_items , FILE_BROWSER_MENU ) ;
filebrowser_set_root_and_ext ( & browser , rarch_console_get_rom_ext ( ) , default_paths . filebrowser_startup_dir ) ;
filebrowser_set_root ( & tmpBrowser , default_paths . filesystem_root_dir ) ;
}
static void rmenu_filebrowser_free ( void )
{
filebrowser_free ( & browser ) ;
filebrowser_free ( & tmpBrowser ) ;
}
2012-06-30 14:04:34 +02:00
void menu_init ( void )
{
2012-08-03 18:54:59 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-08-03 21:06:52 +02:00
( void ) device_ptr ;
2012-08-03 18:54:59 +02:00
2012-07-30 01:35:11 +02:00
//Set libretro filename and version to variable
struct retro_system_info info ;
retro_get_system_info ( & info ) ;
const char * id = info . library_name ? info . library_name : " Unknown " ;
2012-08-03 06:34:33 +02:00
snprintf ( m_title , sizeof ( m_title ) , " Libretro core: %s %s " , id , info . library_version ) ;
2012-08-17 21:43:12 +02:00
rmenu_filebrowser_init ( ) ;
2012-08-17 18:22:28 +02:00
}
2012-07-30 01:35:11 +02:00
2012-08-17 18:22:28 +02:00
void menu_free ( void )
{
2012-08-17 21:43:12 +02:00
rmenu_filebrowser_free ( ) ;
2012-08-17 18:22:28 +02:00
}
2012-01-10 23:33:44 +01:00
void menu_loop ( void )
{
2012-07-31 03:26:00 +02:00
DEVICE_CAST device_ptr = ( DEVICE_CAST ) driver . video_data ;
2012-05-26 18:18:09 +02:00
2012-04-11 02:42:27 +02:00
g_console . menu_enable = true ;
2012-07-31 03:26:00 +02:00
device_ptr - > block_swap = true ;
2012-04-11 02:42:27 +02:00
2012-08-17 18:22:28 +02:00
2012-04-11 02:42:27 +02:00
if ( g_console . ingame_menu_enable )
2012-07-30 23:27:16 +02:00
menu_stack_push ( ingame_menu_settings , INGAME_MENU ) ;
2012-04-11 02:42:27 +02:00
2012-08-17 18:02:09 +02:00
# ifdef _XBOX1
int width = device_ptr - > d3dpp . BackBufferWidth ;
// Load background image
if ( width = = 640 )
{
texture_image_load ( " D: \\ Media \\ main-menu_480p.png " , & m_menuMainBG ) ;
m_menuMainRomListPos_x = 60 ;
m_menuMainRomListPos_y = 80 ;
}
else if ( width = = 1280 )
{
texture_image_load ( " D: \\ Media \\ main-menu_720p.png " , & m_menuMainBG ) ;
m_menuMainRomListPos_x = 360 ;
m_menuMainRomListPos_y = 130 ;
}
2012-08-17 18:08:15 +02:00
// Load rom selector panel
texture_image_load ( " D: \\ Media \\ menuMainRomSelectPanel.png " , & m_menuMainRomSelectPanel ) ;
//Display some text
//Center the text (hardcoded)
xpos = width = = 640 ? 65 : 400 ;
ypos = width = = 640 ? 430 : 670 ;
2012-08-17 18:02:09 +02:00
# endif
2012-04-11 02:42:27 +02:00
do
{
2012-08-01 02:56:15 +02:00
//first button input frame
uint64_t input_state_first_frame = 0 ;
uint64_t input_state = 0 ;
2012-06-28 17:11:22 +02:00
static bool first_held = false ;
2012-07-30 17:54:11 +02:00
menu * current_menu = menu_stack_get_current_ptr ( ) ;
2012-04-11 02:42:27 +02:00
2012-08-02 18:36:34 +02:00
input_ptr . poll ( NULL ) ;
2012-08-01 02:56:15 +02:00
2012-08-17 17:43:23 +02:00
const struct retro_keybind * binds [ MAX_PLAYERS ] = {
2012-08-01 02:56:15 +02:00
g_settings . input . binds [ 0 ] ,
g_settings . input . binds [ 1 ] ,
g_settings . input . binds [ 2 ] ,
g_settings . input . binds [ 3 ] ,
g_settings . input . binds [ 4 ] ,
g_settings . input . binds [ 5 ] ,
g_settings . input . binds [ 6 ] ,
g_settings . input . binds [ 7 ] ,
} ;
2012-08-17 17:43:23 +02:00
const struct retro_keybind _analog_binds [ ] = {
2012-08-01 06:17:25 +02:00
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT ) , 0 } ,
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT ) , 0 } ,
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_UP ) , 0 } ,
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN ) , 0 } ,
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT ) , 0 } ,
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_RIGHT ) , 0 } ,
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_UP ) , 0 } ,
{ 0 , 0 , ( enum retro_key ) 0 , ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_DOWN ) , 0 } ,
2012-08-01 02:56:15 +02:00
} ;
const struct retro_keybind * analog_binds [ ] = {
_analog_binds
} ;
for ( unsigned i = 0 ; i < RARCH_FIRST_META_KEY ; i + + )
{
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , binds , false ,
2012-08-01 02:56:15 +02:00
RETRO_DEVICE_JOYPAD , 0 , i ) ? ( 1 < < i ) : 0 ;
}
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 0 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 1 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 2 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_UP ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 3 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN ) : 0 ;
2012-08-01 02:56:15 +02:00
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 4 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 5 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_RIGHT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 6 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_UP ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 7 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_DOWN ) : 0 ;
2012-08-01 02:56:15 +02:00
uint64_t trig_state = input_state & ~ old_state ; //set first button input frame as trigger
input_state_first_frame = input_state ; //hold onto first button input frame
//second button input frame
input_state = 0 ;
2012-08-02 18:36:34 +02:00
input_ptr . poll ( NULL ) ;
2012-08-01 02:56:15 +02:00
for ( unsigned i = 0 ; i < RARCH_FIRST_META_KEY ; i + + )
{
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , binds , false ,
2012-08-01 02:56:15 +02:00
RETRO_DEVICE_JOYPAD , 0 , i ) ? ( 1 < < i ) : 0 ;
}
2012-06-28 17:11:22 +02:00
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 0 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 1 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 2 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_UP ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 3 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN ) : 0 ;
2012-08-01 02:56:15 +02:00
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 4 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 5 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_RIGHT ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 6 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_UP ) : 0 ;
2012-08-02 18:36:34 +02:00
input_state | = input_ptr . input_state ( NULL , analog_binds , false ,
2012-08-01 06:17:25 +02:00
RETRO_DEVICE_JOYPAD , 0 , 7 ) ? ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_DOWN ) : 0 ;
2012-08-01 02:56:15 +02:00
2012-08-01 06:17:25 +02:00
bool analog_sticks_pressed = ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_UP ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_RIGHT ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_UP ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_DOWN ) ) ;
2012-08-01 02:56:15 +02:00
bool shoulder_buttons_pressed = ( ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L2 ) ) | | ( input_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R2 ) ) ) & & current_menu - > category_id ! = CATEGORY_SETTINGS ;
2012-07-31 05:04:47 +02:00
bool do_held = analog_sticks_pressed | | shoulder_buttons_pressed ;
if ( do_held )
2012-06-28 17:11:22 +02:00
{
2012-07-31 05:04:47 +02:00
if ( ! first_held )
2012-08-02 17:09:41 +02:00
{
2012-07-31 05:04:47 +02:00
first_held = true ;
2012-08-02 17:09:41 +02:00
SET_TIMER_EXPIRATION ( device_ptr , 7 ) ;
}
if ( IS_TIMER_EXPIRED ( device_ptr ) )
{
2012-07-31 05:04:47 +02:00
first_held = false ;
2012-08-02 17:09:41 +02:00
trig_state = input_state ; //second input frame set as current frame
}
2012-06-28 17:11:22 +02:00
}
2012-08-03 19:36:11 +02:00
2012-06-28 14:10:05 +02:00
gfx_ctx_clear ( ) ;
2012-08-01 02:56:15 +02:00
if ( current_menu - > enum_id = = INGAME_MENU_RESIZE & & ( trig_state & RETRO_DEVICE_ID_JOYPAD_Y ) | | current_menu - > enum_id = = INGAME_MENU_SCREENSHOT )
2012-08-03 18:27:38 +02:00
{
# ifdef __CELLOS_LV2__
2012-08-02 17:09:41 +02:00
device_ptr - > menu_render = false ;
2012-08-03 18:27:38 +02:00
# endif
}
2012-06-28 14:10:05 +02:00
else
{
gfx_ctx_set_blend ( true ) ;
2012-08-03 18:27:38 +02:00
# ifdef __CELLOS_LV2__
2012-08-02 17:09:41 +02:00
device_ptr - > menu_render = true ;
2012-08-03 18:27:38 +02:00
# endif
2012-06-28 14:10:05 +02:00
}
rarch_render_cached_frame ( ) ;
2012-07-16 08:44:13 +02:00
filebrowser_t * fb = & browser ;
2012-06-28 21:03:14 +02:00
2012-07-30 17:19:05 +02:00
switch ( current_menu - > enum_id )
2012-04-11 02:42:27 +02:00
{
2012-08-01 02:56:15 +02:00
case FILE_BROWSER_MENU :
2012-08-03 21:22:43 +02:00
select_rom ( rmenu_items , current_menu , trig_state ) ;
2012-08-01 02:56:15 +02:00
fb = & browser ;
break ;
case GENERAL_VIDEO_MENU :
case GENERAL_AUDIO_MENU :
case EMU_GENERAL_MENU :
case EMU_VIDEO_MENU :
case EMU_AUDIO_MENU :
case PATH_MENU :
case CONTROLS_MENU :
2012-08-03 21:22:43 +02:00
select_setting ( rmenu_items , current_menu , trig_state ) ;
2012-08-01 02:56:15 +02:00
break ;
case SHADER_CHOICE :
case PRESET_CHOICE :
case BORDER_CHOICE :
case LIBRETRO_CHOICE :
case INPUT_PRESET_CHOICE :
2012-08-03 21:22:43 +02:00
select_file ( rmenu_items , current_menu , trig_state ) ;
2012-08-01 02:56:15 +02:00
fb = & tmpBrowser ;
break ;
case PATH_SAVESTATES_DIR_CHOICE :
case PATH_DEFAULT_ROM_DIR_CHOICE :
2012-08-04 07:24:15 +02:00
# ifdef HAVE_XML
2012-08-01 02:56:15 +02:00
case PATH_CHEATS_DIR_CHOICE :
2012-08-04 07:24:15 +02:00
# endif
2012-08-05 17:53:01 +02:00
case PATH_SRAM_DIR_CHOICE :
case PATH_SYSTEM_DIR_CHOICE :
2012-08-03 21:22:43 +02:00
select_directory ( rmenu_items , current_menu , trig_state ) ;
2012-08-01 02:56:15 +02:00
fb = & tmpBrowser ;
break ;
case INGAME_MENU :
if ( g_console . ingame_menu_enable )
2012-08-03 21:22:43 +02:00
ingame_menu ( rmenu_items , current_menu , trig_state ) ;
2012-08-01 02:56:15 +02:00
break ;
case INGAME_MENU_RESIZE :
2012-08-03 21:22:43 +02:00
ingame_menu_resize ( rmenu_items , current_menu , trig_state ) ;
2012-08-01 02:56:15 +02:00
break ;
case INGAME_MENU_SCREENSHOT :
2012-08-03 21:22:43 +02:00
ingame_menu_screenshot ( rmenu_items , current_menu , trig_state ) ;
2012-08-01 02:56:15 +02:00
break ;
2012-04-11 02:42:27 +02:00
}
2012-08-03 03:46:01 +02:00
float x_position = POSITION_X ;
float starting_y_position = POSITION_Y_START ;
2012-08-03 17:54:22 +02:00
float y_position_increment = POSITION_Y_INCREMENT ;
2012-08-01 02:56:15 +02:00
2012-07-30 17:19:05 +02:00
switch ( current_menu - > category_id )
2012-06-28 21:03:14 +02:00
{
case CATEGORY_FILEBROWSER :
2012-08-01 16:47:37 +02:00
browser_render ( fb , x_position , starting_y_position , y_position_increment ) ;
2012-06-28 21:03:14 +02:00
break ;
case CATEGORY_SETTINGS :
case CATEGORY_INGAME_MENU :
2012-06-28 21:19:23 +02:00
default :
2012-06-28 21:03:14 +02:00
break ;
}
2012-08-01 02:56:15 +02:00
old_state = input_state_first_frame ;
2012-08-03 19:36:11 +02:00
2012-07-31 03:26:00 +02:00
if ( IS_TIMER_EXPIRED ( device_ptr ) )
2012-04-11 02:42:27 +02:00
{
// if we want to force goto the emulation loop, skip this
if ( g_console . mode_switch ! = MODE_EMULATION )
2012-08-02 17:09:41 +02:00
{
2012-04-11 02:42:27 +02:00
// for ingame menu, we need a different precondition because menu_enable
2012-08-02 17:09:41 +02:00
// can be set to false when going back from ingame menu to menu
2012-04-11 02:42:27 +02:00
if ( g_console . ingame_menu_enable = = true )
2012-08-02 17:09:41 +02:00
{
2012-04-11 02:42:27 +02:00
//we want to force exit when mode_switch is set to MODE_EXIT
if ( g_console . mode_switch ! = MODE_EXIT )
2012-08-01 02:56:15 +02:00
g_console . mode_switch = ( ( ( old_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L3 ) ) & & ( old_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R3 ) ) & & g_console . emulator_initialized ) ) ? MODE_EMULATION : MODE_MENU ;
2012-08-02 17:09:41 +02:00
}
else
{
2012-08-01 02:56:15 +02:00
g_console . menu_enable = ! ( ( ( old_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_L3 ) ) & & ( old_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_R3 ) ) & & g_console . emulator_initialized ) ) ;
2012-08-02 17:09:41 +02:00
g_console . mode_switch = g_console . menu_enable ? MODE_MENU : MODE_EMULATION ;
}
}
2012-04-11 02:42:27 +02: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_console . mode_switch = = MODE_EMULATION & & ! g_console . frame_advance_enable )
{
2012-07-31 03:26:00 +02:00
SET_TIMER_EXPIRATION ( device_ptr , 30 ) ;
2012-04-11 02:42:27 +02:00
}
2012-05-28 22:18:50 +02:00
const char * message = msg_queue_pull ( g_extern . msg_queue ) ;
2012-08-04 05:10:49 +02:00
float msg_queue_x_position = MSG_QUEUE_X_POSITION ;
float msg_queue_y_position = MSG_QUEUE_Y_POSITION ;
float msg_queue_font_size = MSG_QUEUE_FONT_SIZE ;
2012-05-28 22:18:50 +02:00
2012-05-29 04:05:16 +02:00
if ( message & & g_console . info_msg_enable )
2012-05-28 22:18:50 +02:00
{
2012-08-04 22:55:37 +02:00
RARCH_LOG ( " x: %f, y: %f \n " , msg_queue_x_position , msg_queue_y_position ) ;
2012-08-04 05:10:49 +02:00
render_msg_place_func ( msg_queue_x_position , msg_queue_y_position , msg_queue_font_size , WHITE , message ) ;
2012-05-28 22:18:50 +02:00
}
2012-08-03 19:36:11 +02:00
2012-05-27 16:23:01 +02:00
gfx_ctx_swap_buffers ( ) ;
# ifdef HAVE_SYSUTILS
cellSysutilCheckCallback ( ) ;
# endif
2012-08-03 18:51:56 +02:00
2012-08-01 02:56:15 +02:00
if ( current_menu - > enum_id = = INGAME_MENU_RESIZE & & ( old_state & ( 1 < < RETRO_DEVICE_ID_JOYPAD_Y ) ) | | current_menu - > enum_id = = INGAME_MENU_SCREENSHOT )
2012-06-28 14:10:05 +02:00
{ }
else
gfx_ctx_set_blend ( false ) ;
2012-07-31 05:04:47 +02:00
} while ( g_console . menu_enable ) ;
2012-04-11 02:42:27 +02:00
2012-08-03 18:27:38 +02:00
# ifdef __CELLOS_LV2__
2012-07-31 03:26:00 +02:00
device_ptr - > menu_render = false ;
2012-08-03 18:27:38 +02:00
# endif
2012-05-27 17:02:19 +02:00
2012-08-17 18:02:09 +02:00
# ifdef _XBOX1
texture_image_free ( & m_menuMainBG ) ;
2012-08-17 18:08:15 +02:00
texture_image_free ( & m_menuMainRomSelectPanel ) ;
2012-08-17 18:02:09 +02:00
# endif
2012-08-17 18:22:28 +02:00
2012-04-11 02:42:27 +02:00
if ( g_console . ingame_menu_enable )
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-04-11 02:42:27 +02:00
2012-07-31 03:26:00 +02:00
device_ptr - > block_swap = false ;
2012-04-11 02:42:27 +02:00
g_console . ingame_menu_enable = false ;
2012-01-10 23:33:44 +01:00
}