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-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>
# include <cell/dbgfont.h>
2012-03-03 17:23:00 +01:00
# if(CELL_SDK_VERSION > 0x340000)
# include <sysutil/sysutil_bgmplayback.h>
# endif
2012-06-20 08:25:23 +02:00
# include "../ps3_input.h"
# include "../../console/fileio/file_browser.h"
2012-01-10 23:33:44 +01:00
2012-06-28 17:52:51 +02:00
# include "../../console/retroarch_console.h"
2012-01-25 03:11:21 +01:00
2012-06-20 08:25:23 +02:00
# include "../../gfx/gl_common.h"
# include "../../gfx/gl_font.h"
# include "../../gfx/gfx_context.h"
# include "../../gfx/context/ps3_ctx.h"
# include "../../gfx/shader_cg.h"
2012-01-11 22:27:07 +01:00
2012-01-11 02:25:49 +01:00
# include "shared.h"
2012-06-20 08:25:23 +02:00
# include "../../file.h"
# include "../../general.h"
2012-01-10 23:33:44 +01:00
# include "menu.h"
# include "menu-entries.h"
2012-06-29 14:40:50 +02:00
# define NUM_ENTRY_PER_PAGE 17
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-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:13:05 +02:00
filebrowser_t * browser ;
filebrowser_t * tmpBrowser ;
2012-06-28 21:03:14 +02:00
unsigned set_shader = 0 ;
static unsigned currently_selected_controller_menu = 0 ;
2012-05-29 22:22:47 +02:00
static char strw_buffer [ PATH_MAX ] ;
2012-01-10 23:33:44 +01:00
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-06-29 12:27:17 +02:00
static void set_setting_label_write_on_or_off ( bool cond , unsigned currentsetting )
{
if ( cond )
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " ON " ) ;
else
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " OFF " ) ;
}
static void set_setting_label_color ( bool cond , unsigned currentsetting )
{
if ( cond )
items_generalsettings [ currentsetting ] . text_color = GREEN ;
else
items_generalsettings [ currentsetting ] . text_color = ORANGE ;
}
static void set_setting_label ( menu * menu_obj , unsigned currentsetting )
2012-01-16 04:07:02 +01:00
{
2012-04-14 04:38:40 +02:00
switch ( currentsetting )
{
case SETTING_CHANGE_RESOLUTION :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_console . initial_resolution_id = = g_console . supported_resolutions [ g_console . current_resolution_index ] , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , ps3_get_resolution_label ( g_console . supported_resolutions [ g_console . current_resolution_index ] ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_SHADER_PRESETS :
{
2012-05-29 15:25:39 +02:00
char fname [ PATH_MAX ] ;
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_console . cgp_path = = DEFAULT_PRESET_FILE , currentsetting ) ;
2012-05-29 15:25:39 +02:00
fill_pathname_base ( fname , g_console . cgp_path , sizeof ( fname ) ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , fname ) ;
2012-04-14 04:38:40 +02:00
}
break ;
case SETTING_SHADER :
{
2012-05-29 15:25:39 +02:00
char fname [ PATH_MAX ] ;
fill_pathname_base ( fname , g_settings . video . cg_shader_path , sizeof ( fname ) ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " %s " , fname ) ;
2012-06-29 12:27:17 +02:00
set_setting_label_color ( strcmp ( g_settings . video . cg_shader_path , DEFAULT_SHADER_FILE ) = = 0 ,
currentsetting ) ;
2012-04-14 04:38:40 +02:00
}
break ;
case SETTING_SHADER_2 :
{
2012-05-29 15:25:39 +02:00
char fname [ PATH_MAX ] ;
fill_pathname_base ( fname , g_settings . video . second_pass_shader , sizeof ( fname ) ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " %s " , fname ) ;
2012-06-29 12:27:17 +02:00
set_setting_label_color ( strcmp ( g_settings . video . second_pass_shader , DEFAULT_SHADER_FILE ) = = 0 ,
currentsetting ) ;
2012-04-14 04:38:40 +02:00
}
break ;
case SETTING_FONT_SIZE :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_console . menu_font_size = = 1.0f , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " %f " , g_console . menu_font_size ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_KEEP_ASPECT_RATIO :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_console . aspect_ratio_index = = ASPECT_RATIO_4_3 , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ 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-06-29 12:27:17 +02:00
set_setting_label_color ( g_settings . video . smooth , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_settings . video . smooth )
2012-06-29 12:27:17 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " Linear interpolation " ) ;
2012-04-14 04:38:40 +02:00
else
2012-06-29 12:27:17 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " Point filtering " ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_HW_TEXTURE_FILTER_2 :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_settings . video . second_pass_smooth , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_settings . video . second_pass_smooth )
2012-06-29 12:27:17 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " Linear interpolation " ) ;
2012-04-14 04:38:40 +02:00
else
2012-06-29 12:27:17 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " Point filtering " ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_SCALE_ENABLED :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . fbo_enabled , currentsetting ) ;
set_setting_label_color ( g_console . fbo_enabled , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_SCALE_FACTOR :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_settings . video . fbo_scale_x = = 2.0f , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " %fx (X) / %fx (Y) " , g_settings . video . fbo_scale_x , g_settings . video . fbo_scale_y ) ;
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ 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 ;
case SETTING_HW_OVERSCAN_AMOUNT :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_console . overscan_amount = = 0.0f , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " %f " , g_console . overscan_amount ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_THROTTLE_MODE :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . throttle_enable , currentsetting ) ;
set_setting_label_color ( g_console . throttle_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_TRIPLE_BUFFERING :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . triple_buffering_enable , currentsetting ) ;
set_setting_label_color ( g_console . triple_buffering_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_ENABLE_SCREENSHOTS :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . screenshots_enable , currentsetting ) ;
set_setting_label_color ( g_console . screenshots_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP :
case SETTING_DEFAULT_VIDEO_ALL :
break ;
case SETTING_SOUND_MODE :
switch ( g_console . sound_mode )
{
2012-06-30 14:04:34 +02:00
case SOUND_MODE_NORMAL :
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) ,
" INFO - [Sound Output] is set to 'Normal' - normal audio output will be \n used. " ) ;
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " Normal " ) ;
items_generalsettings [ currentsetting ] . text_color = GREEN ;
break ;
case SOUND_MODE_RSOUND :
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) ,
" INFO - [Sound Output] is set to 'RSound' - the sound will be streamed over the \n network to the RSound audio server. " ) ;
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " RSound " ) ;
items_generalsettings [ currentsetting ] . text_color = ORANGE ;
break ;
case SOUND_MODE_HEADSET :
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) ,
" INFO - [Sound Output] is set to 'USB/Bluetooth Headset' - sound will \n be output through the headset " ) ;
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " USB/Bluetooth Headset " ) ;
items_generalsettings [ currentsetting ] . text_color = ORANGE ;
break ;
default :
break ;
2012-04-14 04:38:40 +02:00
}
break ;
case SETTING_RSOUND_SERVER_IP_ADDRESS :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( strcmp ( g_settings . audio . device , " 0.0.0.0 " ) = = 0 , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , g_settings . audio . device ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_DEFAULT_AUDIO_ALL :
break ;
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( g_extern . state_slot = = 0 , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " %d " , g_extern . state_slot ) ;
2012-04-14 04:38:40 +02:00
break ;
/* emu-specific */
2012-05-28 22:43:08 +02:00
case SETTING_EMU_SHOW_INFO_MSG :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . info_msg_enable , currentsetting ) ;
set_setting_label_color ( g_console . info_msg_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_EMU_REWIND_ENABLED :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_settings . rewind_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_settings . rewind_enable )
{
2012-06-28 21:29:12 +02:00
items_generalsettings [ currentsetting ] . text_color = ORANGE ;
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) , " INFO - [Rewind] feature is set to 'ON'. You can rewind the game in real-time. " ) ;
2012-04-14 04:38:40 +02:00
}
else
{
2012-06-28 21:29:12 +02:00
items_generalsettings [ currentsetting ] . text_color = GREEN ;
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) , " INFO - [Rewind] feature is set to 'OFF'. " ) ;
2012-04-14 04:38:40 +02:00
}
break ;
2012-04-21 23:25:32 +02:00
case SETTING_RARCH_DEFAULT_EMU :
2012-04-14 04:38:40 +02:00
{
2012-05-28 17:34:58 +02:00
char fname [ PATH_MAX ] ;
2012-04-14 04:38:40 +02:00
fill_pathname_base ( fname , g_settings . libretro , sizeof ( fname ) ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , " %s " , fname ) ;
2012-04-14 04:38:40 +02:00
2012-06-28 21:29:12 +02:00
items_generalsettings [ currentsetting ] . text_color = GREEN ;
2012-04-14 04:38:40 +02:00
}
break ;
case SETTING_EMU_AUDIO_MUTE :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_extern . audio_data . mute , currentsetting ) ;
set_setting_label_color ( ! g_extern . audio_data . mute , currentsetting ) ;
2012-04-14 04:38:40 +02:00
if ( g_extern . audio_data . mute )
2012-06-29 12:27:17 +02:00
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ 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-06-29 12:27:17 +02:00
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ 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-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . custom_bgm_enable , currentsetting ) ;
set_setting_label_color ( g_console . custom_bgm_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_PATH_DEFAULT_ROM_DIRECTORY :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( ! ( strcmp ( g_console . default_rom_startup_dir , " / " ) ) , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , g_console . default_rom_startup_dir ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_PATH_SAVESTATES_DIRECTORY :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( ! ( strcmp ( g_console . default_savestate_dir , usrDirPath ) ) , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , g_console . default_savestate_dir ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_PATH_SRAM_DIRECTORY :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( ! ( strcmp ( g_console . default_sram_dir , usrDirPath ) ) , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , g_console . default_sram_dir ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_PATH_CHEATS :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( ! ( strcmp ( g_settings . cheat_database , usrDirPath ) ) , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , g_settings . cheat_database ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-07-10 04:00:04 +02:00
case SETTING_PATH_SYSTEM :
set_setting_label_color ( ! ( strcmp ( g_settings . system_directory , systemDirPath ) ) , currentsetting ) ;
2012-07-11 05:26:52 +02:00
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ 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-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . default_sram_dir_enable , currentsetting ) ;
set_setting_label_color ( ! g_console . default_sram_dir_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_ENABLE_STATE_PATH :
2012-06-29 12:27:17 +02:00
set_setting_label_write_on_or_off ( g_console . default_savestate_dir_enable , currentsetting ) ;
set_setting_label_color ( ! g_console . default_savestate_dir_enable , currentsetting ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_CONTROLS_SCHEME :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( strcmp ( g_console . input_cfg_path , " " ) = = 0 , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) , " INFO - Input scheme preset [%s] is selected. " , g_console . input_cfg_path ) ;
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ currentsetting ] . setting_text ) , g_console . input_cfg_path ) ;
2012-04-14 04:38:40 +02:00
break ;
case SETTING_CONTROLS_NUMBER :
2012-06-29 12:27:17 +02:00
set_setting_label_color ( currently_selected_controller_menu = = 0 , currentsetting ) ;
2012-06-28 21:29:12 +02:00
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) , " Controller %d is currently selected. " , currently_selected_controller_menu + 1 ) ;
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ 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-06-29 12:27:17 +02:00
set_setting_label_color ( g_settings . input . binds [ currently_selected_controller_menu ] [ currentsetting - ( FIRST_CONTROL_BIND ) ] . joykey = = rarch_default_keybind_lut [ currentsetting - FIRST_CONTROL_BIND ] , currentsetting ) ;
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 ;
snprintf ( items_generalsettings [ currentsetting ] . text , sizeof ( items_generalsettings [ currentsetting ] . text ) , rarch_input_get_default_keybind_name ( id ) ) ;
snprintf ( items_generalsettings [ currentsetting ] . comment , sizeof ( items_generalsettings [ currentsetting ] . comment ) , " INFO - [%s] on the PS3 controller is mapped to action: \n [%s]. " , items_generalsettings [ currentsetting ] . text , value ) ;
snprintf ( items_generalsettings [ currentsetting ] . setting_text , sizeof ( items_generalsettings [ 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 :
case SETTING_SAVE_SHADER_PRESET :
set_setting_label_color ( menu_obj - > 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 )
{
menuStackindex - - ;
}
static void menu_stack_increment ( void )
{
menuStackindex + + ;
}
2012-06-29 13:30:04 +02:00
static void menu_stack_refresh ( item * items , unsigned stack_idx )
2012-01-16 04:07:02 +01:00
{
2012-04-11 02:42:27 +02:00
int page , i , j ;
float increment ;
2012-06-30 14:04:34 +02:00
menu * menu_obj = & menuStack [ stack_idx ] ;
2012-04-11 02:42:27 +02:00
page = 0 ;
j = 0 ;
increment = 0.16f ;
for ( i = menu_obj - > first_setting ; i < menu_obj - > max_settings ; i + + )
{
if ( ! ( j < ( NUM_ENTRY_PER_PAGE ) ) )
{
j = 0 ;
increment = 0.16f ;
page + + ;
}
2012-06-29 13:30:04 +02:00
items [ i ] . text_xpos = 0.09f ;
items [ i ] . text_ypos = increment ;
items [ i ] . page = page ;
2012-04-11 02:42:27 +02:00
set_setting_label ( menu_obj , i ) ;
increment + = 0.03f ;
j + + ;
}
2012-01-10 23:33:44 +01:00
}
2012-06-28 21:49:40 +02:00
static void menu_stack_push ( unsigned stack_idx , unsigned menu_id )
2012-01-10 23:33:44 +01:00
{
2012-06-28 21:49:40 +02:00
switch ( menu_id )
{
case INGAME_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Ingame Menu " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-29 13:30:04 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_INGAME_MENU ;
menu_stack_refresh ( ingame_menu_settings , stack_idx ) ;
break ;
2012-06-28 21:49:40 +02:00
case INGAME_MENU_RESIZE :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Resize Menu " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
menuStack [ stack_idx ] . enum_id = INGAME_MENU_RESIZE ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_INGAME_MENU ;
break ;
2012-06-28 21:49:40 +02:00
case INGAME_MENU_SCREENSHOT :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Ingame Menu " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 21:49:40 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
2012-06-28 21:49:40 +02:00
menuStack [ stack_idx ] . category_id = CATEGORY_INGAME_MENU ;
break ;
case FILE_BROWSER_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " File Browser " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-29 11:44:50 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_FILEBROWSER ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-07-16 08:13:05 +02:00
strlcpy ( browser - > extensions , rarch_console_get_rom_ext ( ) , sizeof ( browser - > extensions ) ) ;
filebrowser_set_root ( browser , g_console . default_rom_startup_dir ) ;
filebrowser_iterate ( browser , FILEBROWSER_ACTION_RESET ) ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case LIBRETRO_CHOICE :
2012-06-29 15:43:09 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Libretro cores " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-29 11:44:50 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_FILEBROWSER ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-07-16 08:13:05 +02:00
strlcpy ( tmpBrowser - > extensions , " self|SELF|bin|BIN " , sizeof ( tmpBrowser - > extensions ) ) ;
filebrowser_set_root ( tmpBrowser , LIBRETRO_DIR_PATH ) ;
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_RESET ) ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case PRESET_CHOICE :
2012-06-29 15:43:09 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Shader presets " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-29 11:44:50 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_FILEBROWSER ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-07-16 08:13:05 +02:00
strlcpy ( tmpBrowser - > extensions , " cgp|CGP " , sizeof ( tmpBrowser - > extensions ) ) ;
filebrowser_set_root ( tmpBrowser , PRESETS_DIR_PATH ) ;
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_RESET ) ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case INPUT_PRESET_CHOICE :
2012-06-29 15:43:09 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Input presets " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-29 11:44:50 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_FILEBROWSER ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-07-16 08:13:05 +02:00
strlcpy ( tmpBrowser - > extensions , " cfg|CFG " , sizeof ( tmpBrowser - > extensions ) ) ;
filebrowser_set_root ( tmpBrowser , INPUT_PRESETS_DIR_PATH ) ;
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_RESET ) ;
2012-06-29 11:44:50 +02:00
break ;
2012-06-28 21:49:40 +02:00
case SHADER_CHOICE :
2012-06-29 15:43:09 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Shaders " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-29 11:44:50 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_FILEBROWSER ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-07-16 08:13:05 +02:00
strlcpy ( tmpBrowser - > extensions , " cg|CG " , sizeof ( tmpBrowser - > extensions ) ) ;
filebrowser_set_root ( tmpBrowser , SHADERS_DIR_PATH ) ;
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_RESET ) ;
2012-06-29 11:44:50 +02:00
break ;
case BORDER_CHOICE :
2012-06-29 15:43:09 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Borders " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-29 11:44:50 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_FILEBROWSER ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-07-16 08:13:05 +02:00
strlcpy ( tmpBrowser - > extensions , " png|PNG|jpg|JPG|JPEG|jpeg " , sizeof ( tmpBrowser - > extensions ) ) ;
filebrowser_set_root ( tmpBrowser , BORDERS_DIR_PATH ) ;
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_RESET ) ;
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 :
case PATH_CHEATS_DIR_CHOICE :
2012-07-10 04:00:04 +02:00
case PATH_SYSTEM_DIR_CHOICE :
2012-06-29 15:43:09 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Path Selection " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 21:49:40 +02:00
menuStack [ stack_idx ] . enum_id = menu_id ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . selected = 0 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . category_id = CATEGORY_FILEBROWSER ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-07-16 08:13:05 +02:00
strlcpy ( tmpBrowser - > extensions , " empty " , sizeof ( tmpBrowser - > extensions ) ) ;
filebrowser_set_root ( tmpBrowser , " / " ) ;
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_RESET ) ;
2012-06-28 21:49:40 +02:00
break ;
case GENERAL_VIDEO_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Video " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . enum_id = GENERAL_VIDEO_MENU ;
menuStack [ stack_idx ] . selected = FIRST_VIDEO_SETTING ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . first_setting = FIRST_VIDEO_SETTING ;
menuStack [ stack_idx ] . max_settings = MAX_NO_OF_VIDEO_SETTINGS ;
menuStack [ stack_idx ] . category_id = CATEGORY_SETTINGS ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-06-28 21:49:40 +02:00
break ;
case GENERAL_AUDIO_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Audio " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . enum_id = GENERAL_AUDIO_MENU ;
menuStack [ stack_idx ] . selected = FIRST_AUDIO_SETTING ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . first_setting = FIRST_AUDIO_SETTING ;
menuStack [ stack_idx ] . max_settings = MAX_NO_OF_AUDIO_SETTINGS ;
menuStack [ stack_idx ] . category_id = CATEGORY_SETTINGS ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-06-28 21:49:40 +02:00
break ;
case EMU_GENERAL_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Retro " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . enum_id = EMU_GENERAL_MENU ;
menuStack [ stack_idx ] . selected = FIRST_EMU_SETTING ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . first_setting = FIRST_EMU_SETTING ;
menuStack [ stack_idx ] . max_settings = MAX_NO_OF_EMU_SETTINGS ;
menuStack [ stack_idx ] . category_id = CATEGORY_SETTINGS ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-06-28 21:49:40 +02:00
break ;
case EMU_VIDEO_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Retro Video " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . enum_id = EMU_VIDEO_MENU ;
menuStack [ stack_idx ] . selected = FIRST_EMU_VIDEO_SETTING ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . first_setting = FIRST_EMU_VIDEO_SETTING ;
menuStack [ stack_idx ] . max_settings = MAX_NO_OF_EMU_VIDEO_SETTINGS ;
menuStack [ stack_idx ] . category_id = CATEGORY_SETTINGS ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-06-28 21:49:40 +02:00
break ;
case EMU_AUDIO_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Retro Audio " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . enum_id = EMU_AUDIO_MENU ;
menuStack [ stack_idx ] . selected = FIRST_EMU_AUDIO_SETTING ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . first_setting = FIRST_EMU_AUDIO_SETTING ;
menuStack [ stack_idx ] . max_settings = MAX_NO_OF_EMU_AUDIO_SETTINGS ;
menuStack [ stack_idx ] . category_id = CATEGORY_SETTINGS ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-06-28 21:49:40 +02:00
break ;
case PATH_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Path " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . enum_id = PATH_MENU ;
menuStack [ stack_idx ] . selected = FIRST_PATH_SETTING ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . first_setting = FIRST_PATH_SETTING ;
menuStack [ stack_idx ] . max_settings = MAX_NO_OF_PATH_SETTINGS ;
menuStack [ stack_idx ] . category_id = CATEGORY_SETTINGS ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-06-28 21:49:40 +02:00
break ;
case CONTROLS_MENU :
2012-06-29 14:40:50 +02:00
strlcpy ( menuStack [ stack_idx ] . title , " Controls " , sizeof ( menuStack [ stack_idx ] . title ) ) ;
2012-06-28 22:19:03 +02:00
menuStack [ stack_idx ] . enum_id = CONTROLS_MENU ;
menuStack [ stack_idx ] . selected = FIRST_CONTROLS_SETTING_PAGE_1 ;
menuStack [ stack_idx ] . page = 0 ;
menuStack [ stack_idx ] . first_setting = FIRST_CONTROLS_SETTING_PAGE_1 ;
menuStack [ stack_idx ] . max_settings = MAX_NO_OF_CONTROLS_SETTINGS ;
menuStack [ stack_idx ] . category_id = CATEGORY_SETTINGS ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , stack_idx ) ;
2012-06-28 21:49:40 +02:00
break ;
default :
break ;
}
2012-01-10 23:33:44 +01:00
}
2012-06-28 21:49:40 +02:00
//forward decls
extern const char * ps3_get_resolution_label ( unsigned resolution ) ;
2012-06-29 14:40:50 +02:00
static void display_menubar ( void )
2012-06-28 21:49:40 +02:00
{
2012-06-29 14:40:50 +02:00
struct retro_system_info info ;
menu * menu_obj = & menuStack [ menuStackindex ] ;
2012-06-28 21:49:40 +02:00
gl_t * gl = driver . video_data ;
2012-06-29 14:40:50 +02:00
switch ( menu_obj - > enum_id )
{
case GENERAL_VIDEO_MENU :
cellDbgFontPrintf ( 0.09f , 0.03f , 0.91f , WHITE , " NEXT -> " ) ;
break ;
case GENERAL_AUDIO_MENU :
case EMU_GENERAL_MENU :
case EMU_VIDEO_MENU :
case EMU_AUDIO_MENU :
case PATH_MENU :
cellDbgFontPrintf ( 0.09f , 0.03f , 0.91f , WHITE , " <- PREV | NEXT -> " ) ;
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 :
case PATH_CHEATS_DIR_CHOICE :
case PATH_SRAM_DIR_CHOICE :
2012-06-29 14:40:50 +02:00
cellDbgFontPrintf ( 0.09f , 0.03f , 0.91f , WHITE , " <- PREV " ) ;
break ;
default :
break ;
}
retro_get_system_info ( & info ) ;
const char * id = info . library_name ? info . library_name : " Unknown " ;
2012-07-16 08:13:05 +02:00
filebrowser_t * fb = browser ;
2012-06-29 15:43:09 +02:00
switch ( menu_obj - > enum_id )
{
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 :
case PATH_CHEATS_DIR_CHOICE :
case PATH_SRAM_DIR_CHOICE :
2012-07-16 08:13:05 +02:00
fb = tmpBrowser ;
2012-06-29 15:43:09 +02:00
case FILE_BROWSER_MENU :
cellDbgFontPrintf ( 0.09f , 0.09f , FONT_SIZE , YELLOW , " PATH: %s " , filebrowser_get_current_dir ( fb ) ) ;
break ;
default :
break ;
}
2012-06-29 14:40:50 +02:00
cellDbgFontPrintf ( 0.09f , 0.05f , 1.4f , WHITE , menu_obj - > title ) ;
2012-07-15 21:09:18 +02:00
cellDbgFontPrintf ( 0.4f , 0.06f , 0.82f , WHITE , " Libretro core: %s %s " , id , info . library_version ) ;
2012-06-29 16:02:31 +02:00
cellDbgFontPrintf ( 0.8f , 0.12f , 0.82f , WHITE , " v%s " , PACKAGE_VERSION ) ;
2012-06-28 21:49:40 +02:00
gl_render_msg_post ( gl ) ;
}
uint64_t state , trigger_state , held_state ;
static uint64_t old_state = 0 ;
static uint64_t older_state = 0 ;
static void browser_update ( filebrowser_t * b , const char * extensions )
{
filebrowser_action_t action = FILEBROWSER_ACTION_NOOP ;
if ( CTRL_LSTICK_DOWN ( trigger_state ) )
action = FILEBROWSER_ACTION_DOWN ;
else if ( CTRL_DOWN ( trigger_state ) )
action = FILEBROWSER_ACTION_DOWN ;
else if ( CTRL_LSTICK_UP ( trigger_state ) )
action = FILEBROWSER_ACTION_UP ;
else if ( CTRL_UP ( trigger_state ) )
action = FILEBROWSER_ACTION_UP ;
else if ( CTRL_RIGHT ( trigger_state ) )
action = FILEBROWSER_ACTION_RIGHT ;
else if ( CTRL_LSTICK_RIGHT ( trigger_state ) )
action = FILEBROWSER_ACTION_RIGHT ;
else if ( CTRL_LEFT ( trigger_state ) )
action = FILEBROWSER_ACTION_LEFT ;
else if ( CTRL_LSTICK_LEFT ( trigger_state ) )
action = FILEBROWSER_ACTION_LEFT ;
else if ( CTRL_R1 ( trigger_state ) )
action = FILEBROWSER_ACTION_SCROLL_DOWN ;
else if ( CTRL_R2 ( trigger_state ) )
action = FILEBROWSER_ACTION_SCROLL_DOWN_SMOOTH ;
else if ( CTRL_L2 ( trigger_state ) )
action = FILEBROWSER_ACTION_SCROLL_UP_SMOOTH ;
else if ( CTRL_L1 ( trigger_state ) )
action = FILEBROWSER_ACTION_SCROLL_UP ;
else if ( CTRL_CIRCLE ( trigger_state ) )
action = FILEBROWSER_ACTION_CANCEL ;
else if ( CTRL_START ( trigger_state ) )
{
action = FILEBROWSER_ACTION_RESET ;
filebrowser_set_root ( b , " / " ) ;
strlcpy ( b - > extensions , extensions , sizeof ( b - > extensions ) ) ;
}
if ( action ! = FILEBROWSER_ACTION_NOOP )
filebrowser_iterate ( b , action ) ;
}
static void browser_render ( filebrowser_t * b )
{
gl_t * gl = driver . video_data ;
unsigned file_count = b - > current_dir . list - > size ;
int current_index , page_number , page_base , i ;
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 ;
currentX = 0.09f ;
currentY = 0.10f ;
ySpacing = 0.035f ;
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 ;
cellDbgFontPuts ( currentX , currentY , FONT_SIZE , i = = current_index ? RED : b - > current_dir . list - > elems [ i ] . attr . b ? GREEN : WHITE , fname_tmp ) ;
gl_render_msg_post ( gl ) ;
}
gl_render_msg_post ( gl ) ;
}
2012-02-20 22:34:11 +01:00
2012-02-20 20:24:23 +01:00
static void apply_scaling ( unsigned init_mode )
{
2012-05-26 17:35:40 +02:00
gl_t * gl = driver . video_data ;
2012-04-11 02:42:27 +02:00
switch ( init_mode )
{
case FBO_DEINIT :
2012-05-26 17:35:40 +02:00
gl_deinit_fbo ( gl ) ;
2012-04-11 02:42:27 +02:00
break ;
case FBO_INIT :
2012-05-26 17:35:40 +02:00
gl_init_fbo ( gl , RARCH_SCALE_BASE * INPUT_SCALE ,
2012-04-21 23:25:32 +02:00
RARCH_SCALE_BASE * INPUT_SCALE ) ;
2012-04-11 02:42:27 +02:00
break ;
case FBO_REINIT :
2012-05-26 17:35:40 +02:00
gl_deinit_fbo ( gl ) ;
gl_init_fbo ( gl , RARCH_SCALE_BASE * INPUT_SCALE ,
2012-04-21 23:25:32 +02:00
RARCH_SCALE_BASE * INPUT_SCALE ) ;
2012-04-11 02:42:27 +02:00
break ;
}
2012-02-20 20:24:23 +01:00
}
2012-06-28 21:03:14 +02:00
static void select_file ( void )
2012-01-31 14:34:43 +01:00
{
2012-06-28 21:03:14 +02:00
unsigned menu_id = menuStack [ menuStackindex ] . enum_id ;
2012-06-29 15:43:09 +02:00
char extensions [ 256 ] , object [ 256 ] , comment [ 256 ] , path [ PATH_MAX ] ;
2012-05-26 18:18:09 +02:00
gl_t * gl = driver . video_data ;
2012-01-31 14:34:43 +01:00
2012-04-14 04:38:40 +02:00
switch ( menu_id )
{
case SHADER_CHOICE :
2012-05-28 17:28:29 +02:00
strlcpy ( extensions , " cg|CG " , sizeof ( extensions ) ) ;
strlcpy ( object , " Shader " , sizeof ( object ) ) ;
strlcpy ( comment , " INFO - Select a shader from the menu by pressing the X button. " , sizeof ( comment ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case PRESET_CHOICE :
2012-05-28 17:28:29 +02:00
strlcpy ( extensions , " cgp|CGP " , sizeof ( extensions ) ) ;
strlcpy ( object , " Shader preset " , sizeof ( object ) ) ;
strlcpy ( comment , " INFO - Select a shader preset from the menu by pressing the X button. " , sizeof ( comment ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case INPUT_PRESET_CHOICE :
2012-05-28 17:28:29 +02:00
strlcpy ( extensions , " cfg|CFG " , sizeof ( extensions ) ) ;
strlcpy ( object , " Input preset " , sizeof ( object ) ) ;
strlcpy ( comment , " INFO - Select an input preset from the menu by pressing the X button. " , sizeof ( comment ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case BORDER_CHOICE :
2012-05-28 17:28:29 +02:00
strlcpy ( extensions , " png|PNG|jpg|JPG|JPEG|jpeg " , sizeof ( extensions ) ) ;
strlcpy ( object , " Border image file " , sizeof ( object ) ) ;
strlcpy ( comment , " INFO - Select a border image file from the menu by pressing the X button. " , sizeof ( comment ) ) ;
2012-04-14 04:38:40 +02:00
break ;
2012-04-22 01:45:55 +02:00
case LIBRETRO_CHOICE :
2012-05-28 17:28:29 +02:00
strlcpy ( extensions , " self|SELF|bin|BIN " , sizeof ( extensions ) ) ;
2012-06-29 15:43:09 +02:00
strlcpy ( object , " Libretro core " , sizeof ( object ) ) ;
2012-05-28 17:28:29 +02:00
strlcpy ( comment , " INFO - Select a Libretro core from the menu by pressing the X button. " , sizeof ( comment ) ) ;
2012-04-14 04:38:40 +02:00
break ;
}
2012-01-31 14:34:43 +01:00
2012-07-16 08:13:05 +02:00
browser_update ( tmpBrowser , extensions ) ;
2012-02-22 19:49:22 +01:00
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 04:38:40 +02:00
{
2012-07-16 08:13:05 +02:00
if ( filebrowser_get_current_path_isdir ( tmpBrowser ) )
2012-04-14 04:38:40 +02:00
{
/*if 'filename' is in fact '..' - then pop back directory instead of
adding ' . . ' to filename path */
2012-07-16 08:13:05 +02:00
if ( tmpBrowser - > current_dir . ptr = = 0 )
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_CANCEL ) ;
2012-04-14 04:38:40 +02:00
else
2012-07-16 08:13:05 +02:00
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_OK ) ;
2012-04-14 04:38:40 +02:00
}
2012-07-16 08:13:05 +02:00
else if ( path_file_exists ( filebrowser_get_current_path ( tmpBrowser ) ) )
2012-04-14 04:38:40 +02:00
{
2012-07-16 08:13:05 +02:00
snprintf ( path , sizeof ( path ) , filebrowser_get_current_path ( tmpBrowser ) ) ;
2012-04-14 04:38:40 +02:00
switch ( menu_id )
{
case SHADER_CHOICE :
2012-06-28 17:35:20 +02:00
rarch_load_shader ( set_shader + 1 , path ) ;
2012-04-14 04:38:40 +02:00
switch ( set_shader + 1 )
{
case 1 :
strlcpy ( g_settings . video . cg_shader_path , path , sizeof ( g_settings . video . cg_shader_path ) ) ;
break ;
case 2 :
strlcpy ( g_settings . video . second_pass_shader , path , sizeof ( g_settings . video . second_pass_shader ) ) ;
break ;
}
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-04-14 04:38:40 +02:00
break ;
case PRESET_CHOICE :
strlcpy ( g_console . cgp_path , path , sizeof ( g_console . cgp_path ) ) ;
apply_scaling ( FBO_DEINIT ) ;
gl_cg_reinit ( path ) ;
apply_scaling ( FBO_INIT ) ;
break ;
case INPUT_PRESET_CHOICE :
strlcpy ( g_console . input_cfg_path , path , sizeof ( g_console . input_cfg_path ) ) ;
config_read_keybinds ( path ) ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-04-14 04:38:40 +02:00
break ;
case BORDER_CHOICE :
break ;
2012-04-22 01:45:55 +02:00
case LIBRETRO_CHOICE :
2012-04-14 04:38:40 +02:00
strlcpy ( g_settings . libretro , path , sizeof ( g_settings . libretro ) ) ;
2012-05-28 22:18:50 +02:00
if ( set_libretro_core_as_launch )
{
strlcpy ( g_console . launch_app_on_exit , path , sizeof ( g_console . launch_app_on_exit ) ) ;
set_libretro_core_as_launch = false ;
2012-05-29 02:48:13 +02:00
rarch_settings_change ( S_RETURN_TO_LAUNCHER ) ;
2012-05-28 22:18:50 +02:00
}
2012-04-14 04:38:40 +02:00
break ;
}
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-04-14 04:38:40 +02:00
}
}
2012-06-28 17:11:22 +02:00
else if ( CTRL_TRIANGLE ( trigger_state ) )
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-01-31 14:34:43 +01:00
2012-06-29 15:43:09 +02:00
display_menubar ( ) ;
2012-04-14 04:38:40 +02:00
cellDbgFontPrintf ( 0.09f , 0.92f , 0.92 , YELLOW , " X - Select %s / \\ - return to settings START - Reset Startdir " , object ) ;
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , LIGHTBLUE , " %s " , comment ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-01-31 14:34:43 +01:00
}
2012-06-28 21:03:14 +02:00
static void select_directory ( void )
2012-01-31 14:34:43 +01:00
{
2012-06-28 21:03:14 +02:00
unsigned menu_id = menuStack [ menuStackindex ] . enum_id ;
2012-06-19 03:44:17 +02:00
char path [ 1024 ] ;
2012-05-26 18:18:09 +02:00
gl_t * gl = driver . video_data ;
2012-01-31 14:34:43 +01:00
2012-04-14 04:38:40 +02:00
{
2012-07-16 08:13:05 +02:00
browser_update ( tmpBrowser , " empty " ) ;
2012-02-22 19:49:22 +01:00
2012-06-28 17:11:22 +02:00
if ( CTRL_SQUARE ( trigger_state ) )
2012-04-14 04:38:40 +02:00
{
2012-07-16 08:13:05 +02:00
if ( filebrowser_get_current_path_isdir ( tmpBrowser ) )
2012-04-14 04:38:40 +02:00
{
2012-07-16 08:13:05 +02:00
snprintf ( path , sizeof ( path ) , filebrowser_get_current_path ( tmpBrowser ) ) ;
2012-04-14 04:38:40 +02:00
switch ( menu_id )
{
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-04-14 04:38:40 +02:00
break ;
case PATH_SRAM_DIR_CHOICE :
2012-05-22 18:51:06 +02:00
strlcpy ( g_console . default_sram_dir , path , sizeof ( g_console . default_sram_dir ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
2012-05-22 18:51:06 +02:00
strlcpy ( g_console . default_rom_startup_dir , path , sizeof ( g_console . default_rom_startup_dir ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case PATH_CHEATS_DIR_CHOICE :
2012-05-22 18:51:06 +02:00
strlcpy ( g_settings . cheat_database , path , sizeof ( g_settings . cheat_database ) ) ;
2012-04-14 04:38:40 +02:00
break ;
}
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-04-14 04:38:40 +02:00
}
}
2012-06-28 17:11:22 +02:00
else if ( CTRL_TRIANGLE ( trigger_state ) )
2012-04-14 04:38:40 +02:00
{
2012-05-22 18:51:06 +02:00
strlcpy ( path , usrDirPath , sizeof ( path ) ) ;
2012-04-14 04:38:40 +02:00
switch ( menu_id )
{
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-04-14 04:38:40 +02:00
break ;
case PATH_SRAM_DIR_CHOICE :
2012-05-22 18:51:06 +02:00
strlcpy ( g_console . default_sram_dir , path , sizeof ( g_console . default_sram_dir ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case PATH_DEFAULT_ROM_DIR_CHOICE :
2012-05-22 18:51:06 +02:00
strlcpy ( g_console . default_rom_startup_dir , path , sizeof ( g_console . default_rom_startup_dir ) ) ;
2012-04-14 04:38:40 +02:00
break ;
case PATH_CHEATS_DIR_CHOICE :
2012-05-22 18:51:06 +02:00
strlcpy ( g_settings . cheat_database , path , sizeof ( g_settings . cheat_database ) ) ;
2012-04-14 04:38:40 +02:00
break ;
}
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-04-14 04:38:40 +02:00
}
2012-06-28 17:11:22 +02:00
else if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 04:38:40 +02:00
{
2012-07-16 08:13:05 +02:00
if ( filebrowser_get_current_path_isdir ( tmpBrowser ) )
2012-04-14 04:38:40 +02:00
{
/* if 'filename' is in fact '..' - then pop back directory instead of
* adding ' . . ' to filename path */
2012-07-16 08:13:05 +02:00
if ( tmpBrowser - > current_dir . ptr = = 0 )
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_CANCEL ) ;
2012-04-14 04:38:40 +02:00
else
2012-07-16 08:13:05 +02:00
filebrowser_iterate ( tmpBrowser , FILEBROWSER_ACTION_OK ) ;
2012-04-14 04:38:40 +02:00
}
}
}
2012-06-29 15:43:09 +02:00
display_menubar ( ) ;
2012-04-14 04:38:40 +02:00
cellDbgFontPuts ( 0.09f , 0.93f , 0.92f , YELLOW ,
" X - Enter dir / \\ - return to settings START - Reset Startdir " ) ;
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , LIGHTBLUE , " %s " ,
" INFO - Browse to a directory and assign it as the path by \n pressing SQUARE button. " ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-01-31 14:34:43 +01:00
}
2012-06-28 17:11:22 +02:00
static void set_keybind_digital ( uint64_t control_state , uint64_t default_retro_joypad_id )
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-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( control_state ) | CTRL_LSTICK_LEFT ( control_state ) )
2012-04-13 04:31:18 +02:00
keybind_action = KEYBIND_DECREMENT ;
2012-04-11 02:42:27 +02:00
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( control_state ) | | CTRL_LSTICK_RIGHT ( control_state ) | | CTRL_CROSS ( control_state ) )
2012-04-13 04:31:18 +02:00
keybind_action = KEYBIND_INCREMENT ;
2012-04-11 02:42:27 +02:00
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( control_state ) )
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-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-04-14 04:38:40 +02:00
switch ( filename_type )
{
case CONFIG_FILE :
break ;
case SHADER_PRESET_FILE :
snprintf ( filepath , sizeof ( filepath ) , " %s/%s.cgp " , PRESETS_DIR_PATH , filename_tmp ) ;
break ;
case INPUT_PRESET_FILE :
snprintf ( filepath , sizeof ( filepath ) , " %s/%s.cfg " , INPUT_PRESETS_DIR_PATH , filename_tmp ) ;
break ;
}
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 )
{
char filetitle_tmp [ 512 ] ;
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-05-27 16:23:01 +02:00
gfx_ctx_swap_buffers ( ) ;
# 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 :
{
struct gl_cg_cgp_info current_settings ;
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-06-29 12:27:17 +02:00
static void producesettingentry ( menu * menu_obj , unsigned switchvalue )
2012-01-16 04:07:02 +01:00
{
switch ( switchvalue )
{
case SETTING_CHANGE_RESOLUTION :
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-06-05 18:11:42 +02:00
rarch_settings_change ( S_RESOLUTION_NEXT ) ;
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-06-05 18:11:42 +02:00
rarch_settings_change ( S_RESOLUTION_PREVIOUS ) ;
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-01-18 00:18:23 +01:00
{
2012-05-29 15:25:39 +02:00
if ( g_console . supported_resolutions [ g_console . current_resolution_index ] = = CELL_VIDEO_OUT_RESOLUTION_576 )
{
2012-05-30 16:30:25 +02:00
if ( gfx_ctx_check_resolution ( CELL_VIDEO_OUT_RESOLUTION_576 ) )
2012-05-29 15:25:39 +02:00
{
//ps3graphics_set_pal60hz(Settings.PS3PALTemporalMode60Hz);
video_gl . restart ( ) ;
}
}
else
{
//ps3graphics_set_pal60hz(0);
video_gl . restart ( ) ;
}
2012-01-18 00:18:23 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
/*
case SETTING_PAL60_MODE :
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | | CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-01-16 04:07:02 +01: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 ;
*/
case SETTING_SHADER_PRESETS :
2012-06-28 17:11:22 +02:00
if ( ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) ) )
2012-02-20 20:24:23 +01:00
{
2012-05-29 01:27:45 +02:00
if ( g_console . emulator_initialized )
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , PRESET_CHOICE ) ;
2012-05-29 01:27:45 +02:00
}
2012-02-20 20:24:23 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 01:27:45 +02:00
strlcpy ( g_console . cgp_path , " " , sizeof ( g_console . cgp_path ) ) ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_SHADER :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-16 17:15:16 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , SHADER_CHOICE ) ;
2012-05-29 15:25:39 +02:00
set_shader = 0 ;
2012-01-16 17:15:16 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-16 17:15:16 +01:00
{
2012-06-28 17:35:20 +02:00
rarch_load_shader ( 1 , NULL ) ;
2012-05-29 15:25:39 +02:00
strlcpy ( g_settings . video . cg_shader_path , DEFAULT_SHADER_FILE , sizeof ( g_settings . video . cg_shader_path ) ) ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-16 17:15:16 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_SHADER_2 :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-16 17:15:16 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , SHADER_CHOICE ) ;
2012-05-29 15:25:39 +02:00
set_shader = 1 ;
2012-01-16 17:15:16 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-16 17:15:16 +01:00
{
2012-06-28 17:35:20 +02:00
rarch_load_shader ( 2 , NULL ) ;
2012-05-29 15:25:39 +02:00
strlcpy ( g_settings . video . second_pass_shader , DEFAULT_SHADER_FILE , sizeof ( g_settings . video . second_pass_shader ) ) ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-16 17:15:16 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_FONT_SIZE :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-31 18:51:45 +01:00
{
if ( g_console . menu_font_size > 0 )
2012-06-29 11:56:58 +02:00
g_console . menu_font_size - = 0.01f ;
2012-01-31 18:51:45 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-31 18:51:45 +01:00
{
if ( ( g_console . menu_font_size < 2.0f ) )
2012-06-29 11:56:58 +02:00
g_console . menu_font_size + = 0.01f ;
2012-01-31 18:51:45 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-06-29 11:56:58 +02:00
g_console . menu_font_size = 1.0f ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_KEEP_ASPECT_RATIO :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-01-31 18:21:53 +01:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_change ( S_ASPECT_RATIO_DECREMENT ) ;
gfx_ctx_set_aspect_ratio ( NULL , g_console . aspect_ratio_index ) ;
2012-01-31 18:21:53 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-01-31 18:21:53 +01:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_change ( S_ASPECT_RATIO_INCREMENT ) ;
gfx_ctx_set_aspect_ratio ( NULL , g_console . aspect_ratio_index ) ;
2012-01-31 18:21:53 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-31 18:21:53 +01:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_default ( S_DEF_ASPECT_RATIO ) ;
gfx_ctx_set_aspect_ratio ( NULL , g_console . aspect_ratio_index ) ;
2012-01-31 18:21:53 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_HW_TEXTURE_FILTER :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-06-28 21:03:14 +02:00
rarch_settings_change ( S_HW_TEXTURE_FILTER ) ;
gfx_ctx_set_filtering ( 1 , g_settings . video . smooth ) ;
2012-01-16 15:33:18 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-06-28 21:03:14 +02:00
rarch_settings_change ( S_DEF_HW_TEXTURE_FILTER ) ;
gfx_ctx_set_filtering ( 1 , g_settings . video . smooth ) ;
2012-01-16 15:33:18 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_HW_TEXTURE_FILTER_2 :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-05-29 01:37:09 +02:00
rarch_settings_change ( S_HW_TEXTURE_FILTER_2 ) ;
2012-05-27 18:04:25 +02:00
gfx_ctx_set_filtering ( 2 , g_settings . video . second_pass_smooth ) ;
2012-01-16 15:33:18 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-05-29 01:37:09 +02:00
rarch_settings_change ( S_DEF_HW_TEXTURE_FILTER_2 ) ;
2012-05-27 18:04:25 +02:00
gfx_ctx_set_filtering ( 2 , g_settings . video . second_pass_smooth ) ;
2012-01-16 15:33:18 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_SCALE_ENABLED :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_change ( S_SCALE_ENABLED ) ;
2012-05-27 18:04:25 +02:00
gfx_ctx_set_fbo ( g_console . fbo_enabled ) ;
2012-01-16 15:33:18 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_default ( S_DEF_SCALE_ENABLED ) ;
2012-02-20 04:07:18 +01:00
apply_scaling ( FBO_DEINIT ) ;
apply_scaling ( FBO_INIT ) ;
2012-01-16 15:33:18 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_SCALE_FACTOR :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-05-29 15:25:39 +02:00
if ( g_console . fbo_enabled )
{
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-01-16 15:33:18 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-05-29 15:25:39 +02:00
if ( g_console . fbo_enabled )
{
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-01-16 15:33:18 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-16 15:33:18 +01:00
{
2012-05-29 15:25:39 +02:00
rarch_settings_default ( S_DEF_SCALE_FACTOR ) ;
apply_scaling ( FBO_DEINIT ) ;
apply_scaling ( FBO_INIT ) ;
2012-01-16 15:33:18 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_HW_OVERSCAN_AMOUNT :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-02-02 18:39:09 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_change ( S_OVERSCAN_DECREMENT ) ;
2012-05-27 21:52:52 +02:00
gfx_ctx_set_overscan ( ) ;
2012-02-02 18:39:09 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-02-02 18:39:09 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_change ( S_OVERSCAN_INCREMENT ) ;
2012-05-27 21:52:52 +02:00
gfx_ctx_set_overscan ( ) ;
2012-02-02 18:39:09 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-02-02 18:39:09 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_default ( S_DEF_OVERSCAN ) ;
2012-05-27 21:52:52 +02:00
gfx_ctx_set_overscan ( ) ;
2012-02-02 18:39:09 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_THROTTLE_MODE :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-01-30 09:53:16 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_change ( S_THROTTLE ) ;
2012-05-26 14:59:42 +02:00
gfx_ctx_set_swap_interval ( g_console . throttle_enable , true ) ;
2012-01-30 09:53:16 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-30 09:53:16 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_default ( S_DEF_THROTTLE ) ;
2012-05-26 14:59:42 +02:00
gfx_ctx_set_swap_interval ( g_console . throttle_enable , true ) ;
2012-01-30 09:53:16 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_TRIPLE_BUFFERING :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-01-30 15:16:29 +01:00
{
2012-05-29 01:27:45 +02:00
rarch_settings_change ( S_TRIPLE_BUFFERING ) ;
2012-05-27 19:29:10 +02:00
video_gl . restart ( ) ;
2012-01-30 15:16:29 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-30 15:16:29 +01:00
{
2012-06-28 17:11:22 +02:00
bool old_buffer_trigger_state = g_console . triple_buffering_enable ;
2012-05-29 01:27:45 +02:00
rarch_settings_default ( S_DEF_TRIPLE_BUFFERING ) ;
2012-06-28 17:11:22 +02:00
if ( ! old_buffer_trigger_state )
2012-05-29 01:27:45 +02:00
video_gl . restart ( ) ;
2012-01-30 15:16:29 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_ENABLE_SCREENSHOTS :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-01-16 15:45:55 +01:00
{
# if(CELL_SDK_VERSION > 0x340000)
2012-05-29 15:25:39 +02:00
g_console . screenshots_enable = ! g_console . screenshots_enable ;
if ( g_console . screenshots_enable )
{
cellSysmoduleLoadModule ( CELL_SYSMODULE_SYSUTIL_SCREENSHOT ) ;
CellScreenShotSetParam screenshot_param = { 0 , 0 , 0 , 0 } ;
2012-01-16 15:45:55 +01:00
2012-06-29 00:24:10 +02:00
screenshot_param . photo_title = " RetroArch PS3 " ;
screenshot_param . game_title = " RetroArch PS3 " ;
2012-05-29 15:25:39 +02:00
cellScreenShotSetParameter ( & screenshot_param ) ;
cellScreenShotEnable ( ) ;
}
else
{
cellScreenShotDisable ( ) ;
cellSysmoduleUnloadModule ( CELL_SYSMODULE_SYSUTIL_SCREENSHOT ) ;
}
2012-01-16 15:45:55 +01:00
# endif
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-16 15:45:55 +01:00
{
# if(CELL_SDK_VERSION > 0x340000)
2012-05-29 15:25:39 +02:00
g_console . screenshots_enable = true ;
2012-01-16 15:45:55 +01:00
# endif
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_SAVE_SHADER_PRESET :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-05-29 15:25:39 +02:00
rarch_filename_input_and_save ( SHADER_PRESET_FILE ) ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP :
break ;
case SETTING_DEFAULT_VIDEO_ALL :
break ;
case SETTING_SOUND_MODE :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-03-03 11:46:46 +01:00
{
2012-05-29 15:25:39 +02:00
if ( g_console . sound_mode ! = SOUND_MODE_NORMAL )
g_console . sound_mode - - ;
2012-03-03 11:46:46 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-03-03 11:46:46 +01:00
{
2012-05-29 15:25:39 +02:00
if ( g_console . sound_mode < SOUND_MODE_HEADSET )
g_console . sound_mode + + ;
2012-03-03 11:46:46 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_UP ( trigger_state ) | | CTRL_LSTICK_UP ( trigger_state ) | | CTRL_DOWN ( trigger_state ) | | CTRL_LSTICK_DOWN ( trigger_state ) )
2012-05-07 23:52:15 +02:00
{
2012-05-29 15:25:39 +02:00
if ( g_console . sound_mode ! = SOUND_MODE_RSOUND )
rarch_console_rsound_stop ( ) ;
else
rarch_console_rsound_start ( g_settings . audio . device ) ;
2012-05-07 23:52:15 +02:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-03-03 11:46:46 +01:00
{
2012-05-29 15:25:39 +02:00
g_console . sound_mode = SOUND_MODE_NORMAL ;
rarch_console_rsound_stop ( ) ;
2012-03-03 11:46:46 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_RSOUND_SERVER_IP_ADDRESS :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-03-03 11:46:46 +01:00
{
2012-05-29 15:25:39 +02:00
oskutil_write_initial_message ( & g_console . oskutil_handle , L " 192.168.1.1 " ) ;
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-06-28 14:10:05 +02:00
gfx_ctx_clear ( ) ;
2012-05-29 15:25:39 +02:00
gfx_ctx_swap_buffers ( ) ;
2012-05-27 16:23:01 +02:00
# ifdef HAVE_SYSUTILS
2012-05-29 15:25:39 +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 )
strlcpy ( g_settings . audio . device , OUTPUT_TEXT_STRING ( g_console . oskutil_handle ) , sizeof ( g_settings . audio . device ) ) ;
2012-03-03 11:46:46 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
strlcpy ( g_settings . audio . device , " 0.0.0.0 " , sizeof ( g_settings . audio . device ) ) ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_DEFAULT_AUDIO_ALL :
break ;
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-05-29 04:05:16 +02:00
rarch_settings_change ( S_SAVESTATE_DECREMENT ) ;
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-05-29 04:05:16 +02:00
rarch_settings_change ( S_SAVESTATE_INCREMENT ) ;
2012-01-16 15:33:18 +01:00
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 01:27:45 +02:00
rarch_settings_default ( S_DEF_SAVE_STATE ) ;
2012-01-16 04:07:02 +01:00
break ;
2012-05-28 22:43:08 +02:00
case SETTING_EMU_SHOW_INFO_MSG :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-05-29 15:25:39 +02:00
g_console . info_msg_enable = ! g_console . info_msg_enable ;
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
g_console . info_msg_enable = true ;
2012-05-28 22:43:08 +02:00
break ;
2012-01-21 06:06:01 +01:00
case SETTING_EMU_REWIND_ENABLED :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-21 06:06:01 +01:00
{
2012-05-29 15:25:39 +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-05-29 16:51:08 +02:00
rarch_settings_msg ( S_MSG_RESTART_RARCH , S_DELAY_180 ) ;
2012-01-21 06:06:01 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
g_settings . rewind_enable = false ;
2012-01-21 06:06:01 +01:00
break ;
2012-04-21 23:25:32 +02:00
case SETTING_RARCH_DEFAULT_EMU :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-03-03 23:26:14 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , LIBRETRO_CHOICE ) ;
2012-05-29 15:25:39 +02:00
set_libretro_core_as_launch = false ;
2012-03-03 23:26:14 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-03-03 23:26:14 +01:00
{
}
break ;
2012-01-30 15:16:29 +01:00
case SETTING_EMU_AUDIO_MUTE :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-30 15:16:29 +01:00
{
2012-05-29 15:25:39 +02:00
g_extern . audio_data . mute = ! g_extern . audio_data . mute ;
2012-01-30 15:16:29 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
g_extern . audio_data . mute = false ;
2012-01-30 15:16:29 +01:00
break ;
2012-03-03 17:23:00 +01:00
case SETTING_ENABLE_CUSTOM_BGM :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-03-03 17:23:00 +01:00
{
# if(CELL_SDK_VERSION > 0x340000)
2012-05-29 15:25:39 +02:00
g_console . custom_bgm_enable = ! g_console . custom_bgm_enable ;
if ( g_console . custom_bgm_enable )
cellSysutilEnableBgmPlayback ( ) ;
else
cellSysutilDisableBgmPlayback ( ) ;
2012-03-03 17:23:00 +01:00
# endif
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-03-03 17:23:00 +01:00
{
# if(CELL_SDK_VERSION > 0x340000)
g_console . custom_bgm_enable = true ;
# endif
}
break ;
2012-01-16 04:07:02 +01:00
case SETTING_EMU_VIDEO_DEFAULT_ALL :
break ;
case SETTING_EMU_AUDIO_DEFAULT_ALL :
break ;
case SETTING_PATH_DEFAULT_ROM_DIRECTORY :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-30 15:16:29 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , PATH_DEFAULT_ROM_DIR_CHOICE ) ;
2012-01-30 15:16:29 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-22 18:51:06 +02:00
strlcpy ( g_console . default_rom_startup_dir , " / " , sizeof ( g_console . default_rom_startup_dir ) ) ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_PATH_SAVESTATES_DIRECTORY :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-30 17:18:31 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , PATH_SAVESTATES_DIR_CHOICE ) ;
2012-01-30 17:18:31 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
strlcpy ( g_console . default_savestate_dir , usrDirPath , sizeof ( g_console . default_savestate_dir ) ) ;
2012-01-30 17:18:31 +01:00
2012-01-16 04:07:02 +01:00
break ;
case SETTING_PATH_SRAM_DIRECTORY :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-30 17:18:31 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , PATH_SRAM_DIR_CHOICE ) ;
2012-01-30 17:18:31 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
strlcpy ( g_console . default_sram_dir , " " , sizeof ( g_console . default_sram_dir ) ) ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_PATH_CHEATS :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-01-30 15:16:29 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , PATH_CHEATS_DIR_CHOICE ) ;
2012-01-30 15:16:29 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
strlcpy ( g_settings . cheat_database , usrDirPath , sizeof ( g_settings . cheat_database ) ) ;
2012-01-16 04:07:02 +01:00
break ;
2012-07-10 04:00:04 +02:00
case SETTING_PATH_SYSTEM :
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
{
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , PATH_SYSTEM_DIR_CHOICE ) ;
}
if ( CTRL_START ( trigger_state ) )
strlcpy ( g_settings . system_directory , systemDirPath , sizeof ( g_settings . system_directory ) ) ;
break ;
2012-01-31 12:13:43 +01:00
case SETTING_ENABLE_SRAM_PATH :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-01-31 12:13:43 +01:00
{
2012-05-29 15:25:39 +02:00
g_console . default_sram_dir_enable = ! g_console . default_sram_dir_enable ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-31 12:13:43 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-31 12:13:43 +01:00
{
2012-05-29 15:25:39 +02:00
g_console . default_sram_dir_enable = true ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-31 12:13:43 +01:00
}
break ;
case SETTING_ENABLE_STATE_PATH :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-01-31 12:13:43 +01:00
{
2012-05-29 15:25:39 +02:00
g_console . default_savestate_dir_enable = ! g_console . default_savestate_dir_enable ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-31 12:13:43 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-01-31 12:13:43 +01:00
{
2012-05-29 15:25:39 +02:00
g_console . default_savestate_dir_enable = true ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-31 12:13:43 +01:00
}
break ;
2012-01-16 04:07:02 +01:00
case SETTING_PATH_DEFAULT_ALL :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | | CTRL_START ( trigger_state ) )
2012-01-30 17:18:31 +01:00
{
2012-05-29 15:25:39 +02:00
strlcpy ( g_console . default_rom_startup_dir , " / " , sizeof ( g_console . default_rom_startup_dir ) ) ;
strlcpy ( g_console . default_savestate_dir , usrDirPath , sizeof ( g_console . default_savestate_dir ) ) ;
strlcpy ( g_settings . cheat_database , usrDirPath , sizeof ( g_settings . cheat_database ) ) ;
strlcpy ( g_console . default_sram_dir , " " , sizeof ( g_console . default_sram_dir ) ) ;
2012-01-30 17:18:31 +01:00
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-30 17:18:31 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
case SETTING_CONTROLS_SCHEME :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-03-01 14:22:16 +01:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , INPUT_PRESET_CHOICE ) ;
2012-03-01 14:22:16 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_CONTROLS_NUMBER :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-02-29 09:15:59 +01:00
{
2012-05-29 15:25:39 +02:00
if ( currently_selected_controller_menu ! = 0 )
currently_selected_controller_menu - - ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-02-29 09:15:59 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) )
2012-02-29 09:15:59 +01:00
{
2012-05-29 15:25:39 +02:00
if ( currently_selected_controller_menu < 6 )
currently_selected_controller_menu + + ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-02-29 09:15:59 +01:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
currently_selected_controller_menu = 0 ;
2012-01-16 04:07:02 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_UP ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_DOWN :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_DOWN ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_LEFT :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_LEFT ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_RIGHT :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_RIGHT ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_A :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_A ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_B ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_X :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_X ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_Y :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_Y ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_SELECT :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_SELECT ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_START :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_START ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_L ) ;
2012-02-29 09:15:59 +01:00
break ;
2012-04-10 00:22:02 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_R ) ;
2012-01-16 04:07:02 +01:00
break ;
2012-05-07 22:25:56 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L2 :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_L2 ) ;
2012-05-07 22:25:56 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R2 :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_R2 ) ;
2012-05-07 22:25:56 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_L3 :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_L3 ) ;
2012-05-07 22:25:56 +02:00
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_R3 :
2012-06-28 17:11:22 +02:00
set_keybind_digital ( trigger_state , RETRO_DEVICE_ID_JOYPAD_R3 ) ;
2012-05-07 22:25:56 +02:00
break ;
2012-01-16 04:07:02 +01:00
case SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | | CTRL_START ( trigger_state ) )
2012-05-29 15:25:39 +02:00
rarch_filename_input_and_save ( INPUT_PRESET_FILE ) ;
2012-01-16 04:07:02 +01:00
break ;
case SETTING_CONTROLS_DEFAULT_ALL :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | | CTRL_START ( trigger_state ) )
2012-03-01 14:22:16 +01:00
{
2012-05-29 15:25:39 +02:00
rarch_input_set_default_keybinds ( currently_selected_controller_menu ) ;
2012-06-29 13:30:04 +02:00
menu_stack_refresh ( items_generalsettings , menuStackindex ) ;
2012-03-01 14:22:16 +01:00
}
2012-01-16 04:07:02 +01:00
break ;
}
set_setting_label ( menu_obj , switchvalue ) ;
}
2012-01-10 23:33:44 +01:00
2012-06-19 03:44:17 +02:00
static void settings_iterate ( menu * menu_obj , 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 :
menu_obj - > selected + + ;
2012-01-10 23:33:44 +01:00
2012-06-19 03:44:17 +02:00
if ( menu_obj - > selected > = menu_obj - > max_settings )
menu_obj - > selected = menu_obj - > first_setting ;
2012-01-10 23:33:44 +01:00
2012-06-28 21:29:12 +02:00
if ( items_generalsettings [ menu_obj - > selected ] . page ! = menu_obj - > page )
menu_obj - > page = items_generalsettings [ menu_obj - > selected ] . page ;
2012-06-19 03:44:17 +02:00
break ;
case SETTINGS_ACTION_UP :
if ( menu_obj - > selected = = menu_obj - > first_setting )
menu_obj - > selected = menu_obj - > max_settings - 1 ;
else
menu_obj - > selected - - ;
2012-01-10 23:33:44 +01:00
2012-06-28 21:29:12 +02:00
if ( items_generalsettings [ menu_obj - > selected ] . page ! = menu_obj - > page )
menu_obj - > page = items_generalsettings [ menu_obj - > selected ] . page ;
2012-06-19 03:44:17 +02:00
break ;
case SETTINGS_ACTION_TAB_PREVIOUS :
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-06-19 03:44:17 +02:00
break ;
case SETTINGS_ACTION_TAB_NEXT :
2012-04-14 04:38:40 +02:00
switch ( menu_obj - > enum_id )
{
case GENERAL_VIDEO_MENU :
case GENERAL_AUDIO_MENU :
case EMU_GENERAL_MENU :
case EMU_VIDEO_MENU :
case EMU_AUDIO_MENU :
case PATH_MENU :
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , menu_obj - > enum_id + 1 ) ;
2012-04-14 04:38:40 +02:00
break ;
case CONTROLS_MENU :
2012-06-28 21:03:14 +02:00
default :
2012-04-14 04:38:40 +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-06-28 21:03:14 +02:00
static void select_setting ( void )
2012-06-19 03:44:17 +02:00
{
2012-06-28 13:11:07 +02:00
unsigned i ;
2012-06-19 03:44:17 +02:00
gl_t * gl = driver . video_data ;
2012-06-28 21:03:14 +02:00
menu * menu_obj = & menuStack [ menuStackindex ] ;
2012-01-10 23:33:44 +01:00
2012-06-28 21:03:14 +02:00
settings_action_t action = SETTINGS_ACTION_NOOP ;
/* back to ROM menu if CIRCLE is pressed */
if ( CTRL_L1 ( trigger_state ) | | CTRL_CIRCLE ( trigger_state ) )
action = SETTINGS_ACTION_TAB_PREVIOUS ;
else if ( CTRL_R1 ( trigger_state ) )
action = SETTINGS_ACTION_TAB_NEXT ;
else if ( CTRL_DOWN ( trigger_state ) | | CTRL_LSTICK_DOWN ( trigger_state ) )
action = SETTINGS_ACTION_DOWN ;
else if ( CTRL_UP ( trigger_state ) | | CTRL_LSTICK_UP ( trigger_state ) )
action = SETTINGS_ACTION_UP ;
if ( action ! = SETTINGS_ACTION_NOOP )
settings_iterate ( menu_obj , action ) ;
producesettingentry ( menu_obj , menu_obj - > selected ) ;
2012-01-10 23:33:44 +01:00
2012-06-29 14:40:50 +02:00
display_menubar ( ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-01-10 23:33:44 +01:00
2012-06-29 14:40:50 +02:00
2012-06-30 14:04:34 +02:00
for ( i = menu_obj - > first_setting ; i < menu_obj - > max_settings ; i + + )
2012-04-14 04:38:40 +02:00
{
2012-06-28 21:29:12 +02:00
if ( items_generalsettings [ i ] . page = = menu_obj - > page )
2012-04-14 04:38:40 +02:00
{
2012-06-28 21:29:12 +02:00
cellDbgFontPuts ( items_generalsettings [ i ] . text_xpos , items_generalsettings [ i ] . text_ypos , FONT_SIZE , menu_obj - > selected = = items_generalsettings [ i ] . enum_id ? YELLOW : items_generalsettings [ i ] . item_color , items_generalsettings [ i ] . text ) ;
cellDbgFontPuts ( 0.5f , items_generalsettings [ i ] . text_ypos , FONT_SIZE , items_generalsettings [ i ] . text_color , items_generalsettings [ i ] . setting_text ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-04-14 04:38:40 +02:00
}
}
2012-01-10 23:33:44 +01:00
2012-06-28 21:29:12 +02:00
cellDbgFontPuts ( 0.09f , items_generalsettings [ menu_obj - > selected ] . comment_ypos , 0.86f , LIGHTBLUE , items_generalsettings [ menu_obj - > selected ] . comment ) ;
2012-01-10 23:33:44 +01:00
2012-04-14 04:38:40 +02:00
cellDbgFontPuts ( 0.09f , 0.91f , FONT_SIZE , YELLOW , " UP/DOWN - select L3+R3 - resume game X/LEFT/RIGHT - change " ) ;
cellDbgFontPuts ( 0.09f , 0.95f , FONT_SIZE , YELLOW , " START - default L1/CIRCLE - go back R1 - go forward " ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-01-10 23:33:44 +01:00
}
2012-06-19 03:44:17 +02:00
static void menu_romselect_iterate ( filebrowser_t * filebrowser , menu_romselect_action_t action )
{
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-04-14 05:24:09 +02:00
{
/*if 'filename' is in fact '..' - then pop back directory instead of adding '..' to filename path */
2012-07-16 08:13:05 +02:00
if ( browser - > current_dir . ptr = = 0 )
2012-06-19 03:44:17 +02:00
filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_CANCEL ) ;
2012-04-14 05:24:09 +02:00
else
2012-06-19 03:44:17 +02:00
filebrowser_iterate ( filebrowser , FILEBROWSER_ACTION_OK ) ;
2012-04-14 05:24:09 +02:00
}
2012-06-28 18:10:04 +02:00
else
2012-04-14 05:24:09 +02:00
{
2012-05-28 17:34:58 +02:00
char rom_path_temp [ PATH_MAX ] ;
2012-04-14 05:24:09 +02:00
struct retro_system_info info ;
retro_get_system_info ( & info ) ;
bool block_zip_extract = info . block_extract ;
2012-01-10 23:33:44 +01:00
2012-06-19 03:44:17 +02:00
snprintf ( rom_path_temp , sizeof ( rom_path_temp ) , filebrowser_get_current_path ( filebrowser ) ) ;
2012-01-10 23:33:44 +01:00
2012-04-14 05:24:09 +02:00
if ( ( strstr ( rom_path_temp , " .zip " ) | | strstr ( rom_path_temp , " .ZIP " ) ) & & ! block_zip_extract )
2012-04-21 23:25:32 +02:00
rarch_extract_zipfile ( rom_path_temp ) ;
2012-04-14 05:24:09 +02:00
else
{
2012-07-08 17:49:58 +02:00
rarch_console_load_game ( filebrowser_get_current_path ( filebrowser ) ) ;
2012-06-29 16:47:02 +02:00
rarch_settings_msg ( S_MSG_LOADING_ROM , S_DELAY_45 ) ;
2012-04-14 05:24:09 +02:00
}
}
2012-06-19 03:44:17 +02:00
break ;
case MENU_ROMSELECT_ACTION_GOTO_SETTINGS :
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , 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
}
}
static void select_rom ( void )
{
gl_t * gl = driver . video_data ;
2012-07-16 08:13:05 +02:00
browser_update ( browser , rarch_console_get_rom_ext ( ) ) ;
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-06-28 21:03:14 +02:00
if ( CTRL_SELECT ( trigger_state ) )
action = MENU_ROMSELECT_ACTION_GOTO_SETTINGS ;
else if ( CTRL_CROSS ( trigger_state ) )
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-16 08:13:05 +02:00
menu_romselect_iterate ( browser , action ) ;
2012-04-09 14:32:56 +02:00
2012-07-16 08:13:05 +02:00
if ( filebrowser_get_current_path_isdir ( browser ) )
2012-04-14 05:24:09 +02:00
{
2012-07-16 08:13:05 +02:00
if ( ! strcmp ( filebrowser_get_current_path ( browser ) , " app_home " ) | | ! strcmp ( filebrowser_get_current_path ( browser ) , " host_root " ) )
2012-04-14 05:24:09 +02:00
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , RED , " WARNING - This path only works on DEX PS3 systems. Do not attempt to open \n this directory on CEX PS3 systems, or you might have to restart. " ) ;
2012-07-16 08:13:05 +02:00
else if ( ! strcmp ( filebrowser_get_current_path ( browser ) , " .. " ) )
2012-04-14 05:24:09 +02:00
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , LIGHTBLUE , " INFO - Press X to go back to the previous directory. " ) ;
else
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , LIGHTBLUE , " INFO - Press X to enter the directory. " ) ;
}
2012-07-16 08:13:05 +02:00
if ( path_file_exists ( filebrowser_get_current_path ( browser ) ) )
2012-04-14 05:24:09 +02:00
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , LIGHTBLUE , " INFO - Press X to load the game. " ) ;
2012-06-29 15:43:09 +02:00
display_menubar ( ) ;
2012-04-10 01:00:25 +02:00
2012-06-29 14:40:50 +02:00
cellDbgFontPuts ( 0.09f , 0.91f , FONT_SIZE , YELLOW ,
2012-06-30 14:04:34 +02:00
" L3 + R3 - resume game SELECT - Settings screen " ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-01-10 23:33:44 +01:00
}
2012-02-13 21:37:32 +01:00
2012-06-28 14:10:05 +02:00
static void ingame_menu_resize ( void )
{
gl_t * gl = driver . video_data ;
2012-06-29 16:29:52 +02:00
float x_position = 0.09f ;
2012-06-28 14:10:05 +02:00
float font_size = 1.1f ;
2012-06-29 16:29:52 +02:00
float ypos = 0.16f ;
float ypos_increment = 0.035f ;
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 ) ;
if ( CTRL_LSTICK_LEFT ( state ) | | CTRL_LEFT ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . x - = 1 ;
2012-06-28 14:10:05 +02:00
else if ( CTRL_LSTICK_RIGHT ( state ) | | CTRL_RIGHT ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . x + = 1 ;
2012-06-28 14:10:05 +02:00
if ( CTRL_LSTICK_UP ( state ) | | CTRL_UP ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . y + = 1 ;
2012-06-28 14:10:05 +02:00
else if ( CTRL_LSTICK_DOWN ( state ) | | CTRL_DOWN ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . y - = 1 ;
2012-06-28 14:10:05 +02:00
if ( CTRL_RSTICK_LEFT ( state ) | | CTRL_L1 ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . width - = 1 ;
2012-06-28 14:10:05 +02:00
else if ( CTRL_RSTICK_RIGHT ( state ) | | CTRL_R1 ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . width + = 1 ;
2012-06-28 14:10:05 +02:00
if ( CTRL_RSTICK_UP ( state ) | | CTRL_L2 ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . height + = 1 ;
2012-06-28 14:10:05 +02:00
else if ( CTRL_RSTICK_DOWN ( state ) | | CTRL_R2 ( state ) )
2012-06-28 21:03:14 +02:00
g_console . viewports . custom_vp . height - = 1 ;
2012-06-28 14:10:05 +02:00
2012-06-28 17:11:22 +02:00
if ( CTRL_TRIANGLE ( trigger_state ) )
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 ;
g_console . viewports . custom_vp . width = gl - > win_width ;
g_console . viewports . custom_vp . height = gl - > win_height ;
2012-06-28 14:10:05 +02:00
}
2012-06-28 21:03:14 +02:00
2012-06-28 17:11:22 +02:00
if ( CTRL_CIRCLE ( trigger_state ) )
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 17:11:22 +02:00
if ( CTRL_SQUARE ( ~ trigger_state ) )
2012-06-28 14:10:05 +02:00
{
2012-06-29 14:40:50 +02:00
display_menubar ( ) ;
2012-06-28 21:03:14 +02:00
cellDbgFontPrintf ( x_position , ypos , font_size , GREEN , " Viewport X: #%d " , g_console . viewports . custom_vp . x ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
cellDbgFontPrintf ( x_position , ypos + ( ypos_increment * 1 ) , font_size , GREEN , " Viewport Y: #%d " , g_console . viewports . custom_vp . y ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
cellDbgFontPrintf ( x_position , ypos + ( ypos_increment * 2 ) , font_size , GREEN , " Viewport Width: #%d " , g_console . viewports . custom_vp . width ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
cellDbgFontPrintf ( x_position , ypos + ( ypos_increment * 3 ) , font_size , GREEN , " Viewport Height: #%d " , g_console . viewports . custom_vp . height ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
cellDbgFontPrintf ( 0.09f , 0.40f , font_size , LIGHTBLUE , " CONTROLS: " ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
cellDbgFontPrintf ( 0.09f , 0.46f , font_size , LIGHTBLUE , " LEFT or LSTICK UP " ) ;
cellDbgFontPrintf ( 0.5f , 0.46f , font_size , LIGHTBLUE , " - Decrease Viewport X " ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
gl_render_msg_post ( gl ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.48f , font_size , LIGHTBLUE , " RIGHT or LSTICK RIGHT " ) ;
cellDbgFontPrintf ( 0.5f , 0.48f , font_size , LIGHTBLUE , " - Increase Viewport X " ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.50f , font_size , LIGHTBLUE , " UP or LSTICK UP " ) ;
cellDbgFontPrintf ( 0.5f , 0.50f , font_size , LIGHTBLUE , " - Increase Viewport Y " ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
gl_render_msg_post ( gl ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.52f , font_size , LIGHTBLUE , " DOWN or LSTICK DOWN " ) ;
cellDbgFontPrintf ( 0.5f , 0.52f , font_size , LIGHTBLUE , " - Decrease Viewport Y " ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.54f , font_size , LIGHTBLUE , " L1 or RSTICK LEFT " ) ;
cellDbgFontPrintf ( 0.5f , 0.54f , font_size , LIGHTBLUE , " - Decrease Viewport Width " ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
gl_render_msg_post ( gl ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.56f , font_size , LIGHTBLUE , " R1 or RSTICK RIGHT " ) ;
cellDbgFontPrintf ( 0.5f , 0.56f , font_size , LIGHTBLUE , " - Increase Viewport Width " ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.58f , font_size , LIGHTBLUE , " L2 or RSTICK UP " ) ;
cellDbgFontPrintf ( 0.5f , 0.58f , font_size , LIGHTBLUE , " - Increase Viewport Height " ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
gl_render_msg_post ( gl ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.60f , font_size , LIGHTBLUE , " R2 or RSTICK DOWN " ) ;
cellDbgFontPrintf ( 0.5f , 0.60f , font_size , LIGHTBLUE , " - Decrease Viewport Height " ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.66f , font_size , LIGHTBLUE , " TRIANGLE " ) ;
cellDbgFontPrintf ( 0.5f , 0.66f , font_size , LIGHTBLUE , " - Reset To Defaults " ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.68f , font_size , LIGHTBLUE , " SQUARE " ) ;
cellDbgFontPrintf ( 0.5f , 0.68f , font_size , LIGHTBLUE , " - Show Game Screen " ) ;
2012-06-28 14:10:05 +02:00
2012-06-30 14:04:34 +02:00
cellDbgFontPrintf ( 0.09f , 0.70f , font_size , LIGHTBLUE , " CIRCLE " ) ;
cellDbgFontPrintf ( 0.5f , 0.70f , font_size , LIGHTBLUE , " - Return to Ingame Menu " ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
gl_render_msg_post ( gl ) ;
2012-06-28 14:10:05 +02:00
2012-06-28 21:03:14 +02:00
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , LIGHTBLUE , " Allows you to resize the screen by moving around the two analog sticks. \n Press TRIANGLE to reset to default values, and CIRCLE to go back to the menu. " ) ;
gl_render_msg_post ( gl ) ;
2012-06-28 14:10:05 +02:00
}
}
static void ingame_menu_screenshot ( void )
{
gl_t * gl = driver . video_data ;
if ( g_console . ingame_menu_enable )
{
2012-06-28 17:11:22 +02:00
if ( CTRL_CIRCLE ( trigger_state ) )
2012-06-28 14:10:05 +02:00
{
2012-06-28 21:03:14 +02:00
menu_stack_decrement ( ) ;
2012-06-28 14:10:05 +02:00
gl - > menu_render = true ;
}
}
}
2012-06-28 21:03:14 +02:00
static void ingame_menu ( void )
2012-02-13 21:37:32 +01:00
{
2012-05-29 22:22:47 +02:00
char comment [ 256 ] ;
2012-06-28 21:03:14 +02:00
static unsigned menuitem_colors [ MENU_ITEM_LAST ] ;
2012-05-26 17:35:40 +02:00
gl_t * gl = driver . video_data ;
2012-06-29 12:44:11 +02:00
menu * menu_obj = & menuStack [ menuStackindex ] ;
2012-02-13 21:37:32 +01:00
2012-06-29 16:29:52 +02:00
float x_position = 0.09f ;
2012-04-14 05:24:09 +02:00
float font_size = 1.1f ;
2012-06-29 16:29:52 +02:00
float ypos = 0.16f ;
float ypos_increment = 0.035f ;
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-06-30 14:04:34 +02:00
if ( CTRL_CIRCLE ( trigger_state ) )
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-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
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-04-14 05:24:09 +02:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_decrease ( ) ;
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_increase ( ) ;
2012-02-13 21:37:32 +01:00
2012-06-29 11:15:37 +02:00
strlcpy ( comment , " Press LEFT or RIGHT to change the current save state slot. \n Press CROSS to load the state from the currently selected save state slot. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_SAVE_STATE :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
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-04-14 05:24:09 +02:00
}
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_decrease ( ) ;
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-04-21 23:25:32 +02:00
rarch_state_slot_increase ( ) ;
2012-02-13 21:37:32 +01:00
2012-06-29 11:15:37 +02:00
strlcpy ( comment , " Press LEFT or RIGHT to change the current save state slot. \n Press CROSS to save the state to the currently selected save state slot. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_KEEP_ASPECT_RATIO :
2012-06-29 12:44:11 +02:00
producesettingentry ( menu_obj , SETTING_KEEP_ASPECT_RATIO ) ;
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press LEFT or RIGHT to change the [Aspect Ratio]. \n Press START to reset back to default values. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_OVERSCAN_AMOUNT :
2012-06-29 12:44:11 +02:00
producesettingentry ( menu_obj , SETTING_HW_OVERSCAN_AMOUNT ) ;
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press LEFT or RIGHT to change the [Overscan] settings. \n Press START to reset back to default values. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_ORIENTATION :
2012-06-28 17:11:22 +02:00
if ( CTRL_LEFT ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | | CTRL_LSTICK_LEFT ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_change ( S_ROTATION_DECREMENT ) ;
video_gl . set_rotation ( NULL , g_console . screen_orientation ) ;
2012-04-14 05:24:09 +02:00
}
2012-03-01 16:55:19 +01:00
2012-06-28 17:11:22 +02:00
if ( CTRL_RIGHT ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) | | CTRL_CROSS ( trigger_state ) | | CTRL_LSTICK_RIGHT ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_change ( S_ROTATION_INCREMENT ) ;
video_gl . set_rotation ( NULL , g_console . screen_orientation ) ;
2012-04-14 05:24:09 +02:00
}
2012-03-01 16:55:19 +01:00
2012-06-28 17:11:22 +02:00
if ( CTRL_START ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-05-29 22:22:47 +02:00
rarch_settings_default ( S_DEF_ROTATION ) ;
2012-04-14 05:24:09 +02:00
video_gl . set_rotation ( NULL , g_console . screen_orientation ) ;
}
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press LEFT or RIGHT to change the [Orientation] settings. \n Press START to reset back to default values. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_SCALE_FACTOR :
2012-06-29 12:44:11 +02:00
producesettingentry ( menu_obj , SETTING_SCALE_FACTOR ) ;
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press LEFT or RIGHT to change the [Scaling] settings. \n Press START to reset back to default values. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_FRAME_ADVANCE :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) | | CTRL_R2 ( trigger_state ) | | CTRL_L2 ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-05-29 01:57:33 +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-05-22 18:51:06 +02:00
strlcpy ( comment , " Press 'CROSS', 'L2' or 'R2' button to step one frame. Pressing the button \n rapidly will advance the frame more slowly. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RESIZE_MODE :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-06-28 14:10:05 +02:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , INGAME_MENU_RESIZE ) ;
2012-06-28 14:10:05 +02:00
}
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Allows you to resize the screen by moving around the two analog sticks. \n Press TRIANGLE to reset to default values, and CIRCLE to go back. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_SCREENSHOT_MODE :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , INGAME_MENU_SCREENSHOT ) ;
2012-04-14 05:24:09 +02:00
}
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Allows you to take a screenshot without any text clutter. \n Press CIRCLE to go back to the in-game menu while in 'Screenshot Mode'. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RETURN_TO_GAME :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-05-29 01:57:33 +02:00
rarch_settings_change ( S_RETURN_TO_GAME ) ;
2012-02-13 21:37:32 +01:00
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press 'CROSS' to return back to the game. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RESET :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-05-29 01:57:33 +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-05-22 18:51:06 +02:00
strlcpy ( comment , " Press 'CROSS' to reset the game. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
case MENU_ITEM_RETURN_TO_MENU :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-05-29 02:33:06 +02:00
rarch_settings_change ( S_RETURN_TO_MENU ) ;
2012-04-14 05:24:09 +02:00
}
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press 'CROSS' to return to the ROM Browser menu. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
2012-04-22 01:45:55 +02:00
case MENU_ITEM_CHANGE_LIBRETRO :
2012-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-04-14 05:24:09 +02:00
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , LIBRETRO_CHOICE ) ;
2012-05-28 22:18:50 +02:00
set_libretro_core_as_launch = true ;
2012-04-14 05:24:09 +02:00
}
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press 'CROSS' to choose a different emulator core. " , sizeof ( comment ) ) ;
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-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) & & path_file_exists ( MULTIMAN_EXECUTABLE ) )
2012-04-14 05:24:09 +02:00
{
strlcpy ( g_console . launch_app_on_exit , MULTIMAN_EXECUTABLE ,
sizeof ( g_console . launch_app_on_exit ) ) ;
2012-02-13 21:37:32 +01:00
2012-05-29 02:48:13 +02:00
rarch_settings_change ( S_RETURN_TO_DASHBOARD ) ;
2012-04-14 05:24:09 +02:00
}
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press 'CROSS' to quit the emulator and return to multiMAN. " , sizeof ( comment ) ) ;
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-06-28 17:11:22 +02:00
if ( CTRL_CROSS ( trigger_state ) )
2012-05-29 02:08:54 +02:00
rarch_settings_change ( S_RETURN_TO_DASHBOARD ) ;
2012-02-13 21:37:32 +01:00
2012-05-22 18:51:06 +02:00
strlcpy ( comment , " Press 'CROSS' to quit the emulator and return to the XMB. " , sizeof ( comment ) ) ;
2012-04-14 05:24:09 +02:00
break ;
}
2012-02-13 21:37:32 +01:00
2012-06-30 14:04:34 +02:00
if ( CTRL_UP ( trigger_state ) | | CTRL_LSTICK_UP ( trigger_state ) )
{
if ( g_console . ingame_menu_item > 0 )
g_console . ingame_menu_item - - ;
}
2012-02-13 21:37:32 +01:00
2012-06-30 14:04:34 +02:00
if ( CTRL_DOWN ( trigger_state ) | | CTRL_LSTICK_DOWN ( trigger_state ) )
{
if ( g_console . ingame_menu_item < ( MENU_ITEM_LAST - 1 ) )
g_console . ingame_menu_item + + ;
}
2012-02-13 21:37:32 +01:00
2012-06-30 14:04:34 +02:00
if ( CTRL_L3 ( trigger_state ) & & CTRL_R3 ( trigger_state ) )
rarch_settings_change ( S_RETURN_TO_GAME ) ;
2012-02-13 21:37:32 +01:00
2012-06-29 14:40:50 +02:00
display_menubar ( ) ;
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 ) ) ;
cellDbgFontPrintf ( x_position , ypos , 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 ) ) ;
cellDbgFontPrintf ( x_position , ypos + ( ypos_increment * MENU_ITEM_SAVE_STATE ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_SAVE_STATE ) , strw_buffer ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
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 ) ) ;
cellDbgFontPrintf ( x_position , ( ypos + ( ypos_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-04-14 05:24:09 +02:00
cellDbgFontPrintf ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_OVERSCAN_AMOUNT ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_OVERSCAN_AMOUNT ) , " Overscan: %f " , g_console . overscan_amount ) ;
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 ) ) ;
cellDbgFontPrintf ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_ORIENTATION ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_ORIENTATION ) , strw_buffer ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
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_SCALE_FACTOR , sizeof ( strw_buffer ) ) ;
cellDbgFontPrintf ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_SCALE_FACTOR ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_SCALE_FACTOR ) , strw_buffer ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-02-25 20:11:57 +01:00
2012-04-14 05:24:09 +02:00
cellDbgFontPrintf ( x_position , ( ypos + ( ypos_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-04-14 05:24:09 +02:00
cellDbgFontPuts ( x_position , ( ypos + ( ypos_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-04-14 05:24:09 +02:00
cellDbgFontPuts ( x_position , ( ypos + ( ypos_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-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-04-14 05:24:09 +02:00
cellDbgFontPuts ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_RESET ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RESET ) , " Reset " ) ;
cellDbgFontPuts ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_RETURN_TO_GAME ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_GAME ) , " Return to Game " ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-04-14 05:24:09 +02:00
cellDbgFontPuts ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_RETURN_TO_MENU ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_MENU ) , " Return to Menu " ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-04-14 05:24:09 +02:00
2012-04-22 01:45:55 +02:00
cellDbgFontPuts ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_CHANGE_LIBRETRO ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_CHANGE_LIBRETRO ) , " Change libretro core " ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-04-10 01:00:25 +02:00
2012-05-30 16:30:25 +02:00
# ifdef HAVE_MULTIMAN
2012-04-14 05:24:09 +02:00
cellDbgFontPuts ( x_position , ( ypos + ( ypos_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-05-29 22:36:17 +02:00
cellDbgFontPuts ( x_position , ( ypos + ( ypos_increment * MENU_ITEM_RETURN_TO_DASHBOARD ) ) , font_size , MENU_ITEM_SELECTED ( MENU_ITEM_RETURN_TO_DASHBOARD ) , " Return to XMB " ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-04-14 05:24:09 +02:00
cellDbgFontPrintf ( 0.09f , 0.83f , 0.91f , LIGHTBLUE , comment ) ;
2012-05-30 16:30:25 +02:00
gl_render_msg_post ( gl ) ;
2012-02-13 21:37:32 +01:00
}
2012-06-28 17:11:22 +02:00
static bool check_analog ( uint64_t state_tmp )
{
if ( CTRL_LSTICK_UP ( state_tmp ) | | CTRL_LSTICK_DOWN ( state_tmp ) | | CTRL_LSTICK_RIGHT ( state_tmp ) | | CTRL_LSTICK_LEFT ( state_tmp ) )
return true ;
else
return false ;
}
static bool check_shoulder_buttons ( uint64_t state_tmp )
{
if ( CTRL_L1 ( state_tmp ) | | CTRL_L2 ( state_tmp ) | | CTRL_R1 ( state_tmp ) | | CTRL_R2 ( state_tmp ) )
return true ;
else
return false ;
}
2012-06-28 13:11:07 +02:00
2012-06-30 14:04:34 +02:00
void menu_init ( void )
{
2012-07-16 08:13:05 +02:00
browser = ( filebrowser_t * ) malloc ( 1 * sizeof ( filebrowser_t ) ) ;
tmpBrowser = ( filebrowser_t * ) malloc ( 1 * sizeof ( filebrowser_t ) ) ;
2012-06-30 14:04:34 +02:00
menu_stack_push ( 0 , FILE_BROWSER_MENU ) ;
2012-07-16 08:13:05 +02:00
filebrowser_set_root ( tmpBrowser , " / " ) ;
2012-06-30 14:04:34 +02:00
}
void menu_free ( void )
{
2012-07-16 08:13:05 +02:00
filebrowser_free ( browser ) ;
filebrowser_free ( tmpBrowser ) ;
free ( browser ) ;
free ( tmpBrowser ) ;
2012-06-30 14:04:34 +02:00
}
2012-01-10 23:33:44 +01:00
void menu_loop ( void )
{
2012-05-26 18:18:09 +02:00
gl_t * gl = driver . video_data ;
2012-04-11 02:42:27 +02:00
g_console . menu_enable = true ;
2012-05-27 19:36:31 +02:00
gl - > block_swap = true ;
2012-04-11 02:42:27 +02:00
if ( g_console . ingame_menu_enable )
{
2012-06-28 21:03:14 +02:00
menu_stack_increment ( ) ;
menu_stack_push ( menuStackindex , INGAME_MENU ) ;
2012-04-11 02:42:27 +02:00
}
do
{
2012-06-28 17:11:22 +02:00
static bool first_held = false ;
2012-06-28 14:10:05 +02:00
unsigned menu_id = menuStack [ menuStackindex ] . enum_id ;
2012-06-28 17:11:22 +02:00
unsigned menu_category_id = menuStack [ menuStackindex ] . category_id ;
2012-04-11 02:42:27 +02:00
2012-06-28 13:11:07 +02:00
state = cell_pad_input_poll_device ( 0 ) ;
2012-06-28 17:11:22 +02:00
trigger_state = state & ~ old_state ;
held_state = state & older_state ;
held_state = held_state & old_state ;
if ( held_state )
{
bool analog_sticks_pressed = check_analog ( held_state ) ;
bool shoulder_buttons_pressed = check_shoulder_buttons ( held_state ) & & menu_category_id ! = CATEGORY_SETTINGS ;
bool do_held = analog_sticks_pressed | | shoulder_buttons_pressed ;
if ( do_held )
{
if ( ! first_held )
{
first_held = true ;
SET_TIMER_EXPIRATION ( gl , 7 ) ;
}
if ( IS_TIMER_EXPIRED ( gl ) )
{
first_held = false ;
trigger_state = held_state ;
}
}
}
2012-06-28 13:11:07 +02:00
2012-06-28 14:10:05 +02:00
gfx_ctx_clear ( ) ;
if ( menu_id = = INGAME_MENU_RESIZE & & CTRL_SQUARE ( state ) | | menu_id = = INGAME_MENU_SCREENSHOT )
gl - > menu_render = false ;
else
{
gfx_ctx_set_blend ( true ) ;
gl - > menu_render = true ;
}
rarch_render_cached_frame ( ) ;
2012-07-16 08:13:05 +02:00
filebrowser_t * fb = browser ;
2012-06-28 21:03:14 +02:00
2012-06-28 14:10:05 +02:00
switch ( menu_id )
2012-04-11 02:42:27 +02:00
{
case FILE_BROWSER_MENU :
select_rom ( ) ;
2012-07-16 08:13:05 +02:00
fb = browser ;
2012-04-11 02:42:27 +02:00
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-06-28 21:03:14 +02:00
select_setting ( ) ;
2012-04-11 02:42:27 +02:00
break ;
case SHADER_CHOICE :
case PRESET_CHOICE :
case BORDER_CHOICE :
2012-04-22 01:45:55 +02:00
case LIBRETRO_CHOICE :
2012-04-11 02:42:27 +02:00
case INPUT_PRESET_CHOICE :
2012-06-28 21:03:14 +02:00
select_file ( ) ;
2012-07-16 08:13:05 +02:00
fb = tmpBrowser ;
2012-04-11 02:42:27 +02:00
break ;
case PATH_SAVESTATES_DIR_CHOICE :
case PATH_DEFAULT_ROM_DIR_CHOICE :
case PATH_CHEATS_DIR_CHOICE :
case PATH_SRAM_DIR_CHOICE :
2012-06-28 21:03:14 +02:00
select_directory ( ) ;
2012-07-16 08:13:05 +02:00
fb = tmpBrowser ;
2012-04-11 02:42:27 +02:00
break ;
case INGAME_MENU :
if ( g_console . ingame_menu_enable )
2012-06-28 21:03:14 +02:00
ingame_menu ( ) ;
2012-06-28 14:10:05 +02:00
break ;
case INGAME_MENU_RESIZE :
ingame_menu_resize ( ) ;
2012-04-11 02:42:27 +02:00
break ;
2012-06-28 14:10:05 +02:00
case INGAME_MENU_SCREENSHOT :
ingame_menu_screenshot ( ) ;
break ;
2012-04-11 02:42:27 +02:00
}
2012-06-28 21:03:14 +02:00
switch ( menu_category_id )
{
case CATEGORY_FILEBROWSER :
browser_render ( fb ) ;
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-06-28 17:11:22 +02:00
older_state = old_state ;
2012-06-28 13:11:07 +02:00
old_state = state ;
2012-04-11 02:42:27 +02:00
2012-05-28 03:46:44 +02:00
if ( IS_TIMER_EXPIRED ( gl ) )
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 )
{
// for ingame menu, we need a different precondition because menu_enable
// can be set to false when going back from ingame menu to menu
if ( g_console . ingame_menu_enable = = true )
{
//we want to force exit when mode_switch is set to MODE_EXIT
if ( g_console . mode_switch ! = MODE_EXIT )
g_console . mode_switch = ( ( CTRL_L3 ( old_state ) & & CTRL_R3 ( old_state ) & & g_console . emulator_initialized ) ) ? MODE_EMULATION : MODE_MENU ;
}
else
{
g_console . menu_enable = ! ( ( CTRL_L3 ( old_state ) & & CTRL_R3 ( old_state ) & & g_console . emulator_initialized ) ) ;
g_console . mode_switch = g_console . menu_enable ? MODE_MENU : MODE_EMULATION ;
}
}
}
// 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-05-28 03:46:44 +02:00
SET_TIMER_EXPIRATION ( gl , 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-05-29 04:05:16 +02:00
if ( message & & g_console . info_msg_enable )
2012-05-28 22:18:50 +02:00
{
cellDbgFontPrintf ( g_settings . video . msg_pos_x , 0.75f , 1.05f , WHITE , message ) ;
gl_render_msg_post ( gl ) ;
}
2012-05-27 16:23:01 +02:00
gfx_ctx_swap_buffers ( ) ;
# ifdef HAVE_SYSUTILS
cellSysutilCheckCallback ( ) ;
# endif
2012-06-28 14:10:05 +02:00
if ( menu_id = = INGAME_MENU_RESIZE & & CTRL_SQUARE ( state ) | | menu_id = = INGAME_MENU_SCREENSHOT )
{ }
else
gfx_ctx_set_blend ( false ) ;
2012-04-11 02:42:27 +02:00
} while ( g_console . menu_enable ) ;
2012-05-27 17:02:19 +02:00
gl - > menu_render = false ;
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-05-27 19:36:31 +02:00
gl - > 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
}