mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
(PS3) Implemented SSNES control flow
This commit is contained in:
parent
955c0e85c8
commit
d9a72ea076
58
ps3/main.c
58
ps3/main.c
@ -66,10 +66,13 @@
|
|||||||
if(!(config_get_array(currentconfig, charstring, setting, sizeof(setting)))) \
|
if(!(config_get_array(currentconfig, charstring, setting, sizeof(setting)))) \
|
||||||
strncpy(setting,defaultvalue, sizeof(setting));
|
strncpy(setting,defaultvalue, sizeof(setting));
|
||||||
|
|
||||||
|
|
||||||
uint32_t g_emulator_initialized = 0;
|
uint32_t g_emulator_initialized = 0;
|
||||||
|
|
||||||
char special_action_msg[256]; /* message which should be overlaid on top of the screen*/
|
char special_action_msg[256]; /* message which should be overlaid on top of the screen*/
|
||||||
uint32_t special_action_msg_expired; /* time at which the message no longer needs to be overlaid onscreen*/
|
uint32_t special_action_msg_expired; /* time at which the message no longer needs to be overlaid onscreen*/
|
||||||
|
uint32_t mode_switch = MODE_MENU;
|
||||||
|
bool init_ssnes = false;
|
||||||
|
|
||||||
char contentInfoPath[MAX_PATH_LENGTH];
|
char contentInfoPath[MAX_PATH_LENGTH];
|
||||||
char usrDirPath[MAX_PATH_LENGTH];
|
char usrDirPath[MAX_PATH_LENGTH];
|
||||||
@ -200,7 +203,6 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
|
|||||||
case CELL_SYSUTIL_REQUEST_EXITGAME:
|
case CELL_SYSUTIL_REQUEST_EXITGAME:
|
||||||
menu_is_running = 0;
|
menu_is_running = 0;
|
||||||
g_quitting = true;
|
g_quitting = true;
|
||||||
sys_process_exit(0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -252,23 +254,53 @@ int main(int argc, char *argv[])
|
|||||||
ps3_input_init();
|
ps3_input_init();
|
||||||
|
|
||||||
menu_init();
|
menu_init();
|
||||||
menu_loop();
|
|
||||||
|
|
||||||
char arg1[] = "ssnes";
|
begin_loop:
|
||||||
char arg2[PATH_MAX];
|
if(mode_switch == MODE_EMULATION)
|
||||||
|
{
|
||||||
snprintf(arg2, sizeof(arg2), g_extern.system.fullpath);
|
while(ssnes_main_iterate());
|
||||||
char arg3[] = "-v";
|
ssnes_main_deinit();
|
||||||
char arg4[] = "-c";
|
}
|
||||||
char arg5[MAX_PATH_LENGTH];
|
else if(mode_switch == MODE_MENU)
|
||||||
|
{
|
||||||
|
menu_loop();
|
||||||
|
if(init_ssnes)
|
||||||
|
{
|
||||||
|
char arg1[] = "ssnes";
|
||||||
|
char arg2[PATH_MAX];
|
||||||
|
|
||||||
snprintf(arg5, sizeof(arg5), SYS_CONFIG_FILE);
|
snprintf(arg2, sizeof(arg2), g_extern.system.fullpath);
|
||||||
char *argv_[] = { arg1, arg2, arg3, arg4, arg5, NULL };
|
char arg3[] = "-v";
|
||||||
|
char arg4[] = "-c";
|
||||||
|
char arg5[MAX_PATH_LENGTH];
|
||||||
|
|
||||||
g_emulator_initialized = 1;
|
snprintf(arg5, sizeof(arg5), SYS_CONFIG_FILE);
|
||||||
|
char *argv_[] = { arg1, arg2, arg3, arg4, arg5, NULL };
|
||||||
|
|
||||||
return ssnes_main(sizeof(argv_) / sizeof(argv_[0]) - 1, argv_);
|
g_emulator_initialized = 1;
|
||||||
|
int argc = sizeof(argv_) / sizeof(argv_[0]) - 1;
|
||||||
|
int init_ret = ssnes_main_init(argc, argv_);
|
||||||
|
printf("init_ret: %d\n", init_ret);
|
||||||
|
if(init_ret)
|
||||||
|
{
|
||||||
|
mode_switch = MODE_MENU;
|
||||||
|
ssnes_main_deinit();
|
||||||
|
}
|
||||||
|
init_ssnes = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef MULTIMAN_SUPPORT
|
||||||
|
else if(mode_switch == MODE_MULTIMAN_STARTUP)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
goto begin_shutdown;
|
||||||
|
|
||||||
|
goto begin_loop;
|
||||||
|
|
||||||
|
begin_shutdown:
|
||||||
ps3_input_deinit();
|
ps3_input_deinit();
|
||||||
ps3_video_deinit();
|
ps3_video_deinit();
|
||||||
|
sys_process_exit(0);
|
||||||
}
|
}
|
||||||
|
@ -279,6 +279,7 @@ static void browser_update(filebrowser_t * b)
|
|||||||
if (g_emulator_initialized)
|
if (g_emulator_initialized)
|
||||||
{
|
{
|
||||||
menu_is_running = 0;
|
menu_is_running = 0;
|
||||||
|
mode_switch = MODE_EMULATION;
|
||||||
set_text_message("", 15);
|
set_text_message("", 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1197,6 +1198,7 @@ static void select_setting(menu * menu_obj)
|
|||||||
if (g_emulator_initialized)
|
if (g_emulator_initialized)
|
||||||
{
|
{
|
||||||
menu_is_running = 0;
|
menu_is_running = 0;
|
||||||
|
mode_switch = MODE_EMULATION;
|
||||||
set_text_message("", 15);
|
set_text_message("", 15);
|
||||||
}
|
}
|
||||||
old_state = state;
|
old_state = state;
|
||||||
@ -1277,6 +1279,8 @@ static void select_rom(void)
|
|||||||
|
|
||||||
menu_is_running = 0;
|
menu_is_running = 0;
|
||||||
snprintf(g_extern.system.fullpath, sizeof(g_extern.system.fullpath), "%s/%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), FILEBROWSER_GET_CURRENT_FILENAME(browser));
|
snprintf(g_extern.system.fullpath, sizeof(g_extern.system.fullpath), "%s/%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), FILEBROWSER_GET_CURRENT_FILENAME(browser));
|
||||||
|
init_ssnes = 1;
|
||||||
|
mode_switch = MODE_EMULATION;
|
||||||
|
|
||||||
old_state = state;
|
old_state = state;
|
||||||
return;
|
return;
|
||||||
|
12
ps3/shared.h
12
ps3/shared.h
@ -18,10 +18,22 @@
|
|||||||
|
|
||||||
#define MAX_PATH_LENGTH 1024
|
#define MAX_PATH_LENGTH 1024
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MODE_EMULATION,
|
||||||
|
MODE_MENU,
|
||||||
|
#ifdef MULTIMAN_SUPPORT
|
||||||
|
MODE_MULTIMAN_STARTUP,
|
||||||
|
#endif
|
||||||
|
MODE_EXIT
|
||||||
|
};
|
||||||
|
|
||||||
extern char special_action_msg[256];
|
extern char special_action_msg[256];
|
||||||
extern uint32_t g_emulator_initialized;
|
extern uint32_t g_emulator_initialized;
|
||||||
extern uint32_t special_action_msg_expired;
|
extern uint32_t special_action_msg_expired;
|
||||||
|
extern uint32_t mode_switch;
|
||||||
extern unsigned g_frame_count;
|
extern unsigned g_frame_count;
|
||||||
|
extern bool init_ssnes;
|
||||||
extern bool g_quitting;
|
extern bool g_quitting;
|
||||||
|
|
||||||
extern char contentInfoPath[MAX_PATH_LENGTH];
|
extern char contentInfoPath[MAX_PATH_LENGTH];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user