int main(int argc, char *argv[]) { get_environment_settings(); rarch_main_clear_state(); config_set_defaults(); char full_path[1024]; snprintf(full_path, sizeof(full_path), "game:\\CORE.xex"); bool find_libretro_file = rarch_configure_libretro_core(full_path, "game:\\", "game:\\", SYS_CONFIG_FILE, ".xex"); set_default_settings(); rarch_config_load(SYS_CONFIG_FILE, "game:\\", ".xex", find_libretro_file); init_libretro_sym(); video_xdk360.start(); input_xdk360.init(); rarch_input_set_default_keybind_names_for_emulator(); menu_init(); begin_loop: if(g_console.mode_switch == MODE_EMULATION) { bool repeat = false; input_xdk360.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(SYS_CONFIG_FILE); } else goto begin_shutdown; goto begin_loop; begin_shutdown: if(path_file_exists(SYS_CONFIG_FILE)) rarch_config_save(SYS_CONFIG_FILE); menu_free(); video_xdk360.stop(); input_xdk360.free(NULL); rarch_exec(); return 0; }
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; }
int main(int argc, char *argv[]) { get_environment_settings(); rarch_main_clear_state(); config_set_defaults(); #ifdef _XBOX1 configure_libretro("D:\\", ".xbe"); #else configure_libretro("game:\\", ".xex"); #endif #if defined(HAVE_D3D8) || defined(HAVE_D3D9) video_xdk_d3d.start(); #else video_null.start(); #endif input_xinput.init(); rarch_input_set_default_keybind_names_for_emulator(); menu_init(); begin_loop: if(g_console.mode_switch == MODE_EMULATION) { bool repeat = false; input_xinput.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(SYS_CONFIG_FILE); } else goto begin_shutdown; goto begin_loop; begin_shutdown: if(path_file_exists(SYS_CONFIG_FILE)) rarch_config_save(SYS_CONFIG_FILE); menu_free(); #if defined(HAVE_D3D8) || defined(HAVE_D3D9) video_xdk_d3d.stop(); #else video_null.stop(); #endif input_xinput.free(NULL); rarch_exec(); return 0; }