2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2013-01-01 00:37:37 +00:00
|
|
|
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2013 - Daniel De Matteis
|
2012-01-29 22:16:39 +00:00
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2012-01-29 22:16:39 +00: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 21:13:50 +00:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2012-01-29 22:16:39 +00: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 21:31:57 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2012-01-29 22:16:39 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2012-01-05 21:47:34 +00:00
|
|
|
|
2012-06-24 19:55:36 +00:00
|
|
|
#include <stdint.h>
|
2012-06-24 19:09:52 +00:00
|
|
|
#include "../../boolean.h"
|
2012-01-10 22:33:44 +00:00
|
|
|
#include <stddef.h>
|
2012-01-11 00:04:17 +00:00
|
|
|
#include <string.h>
|
2012-01-10 22:33:44 +00:00
|
|
|
|
2012-09-16 02:04:25 +00:00
|
|
|
#include "../sdk_defines.h"
|
2012-03-03 16:23:00 +00:00
|
|
|
|
2012-09-16 02:04:25 +00:00
|
|
|
#include <sys/process.h>
|
2012-01-11 00:04:17 +00:00
|
|
|
|
2012-06-20 06:25:23 +00:00
|
|
|
#include "../ps3_input.h"
|
2012-01-11 21:55:07 +00:00
|
|
|
|
2012-06-20 06:25:23 +00:00
|
|
|
#include "../../gfx/gl_common.h"
|
|
|
|
|
2012-07-28 13:54:35 +00:00
|
|
|
#include "../../console/rarch_console.h"
|
2012-09-14 03:07:33 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_RARCH_EXEC
|
2012-07-28 14:35:07 +00:00
|
|
|
#include "../../console/rarch_console_exec.h"
|
2012-09-14 03:07:33 +00:00
|
|
|
#endif
|
2012-09-11 10:33:46 +00:00
|
|
|
|
2012-07-28 14:42:57 +00:00
|
|
|
#include "../../console/rarch_console_libretro_mgmt.h"
|
2012-09-11 10:33:46 +00:00
|
|
|
|
2012-07-28 13:54:35 +00:00
|
|
|
#include "../../console/rarch_console_input.h"
|
|
|
|
#include "../../console/rarch_console_config.h"
|
2012-07-28 14:10:31 +00:00
|
|
|
#include "../../console/rarch_console_settings.h"
|
2012-07-28 14:21:05 +00:00
|
|
|
#include "../../console/rarch_console_main_wrap.h"
|
2012-07-28 14:10:31 +00:00
|
|
|
#include "../../console/rarch_console_video.h"
|
2012-06-20 06:25:23 +00:00
|
|
|
#include "../../conf/config_file.h"
|
|
|
|
#include "../../conf/config_file_macros.h"
|
|
|
|
#include "../../general.h"
|
|
|
|
#include "../../file.h"
|
2012-01-12 23:01:52 +00:00
|
|
|
|
2012-08-03 19:22:43 +00:00
|
|
|
#include "../../console/rmenu/rmenu.h"
|
2012-01-11 00:04:17 +00:00
|
|
|
|
2012-01-29 22:11:47 +00:00
|
|
|
#define EMULATOR_CONTENT_DIR "SSNE10000"
|
|
|
|
|
2012-09-11 10:33:46 +00:00
|
|
|
#ifdef HAVE_HDD_CACHE_PARTITION
|
2012-03-06 20:03:43 +00:00
|
|
|
#define CACHE_ID "ABCD12345"
|
2012-09-11 10:33:46 +00:00
|
|
|
#endif
|
2012-02-25 19:11:57 +00:00
|
|
|
|
2012-09-11 10:33:46 +00:00
|
|
|
#ifndef __PSL1GHT__
|
|
|
|
#define NP_POOL_SIZE (128*1024)
|
2012-02-25 19:11:57 +00:00
|
|
|
static uint8_t np_pool[NP_POOL_SIZE];
|
2012-09-11 10:33:46 +00:00
|
|
|
#endif
|
2012-02-20 06:50:59 +00:00
|
|
|
|
2012-04-21 21:25:32 +00:00
|
|
|
int rarch_main(int argc, char *argv[]);
|
2012-01-05 21:47:34 +00:00
|
|
|
|
2012-06-16 20:03:08 +00:00
|
|
|
SYS_PROCESS_PARAM(1001, 0x200000)
|
2012-01-05 21:47:34 +00:00
|
|
|
|
|
|
|
#undef main
|
2012-01-11 00:04:17 +00:00
|
|
|
|
2012-05-25 14:24:28 +00:00
|
|
|
#ifdef HAVE_SYSUTILS
|
2012-02-04 12:29:02 +00:00
|
|
|
static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdata)
|
|
|
|
{
|
2012-04-11 00:42:27 +00:00
|
|
|
(void) param;
|
|
|
|
(void) userdata;
|
2012-09-11 10:33:46 +00:00
|
|
|
#ifdef HAVE_OSKUTIL
|
2012-10-15 04:24:39 +00:00
|
|
|
oskutil_params *osk = &g_extern.console.misc.oskutil_handle;
|
2012-09-11 10:33:46 +00:00
|
|
|
#endif
|
2012-05-26 14:44:02 +00:00
|
|
|
gl_t *gl = driver.video_data;
|
2012-04-11 00:42:27 +00:00
|
|
|
|
|
|
|
switch (status)
|
|
|
|
{
|
|
|
|
case CELL_SYSUTIL_REQUEST_EXITGAME:
|
2012-11-26 06:03:31 +00:00
|
|
|
gl->quitting = true;
|
2012-05-29 02:16:38 +00:00
|
|
|
rarch_settings_change(S_QUIT);
|
2012-11-26 06:03:31 +00:00
|
|
|
break;
|
2012-06-19 03:10:42 +00:00
|
|
|
#ifdef HAVE_OSKUTIL
|
2012-04-11 00:42:27 +00:00
|
|
|
case CELL_SYSUTIL_OSKDIALOG_FINISHED:
|
2012-11-26 06:03:31 +00:00
|
|
|
oskutil_close(osk);
|
|
|
|
oskutil_finished(osk);
|
|
|
|
break;
|
2012-04-11 00:42:27 +00:00
|
|
|
case CELL_SYSUTIL_OSKDIALOG_UNLOADED:
|
2012-11-26 06:03:31 +00:00
|
|
|
oskutil_unload(osk);
|
|
|
|
break;
|
2012-06-19 03:10:42 +00:00
|
|
|
#endif
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
2012-02-04 12:29:02 +00:00
|
|
|
}
|
2012-05-25 14:24:28 +00:00
|
|
|
#endif
|
2012-02-04 12:29:02 +00:00
|
|
|
|
2012-09-14 03:07:33 +00:00
|
|
|
#ifdef __PSL1GHT__
|
|
|
|
void menu_init (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-12-15 15:39:30 +00:00
|
|
|
bool rmenu_iterate(void)
|
2012-09-14 03:07:33 +00:00
|
|
|
{
|
2012-11-26 06:03:31 +00:00
|
|
|
rarch_console_load_game_wrap("/dev_hdd0/game/SSNE10000/USRDIR/mm3.nes", 0, 0);
|
2012-12-15 15:39:30 +00:00
|
|
|
|
|
|
|
return false;
|
2012-09-14 03:07:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void menu_free (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-02-28 13:42:29 +00:00
|
|
|
static void get_environment_settings(int argc, char *argv[])
|
2012-01-11 00:04:17 +00:00
|
|
|
{
|
2012-04-11 00:42:27 +00:00
|
|
|
g_extern.verbose = true;
|
|
|
|
|
|
|
|
int ret;
|
|
|
|
unsigned int get_type;
|
|
|
|
unsigned int get_attributes;
|
|
|
|
CellGameContentSize size;
|
|
|
|
char dirName[CELL_GAME_DIRNAME_SIZE];
|
2012-06-23 20:36:35 +00:00
|
|
|
char contentInfoPath[PATH_MAX];
|
2012-06-30 11:37:18 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_HDD_CACHE_PARTITION
|
2012-04-11 00:42:27 +00:00
|
|
|
CellSysCacheParam param;
|
|
|
|
memset(¶m, 0x00, sizeof(CellSysCacheParam));
|
2012-05-28 15:28:29 +00:00
|
|
|
strlcpy(param.cacheId,CACHE_ID, sizeof(CellSysCacheParam));
|
2012-04-11 00:42:27 +00:00
|
|
|
|
|
|
|
ret = cellSysCacheMount(¶m);
|
|
|
|
if(ret != CELL_SYSCACHE_RET_OK_CLEARED)
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("System cache partition could not be mounted, it might be already mounted.\n");
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
2012-06-30 11:37:18 +00:00
|
|
|
#endif
|
2012-04-11 00:42:27 +00:00
|
|
|
|
2012-05-30 14:30:25 +00:00
|
|
|
#ifdef HAVE_MULTIMAN
|
2012-08-18 16:25:38 +00:00
|
|
|
/* not launched from external launcher, set default path */
|
|
|
|
strlcpy(default_paths.multiman_self_file, "/dev_hdd0/game/BLES80608/USRDIR/RELOAD.SELF",
|
2012-11-26 06:03:31 +00:00
|
|
|
sizeof(default_paths.multiman_self_file));
|
2012-04-11 00:42:27 +00:00
|
|
|
|
2012-07-23 22:15:07 +00:00
|
|
|
if(path_file_exists(default_paths.multiman_self_file) && argc > 1 && path_file_exists(argv[1]))
|
2012-04-11 00:42:27 +00:00
|
|
|
{
|
2012-10-15 04:24:39 +00:00
|
|
|
g_extern.console.external_launch.support = EXTERN_LAUNCHER_MULTIMAN;
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_LOG("Started from multiMAN, auto-game start enabled.\n");
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
|
|
|
else
|
2012-05-30 14:30:25 +00:00
|
|
|
#endif
|
2012-04-11 00:42:27 +00:00
|
|
|
{
|
2012-10-15 04:24:39 +00:00
|
|
|
g_extern.console.external_launch.support = EXTERN_LAUNCHER_SALAMANDER;
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_WARN("Not started from multiMAN, auto-game start disabled.\n");
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
memset(&size, 0x00, sizeof(CellGameContentSize));
|
|
|
|
|
|
|
|
ret = cellGameBootCheck(&get_type, &get_attributes, &size, dirName);
|
|
|
|
if(ret < 0)
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("cellGameBootCheck() Error: 0x%x.\n", ret);
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_LOG("cellGameBootCheck() OK.\n");
|
|
|
|
RARCH_LOG("Directory name: [%s].\n", dirName);
|
|
|
|
RARCH_LOG(" HDD Free Size (in KB) = [%d] Size (in KB) = [%d] System Size (in KB) = [%d].\n", size.hddFreeSizeKB, size.sizeKB, size.sysSizeKB);
|
2012-04-14 03:30:10 +00:00
|
|
|
|
|
|
|
switch(get_type)
|
|
|
|
{
|
|
|
|
case CELL_GAME_GAMETYPE_DISC:
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_LOG("RetroArch was launched on Optical Disc Drive.\n");
|
2012-11-26 06:03:31 +00:00
|
|
|
break;
|
|
|
|
case CELL_GAME_GAMETYPE_HDD:
|
|
|
|
RARCH_LOG("RetroArch was launched on HDD.\n");
|
|
|
|
break;
|
2012-04-14 03:30:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if((get_attributes & CELL_GAME_ATTRIBUTE_APP_HOME) == CELL_GAME_ATTRIBUTE_APP_HOME)
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_LOG("RetroArch was launched from host machine (APP_HOME).\n");
|
2012-04-14 03:30:10 +00:00
|
|
|
|
2012-07-23 16:17:50 +00:00
|
|
|
ret = cellGameContentPermit(contentInfoPath, default_paths.port_dir);
|
2012-04-14 03:30:10 +00:00
|
|
|
|
2012-05-30 14:30:25 +00:00
|
|
|
#ifdef HAVE_MULTIMAN
|
2012-10-15 04:24:39 +00:00
|
|
|
if(g_extern.console.external_launch.support == EXTERN_LAUNCHER_MULTIMAN)
|
2012-04-14 03:30:10 +00:00
|
|
|
{
|
|
|
|
snprintf(contentInfoPath, sizeof(contentInfoPath), "/dev_hdd0/game/%s", EMULATOR_CONTENT_DIR);
|
2012-11-26 06:03:31 +00:00
|
|
|
snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "/dev_hdd0/game/%s/USRDIR", EMULATOR_CONTENT_DIR);
|
2012-04-14 03:30:10 +00:00
|
|
|
}
|
2012-05-30 14:30:25 +00:00
|
|
|
#endif
|
2012-04-14 03:30:10 +00:00
|
|
|
|
|
|
|
if(ret < 0)
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("cellGameContentPermit() Error: 0x%x\n", ret);
|
2012-04-14 03:30:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_LOG("cellGameContentPermit() OK.\n");
|
2012-11-26 06:03:31 +00:00
|
|
|
RARCH_LOG("contentInfoPath : [%s].\n", contentInfoPath);
|
|
|
|
RARCH_LOG("usrDirPath : [%s].\n", default_paths.port_dir);
|
2012-04-14 03:30:10 +00:00
|
|
|
}
|
|
|
|
|
2012-07-25 19:46:22 +00:00
|
|
|
#ifdef HAVE_HDD_CACHE_PARTITION
|
|
|
|
snprintf(default_paths.cache_dir, sizeof(default_paths.cache_dir), "/dev_hdd1/");
|
|
|
|
#endif
|
2012-07-23 16:17:50 +00:00
|
|
|
snprintf(default_paths.core_dir, sizeof(default_paths.core_dir), "%s/cores", default_paths.port_dir);
|
2012-07-24 07:57:34 +00:00
|
|
|
snprintf(default_paths.executable_extension, sizeof(default_paths.executable_extension), ".SELF");
|
2012-07-23 16:17:50 +00:00
|
|
|
snprintf(default_paths.savestate_dir, sizeof(default_paths.savestate_dir), "%s/savestates", default_paths.core_dir);
|
2012-07-24 07:57:34 +00:00
|
|
|
snprintf(default_paths.filesystem_root_dir, sizeof(default_paths.filesystem_root_dir), "/");
|
2012-07-29 22:26:37 +00:00
|
|
|
snprintf(default_paths.filebrowser_startup_dir, sizeof(default_paths.filebrowser_startup_dir), default_paths.filesystem_root_dir);
|
2012-07-23 16:17:50 +00:00
|
|
|
snprintf(default_paths.sram_dir, sizeof(default_paths.sram_dir), "%s/sram", default_paths.core_dir);
|
|
|
|
|
|
|
|
snprintf(default_paths.system_dir, sizeof(default_paths.system_dir), "%s/system", default_paths.core_dir);
|
2012-07-10 02:00:04 +00:00
|
|
|
|
2012-04-14 03:30:10 +00:00
|
|
|
/* now we fill in all the variables */
|
2012-07-23 16:17:50 +00:00
|
|
|
snprintf(default_paths.border_file, sizeof(default_paths.border_file), "%s/borders/Centered-1080p/mega-man-2.png", default_paths.core_dir);
|
2012-07-23 22:15:07 +00:00
|
|
|
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);
|
2012-07-23 16:17:50 +00:00
|
|
|
snprintf(default_paths.border_dir, sizeof(default_paths.border_dir), "%s/borders", default_paths.core_dir);
|
2012-09-11 07:17:25 +00:00
|
|
|
#if defined(HAVE_CG) || defined(HAVE_GLSL)
|
2012-07-23 16:17:50 +00:00
|
|
|
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);
|
|
|
|
snprintf(default_paths.menu_shader_file, sizeof(default_paths.menu_shader_file), "%s/shaders/Borders/Menu/border-only-rarch.cg", default_paths.core_dir);
|
2012-09-11 07:17:25 +00:00
|
|
|
#endif
|
2012-07-23 16:17:50 +00:00
|
|
|
snprintf(default_paths.config_file, sizeof(default_paths.config_file), "%s/retroarch.cfg", default_paths.port_dir);
|
2012-08-22 17:30:20 +00:00
|
|
|
snprintf(default_paths.salamander_file, sizeof(default_paths.salamander_file), "EBOOT.BIN");
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_extern.verbose = false;
|
2012-02-20 06:50:59 +00:00
|
|
|
}
|
|
|
|
|
2012-01-05 21:47:34 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2012-05-25 14:24:28 +00:00
|
|
|
#ifdef HAVE_SYSUTILS
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_LOG("Registering system utility callback...\n");
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL);
|
2012-05-25 14:24:28 +00:00
|
|
|
#endif
|
2012-02-26 14:18:44 +00:00
|
|
|
|
2012-05-25 14:24:28 +00:00
|
|
|
#ifdef HAVE_SYSMODULES
|
2012-09-27 16:16:06 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_FREETYPE
|
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_FONT);
|
2012-09-27 16:19:10 +00:00
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_FREETYPE);
|
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_FONTFT);
|
2012-09-27 16:16:06 +00:00
|
|
|
#endif
|
|
|
|
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_IO);
|
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_FS);
|
2012-09-16 02:04:25 +00:00
|
|
|
#ifndef __PSL1GHT__
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_AVCONF_EXT);
|
2012-09-16 02:04:25 +00:00
|
|
|
#endif
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_PNGDEC);
|
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_JPGDEC);
|
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_NET);
|
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_NP);
|
2012-05-25 14:24:28 +00:00
|
|
|
#endif
|
2012-02-25 19:11:57 +00:00
|
|
|
|
2012-09-11 10:33:46 +00:00
|
|
|
#ifndef __PSL1GHT__
|
2012-04-11 00:42:27 +00:00
|
|
|
sys_net_initialize_network();
|
2012-09-11 10:33:46 +00:00
|
|
|
#endif
|
2012-02-25 19:11:57 +00:00
|
|
|
|
2012-02-27 19:07:24 +00:00
|
|
|
#ifdef HAVE_LOGGER
|
2012-04-11 00:42:27 +00:00
|
|
|
logger_init();
|
2012-02-27 19:07:24 +00:00
|
|
|
#endif
|
|
|
|
|
2012-09-11 10:33:46 +00:00
|
|
|
#ifndef __PSL1GHT__
|
2012-04-11 00:42:27 +00:00
|
|
|
sceNpInit(NP_POOL_SIZE, np_pool);
|
2012-09-11 10:33:46 +00:00
|
|
|
#endif
|
2012-01-11 00:04:17 +00:00
|
|
|
|
2012-04-21 21:25:32 +00:00
|
|
|
rarch_main_clear_state();
|
2012-04-11 00:42:27 +00:00
|
|
|
get_environment_settings(argc, argv);
|
2012-01-16 03:07:02 +00:00
|
|
|
|
2012-04-11 00:42:27 +00:00
|
|
|
config_set_defaults();
|
2012-07-25 19:02:01 +00:00
|
|
|
input_ps3.init();
|
2012-01-21 16:24:25 +00:00
|
|
|
|
2012-07-24 07:57:34 +00:00
|
|
|
char tmp_path[PATH_MAX];
|
2012-07-23 16:17:50 +00:00
|
|
|
snprintf(tmp_path, sizeof(tmp_path), "%s/", default_paths.core_dir);
|
2012-07-28 16:41:18 +00:00
|
|
|
const char *path_prefix = tmp_path;
|
|
|
|
const char *extension = default_paths.executable_extension;
|
|
|
|
const input_driver_t *input = &input_ps3;
|
|
|
|
|
2012-08-22 20:04:28 +00:00
|
|
|
char core_exe_path[1024];
|
|
|
|
snprintf(core_exe_path, sizeof(core_exe_path), "%sCORE%s", path_prefix, extension);
|
2012-08-05 05:43:37 +00:00
|
|
|
|
2012-09-11 10:33:46 +00:00
|
|
|
#ifdef HAVE_LIBRETRO_MANAGEMENT
|
2012-08-22 20:04:28 +00:00
|
|
|
bool find_libretro_file = rarch_configure_libretro_core(core_exe_path, path_prefix, path_prefix,
|
2012-11-26 06:03:31 +00:00
|
|
|
default_paths.config_file, extension);
|
2012-09-11 10:33:46 +00:00
|
|
|
#else
|
|
|
|
bool find_libretro_file = false;
|
|
|
|
#endif
|
2012-07-28 16:41:18 +00:00
|
|
|
|
2012-09-09 23:48:39 +00:00
|
|
|
rarch_settings_set_default();
|
|
|
|
rarch_input_set_controls_default(input);
|
2012-10-04 18:09:23 +00:00
|
|
|
rarch_config_load(default_paths.config_file, find_libretro_file);
|
2012-07-28 16:41:18 +00:00
|
|
|
init_libretro_sym();
|
2012-01-11 00:04:17 +00:00
|
|
|
|
2012-07-27 13:46:15 +00:00
|
|
|
input_ps3.post_init();
|
|
|
|
|
2012-09-16 02:04:25 +00:00
|
|
|
#if (CELL_SDK_VERSION > 0x340000) && !defined(__PSL1GHT__)
|
2012-10-15 04:24:39 +00:00
|
|
|
if (g_extern.console.screen.state.screenshots.enable)
|
2012-04-11 00:42:27 +00:00
|
|
|
{
|
2012-05-25 14:24:28 +00:00
|
|
|
#ifdef HAVE_SYSMODULES
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
|
2012-05-25 14:24:28 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYSUTILS
|
2012-04-11 00:42:27 +00:00
|
|
|
CellScreenShotSetParam screenshot_param = {0, 0, 0, 0};
|
|
|
|
|
2012-04-21 01:28:32 +00:00
|
|
|
screenshot_param.photo_title = "RetroArch PS3";
|
|
|
|
screenshot_param.game_title = "RetroArch PS3";
|
2012-04-11 00:42:27 +00:00
|
|
|
cellScreenShotSetParameter (&screenshot_param);
|
|
|
|
cellScreenShotEnable();
|
2012-05-25 14:24:28 +00:00
|
|
|
#endif
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
2012-05-25 14:24:28 +00:00
|
|
|
#ifdef HAVE_SYSUTILS
|
2012-10-15 04:24:39 +00:00
|
|
|
if (g_extern.console.sound.custom_bgm.enable)
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysutilEnableBgmPlayback();
|
2012-05-25 14:24:28 +00:00
|
|
|
#endif
|
2012-01-16 14:45:55 +00:00
|
|
|
#endif
|
|
|
|
|
2012-08-18 20:45:46 +00:00
|
|
|
video_gl.start();
|
2012-08-21 23:16:15 +00:00
|
|
|
driver.video = &video_gl;
|
2012-05-28 03:06:25 +00:00
|
|
|
|
2012-06-19 03:10:42 +00:00
|
|
|
#ifdef HAVE_OSKUTIL
|
2012-10-15 04:24:39 +00:00
|
|
|
oskutil_params *osk = &g_extern.console.misc.oskutil_handle;
|
2012-09-11 10:33:46 +00:00
|
|
|
oskutil_init(osk, 0);
|
2012-06-19 03:10:42 +00:00
|
|
|
#endif
|
2012-01-11 21:27:07 +00:00
|
|
|
|
2012-04-11 00:42:27 +00:00
|
|
|
menu_init();
|
2012-01-16 03:07:02 +00:00
|
|
|
|
2012-10-15 04:24:39 +00:00
|
|
|
switch(g_extern.console.external_launch.support)
|
2012-04-11 00:42:27 +00:00
|
|
|
{
|
|
|
|
case EXTERN_LAUNCHER_SALAMANDER:
|
2012-10-15 04:24:39 +00:00
|
|
|
g_extern.console.rmenu.mode = MODE_MENU;
|
2012-11-26 06:03:31 +00:00
|
|
|
break;
|
2012-05-30 14:30:25 +00:00
|
|
|
#ifdef HAVE_MULTIMAN
|
2012-04-11 00:42:27 +00:00
|
|
|
case EXTERN_LAUNCHER_MULTIMAN:
|
2012-11-26 06:03:31 +00:00
|
|
|
RARCH_LOG("Started from multiMAN, will auto-start game.\n");
|
|
|
|
strlcpy(g_extern.file_state.rom_path, argv[1], sizeof(g_extern.file_state.rom_path));
|
2012-05-30 14:30:25 +00:00
|
|
|
rarch_settings_change(S_START_RARCH);
|
2012-11-26 06:03:31 +00:00
|
|
|
break;
|
2012-05-30 14:30:25 +00:00
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
break;
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
2012-02-20 06:50:59 +00:00
|
|
|
|
2012-01-20 17:00:33 +00:00
|
|
|
begin_loop:
|
2012-10-15 04:24:39 +00:00
|
|
|
if(g_extern.console.rmenu.mode == MODE_EMULATION)
|
2012-04-11 00:42:27 +00:00
|
|
|
{
|
|
|
|
input_ps3.poll(NULL);
|
2012-10-15 04:24:39 +00:00
|
|
|
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
2012-12-15 15:47:35 +00:00
|
|
|
while(rarch_main_iterate());
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
2013-01-06 00:28:23 +00:00
|
|
|
else if (g_extern.console.rmenu.mode == MODE_INIT)
|
|
|
|
rarch_startup(default_paths.config_file);
|
2012-10-15 04:24:39 +00:00
|
|
|
else if(g_extern.console.rmenu.mode == MODE_MENU)
|
2012-12-15 15:47:35 +00:00
|
|
|
while(rmenu_iterate());
|
2012-04-11 00:42:27 +00:00
|
|
|
else
|
|
|
|
goto begin_shutdown;
|
|
|
|
|
|
|
|
goto begin_loop;
|
2012-01-11 21:27:07 +00:00
|
|
|
|
2012-01-20 17:00:33 +00:00
|
|
|
begin_shutdown:
|
2013-01-05 21:18:59 +00:00
|
|
|
config_save_file(default_paths.config_file);
|
2012-05-28 15:49:31 +00:00
|
|
|
|
2013-01-05 22:49:58 +00:00
|
|
|
if(g_extern.main_is_init)
|
2012-04-21 21:25:32 +00:00
|
|
|
rarch_main_deinit();
|
2012-05-28 15:49:31 +00:00
|
|
|
|
2012-05-28 03:06:25 +00:00
|
|
|
input_ps3.free(NULL);
|
2012-08-18 20:45:46 +00:00
|
|
|
video_gl.stop();
|
2012-06-18 04:06:49 +00:00
|
|
|
menu_free();
|
2012-05-27 17:29:10 +00:00
|
|
|
|
2012-06-19 03:10:42 +00:00
|
|
|
#ifdef HAVE_OSKUTIL
|
2012-09-13 04:52:47 +00:00
|
|
|
if(osk)
|
2012-09-11 10:33:46 +00:00
|
|
|
oskutil_unload(osk);
|
2012-06-19 03:10:42 +00:00
|
|
|
#endif
|
|
|
|
|
2012-02-27 19:07:24 +00:00
|
|
|
#ifdef HAVE_LOGGER
|
2012-04-11 00:42:27 +00:00
|
|
|
logger_shutdown();
|
2012-02-27 19:07:24 +00:00
|
|
|
#endif
|
|
|
|
|
2012-09-16 02:04:25 +00:00
|
|
|
#if defined(HAVE_SYSMODULES)
|
2012-09-27 16:16:06 +00:00
|
|
|
|
2012-11-26 06:03:31 +00:00
|
|
|
/* Freetype font PRX */
|
2012-09-27 16:16:06 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_FREETYPE
|
2012-09-27 16:19:10 +00:00
|
|
|
cellSysmoduleLoadModule(CELL_SYSMODULE_FONTFT);
|
2012-09-27 16:16:06 +00:00
|
|
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_FREETYPE);
|
|
|
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_FONT);
|
|
|
|
#endif
|
|
|
|
|
2012-11-26 06:03:31 +00:00
|
|
|
/* screenshot PRX */
|
2012-09-27 16:16:06 +00:00
|
|
|
|
2012-09-16 02:04:25 +00:00
|
|
|
#ifndef __PSL1GHT__
|
2012-10-15 04:24:39 +00:00
|
|
|
if(g_extern.console.screen.state.screenshots.enable)
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
|
2012-09-16 02:04:25 +00:00
|
|
|
#endif
|
2012-09-27 16:16:06 +00:00
|
|
|
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_JPGDEC);
|
|
|
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_PNGDEC);
|
2012-09-27 16:16:06 +00:00
|
|
|
|
2012-11-26 06:03:31 +00:00
|
|
|
/* system game utility PRX */
|
2012-09-16 02:04:25 +00:00
|
|
|
#ifndef __PSL1GHT__
|
2012-04-11 00:42:27 +00:00
|
|
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_AVCONF_EXT);
|
|
|
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
2012-05-25 14:24:28 +00:00
|
|
|
#endif
|
2012-09-27 16:16:06 +00:00
|
|
|
|
2012-09-16 02:04:25 +00:00
|
|
|
#endif
|
2012-04-11 00:42:27 +00:00
|
|
|
|
2012-06-30 11:37:18 +00:00
|
|
|
#ifdef HAVE_HDD_CACHE_PARTITION
|
2012-04-11 00:42:27 +00:00
|
|
|
int ret = cellSysCacheClear();
|
|
|
|
|
|
|
|
if(ret != CELL_SYSCACHE_RET_OK_CLEARED)
|
|
|
|
{
|
2012-04-21 21:25:32 +00:00
|
|
|
RARCH_ERR("System cache partition could not be cleared on exit.\n");
|
2012-04-11 00:42:27 +00:00
|
|
|
}
|
2012-06-30 11:37:18 +00:00
|
|
|
#endif
|
2012-04-11 00:42:27 +00:00
|
|
|
|
2012-09-14 03:07:33 +00:00
|
|
|
#ifdef HAVE_RARCH_EXEC
|
2012-10-15 04:24:39 +00:00
|
|
|
if(g_extern.console.external_launch.enable)
|
|
|
|
rarch_console_exec(g_extern.console.external_launch.launch_app);
|
2012-09-14 03:07:33 +00:00
|
|
|
#endif
|
2012-04-13 19:01:04 +00:00
|
|
|
|
2012-04-11 00:42:27 +00:00
|
|
|
return 1;
|
2012-01-05 21:47:34 +00:00
|
|
|
}
|