(PS3/Xbox 1) Menu unification changes

This commit is contained in:
twinaphex 2012-08-03 18:54:59 +02:00
parent 8e71b62748
commit bb338d07d7
5 changed files with 94 additions and 6 deletions

View File

@ -284,7 +284,8 @@ MENU
#if defined(_XBOX360)
#include "../../360/frontend-xdk/menu.cpp"
#elif defined(_XBOX1)
#include "../../ps3/frontend/menu.c"
#include "../../xbox1/frontend/menu.c"
//#include "../../ps3/frontend/menu.c"
#include "../../xbox1/frontend/RetroLaunch/IoSupport.cpp"
#include "../../xbox1/frontend/RetroLaunch/Surface.cpp"
#elif defined(GEKKO)

View File

@ -16,6 +16,7 @@
item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
{
#ifdef __CELLOS_LV2__
{
SETTING_CHANGE_RESOLUTION, /* enum ID of item */
"Resolution", /* item label */
@ -26,6 +27,8 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - Change the display resolution.", /* item comment */
WHITE, /* color of item comment */
},
#endif
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
{
SETTING_SHADER_PRESETS,
"Shader Preset (CGP)",
@ -56,6 +59,7 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - Select a shader as [Shader #2]. NOTE: Some shaders might be\ntoo slow at 1080p. If you experience any slowdown, try another shader.",
WHITE,
},
#endif
{
SETTING_FONT_SIZE,
"Font Size",
@ -86,6 +90,7 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - Hardware filtering is set to 'Bilinear filtering' for [Shader #1].",
WHITE,
},
#ifdef HAVE_FBO
{
SETTING_HW_TEXTURE_FILTER_2,
"Hardware Filtering shader #2",
@ -116,6 +121,7 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - [Custom Scaling Factor] is set to '2x'.",
WHITE,
},
#endif
{
SETTING_HW_OVERSCAN_AMOUNT,
"Overscan",
@ -156,6 +162,7 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - [Enable Screenshots] feature is set to 'OFF'.",
WHITE,
},
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
{
SETTING_SAVE_SHADER_PRESET,
"SAVE SETTINGS AS CGP PRESET ",
@ -176,6 +183,7 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - Automatically load the currently selected [CG Preset] file on startup.",
GREEN,
},
#endif
{
SETTING_DEFAULT_VIDEO_ALL,
"DEFAULT",
@ -196,6 +204,7 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - [Sound Output] is set to 'Normal' - normal audio output will be\nused.",
WHITE,
},
#ifdef HAVE_RSOUND
{
SETTING_RSOUND_SERVER_IP_ADDRESS,
"RSound Audio Server IP Address",
@ -206,6 +215,7 @@ item menu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
"INFO - Enter the IP Address of the [RSound Audio Server]. IP address\nmust be an IPv4 32-bits address, eg: '192.168.1.7'.",
WHITE,
},
#endif
{
SETTING_ENABLE_CUSTOM_BGM,
"Enable Custom BGM Feature",

View File

@ -190,6 +190,7 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
else
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "Point filtering");
break;
#ifdef HAVE_FBO
case SETTING_SCALE_ENABLED:
set_setting_label_write_on_or_off(items, g_console.fbo_enabled, currentsetting);
set_setting_label_color(items,g_console.fbo_enabled, currentsetting);
@ -199,6 +200,7 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "%fx (X) / %fx (Y)", g_settings.video.fbo_scale_x, g_settings.video.fbo_scale_y);
snprintf(items[currentsetting].comment, sizeof(items[currentsetting].comment), "INFO - [Custom Scaling Factor] is set to: '%fx (X) / %fx (Y)'.", g_settings.video.fbo_scale_x, g_settings.video.fbo_scale_y);
break;
#endif
case SETTING_HW_OVERSCAN_AMOUNT:
set_setting_label_color(items,g_console.overscan_amount == 0.0f, currentsetting);
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "%f", g_console.overscan_amount);
@ -215,7 +217,9 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
set_setting_label_write_on_or_off(items, g_console.screenshots_enable, currentsetting);
set_setting_label_color(items,g_console.screenshots_enable, currentsetting);
break;
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP:
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP:
#endif
case SETTING_DEFAULT_VIDEO_ALL:
break;
case SETTING_SOUND_MODE:
@ -247,10 +251,12 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
break;
}
break;
#ifdef HAVE_RSOUND
case SETTING_RSOUND_SERVER_IP_ADDRESS:
set_setting_label_color(items,strcmp(g_settings.audio.device,"0.0.0.0") == 0, currentsetting);
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), g_settings.audio.device);
break;
#endif
case SETTING_DEFAULT_AUDIO_ALL:
break;
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT:
@ -379,7 +385,9 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
case SETTING_EMU_AUDIO_DEFAULT_ALL:
case SETTING_PATH_DEFAULT_ALL:
case SETTING_EMU_DEFAULT_ALL:
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
case SETTING_SAVE_SHADER_PRESET:
#endif
set_setting_label_color(items, current_menu->selected == currentsetting, currentsetting);
break;
default:
@ -2183,6 +2191,8 @@ static void ingame_menu(item *items, menu *current_menu, uint64_t input)
void menu_init (void)
{
DEVICE_CAST device_ptr = (DEVICE_CAST)driver.video_data;
//Set libretro filename and version to variable
struct retro_system_info info;
retro_get_system_info(&info);
@ -2191,13 +2201,62 @@ void menu_init (void)
menu_stack_push(menu_items, FILE_BROWSER_MENU);
filebrowser_set_root_and_ext(&browser, rarch_console_get_rom_ext(), default_paths.filebrowser_startup_dir);
#ifdef _XBOX1
filebrowser_set_root(&tmpBrowser, "D:");
#else
filebrowser_set_root(&tmpBrowser, "/");
#endif
#ifdef _XBOX1
// Set file cache size
XSetFileCacheSize(8 * 1024 * 1024);
// Mount drives
xbox_io_mount("A:", "cdrom0");
xbox_io_mount("E:", "Harddisk0\\Partition1");
xbox_io_mount("Z:", "Harddisk0\\Partition2");
xbox_io_mount("F:", "Harddisk0\\Partition6");
xbox_io_mount("G:", "Harddisk0\\Partition7");
// Backbuffer width
int width = device_ptr->d3dpp.BackBufferWidth;
// Quick hack to properly center the romlist in 720p,
// it might need more work though (font size and rom selector size -> needs more memory)
// Init rom list coords
// Load background image
if(width == 640)
{
d3d_surface_new(&m_menuMainBG, "D:\\Media\\menuMainBG.png");
m_menuMainRomListPos_x = 100;
m_menuMainRomListPos_y = 100;
}
else if(width == 1280)
{
d3d_surface_new(&m_menuMainBG, "D:\\Media\\menuMainBG_720p.png");
m_menuMainRomListPos_x = 400;
m_menuMainRomListPos_y = 150;
}
// Load rom selector panel
d3d_surface_new(&m_menuMainRomSelectPanel, "D:\\Media\\menuMainRomSelectPanel.png");
//Display some text
//Center the text (hardcoded)
xpos = width == 640 ? 65 : 400;
ypos = width == 640 ? 430 : 670;
#endif
}
void menu_free (void)
{
filebrowser_free(&browser);
filebrowser_free(&tmpBrowser);
#ifdef _XBOX1
d3d_surface_free(&m_menuMainBG);
d3d_surface_free(&m_menuMainRomSelectPanel);
#endif
}
void menu_loop(void)
@ -2337,7 +2396,9 @@ void menu_loop(void)
#endif
}
#ifdef __CELLOS_LV2__
rarch_render_cached_frame();
#endif
filebrowser_t * fb = &browser;

