(PS3) Added entries to default_paths

This commit is contained in:
Twinaphex 2012-07-24 00:15:07 +02:00
parent 7a74886730
commit 463b43724c
5 changed files with 21 additions and 54 deletions

View File

@ -136,10 +136,16 @@ enum
============================================================ */
typedef struct
{
char menu_border_file[PATH_MAX];
char border_file[PATH_MAX];
char border_dir[PATH_MAX];
char cgp_dir[PATH_MAX];
char config_file[PATH_MAX];
char core_dir[PATH_MAX];
char input_presets_dir[PATH_MAX];
#ifdef HAVE_MULTIMAN
char multiman_self_file[PATH_MAX];
#endif
char port_dir[PATH_MAX];
char savestate_dir[PATH_MAX];
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)

View File

@ -26,7 +26,6 @@
#include "../gl_common.h"
#include "../image.h"
#include "../../ps3/frontend/shared.h"
#include "ps3_ctx.h"
@ -137,7 +136,7 @@ bool gfx_ctx_menu_init(void)
glGenTextures(1, &gl->menu_texture_id);
RARCH_LOG("Loading texture image for menu...\n");
if (!texture_image_load(DEFAULT_MENU_BORDER_FILE, &menu_texture))
if (!texture_image_load(default_paths.menu_border_file, &menu_texture))
{
RARCH_ERR("Failed to load texture image for menu.\n");
return false;

View File

@ -51,8 +51,6 @@
#include "../../general.h"
#include "../../file.h"
#include "shared.h"
#include "menu.h"
#define EMULATOR_CONTENT_DIR "SSNE10000"
@ -61,14 +59,6 @@
#define NP_POOL_SIZE (128*1024)
static uint8_t np_pool[NP_POOL_SIZE];
char DEFAULT_PRESET_FILE[PATH_MAX];
char DEFAULT_MENU_BORDER_FILE[PATH_MAX];
char PRESETS_DIR_PATH[PATH_MAX];
char INPUT_PRESETS_DIR_PATH[PATH_MAX];
char EMULATOR_CORE_SELF[PATH_MAX];
#ifdef HAVE_MULTIMAN
char MULTIMAN_EXECUTABLE[PATH_MAX];
#endif
int rarch_main(int argc, char *argv[]);
@ -185,16 +175,16 @@ static void get_environment_settings(int argc, char *argv[])
if(argc > 1)
{
/* launched from external launcher */
strlcpy(MULTIMAN_EXECUTABLE, argv[2], sizeof(MULTIMAN_EXECUTABLE));
strlcpy(default_paths.multiman_self_file, argv[2], sizeof(default_paths.multiman_self_file));
}
else
{
/* not launched from external launcher, set default path */
strlcpy(MULTIMAN_EXECUTABLE, "/dev_hdd0/game/BLES80608/USRDIR/RELOAD.SELF",
sizeof(MULTIMAN_EXECUTABLE));
strlcpy(default_paths.multiman_self_file, "/dev_hdd0/game/BLES80608/USRDIR/RELOAD.SELF",
sizeof(default_paths.multiman_self_file));
}
if(path_file_exists(MULTIMAN_EXECUTABLE) && argc > 1 && path_file_exists(argv[1]))
if(path_file_exists(default_paths.multiman_self_file) && argc > 1 && path_file_exists(argv[1]))
{
g_console.external_launcher_support = EXTERN_LAUNCHER_MULTIMAN;
RARCH_LOG("Started from multiMAN, auto-game start enabled.\n");
@ -260,11 +250,10 @@ static void get_environment_settings(int argc, char *argv[])
snprintf(default_paths.system_dir, sizeof(default_paths.system_dir), "%s/system", default_paths.core_dir);
/* now we fill in all the variables */
snprintf(DEFAULT_PRESET_FILE, sizeof(DEFAULT_PRESET_FILE), "%s/presets/stock.conf", default_paths.core_dir);
snprintf(default_paths.border_file, sizeof(default_paths.border_file), "%s/borders/Centered-1080p/mega-man-2.png", default_paths.core_dir);
snprintf(DEFAULT_MENU_BORDER_FILE, sizeof(DEFAULT_MENU_BORDER_FILE), "%s/borders/Menu/main-menu.png", default_paths.core_dir);
snprintf(PRESETS_DIR_PATH, sizeof(PRESETS_DIR_PATH), "%s/presets", default_paths.core_dir);
snprintf(INPUT_PRESETS_DIR_PATH, sizeof(INPUT_PRESETS_DIR_PATH), "%s/input", PRESETS_DIR_PATH);
snprintf(default_paths.menu_border_file, sizeof(default_paths.menu_border_file), "%s/borders/Menu/main-menu.png", default_paths.core_dir);
snprintf(default_paths.cgp_dir, sizeof(default_paths.cgp_dir), "%s/presets", default_paths.core_dir);
snprintf(default_paths.input_presets_dir, sizeof(default_paths.input_presets_dir), "%s/input", default_paths.cgp_dir);
snprintf(default_paths.border_dir, sizeof(default_paths.border_dir), "%s/borders", default_paths.core_dir);
snprintf(default_paths.shader_dir, sizeof(default_paths.shader_dir), "%s/shaders", default_paths.core_dir);
snprintf(default_paths.shader_file, sizeof(default_paths.shader_file), "%s/shaders/stock.cg", default_paths.core_dir);

View File

@ -34,7 +34,6 @@
#include "../../gfx/context/ps3_ctx.h"
#include "../../gfx/shader_cg.h"
#include "shared.h"
#include "../../file.h"
#include "../../general.h"
@ -97,7 +96,7 @@ static void set_setting_label(menu * menu_obj, unsigned currentsetting)
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]));
break;
case SETTING_SHADER_PRESETS:
set_setting_label_color(g_console.cgp_path == DEFAULT_PRESET_FILE, currentsetting);
set_setting_label_color(true, currentsetting);
fill_pathname_base(fname, g_console.cgp_path, sizeof(fname));
snprintf(items_generalsettings[currentsetting].setting_text, sizeof(items_generalsettings[currentsetting].setting_text), fname);
break;
@ -405,7 +404,7 @@ static void menu_stack_push(unsigned stack_idx, unsigned menu_id)
menuStack[stack_idx].category_id = CATEGORY_FILEBROWSER;
menu_stack_refresh(items_generalsettings, stack_idx);
strlcpy(tmpBrowser.extensions, "cgp|CGP", sizeof(tmpBrowser.extensions));
filebrowser_set_root(&tmpBrowser, PRESETS_DIR_PATH);
filebrowser_set_root(&tmpBrowser, default_paths.cgp_dir);
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_RESET);
break;
case INPUT_PRESET_CHOICE:
@ -416,7 +415,7 @@ static void menu_stack_push(unsigned stack_idx, unsigned menu_id)
menuStack[stack_idx].category_id = CATEGORY_FILEBROWSER;
menu_stack_refresh(items_generalsettings, stack_idx);
strlcpy(tmpBrowser.extensions, "cfg|CFG", sizeof(tmpBrowser.extensions));
filebrowser_set_root(&tmpBrowser, INPUT_PRESETS_DIR_PATH);
filebrowser_set_root(&tmpBrowser, default_paths.input_presets_dir);
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_RESET);
break;
case SHADER_CHOICE:
@ -952,10 +951,10 @@ static void rarch_filename_input_and_save (unsigned filename_type)
case CONFIG_FILE:
break;
case SHADER_PRESET_FILE:
snprintf(filepath, sizeof(filepath), "%s/%s.cgp", PRESETS_DIR_PATH, filename_tmp);
snprintf(filepath, sizeof(filepath), "%s/%s.cgp", default_paths.cgp_dir, filename_tmp);
break;
case INPUT_PRESET_FILE:
snprintf(filepath, sizeof(filepath), "%s/%s.cfg", INPUT_PRESETS_DIR_PATH, filename_tmp);
snprintf(filepath, sizeof(filepath), "%s/%s.cfg", default_paths.input_presets_dir, filename_tmp);
break;
}
@ -1988,9 +1987,9 @@ static void ingame_menu(void)
case MENU_ITEM_RETURN_TO_MULTIMAN:
if(input_state & (1 << RETRO_DEVICE_ID_JOYPAD_B))
{
if(path_file_exists(MULTIMAN_EXECUTABLE))
if(path_file_exists(default_paths.multiman_self_file))
{
strlcpy(g_console.launch_app_on_exit, MULTIMAN_EXECUTABLE,
strlcpy(g_console.launch_app_on_exit, default_paths.multiman_self_file,
sizeof(g_console.launch_app_on_exit));
rarch_settings_change(S_RETURN_TO_DASHBOARD);

View File

@ -1,26 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
* Copyright (C) 2011-2012 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PS3_SHARED_H
#define _PS3_SHARED_H
extern char DEFAULT_PRESET_FILE[PATH_MAX];
extern char DEFAULT_MENU_BORDER_FILE[PATH_MAX];
extern char PRESETS_DIR_PATH[PATH_MAX];
extern char INPUT_PRESETS_DIR_PATH[PATH_MAX];
extern char MULTIMAN_EXECUTABLE[PATH_MAX];
#endif