static void system_post_init(void) { #if (CELL_SDK_VERSION > 0x340000) && !defined(__PSL1GHT__) if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SCREENSHOTS_ENABLE)) { #ifdef HAVE_SYSMODULES cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); #endif #ifdef HAVE_SYSUTILS CellScreenShotSetParam screenshot_param = {0, 0, 0, 0}; screenshot_param.photo_title = "RetroArch PS3"; screenshot_param.game_title = "RetroArch PS3"; cellScreenShotSetParameter (&screenshot_param); cellScreenShotEnable(); #endif } #ifdef HAVE_SYSUTILS if (g_extern.lifecycle_mode_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE)) cellSysutilEnableBgmPlayback(); #endif #endif #ifdef HAVE_OSKUTIL oskutil_params *osk = &g_extern.console.misc.oskutil_handle; oskutil_init(osk, 0); #endif }
int main(int argc, char *argv[]) { #ifdef HAVE_SYSUTILS RARCH_LOG("Registering system utility callback...\n"); cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL); #endif #ifdef HAVE_SYSMODULES cellSysmoduleLoadModule(CELL_SYSMODULE_IO); cellSysmoduleLoadModule(CELL_SYSMODULE_FS); cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_GAME); cellSysmoduleLoadModule(CELL_SYSMODULE_AVCONF_EXT); cellSysmoduleLoadModule(CELL_SYSMODULE_PNGDEC); cellSysmoduleLoadModule(CELL_SYSMODULE_JPGDEC); cellSysmoduleLoadModule(CELL_SYSMODULE_NET); cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_NP); #endif sys_net_initialize_network(); #ifdef HAVE_LOGGER logger_init(); #endif sceNpInit(NP_POOL_SIZE, np_pool); rarch_main_clear_state(); get_environment_settings(argc, argv); config_set_defaults(); input_ps3.init(); char tmp_path[PATH_MAX]; snprintf(tmp_path, sizeof(tmp_path), "%s/", default_paths.core_dir); rarch_configure_libretro(&input_ps3, tmp_path, default_paths.executable_extension); #if(CELL_SDK_VERSION > 0x340000) if (g_console.screenshots_enable) { #ifdef HAVE_SYSMODULES cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); #endif #ifdef HAVE_SYSUTILS CellScreenShotSetParam screenshot_param = {0, 0, 0, 0}; screenshot_param.photo_title = "RetroArch PS3"; screenshot_param.game_title = "RetroArch PS3"; cellScreenShotSetParameter (&screenshot_param); cellScreenShotEnable(); #endif } #ifdef HAVE_SYSUTILS if (g_console.custom_bgm_enable) cellSysutilEnableBgmPlayback(); #endif #endif video_gl.start(); #ifdef HAVE_OSKUTIL oskutil_init(&g_console.oskutil_handle, 0); #endif rarch_input_set_default_keybind_names_for_emulator(); menu_init(); switch(g_console.external_launcher_support) { case EXTERN_LAUNCHER_SALAMANDER: g_console.mode_switch = MODE_MENU; break; #ifdef HAVE_MULTIMAN case EXTERN_LAUNCHER_MULTIMAN: RARCH_LOG("Started from multiMAN, will auto-start game.\n"); strlcpy(g_console.rom_path, argv[1], sizeof(g_console.rom_path)); rarch_settings_change(S_START_RARCH); rarch_startup(default_paths.config_file); break; #endif default: break; } begin_loop: if(g_console.mode_switch == MODE_EMULATION) { bool repeat = false; input_ps3.poll(NULL); rarch_set_auto_viewport(g_extern.frame_cache.width, g_extern.frame_cache.height); do{ repeat = rarch_main_iterate(); }while(repeat && !g_console.frame_advance_enable); } else if(g_console.mode_switch == MODE_MENU) { menu_loop(); rarch_startup(default_paths.config_file); } else goto begin_shutdown; goto begin_loop; begin_shutdown: if(path_file_exists(default_paths.config_file)) rarch_config_save(default_paths.config_file); if(g_console.emulator_initialized) rarch_main_deinit(); input_ps3.free(NULL); video_gl.stop(); menu_free(); #ifdef HAVE_OSKUTIL if(g_console.oskutil_handle.is_running) oskutil_unload(&g_console.oskutil_handle); #endif #ifdef HAVE_LOGGER logger_shutdown(); #endif #ifdef HAVE_SYSMODULES if(g_console.screenshots_enable) cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); cellSysmoduleUnloadModule(CELL_SYSMODULE_JPGDEC); cellSysmoduleUnloadModule(CELL_SYSMODULE_PNGDEC); cellSysmoduleUnloadModule(CELL_SYSMODULE_AVCONF_EXT); cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME); #endif #ifdef HAVE_HDD_CACHE_PARTITION int ret = cellSysCacheClear(); if(ret != CELL_SYSCACHE_RET_OK_CLEARED) { RARCH_ERR("System cache partition could not be cleared on exit.\n"); } #endif rarch_exec(); return 1; }