View File

@ -109,25 +109,35 @@ enum
enum
{
#ifdef __CELLOS_LV2__
SETTING_CHANGE_RESOLUTION,
#endif
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
SETTING_SHADER_PRESETS,
SETTING_SHADER,
SETTING_SHADER_2,
#endif
SETTING_FONT_SIZE,
SETTING_KEEP_ASPECT_RATIO,
SETTING_HW_TEXTURE_FILTER,
SETTING_HW_TEXTURE_FILTER_2,
#ifdef HAVE_FBO
SETTING_SCALE_ENABLED,
SETTING_SCALE_FACTOR,
#endif
SETTING_HW_OVERSCAN_AMOUNT,
SETTING_THROTTLE_MODE,
SETTING_TRIPLE_BUFFERING,
SETTING_ENABLE_SCREENSHOTS,
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
SETTING_SAVE_SHADER_PRESET,
SETTING_APPLY_SHADER_PRESET_ON_STARTUP,
#endif
SETTING_DEFAULT_VIDEO_ALL,
SETTING_SOUND_MODE,
#ifdef HAVE_RSOUND
SETTING_RSOUND_SERVER_IP_ADDRESS,
#endif
SETTING_ENABLE_CUSTOM_BGM,
SETTING_DEFAULT_AUDIO_ALL,
SETTING_EMU_CURRENT_SAVE_STATE_SLOT,

View File

@ -95,12 +95,12 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), ps3_get_resolution_label(g_console.supported_resolutions[g_console.current_resolution_index]));
break;
#endif
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
case SETTING_SHADER_PRESETS:
set_setting_label_color(items,true, currentsetting);
fill_pathname_base(fname, g_console.cgp_path, sizeof(fname));
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), fname);
break;
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
case SETTING_SHADER:
fill_pathname_base(fname, g_settings.video.cg_shader_path, sizeof(fname));
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "%s", fname);
@ -135,6 +135,7 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
else
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "Point filtering");
break;
#ifdef HAVE_FBO
case SETTING_SCALE_ENABLED:
set_setting_label_write_on_or_off(items, g_console.fbo_enabled, currentsetting);
set_setting_label_color(items,g_console.fbo_enabled, currentsetting);
@ -144,6 +145,7 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "%fx (X) / %fx (Y)", g_settings.video.fbo_scale_x, g_settings.video.fbo_scale_y);
snprintf(items[currentsetting].comment, sizeof(items[currentsetting].comment), "INFO - [Custom Scaling Factor] is set to: '%fx (X) / %fx (Y)'.", g_settings.video.fbo_scale_x, g_settings.video.fbo_scale_y);
break;
#endif
case SETTING_HW_OVERSCAN_AMOUNT:
set_setting_label_color(items,g_console.overscan_amount == 0.0f, currentsetting);
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "%f", g_console.overscan_amount);
@ -160,7 +162,9 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
set_setting_label_write_on_or_off(items, g_console.screenshots_enable, currentsetting);
set_setting_label_color(items,g_console.screenshots_enable, currentsetting);
break;
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
case SETTING_APPLY_SHADER_PRESET_ON_STARTUP:
#endif
case SETTING_DEFAULT_VIDEO_ALL:
break;
case SETTING_SOUND_MODE:
@ -192,10 +196,12 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
break;
}
break;
#ifdef HAVE_RSOUND
case SETTING_RSOUND_SERVER_IP_ADDRESS:
set_setting_label_color(items,strcmp(g_settings.audio.device,"0.0.0.0") == 0, currentsetting);
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), g_settings.audio.device);
break;
#endif
case SETTING_DEFAULT_AUDIO_ALL:
break;
case SETTING_EMU_CURRENT_SAVE_STATE_SLOT:
@ -324,7 +330,9 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
case SETTING_EMU_AUDIO_DEFAULT_ALL:
case SETTING_PATH_DEFAULT_ALL:
case SETTING_EMU_DEFAULT_ALL:
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
case SETTING_SAVE_SHADER_PRESET:
#endif
set_setting_label_color(items, current_menu->selected == currentsetting, currentsetting);
break;
default:
@ -730,7 +738,7 @@ static void select_rom(item *items, menu *current_menu, uint64_t input)
render_msg_place_func(xpos, ypos, 0, 0, m_title);
}
int menu_init(void)
void menu_init(void)
{
DEVICE_CAST device_ptr = (DEVICE_CAST)driver.video_data;
@ -787,8 +795,6 @@ int menu_init(void)
xpos = width == 640 ? 65 : 400;
ypos = width == 640 ? 430 : 670;
#endif
return 0;
}
void menu_free(void)