void frontend_driver_shutdown(bool a) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->shutdown) return; frontend->shutdown(a); }
uint64_t frontend_driver_get_used_memory(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->get_used_mem) return 0; return frontend->get_used_mem(); }
static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdata) { (void)param; (void)userdata; (void)status; #ifndef IS_SALAMANDER switch (status) { case CELL_SYSUTIL_REQUEST_EXITGAME: { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (frontend) frontend->shutdown = frontend_ps3_shutdown; runloop_ctl(RUNLOOP_CTL_SET_SHUTDOWN, NULL); } break; } #endif }
bool frontend_driver_is_inited(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend) return false; return true; }
void frontend_driver_exitspawn(char *s, size_t len) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->exitspawn) return; frontend->exitspawn(s, len); }
void frontend_driver_deinit(void *args) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->deinit) return; frontend->deinit(args); }
const struct video_driver *frontend_driver_get_video_driver(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->get_video_driver) return NULL; return frontend->get_video_driver(); }
bool frontend_driver_has_get_video_driver_func(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->get_video_driver) return false; return true; }
environment_get_t frontend_driver_environment_get_ptr(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend) return NULL; return frontend->environment_get; }
enum frontend_architecture frontend_driver_get_cpu_architecture(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->get_architecture) return FRONTEND_ARCH_NONE; return frontend->get_architecture(); }
bool frontend_driver_has_fork(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->set_fork) return false; return true; }
void frontend_driver_process_args(int *argc, char *argv[]) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->process_args) return; frontend->process_args(argc, argv); }
void frontend_driver_set_fork(bool a, bool b) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->set_fork) return; frontend->set_fork(a, b); }
bool frontend_driver_set_fork(enum frontend_fork fork_mode) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend_driver_has_fork()) return false; return frontend->set_fork(fork_mode); }
void frontend_driver_content_loaded(void) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->content_loaded) return; frontend->content_loaded(); }
int frontend_driver_parse_drive_list(void *data) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend || !frontend->parse_drive_list) return -1; return frontend->parse_drive_list(data); }
bool win32_suppress_screensaver(void *data, bool enable) { #ifdef _XBOX return false; #else if(enable) { int major, minor; char tmp[PATH_MAX_LENGTH]; const frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (!frontend) return false; frontend->get_os(tmp, sizeof(tmp), &major, &minor); if (major*100+minor >= 601) { /* Windows 7, 8, 10 codepath */ typedef HANDLE (WINAPI * PowerCreateRequestPtr)(REASON_CONTEXT *context); typedef BOOL (WINAPI * PowerSetRequestPtr)(HANDLE PowerRequest, POWER_REQUEST_TYPE RequestType); HMODULE kernel32 = GetModuleHandle("kernel32.dll"); PowerCreateRequestPtr powerCreateRequest = (PowerCreateRequestPtr)GetProcAddress(kernel32, "PowerCreateRequest"); PowerSetRequestPtr powerSetRequest = (PowerSetRequestPtr)GetProcAddress(kernel32, "PowerSetRequest"); if(powerCreateRequest && powerSetRequest) { POWER_REQUEST_CONTEXT RequestContext; HANDLE Request; RequestContext.Version = POWER_REQUEST_CONTEXT_VERSION; RequestContext.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING; RequestContext.Reason.SimpleReasonString = (LPWSTR)L"RetroArch running"; Request = powerCreateRequest(&RequestContext); powerSetRequest( Request, PowerRequestDisplayRequired); return true; } } else { /* XP / Vista codepath */ SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED); return true; } } return false; #endif }
/** * main_exit: * * Cleanly exit RetroArch. * * Also saves configuration files to disk, * and (optionally) autosave state. **/ void main_exit(void *args) { driver_t *driver = driver_get_ptr(); settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); const frontend_ctx_driver_t *frontend = frontend_get_ptr(); const ui_companion_driver_t *ui = ui_companion_get_ptr(); global->system.shutdown = false; main_exit_save_config(); if (global->main_is_init) { #ifdef HAVE_MENU /* Do not want menu context to live any more. */ driver->menu_data_own = false; #endif rarch_main_deinit(); } event_command(EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG); #if defined(HAVE_LOGGER) && !defined(ANDROID) logger_shutdown(); #endif if (frontend) { if (frontend->deinit) frontend->deinit(args); if (frontend->exitspawn) frontend->exitspawn(settings->libretro, sizeof(settings->libretro)); } rarch_main_free(); if (ui) { if (ui->deinit) ui->deinit(driver->ui_companion_data); } if (frontend) { if (frontend->shutdown) frontend->shutdown(false); } driver_free(); }
static void task_powerstate_handler(retro_task_t *task) { const frontend_ctx_driver_t *frontend = frontend_get_ptr(); powerstate_t *powerstate = (powerstate_t*)task->state; if (frontend && frontend->get_powerstate) { int seconds = 0; powerstate->state = frontend->get_powerstate(&seconds, &powerstate->percent); } task_set_data(task, powerstate); task_set_finished(task, true); }
static void frontend_ps3_exitspawn(char *core_path, size_t core_path_size) { #ifdef HAVE_RARCH_EXEC bool should_load_game = false; #ifndef IS_SALAMANDER bool original_verbose = verbosity_is_enabled(); verbosity_enable(); if (ps3_fork_mode == FRONTEND_FORK_NONE) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (frontend) frontend->shutdown = frontend_ps3_shutdown; return; } switch (ps3_fork_mode) { case FRONTEND_FORK_CORE_WITH_ARGS: should_load_game = true; break; case FRONTEND_FORK_NONE: default: break; } #endif frontend_ps3_exec(core_path, should_load_game); #ifdef IS_SALAMANDER cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME); cellSysmoduleLoadModule(CELL_SYSMODULE_FS); cellSysmoduleLoadModule(CELL_SYSMODULE_IO); #endif #ifndef IS_SALAMANDER if (original_verbose) verbosity_enable(); else verbosity_disable(); #endif #endif }
void netplay_get_architecture(char *frontend_architecture, size_t size) { const frontend_ctx_driver_t *frontend = frontend_get_ptr(); enum frontend_architecture arch = frontend_driver_get_cpu_architecture(); char architecture[PATH_MAX_LENGTH]; switch (arch) { case FRONTEND_ARCH_X86: strlcpy(architecture, "x86", sizeof(architecture)); break; case FRONTEND_ARCH_X86_64: strlcpy(architecture, "x64", sizeof(architecture)); break; case FRONTEND_ARCH_PPC: strlcpy(architecture, "PPC", sizeof(architecture)); break; case FRONTEND_ARCH_ARM: strlcpy(architecture, "ARM", sizeof(architecture)); break; case FRONTEND_ARCH_ARMV7: strlcpy(architecture, "ARMv7", sizeof(architecture)); break; case FRONTEND_ARCH_ARMV8: strlcpy(architecture, "ARMv8", sizeof(architecture)); break; case FRONTEND_ARCH_MIPS: strlcpy(architecture, "MIPS", sizeof(architecture)); break; case FRONTEND_ARCH_TILE: strlcpy(architecture, "Tilera", sizeof(architecture)); break; case FRONTEND_ARCH_NONE: default: strlcpy(architecture, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), sizeof(architecture)); break; } snprintf(frontend_architecture, size, "%s %s", frontend->ident, architecture); }
static void frontend_ps3_exitspawn(char *core_path, size_t core_path_size) { #ifdef HAVE_RARCH_EXEC bool should_load_game = false; #ifndef IS_SALAMANDER bool *verbose = retro_main_verbosity(); bool original_verbose = *verbose; *verbose = true; should_load_game = exitspawn_start_game; if (!exit_spawn) { frontend_ctx_driver_t *frontend = frontend_get_ptr(); if (frontend) frontend->shutdown = frontend_ps3_shutdown; return; } #endif frontend_ps3_exec(core_path, should_load_game); #ifdef IS_SALAMANDER cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME); cellSysmoduleLoadModule(CELL_SYSMODULE_FS); cellSysmoduleLoadModule(CELL_SYSMODULE_IO); #endif #ifndef IS_SALAMANDER *verbose = original_verbose; #endif #endif }