mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 04:44:02 +00:00
(PS3) Added Multiman hooks
This commit is contained in:
parent
11720b8113
commit
ffc6fc5e24
@ -173,11 +173,9 @@ struct settings
|
||||
#ifdef SSNES_CONSOLE
|
||||
struct console_settings
|
||||
{
|
||||
bool autostart_game;
|
||||
bool block_config_read;
|
||||
bool default_sram_dir_enable;
|
||||
bool default_savestate_dir_enable;
|
||||
bool external_launcher_support;
|
||||
bool frame_advance_enable;
|
||||
bool initialize_ssnes_enable;
|
||||
bool ingame_menu_enable;
|
||||
@ -190,6 +188,7 @@ struct console_settings
|
||||
float overscan_amount;
|
||||
uint32_t aspect_ratio_index;
|
||||
uint32_t emulator_initialized;
|
||||
uint32_t external_launcher_support;
|
||||
uint32_t screen_orientation;
|
||||
uint32_t current_resolution_index;
|
||||
uint32_t current_resolution_id;
|
||||
@ -209,6 +208,7 @@ struct console_settings
|
||||
char default_rom_startup_dir[PATH_MAX];
|
||||
char default_savestate_dir[PATH_MAX];
|
||||
char default_sram_dir[PATH_MAX];
|
||||
char launch_app_on_exit[PATH_MAX];
|
||||
float menu_font_size;
|
||||
};
|
||||
#endif
|
||||
|
55
ps3/main.c
55
ps3/main.c
@ -70,8 +70,7 @@ char DEFAULT_SHADER_FILE[MAX_PATH_LENGTH];
|
||||
char DEFAULT_MENU_SHADER_FILE[MAX_PATH_LENGTH];
|
||||
char SYS_CONFIG_FILE[MAX_PATH_LENGTH];
|
||||
char EMULATOR_CORE_SELF[MAX_PATH_LENGTH];
|
||||
|
||||
const char * MULTIMAN_EXECUTABLE = "/dev_hdd0/game/BLES80608/USRDIR/RELOAD.SELF";
|
||||
char MULTIMAN_EXECUTABLE[MAX_PATH_LENGTH];
|
||||
|
||||
int ssnes_main(int argc, char *argv[]);
|
||||
|
||||
@ -318,7 +317,7 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
|
||||
}
|
||||
}
|
||||
|
||||
static void get_environment_settings(int argc)
|
||||
static void get_environment_settings(int argc, char *argv[])
|
||||
{
|
||||
g_extern.verbose = true;
|
||||
|
||||
@ -327,27 +326,28 @@ static void get_environment_settings(int argc)
|
||||
CellGameContentSize size;
|
||||
char dirName[CELL_GAME_DIRNAME_SIZE];
|
||||
|
||||
|
||||
if(path_file_exists(MULTIMAN_EXECUTABLE))
|
||||
if(argc >= 2)
|
||||
{
|
||||
g_console.external_launcher_support = true;
|
||||
SSNES_LOG("multiMAN found, support enabled.\n");
|
||||
/* launched from external launcher */
|
||||
strncpy(MULTIMAN_EXECUTABLE, argv[1], sizeof(MULTIMAN_EXECUTABLE));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_console.external_launcher_support = false;
|
||||
SSNES_WARN("multiMAN not found, support disabled.\n");
|
||||
/* not launched from external launcher, set default path */
|
||||
strncpy(MULTIMAN_EXECUTABLE, "/dev_hdd0/game/BLES80608/USRDIR/RELOAD.SELF",
|
||||
sizeof(MULTIMAN_EXECUTABLE));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(argc > 1)
|
||||
if(path_file_exists(MULTIMAN_EXECUTABLE) && (strcmp(argv[2],"") != 0))
|
||||
{
|
||||
g_console.autostart_game = true;
|
||||
SSNES_LOG("Started from multiMAN, will auto-start game.\n");
|
||||
g_console.external_launcher_support = EXTERN_LAUNCHER_MULTIMAN;
|
||||
SSNES_LOG("Started from multiMAN, auto-game start enabled.\n");
|
||||
}
|
||||
else
|
||||
g_console.autostart_game = false;
|
||||
#endif
|
||||
{
|
||||
g_console.external_launcher_support = EXTERN_LAUNCHER_SALAMANDER;
|
||||
SSNES_WARN("Not started from multiMAN, auto-game start disabled.\n");
|
||||
}
|
||||
|
||||
memset(&size, 0x00, sizeof(CellGameContentSize));
|
||||
|
||||
@ -377,7 +377,7 @@ static void get_environment_settings(int argc)
|
||||
|
||||
ret = cellGameContentPermit(contentInfoPath, usrDirPath);
|
||||
|
||||
if(g_console.external_launcher_support)
|
||||
if(g_console.external_launcher_support == EXTERN_LAUNCHER_MULTIMAN)
|
||||
{
|
||||
snprintf(contentInfoPath, sizeof(contentInfoPath), "/dev_hdd0/game/%s", EMULATOR_CONTENT_DIR);
|
||||
snprintf(usrDirPath, sizeof(usrDirPath), "/dev_hdd0/game/%s/USRDIR", EMULATOR_CONTENT_DIR);
|
||||
@ -528,7 +528,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
sceNpInit(NP_POOL_SIZE, np_pool);
|
||||
|
||||
get_environment_settings(argc);
|
||||
get_environment_settings(argc, argv);
|
||||
|
||||
ssnes_main_clear_state();
|
||||
|
||||
@ -558,12 +558,17 @@ int main(int argc, char *argv[])
|
||||
menu_init();
|
||||
g_console.mode_switch = MODE_MENU;
|
||||
|
||||
if(g_console.autostart_game)
|
||||
switch(g_console.external_launcher_support)
|
||||
{
|
||||
strncpy(g_console.rom_path, argv[1], sizeof(g_console.rom_path));
|
||||
g_console.initialize_ssnes_enable = 1;
|
||||
g_console.mode_switch = MODE_EMULATION;
|
||||
startup_ssnes();
|
||||
case EXTERN_LAUNCHER_SALAMANDER:
|
||||
break;
|
||||
case EXTERN_LAUNCHER_MULTIMAN:
|
||||
SSNES_LOG("Started from multiMAN, will auto-start game.\n");
|
||||
strncpy(g_console.rom_path, argv[1], sizeof(g_console.rom_path));
|
||||
g_console.initialize_ssnes_enable = 1;
|
||||
g_console.mode_switch = MODE_EMULATION;
|
||||
startup_ssnes();
|
||||
break;
|
||||
}
|
||||
|
||||
begin_loop:
|
||||
@ -628,12 +633,12 @@ begin_shutdown:
|
||||
};
|
||||
|
||||
SceNpDrmKey * k_licensee = NULL;
|
||||
int ret = sceNpDrmProcessExitSpawn2(k_licensee, g_settings.libsnes, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M);
|
||||
SSNES_LOG("Attempt to load SELF: [%s] (return code: [%x]).\n", g_settings.libsnes, ret);
|
||||
int ret = sceNpDrmProcessExitSpawn2(k_licensee, g_console.launch_app_on_exit, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M);
|
||||
SSNES_LOG("Attempt to load SELF: [%s] (return code: [%x]).\n", g_console.launch_app_on_exit, ret);
|
||||
if(ret < 0)
|
||||
{
|
||||
SSNES_LOG("SELF file is not of NPDRM type, trying another approach to boot it...\n");
|
||||
sys_game_process_exitspawn(g_settings.libsnes, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M);
|
||||
sys_game_process_exitspawn(g_console.launch_app_on_exit, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M);
|
||||
|
||||
}
|
||||
sceNpTerm();
|
||||
|
19
ps3/menu.c
19
ps3/menu.c
@ -810,7 +810,7 @@ static void select_file(uint32_t menu_id)
|
||||
break;
|
||||
case LIBSNES_CHOICE:
|
||||
strncpy(dir_path, LIBSNES_DIR_PATH, sizeof(dir_path));
|
||||
strncpy(extensions, "self|SELF", sizeof(extensions));
|
||||
strncpy(extensions, "self|SELF|bin|BIN", sizeof(extensions));
|
||||
strncpy(title, "LIBSNES CORE SELECTION", sizeof(title));
|
||||
strncpy(object, "Libsnes", sizeof(object));
|
||||
strncpy(object, "Libsnes core file", sizeof(object));
|
||||
@ -880,7 +880,8 @@ static void select_file(uint32_t menu_id)
|
||||
case BORDER_CHOICE:
|
||||
break;
|
||||
case LIBSNES_CHOICE:
|
||||
strlcpy(g_settings.libsnes, path, sizeof(g_settings.libsnes));
|
||||
strlcpy(g_console.launch_app_on_exit, path,
|
||||
sizeof(g_console.launch_app_on_exit));
|
||||
g_console.return_to_launcher = true;
|
||||
g_console.menu_enable = false;
|
||||
g_console.mode_switch = MODE_EXIT;
|
||||
@ -1972,24 +1973,20 @@ static void ingame_menu(uint32_t menu_id)
|
||||
}
|
||||
strcpy(comment, "Press 'CROSS' to choose a different emulator core.");
|
||||
break;
|
||||
#ifdef MULTIMAN_SUPPORT
|
||||
case MENU_ITEM_RETURN_TO_MULTIMAN:
|
||||
if(CTRL_CROSS(state))
|
||||
if(CTRL_CROSS(state) && path_file_exists(MULTIMAN_EXECUTABLE))
|
||||
{
|
||||
strlcpy(g_console.launch_app_on_exit, MULTIMAN_EXECUTABLE,
|
||||
sizeof(g_console.launch_app_on_exit));
|
||||
g_console.return_to_launcher = true;
|
||||
g_console.menu_enable = false;
|
||||
g_console.mode_switch = MODE_EXIT;
|
||||
}
|
||||
|
||||
strcpy(comment, "Press 'CROSS' to quit the emulator and return to multiMAN.");
|
||||
break;
|
||||
#endif
|
||||
case MENU_ITEM_RETURN_TO_XMB:
|
||||
if(CTRL_CROSS(state))
|
||||
{
|
||||
#ifdef MULTIMAN_SUPPORT
|
||||
return_to_MM = false;
|
||||
#endif
|
||||
g_console.menu_enable = false;
|
||||
g_console.mode_switch = MODE_EXIT;
|
||||
}
|
||||
@ -2071,15 +2068,15 @@ static void ingame_menu(uint32_t menu_id)
|
||||
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");
|
||||
cellDbgFontDraw();
|
||||
|
||||
cellDbgFontPuts(x_position, (ypos+(ypos_increment*MENU_ITEM_RETURN_TO_MENU)), font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_MENU), "Return to Menu");
|
||||
cellDbgFontDraw();
|
||||
|
||||
cellDbgFontPuts(x_position, (ypos+(ypos_increment*MENU_ITEM_CHANGE_LIBSNES)), font_size, MENU_ITEM_SELECTED(MENU_ITEM_CHANGE_LIBSNES), "Change libsnes core");
|
||||
cellDbgFontDraw();
|
||||
#ifdef MULTIMAN_SUPPORT
|
||||
|
||||
cellDbgFontPuts(x_position, (ypos+(ypos_increment*MENU_ITEM_RETURN_TO_MULTIMAN)), font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_MULTIMAN), "Return to multiMAN");
|
||||
#endif
|
||||
|
||||
cellDbgFontPuts(x_position, (ypos+(ypos_increment*MENU_ITEM_RETURN_TO_XMB)), font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_XMB), "Return to XMB");
|
||||
cellDbgFontDraw();
|
||||
|
13
ps3/shared.h
13
ps3/shared.h
@ -32,13 +32,16 @@
|
||||
#define LIGHTBLUE 0xFFFFE0E0U
|
||||
#define LIGHTORANGE 0xFFE0EEFFu
|
||||
|
||||
enum
|
||||
{
|
||||
EXTERN_LAUNCHER_SALAMANDER,
|
||||
EXTERN_LAUNCHER_MULTIMAN
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MODE_EMULATION,
|
||||
MODE_MENU,
|
||||
#ifdef MULTIMAN_SUPPORT
|
||||
MODE_MULTIMAN_STARTUP,
|
||||
#endif
|
||||
MODE_EXIT
|
||||
};
|
||||
|
||||
@ -64,9 +67,7 @@ enum {
|
||||
MENU_ITEM_RETURN_TO_GAME,
|
||||
MENU_ITEM_RETURN_TO_MENU,
|
||||
MENU_ITEM_CHANGE_LIBSNES,
|
||||
#ifdef MULTIMAN_SUPPORT
|
||||
MENU_ITEM_RETURN_TO_MULTIMAN,
|
||||
#endif
|
||||
MENU_ITEM_RETURN_TO_XMB
|
||||
};
|
||||
|
||||
@ -88,4 +89,4 @@ extern char DEFAULT_SHADER_FILE[MAX_PATH_LENGTH];
|
||||
extern char DEFAULT_MENU_SHADER_FILE[MAX_PATH_LENGTH];
|
||||
extern char LIBSNES_DIR_PATH[MAX_PATH_LENGTH];
|
||||
extern char SYS_CONFIG_FILE[MAX_PATH_LENGTH];
|
||||
extern char MULTIMAN_GAME_TO_BOOT[MAX_PATH_LENGTH];
|
||||
extern char MULTIMAN_EXECUTABLE[MAX_PATH_LENGTH];
|
||||
|
Loading…
x
Reference in New Issue
Block a user