本文整理汇总了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函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}