本文整理汇总了C++中rarch_system_info_get_ptr函数的典型用法代码示例。如果您正苦于以下问题:C++ rarch_system_info_get_ptr函数的具体用法?C++ rarch_system_info_get_ptr怎么用?C++ rarch_system_info_get_ptr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rarch_system_info_get_ptr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: history_playlist_push
static void history_playlist_push(content_playlist_t *playlist,
const char *path, const char *core_path,
struct retro_system_info *info)
{
char tmp[PATH_MAX_LENGTH] = {0};
global_t *global = global_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (!playlist || (global->core_type == CORE_TYPE_DUMMY) || !info)
return;
/* Path can be relative here.
* Ensure we're pushing absolute path. */
strlcpy(tmp, path, sizeof(tmp));
if (*tmp)
path_resolve_realpath(tmp, sizeof(tmp));
if (system->no_content || *tmp)
content_playlist_push(playlist,
*tmp ? tmp : NULL,
NULL,
core_path,
info->library_name,
NULL,
NULL);
}
开发者ID:TheDuckMan64,项目名称:RetroArch,代码行数:28,代码来源:frontend.c
示例2: callback_sysutil_exit
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();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (system)
system->shutdown = true;
if (frontend)
frontend->shutdown = frontend_ps3_shutdown;
}
break;
}
#endif
}
开发者ID:mak77,项目名称:RetroArch,代码行数:26,代码来源:platform_ps3.c
示例3: init_camera
void init_camera(void)
{
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
/* Resource leaks will follow if camera is initialized twice. */
if (driver->camera_data)
return;
find_camera_driver();
driver->camera_data = driver->camera->init(
*settings->camera.device ? settings->camera.device : NULL,
system->camera_callback.caps,
settings->camera.width ?
settings->camera.width : system->camera_callback.width,
settings->camera.height ?
settings->camera.height : system->camera_callback.height);
if (!driver->camera_data)
{
RARCH_ERR("Failed to initialize camera driver. Will continue without camera.\n");
driver->camera_active = false;
}
if (system->camera_callback.initialized)
system->camera_callback.initialized();
}
开发者ID:xurayg,项目名称:RetroArch,代码行数:29,代码来源:camera_driver.c
示例4: main_exit_save_config
/**
* main_exit_save_config:
*
* Saves configuration file to disk, and (optionally)
* autosave state.
**/
void main_exit_save_config(void)
{
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
rarch_system_info_t *info = rarch_system_info_get_ptr();
if (settings->config_save_on_exit && *global->config_path)
{
/* restore original paths in case per-core organization is enabled */
if (settings->sort_savefiles_enable && orig_savefile_dir[0] != '\0')
strlcpy(global->savefile_dir,orig_savefile_dir,sizeof(global->savefile_dir));
if (settings->sort_savestates_enable && orig_savestate_dir[0] != '\0')
strlcpy(global->savestate_dir,orig_savestate_dir,sizeof(global->savestate_dir));
/* restore system directory if it was set to <content dir> */
if(settings->system_in_content_dir && !strcmp(info->info.library_name,"No Core"))
settings->system_directory[0] = '\0';
/* Save last core-specific config to the default config location,
* needed on consoles for core switching and reusing last good
* config for new cores.
*/
config_save_file(global->config_path);
/* Flush out the core specific config. */
if (*global->core_specific_config_path &&
settings->core_specific_config)
config_save_file(global->core_specific_config_path);
}
event_command(EVENT_CMD_AUTOSAVE_STATE);
}
开发者ID:TheDuckMan64,项目名称:RetroArch,代码行数:38,代码来源:frontend.c
示例5: implementation_magic_value
/**
* implementation_magic_value:
*
* Not really a hash, but should be enough to differentiate
* implementations from each other.
*
* Subtle differences in the implementation will not be possible to spot.
* The alternative would have been checking serialization sizes, but it
* was troublesome for cross platform compat.
**/
static uint32_t implementation_magic_value(void)
{
size_t i, len;
uint32_t res = 0;
const char *ver = PACKAGE_VERSION;
unsigned api = core.retro_api_version();
rarch_system_info_t *info = rarch_system_info_get_ptr();
const char *lib = info ? info->info.library_name : NULL;
res |= api;
len = strlen(lib);
for (i = 0; i < len; i++)
res ^= lib[i] << (i & 0xf);
lib = info->info.library_version;
len = strlen(lib);
for (i = 0; i < len; i++)
res ^= lib[i] << (i & 0xf);
len = strlen(ver);
for (i = 0; i < len; i++)
res ^= ver[i] << ((i & 0xf) + 16);
return res;
}
开发者ID:ssangkong,项目名称:RetroArch,代码行数:37,代码来源:netplay.c
示例6: menu_entries_get_core_title
/* Sets 's' to the name of the current core
* (shown at the top of the UI). */
int menu_entries_get_core_title(char *s, size_t len)
{
const char *core_name = NULL;
const char *core_version = NULL;
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
rarch_system_info_t *info = rarch_system_info_get_ptr();
if (!settings->menu.core_enable)
return -1;
if (global)
{
core_name = global->menu.info.library_name;
core_version = global->menu.info.library_version;
}
if (!core_name || core_name[0] == '\0')
core_name = info->info.library_name;
if (!core_name || core_name[0] == '\0')
core_name = menu_hash_to_str(MENU_VALUE_NO_CORE);
if (!core_version)
core_version = info->info.library_version;
if (!core_version)
core_version = "";
snprintf(s, len, "%s - %s %s", PACKAGE_VERSION,
core_name, core_version);
return 0;
}
开发者ID:ioev,项目名称:RetroArch,代码行数:34,代码来源:menu_entries.c
示例7: event_disk_control_set_eject
/**
* event_disk_control_set_eject:
* @new_state : Eject or close the virtual drive tray.
* false (0) : Close
* true (1) : Eject
* @print_log : Show message onscreen.
*
* Ejects/closes of the virtual drive tray.
**/
static void event_disk_control_set_eject(bool new_state, bool print_log)
{
char msg[PATH_MAX_LENGTH] = {0};
bool error = false;
rarch_system_info_t *info = rarch_system_info_get_ptr();
const struct retro_disk_control_callback *control =
info ? (const struct retro_disk_control_callback*)&info->disk_control : NULL;
if (!control || !control->get_num_images)
return;
*msg = '\0';
if (control->set_eject_state(new_state))
snprintf(msg, sizeof(msg), "%s virtual disk tray.",
new_state ? "Ejected" : "Closed");
else
{
error = true;
snprintf(msg, sizeof(msg), "Failed to %s virtual disk tray.",
new_state ? "eject" : "close");
}
if (*msg)
{
if (error)
RARCH_ERR("%s\n", msg);
else
RARCH_LOG("%s\n", msg);
/* Only noise in menu. */
if (print_log)
rarch_main_msg_queue_push(msg, 1, 180, true);
}
}
开发者ID:hbfelizzola,项目名称:RetroArch,代码行数:44,代码来源:command_event.c
示例8: driver_camera_poll
/**
* driver_camera_poll:
*
* Call camera driver's poll function.
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
*
* Returns: true (1) if successful, otherwise false (0).
**/
void driver_camera_poll(void)
{
driver_t *driver = driver_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (driver->camera && driver->camera->poll && driver->camera_data)
driver->camera->poll(driver->camera_data,
system->camera_callback.frame_raw_framebuffer,
system->camera_callback.frame_opengl_texture);
}
开发者ID:xurayg,项目名称:RetroArch,代码行数:18,代码来源:camera_driver.c
示例9: event_init_controllers
/**
* event_init_controllers:
*
* Initialize libretro controllers.
**/
static void event_init_controllers(void)
{
unsigned i;
settings_t *settings = config_get_ptr();
rarch_system_info_t *info = rarch_system_info_get_ptr();
for (i = 0; i < MAX_USERS; i++)
{
const char *ident = NULL;
const struct retro_controller_description *desc = NULL;
unsigned device = settings->input.libretro_device[i];
if (i < info->num_ports)
desc = libretro_find_controller_description(
&info->ports[i], device);
if (desc)
ident = desc->desc;
if (!ident)
{
/* If we're trying to connect a completely unknown device,
* revert back to JOYPAD. */
if (device != RETRO_DEVICE_JOYPAD && device != RETRO_DEVICE_NONE)
{
/* Do not fix settings->input.libretro_device[i],
* because any use of dummy core will reset this,
* which is not a good idea. */
RARCH_WARN("Input device ID %u is unknown to this libretro implementation. Using RETRO_DEVICE_JOYPAD.\n", device);
device = RETRO_DEVICE_JOYPAD;
}
ident = "Joypad";
}
switch (device)
{
case RETRO_DEVICE_NONE:
RARCH_LOG("Disconnecting device from port %u.\n", i + 1);
pretro_set_controller_port_device(i, device);
break;
case RETRO_DEVICE_JOYPAD:
break;
default:
/* Some cores do not properly range check port argument.
* This is broken behavior of course, but avoid breaking
* cores needlessly. */
RARCH_LOG("Connecting %s (ID: %u) to port %u.\n", ident,
device, i + 1);
pretro_set_controller_port_device(i, device);
break;
}
}
}
开发者ID:hbfelizzola,项目名称:RetroArch,代码行数:59,代码来源:command_event.c
示例10: menu_driver_toggle
static void menu_driver_toggle(bool latch)
{
const menu_ctx_driver_t *menu_driver = menu_ctx_driver_get_ptr();
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (menu_driver->toggle)
menu_driver->toggle(latch);
if (latch)
menu_driver_ctl(RARCH_MENU_CTL_SET_ALIVE, NULL);
else
menu_driver_ctl(RARCH_MENU_CTL_UNSET_ALIVE, NULL);
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
{
menu_entries_set_refresh(false);
/* Menu should always run with vsync on. */
event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
/* Stop all rumbling before entering the menu. */
event_command(EVENT_CMD_RUMBLE_STOP);
if (settings->menu.pause_libretro)
event_command(EVENT_CMD_AUDIO_STOP);
/* Override keyboard callback to redirect to menu instead.
* We'll use this later for something ...
* FIXME: This should probably be moved to menu_common somehow. */
if (global)
{
global->frontend_key_event = system->key_event;
system->key_event = menu_input_key_event;
runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME_LAST, NULL);
}
}
else
{
if (!runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL))
driver_set_nonblock_state();
if (settings && settings->menu.pause_libretro)
event_command(EVENT_CMD_AUDIO_START);
/* Prevent stray input from going to libretro core */
input_driver_ctl(RARCH_INPUT_CTL_SET_FLUSHING_INPUT, NULL);
/* Restore libretro keyboard callback. */
if (global)
system->key_event = global->frontend_key_event;
}
}
开发者ID:Ced2911,项目名称:RetroArch,代码行数:54,代码来源:menu_driver.c
示例11: playlist_association_left
static int playlist_association_left(unsigned type, const char *label,
bool wraparound)
{
unsigned idx = type - MENU_SETTINGS_PLAYLIST_ASSOCIATION_START;
rarch_system_info_t *system = rarch_system_info_get_ptr();
(void)idx;
(void)system;
return 0;
}
开发者ID:Arche-san,项目名称:RetroArch,代码行数:11,代码来源:menu_cbs_left.c
示例12: core_setting_left
static int core_setting_left(unsigned type, const char *label,
bool wraparound)
{
unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START;
rarch_system_info_t *system = rarch_system_info_get_ptr();
(void)label;
core_option_prev(system->core_options, idx);
return 0;
}
开发者ID:brianblakely,项目名称:RetroArch,代码行数:12,代码来源:menu_cbs_left.c
示例13: qnx_handle_navigator_event
static void qnx_handle_navigator_event(
qnx_input_t *qnx, bps_event_t *event)
{
int rc;
navigator_window_state_t state;
bps_event_t *event_pause = NULL;
rarch_system_info_t *system = rarch_system_info_get_ptr();
(void)rc;
switch (bps_event_get_code(event))
{
case NAVIGATOR_SWIPE_DOWN:
qnx->lifecycle_state ^= (UINT64_C(1) << RARCH_MENU_TOGGLE);
break;
case NAVIGATOR_EXIT:
/* Catch this in thumbnail loop. */
break;
case NAVIGATOR_WINDOW_STATE:
state = navigator_event_get_window_state(event);
switch(state)
{
case NAVIGATOR_WINDOW_THUMBNAIL:
for(;;)
{
/* Block until we get a resume or exit event. */
rc = bps_get_event(&event_pause, -1);
if(bps_event_get_code(event_pause) == NAVIGATOR_WINDOW_STATE)
{
state = navigator_event_get_window_state(event_pause);
if(state == NAVIGATOR_WINDOW_FULLSCREEN)
break;
}
else if (bps_event_get_code(event_pause) == NAVIGATOR_EXIT)
{
system->shutdown = true;
break;
}
}
break;
case NAVIGATOR_WINDOW_FULLSCREEN:
break;
case NAVIGATOR_WINDOW_INVISIBLE:
break;
}
break;
default:
break;
}
}
开发者ID:Arche-san,项目名称:RetroArch,代码行数:52,代码来源:qnx_input.c
示例14: action_start_core_setting
static int action_start_core_setting(unsigned type,
const char *label)
{
unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START;
rarch_system_info_t *system = rarch_system_info_get_ptr();
(void)label;
if (system)
core_option_set_default(system->core_options, idx);
return 0;
}
开发者ID:brianblakely,项目名称:RetroArch,代码行数:13,代码来源:menu_cbs_start.c
示例15: input_keyboard_event
/**
* input_keyboard_event:
* @down : Keycode was pressed down?
* @code : Keycode.
* @character : Character inputted.
* @mod : TODO/FIXME: ???
*
* Keyboard event utils. Called by drivers when keyboard events are fired.
* This interfaces with the global system driver struct and libretro callbacks.
**/
void input_keyboard_event(bool down, unsigned code,
uint32_t character, uint16_t mod, unsigned device)
{
static bool deferred_wait_keys;
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (deferred_wait_keys)
{
if (down)
return;
input_keyboard_wait_keys_cancel();
deferred_wait_keys = false;
}
else if (g_keyboard_press_cb)
{
if (!down)
return;
if (code == RETROK_UNKNOWN)
return;
if (g_keyboard_press_cb(g_keyboard_press_data, code))
return;
deferred_wait_keys = true;
}
else if (g_keyboard_line)
{
if (!down)
return;
switch (device)
{
case RETRO_DEVICE_POINTER:
if (!input_keyboard_line_event(g_keyboard_line, (code != 0x12d) ? (char)code : character))
return;
break;
default:
if (!input_keyboard_line_event(g_keyboard_line, character))
return;
break;
}
/* Line is complete, can free it now. */
input_keyboard_line_free(g_keyboard_line);
g_keyboard_line = NULL;
/* Unblock all hotkeys. */
input_driver_keyboard_mapping_set_block(false);
}
else if (system->key_event)
system->key_event(down, code, character, mod);
}
开发者ID:Ced2911,项目名称:RetroArch,代码行数:61,代码来源:input_keyboard.c
示例16: rarch_game_specific_options
/**
* rarch_game_specific_options:
* @cmd : Output variable with path to core options file.
*
* Environment callback function implementation.
*
* Returns: true (1) if a game specific core options path has been found,
* otherwise false (0).
**/
static bool rarch_game_specific_options(char **output)
{
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
const char *core_name = NULL;
const char *game_name = NULL;
config_file_t *option_file = NULL;
char game_path[PATH_MAX_LENGTH] = {0};
char config_directory[PATH_MAX_LENGTH] = {0};
core_name = system ? system->info.library_name : NULL;
game_name = global ? path_basename(global->name.base) : NULL;
if (!core_name || !game_name)
return false;
if (core_name[0] == '\0' || game_name[0] == '\0')
return false;
RARCH_LOG("Per-Game Options: core name: %s\n", core_name);
RARCH_LOG("Per-Game Options: game name: %s\n", game_name);
/* Config directory: config_directory.
* Try config directory setting first,
* fallback to the location of the current configuration file. */
if (settings->menu_config_directory[0] != '\0')
strlcpy(config_directory, settings->menu_config_directory, PATH_MAX_LENGTH);
else if (global->path.config[0] != '\0')
fill_pathname_basedir(config_directory, global->path.config, PATH_MAX_LENGTH);
else
{
RARCH_WARN("Per-Game Options: no config directory set\n");
return false;
}
/* Concatenate strings into full paths for game_path */
fill_pathname_join(game_path, config_directory, core_name, PATH_MAX_LENGTH);
fill_pathname_join(game_path, game_path, game_name, PATH_MAX_LENGTH);
strlcat(game_path, ".opt", PATH_MAX_LENGTH);
option_file = config_file_new(game_path);
if (!option_file)
return false;
config_file_free(option_file);
RARCH_LOG("Per-Game Options: game-specific core options found at %s\n", game_path);
*output = strdup(game_path);
return true;
}
开发者ID:flaviommedeiros,项目名称:cprojects,代码行数:60,代码来源:dynamic-5.c
示例17: menu_driver_toggle
void menu_driver_toggle(bool latch)
{
driver_t *driver = driver_get_ptr();
const menu_ctx_driver_t *menu_driver = menu_ctx_driver_get_ptr();
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (menu_driver->toggle)
menu_driver->toggle(latch);
menu_alive = latch;
if (menu_alive == true)
{
menu_entries_set_refresh(false);
/* Menu should always run with vsync on. */
event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
/* Stop all rumbling before entering the menu. */
event_command(EVENT_CMD_RUMBLE_STOP);
if (settings->menu.pause_libretro)
event_command(EVENT_CMD_AUDIO_STOP);
/* Override keyboard callback to redirect to menu instead.
* We'll use this later for something ...
* FIXME: This should probably be moved to menu_common somehow. */
if (global)
{
global->frontend_key_event = system->key_event;
system->key_event = menu_input_key_event;
system->frame_time_last = 0;
}
}
else
{
driver_set_nonblock_state(driver->nonblock_state);
if (settings && settings->menu.pause_libretro)
event_command(EVENT_CMD_AUDIO_START);
/* Prevent stray input from going to libretro core */
driver->flushing_input = true;
/* Restore libretro keyboard callback. */
if (global)
system->key_event = global->frontend_key_event;
}
}
开发者ID:ssangkong,项目名称:RetroArch,代码行数:50,代码来源:menu_driver.c
示例18: uninit_location
void uninit_location(void)
{
driver_t *driver = driver_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (driver->location_data && driver->location)
{
if (system->location_callback.deinitialized)
system->location_callback.deinitialized();
if (driver->location->free)
driver->location->free(driver->location_data);
}
driver->location_data = NULL;
}
开发者ID:xurayg,项目名称:RetroArch,代码行数:15,代码来源:location_driver.c
示例19: uninit_camera
void uninit_camera(void)
{
driver_t *driver = driver_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (driver->camera_data && driver->camera)
{
if (system->camera_callback.deinitialized)
system->camera_callback.deinitialized();
if (driver->camera->free)
driver->camera->free(driver->camera_data);
}
driver->camera_data = NULL;
}
开发者ID:xurayg,项目名称:RetroArch,代码行数:15,代码来源:camera_driver.c
示例20: driver_adjust_system_rates
static void driver_adjust_system_rates(void)
{
rarch_system_info_t *system = rarch_system_info_get_ptr();
driver_t *driver = driver_get_ptr();
audio_monitor_adjust_system_rates();
video_monitor_adjust_system_rates();
if (!driver->video_data)
return;
if (system->force_nonblock)
event_command(EVENT_CMD_VIDEO_SET_NONBLOCKING_STATE);
else
driver_set_nonblock_state(driver->nonblock_state);
}
开发者ID:brianblakely,项目名称:RetroArch,代码行数:16,代码来源:driver.c
注:本文中的rarch_system_info_get_ptr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论