mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Start cleaning up the rather messy manual assignment
This commit is contained in:
parent
72a9d77638
commit
db624a7c99
@ -85,8 +85,7 @@ static void core_info_list_resolve_all_extensions(
|
||||
|
||||
copied = strlcat(core_info_list->all_ext,
|
||||
core_info_list->list[i].supported_extensions, all_ext_len);
|
||||
core_info_list->all_ext[copied] = '|';
|
||||
core_info_list->all_ext[copied+1] = '\0';
|
||||
string_add_alpha_fast(core_info_list->all_ext, '|', copied);
|
||||
}
|
||||
#ifdef HAVE_7ZIP
|
||||
strlcat(core_info_list->all_ext, "7z|", all_ext_len);
|
||||
|
@ -68,22 +68,9 @@ static std::string build_stage_source(
|
||||
{
|
||||
char expected[128];
|
||||
|
||||
expected[0] = '#';
|
||||
expected[1] = 'p';
|
||||
expected[2] = 'r';
|
||||
expected[3] = 'a';
|
||||
expected[4] = 'g';
|
||||
expected[5] = 'm';
|
||||
expected[6] = 'a';
|
||||
expected[7] = ' ';
|
||||
expected[8] = 's';
|
||||
expected[9] = 't';
|
||||
expected[10] = 'a';
|
||||
expected[11] = 'g';
|
||||
expected[12] = 'e';
|
||||
expected[13] = ' ';
|
||||
expected[14] = '\0';
|
||||
expected[0] = '\0';
|
||||
|
||||
string_add_alpha_14_fast(expected, "#pragma stage ", 0);
|
||||
strlcat(expected, stage, sizeof(expected));
|
||||
|
||||
active = strcmp(expected, line) == 0;
|
||||
|
@ -576,51 +576,16 @@ static void gl_glsl_find_uniforms_frame(glsl_shader_data_t *glsl,
|
||||
texture[0] = texture_size[0] = input_size[0] = tex_coord[0] = '\0';
|
||||
|
||||
copied = strlcpy(texture, base, sizeof(texture));
|
||||
texture[copied ] = 'T';
|
||||
texture[copied+1] = 'e';
|
||||
texture[copied+2] = 'x';
|
||||
texture[copied+3] = 't';
|
||||
texture[copied+4] = 'u';
|
||||
texture[copied+5] = 'r';
|
||||
texture[copied+6] = 'e';
|
||||
texture[copied+7] = '\0';
|
||||
string_add_alpha_7_fast(texture, "Texture", copied);
|
||||
|
||||
copied = strlcpy(texture_size, base, sizeof(texture_size));
|
||||
texture_size[copied ] = 'T';
|
||||
texture_size[copied+1] = 'e';
|
||||
texture_size[copied+2] = 'x';
|
||||
texture_size[copied+3] = 't';
|
||||
texture_size[copied+4] = 'u';
|
||||
texture_size[copied+5] = 'r';
|
||||
texture_size[copied+6] = 'e';
|
||||
texture_size[copied+7] = 'S';
|
||||
texture_size[copied+8] = 'i';
|
||||
texture_size[copied+9] = 'z';
|
||||
texture_size[copied+10] = 'e';
|
||||
texture_size[copied+11] = '\0';
|
||||
string_add_alpha_11_fast(texture_size, "TextureSize", copied);
|
||||
|
||||
copied = strlcpy(input_size, base, sizeof(input_size));
|
||||
input_size [copied ] = 'I';
|
||||
input_size [copied+1] = 'n';
|
||||
input_size [copied+2] = 'p';
|
||||
input_size [copied+3] = 'u';
|
||||
input_size [copied+4] = 't';
|
||||
input_size [copied+5] = 'S';
|
||||
input_size [copied+6] = 'i';
|
||||
input_size [copied+7] = 'z';
|
||||
input_size [copied+8 ] = 'e';
|
||||
input_size [copied+9 ] = '\0';
|
||||
string_add_alpha_9_fast(input_size, "InputSize", copied);
|
||||
|
||||
copied = strlcpy(tex_coord, base, sizeof(tex_coord));
|
||||
tex_coord [copied ] = 'T';
|
||||
tex_coord [copied+1] = 'e';
|
||||
tex_coord [copied+2] = 'x';
|
||||
tex_coord [copied+3] = 'C';
|
||||
tex_coord [copied+4] = 'o';
|
||||
tex_coord [copied+5] = 'o';
|
||||
tex_coord [copied+6] = 'r';
|
||||
tex_coord [copied+7] = 'd';
|
||||
tex_coord [copied+8 ] = '\0';
|
||||
string_add_alpha_8_fast(tex_coord, "TexCoord", copied);
|
||||
|
||||
if (frame->texture < 0)
|
||||
frame->texture = gl_glsl_get_uniform(glsl, prog, texture);
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <compat/strl.h>
|
||||
#include "../../verbosity.h"
|
||||
|
||||
using namespace std;
|
||||
@ -723,8 +724,13 @@ bool slang_reflect(
|
||||
}
|
||||
}
|
||||
|
||||
RARCH_LOG("[slang]:\n");
|
||||
RARCH_LOG("[slang]: Parameters:\n");
|
||||
{
|
||||
char buf[64];
|
||||
buf[0] = '\0';
|
||||
snprintf(buf, sizeof(buf),
|
||||
"[slang]:\n%s [slang]: Parameters:\n", FILE_PATH_LOG_INFO);
|
||||
RARCH_LOG(buf);
|
||||
}
|
||||
|
||||
for (i = 0; i < reflection->semantic_float_parameters.size(); i++)
|
||||
{
|
||||
|
@ -355,19 +355,11 @@ static bool video_shader_parse_textures(config_file_t *conf,
|
||||
fill_pathname_resolve_relative(shader->lut[shader->luts].path,
|
||||
conf->path, tmp_path, sizeof(shader->lut[shader->luts].path));
|
||||
|
||||
|
||||
strlcpy(shader->lut[shader->luts].id, id,
|
||||
sizeof(shader->lut[shader->luts].id));
|
||||
|
||||
written = strlcpy(id_filter, id, sizeof(id_filter));
|
||||
id_filter[written ] = '_';
|
||||
id_filter[written+1] = 'l';
|
||||
id_filter[written+2] = 'i';
|
||||
id_filter[written+3] = 'n';
|
||||
id_filter[written+4] = 'e';
|
||||
id_filter[written+5] = 'a';
|
||||
id_filter[written+6] = 'r';
|
||||
id_filter[written+7] = '\0';
|
||||
string_add_alpha_7_fast(id_filter, "_linear", written);
|
||||
if (config_get_bool(conf, id_filter, &smooth))
|
||||
shader->lut[shader->luts].filter = smooth ?
|
||||
RARCH_FILTER_LINEAR : RARCH_FILTER_NEAREST;
|
||||
@ -375,29 +367,12 @@ static bool video_shader_parse_textures(config_file_t *conf,
|
||||
shader->lut[shader->luts].filter = RARCH_FILTER_UNSPEC;
|
||||
|
||||
written = strlcpy(id_wrap, id, sizeof(id_wrap));
|
||||
id_wrap [written ] = '_';
|
||||
id_wrap [written+1] = 'w';
|
||||
id_wrap [written+2] = 'r';
|
||||
id_wrap [written+3] = 'a';
|
||||
id_wrap [written+4] = 'p';
|
||||
id_wrap [written+5] = '_';
|
||||
id_wrap [written+6] = 'm';
|
||||
id_wrap [written+7] = 'o';
|
||||
id_wrap [written+8] = 'd';
|
||||
id_wrap [written+9] = 'e';
|
||||
id_wrap [written+10] = '\0';
|
||||
string_add_alpha_10_fast(id_wrap, "_wrap_mode", written);
|
||||
if (config_get_array(conf, id_wrap, wrap_mode, sizeof(wrap_mode)))
|
||||
shader->lut[shader->luts].wrap = wrap_str_to_mode(wrap_mode);
|
||||
|
||||
written = strlcpy(id_mipmap, id, sizeof(id_mipmap));
|
||||
id_mipmap[written ] = '_';
|
||||
id_mipmap[written+1] = 'm';
|
||||
id_mipmap[written+2] = 'i';
|
||||
id_mipmap[written+3] = 'p';
|
||||
id_mipmap[written+4] = 'm';
|
||||
id_mipmap[written+5] = 'a';
|
||||
id_mipmap[written+6] = 'p';
|
||||
id_mipmap[written+7] = '\0';
|
||||
string_add_alpha_7_fast(id_mipmap, "_mipmap", written);
|
||||
if (config_get_bool(conf, id_mipmap, &mipmap))
|
||||
shader->lut[shader->luts].mipmap = mipmap;
|
||||
else
|
||||
@ -1135,15 +1110,7 @@ void video_shader_write_conf_preset(config_file_t *conf,
|
||||
char key[128];
|
||||
key[0] = '\0';
|
||||
written = strlcpy(key, shader->lut[i].id, sizeof(key));
|
||||
|
||||
key[written ] = '_';
|
||||
key[written+1] = 'l';
|
||||
key[written+2] = 'i';
|
||||
key[written+3] = 'n';
|
||||
key[written+4] = 'e';
|
||||
key[written+5] = 'a';
|
||||
key[written+6] = 'r';
|
||||
key[written+7] = '\0';
|
||||
string_add_alpha_7_fast(key, "_linear", written);
|
||||
config_set_bool(conf, key,
|
||||
shader->lut[i].filter == RARCH_FILTER_LINEAR);
|
||||
}
|
||||
@ -1153,18 +1120,7 @@ void video_shader_write_conf_preset(config_file_t *conf,
|
||||
char key[128];
|
||||
key[0] = '\0';
|
||||
written = strlcpy(key, shader->lut[i].id, sizeof(key));
|
||||
|
||||
key [written ] = '_';
|
||||
key [written+1] = 'w';
|
||||
key [written+2] = 'r';
|
||||
key [written+3] = 'a';
|
||||
key [written+4] = 'p';
|
||||
key [written+5] = '_';
|
||||
key [written+6] = 'm';
|
||||
key [written+7] = 'o';
|
||||
key [written+8] = 'd';
|
||||
key [written+9] = 'e';
|
||||
key [written+10] = '\0';
|
||||
string_add_alpha_10_fast(key, "_wrap_mode", written);
|
||||
config_set_string(conf, key,
|
||||
wrap_mode_to_str(shader->lut[i].wrap));
|
||||
}
|
||||
@ -1174,15 +1130,7 @@ void video_shader_write_conf_preset(config_file_t *conf,
|
||||
char key[128];
|
||||
key[0] = '\0';
|
||||
written = strlcpy(key, shader->lut[i].id, sizeof(key));
|
||||
|
||||
key [written ] = '_';
|
||||
key [written+1] = 'm';
|
||||
key [written+2] = 'i';
|
||||
key [written+3] = 'p';
|
||||
key [written+4] = 'm';
|
||||
key [written+5] = 'a';
|
||||
key [written+6] = 'p';
|
||||
key [written+7] = '\0';
|
||||
string_add_alpha_7_fast(key, "_mipmap", written);
|
||||
config_set_bool(conf, key,
|
||||
shader->lut[i].mipmap);
|
||||
}
|
||||
|
@ -59,6 +59,70 @@ static INLINE bool string_is_equal(const char *a, const char *b)
|
||||
#define string_add_glob_open(s, size) strlcat((s), "glob('*", (size))
|
||||
#define string_add_glob_close(s, size) strlcat((s), "*')", (size))
|
||||
|
||||
#define string_add_alpha_fast(s, alpha, size) \
|
||||
(s)[(size)] = (alpha); \
|
||||
(s)[(size)+1] = '\0'
|
||||
|
||||
#define string_add_alpha_2_fast(s, str, size) \
|
||||
string_add_alpha_fast(s, str[0], size); \
|
||||
string_add_alpha_fast(s, str[1], size+1)
|
||||
|
||||
#define string_add_alpha_3_fast(s, str, size) \
|
||||
string_add_alpha_2_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[2], size+2)
|
||||
|
||||
#define string_add_alpha_4_fast(s, str, size) \
|
||||
string_add_alpha_3_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[3], size+3)
|
||||
|
||||
#define string_add_alpha_5_fast(s, str, size) \
|
||||
string_add_alpha_4_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[4], size+4)
|
||||
|
||||
#define string_add_alpha_6_fast(s, str, size) \
|
||||
string_add_alpha_5_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[5], size+5)
|
||||
|
||||
#define string_add_alpha_7_fast(s, str, size) \
|
||||
string_add_alpha_6_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[6], size+6)
|
||||
|
||||
#define string_add_alpha_8_fast(s, str, size) \
|
||||
string_add_alpha_7_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[7], size+7)
|
||||
|
||||
#define string_add_alpha_9_fast(s, str, size) \
|
||||
string_add_alpha_8_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[8], size+8)
|
||||
|
||||
#define string_add_alpha_10_fast(s, str, size) \
|
||||
string_add_alpha_9_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[9], size+9)
|
||||
|
||||
#define string_add_alpha_11_fast(s, str, size) \
|
||||
string_add_alpha_10_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[10], size+10)
|
||||
|
||||
#define string_add_alpha_12_fast(s, str, size) \
|
||||
string_add_alpha_11_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[11], size+11)
|
||||
|
||||
#define string_add_alpha_13_fast(s, str, size) \
|
||||
string_add_alpha_12_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[12], size+12)
|
||||
|
||||
#define string_add_alpha_14_fast(s, str, size) \
|
||||
string_add_alpha_13_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[13], size+13)
|
||||
|
||||
#define string_add_alpha_15_fast(s, str, size) \
|
||||
string_add_alpha_14_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[14], size+14)
|
||||
|
||||
#define string_add_alpha_16_fast(s, str, size) \
|
||||
string_add_alpha_15_fast(s, str, size); \
|
||||
string_add_alpha_fast(s, str[15], size+15)
|
||||
|
||||
#define string_add_backslash_fast(s, size) \
|
||||
(s)[(size)] = '/'; \
|
||||
(s)[(size)+1] = '\0'
|
||||
@ -94,15 +158,6 @@ static INLINE bool string_is_equal(const char *a, const char *b)
|
||||
#define string_is_not_equal_fast(a, b, size) (memcmp(a, b, size) != 0)
|
||||
#define string_is_equal_fast(a, b, size) (memcmp(a, b, size) == 0)
|
||||
|
||||
static INLINE void string_add_between_pairs(char *s, const char *str,
|
||||
size_t size)
|
||||
{
|
||||
size_t copied;
|
||||
string_add_pair_open(s, size);
|
||||
copied = strlcat(s, str, size);
|
||||
string_add_pair_close_fast(s, copied);
|
||||
}
|
||||
|
||||
static INLINE bool string_is_equal_case_insensitive(const char *a,
|
||||
const char *b)
|
||||
{
|
||||
|
@ -1155,7 +1155,7 @@ libretro_vfs_implementation_dir *retro_vfs_opendir_impl(
|
||||
if (name[path_len - 1] != '\\')
|
||||
path_buf[copied++] = '\\';
|
||||
|
||||
string_add_star_fast(path_buf, copied);
|
||||
string_add_alpha_fast(path_buf, '*', copied);
|
||||
|
||||
#if defined(LEGACY_WIN32)
|
||||
path_local = utf8_to_local_string_alloc(path_buf);
|
||||
|
@ -4903,8 +4903,13 @@ void netplay_refresh_rooms_menu(file_list_t *list)
|
||||
char country[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
if (*netplay_room_list[i].country)
|
||||
string_add_between_pairs(country, netplay_room_list[i].country,
|
||||
{
|
||||
size_t copied = 0;
|
||||
string_add_alpha_fast(country, '(', copied);
|
||||
copied = strlcat(country, netplay_room_list[i].country,
|
||||
sizeof(country));
|
||||
string_add_alpha_fast(country, ')', copied);
|
||||
}
|
||||
|
||||
/* Uncomment this to debug mismatched room parameters*/
|
||||
#if 0
|
||||
|
@ -65,16 +65,7 @@ static int menu_action_sublabel_file_browser_core(file_list_t *list, unsigned ty
|
||||
|
||||
core_info_get_list(&core_list);
|
||||
|
||||
s[0] = 'L';
|
||||
s[1] = 'i';
|
||||
s[2] = 'c';
|
||||
s[3] = 'e';
|
||||
s[4] = 'n';
|
||||
s[5] = 's';
|
||||
s[6] = 'e';
|
||||
s[7] = ':';
|
||||
s[8] = ' ';
|
||||
s[9] = '\0';
|
||||
string_add_alpha_9_fast(s, "License: ", 0);
|
||||
|
||||
if (core_list)
|
||||
{
|
||||
@ -98,10 +89,7 @@ static int menu_action_sublabel_file_browser_core(file_list_t *list, unsigned ty
|
||||
}
|
||||
}
|
||||
|
||||
s[9] = 'N';
|
||||
s[10] = '/';
|
||||
s[11] = 'A';
|
||||
s[12] = '\0';
|
||||
string_add_alpha_3_fast(s, "N/A", 9);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1034,7 +1022,7 @@ static int action_bind_sublabel_playlist_entry(
|
||||
|
||||
/* Add core name */
|
||||
written = strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_CORE), len);
|
||||
string_add_space_fast(s, written);
|
||||
string_add_alpha_fast(s, ' ', written);
|
||||
written = strlcat(s, entry->core_name, len);
|
||||
|
||||
/* Get runtime info *if* required runtime log is enabled
|
||||
|
@ -305,8 +305,7 @@ static int action_get_title_generic(char *s, size_t len, const char *path,
|
||||
|
||||
if (!string_is_empty(elem0_path))
|
||||
{
|
||||
s[written ] = '-';
|
||||
string_add_space_fast(s, written+1);
|
||||
string_add_alpha_2_fast(s, "- ", written);
|
||||
strlcat(s, path_basename(elem0_path), len);
|
||||
}
|
||||
}
|
||||
@ -398,9 +397,7 @@ static int action_get_title_group_settings(const char *path, const char *label,
|
||||
|
||||
if (!string_is_empty(elem1))
|
||||
{
|
||||
string_add_space_fast(s, copied);
|
||||
s[copied+1] = '-';
|
||||
string_add_space_fast(s, copied+2);
|
||||
string_add_alpha_3_fast(s, " - ", copied);
|
||||
strlcat(s, elem1, len);
|
||||
}
|
||||
}
|
||||
|
@ -1642,10 +1642,9 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
if (materialui_get_core_title(title_msg, sizeof(title_msg)) == 0)
|
||||
{
|
||||
string_add_space_fast(menu_title, copied);
|
||||
string_add_pair_open_fast(menu_title, copied+1);
|
||||
string_add_alpha_2_fast(menu_title, " (", copied);
|
||||
copied = strlcat(menu_title, title_msg, sizeof(menu_title));
|
||||
string_add_pair_close_fast(menu_title, copied);
|
||||
string_add_alpha_fast(menu_title, ')', copied);
|
||||
}
|
||||
|
||||
if (use_smooth_ticker)
|
||||
|
@ -584,11 +584,7 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||
#endif
|
||||
copied = strlcpy(filename, OZONE_TEXTURES_FILES[i], sizeof(filename));
|
||||
|
||||
string_add_dot_fast(filename, copied);
|
||||
filename[copied+1] = 'p';
|
||||
filename[copied+2] = 'n';
|
||||
filename[copied+3] = 'g';
|
||||
filename[copied+4] = '\0';
|
||||
string_add_alpha_4_fast(filename, ".png", copied);
|
||||
|
||||
#if 0
|
||||
if (i == OZONE_TEXTURE_DISCORD_OWN_AVATAR && discord_avatar_is_ready())
|
||||
@ -622,11 +618,7 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||
filename[0] = '\0';
|
||||
copied = strlcpy(filename,
|
||||
OZONE_TAB_TEXTURES_FILES[i], sizeof(filename));
|
||||
string_add_dot_fast(filename, copied);
|
||||
filename[copied+1] = 'p';
|
||||
filename[copied+2] = 'n';
|
||||
filename[copied+3] = 'g';
|
||||
filename[copied+4] = '\0';
|
||||
string_add_alpha_4_fast(filename, ".png", copied);
|
||||
|
||||
if (!menu_display_reset_textures_list(filename, ozone->tab_path, &ozone->tab_textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
{
|
||||
|
@ -1404,9 +1404,7 @@ bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker)
|
||||
{
|
||||
size_t copied = utf8cpy(ticker->s,
|
||||
PATH_MAX_LENGTH, ticker->str, ticker->len - 3);
|
||||
string_add_dot_fast(ticker->s, copied);
|
||||
string_add_dot_fast(ticker->s, copied+1);
|
||||
string_add_dot_fast(ticker->s, copied+2);
|
||||
string_add_alpha_3_fast(ticker->s, "...", copied);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1516,9 +1514,7 @@ bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
|
||||
/* Copy string segment + add suffix */
|
||||
copied = utf8cpy(ticker->dst_str, ticker->dst_str_len, ticker->src_str, num_chars);
|
||||
string_add_dot_fast(ticker->dst_str, copied);
|
||||
string_add_dot_fast(ticker->dst_str, copied+1);
|
||||
string_add_dot_fast(ticker->dst_str, copied+2);
|
||||
string_add_alpha_3_fast(ticker->dst_str, "...", copied);
|
||||
|
||||
if (ticker->dst_str_width)
|
||||
*ticker->dst_str_width = (num_chars * glyph_width) + suffix_width;
|
||||
@ -1719,9 +1715,7 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
|
||||
/* Copy string segment + add suffix */
|
||||
copied = utf8cpy(ticker->dst_str, ticker->dst_str_len, ticker->src_str, num_chars);
|
||||
string_add_dot_fast(ticker->dst_str, copied);
|
||||
string_add_dot_fast(ticker->dst_str, copied+1);
|
||||
string_add_dot_fast(ticker->dst_str, copied+2);
|
||||
string_add_alpha_3_fast(ticker->dst_str, "...", copied);
|
||||
|
||||
if (ticker->dst_str_width)
|
||||
*ticker->dst_str_width = current_width + (3 * period_width);
|
||||
|
@ -3009,9 +3009,7 @@ static unsigned menu_displaylist_parse_content_information(
|
||||
tmp[0] = '\0';
|
||||
|
||||
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_LABEL), sizeof(tmp));
|
||||
tmp[n ] = ':';
|
||||
tmp[n+1] = ' ';
|
||||
tmp[n+2] = '\0';
|
||||
string_add_alpha_2_fast(tmp, ": ", n);
|
||||
n = strlcat(tmp, content_label, sizeof(tmp));
|
||||
tmp[n ] = '\0';
|
||||
|
||||
@ -3033,9 +3031,7 @@ static unsigned menu_displaylist_parse_content_information(
|
||||
tmp[0] = '\0';
|
||||
|
||||
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_PATH), sizeof(tmp));
|
||||
tmp[n ] = ':';
|
||||
tmp[n+1] = ' ';
|
||||
tmp[n+2] = '\0';
|
||||
string_add_alpha_2_fast(tmp, ": ", n);
|
||||
n = strlcat(tmp, content_path, sizeof(tmp));
|
||||
tmp[n ] = '\0';
|
||||
|
||||
@ -3058,9 +3054,7 @@ static unsigned menu_displaylist_parse_content_information(
|
||||
tmp[0] = '\0';
|
||||
|
||||
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CORE_NAME), sizeof(tmp));
|
||||
tmp[n ] = ':';
|
||||
tmp[n+1] = ' ';
|
||||
tmp[n+2] = '\0';
|
||||
string_add_alpha_2_fast(tmp, ": ", n);
|
||||
n = strlcat(tmp, core_name, sizeof(tmp));
|
||||
tmp[n ] = '\0';
|
||||
|
||||
@ -3095,9 +3089,7 @@ static unsigned menu_displaylist_parse_content_information(
|
||||
tmp[0] = '\0';
|
||||
|
||||
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_DATABASE), sizeof(tmp));
|
||||
tmp[n ] = ':';
|
||||
tmp[n+1] = ' ';
|
||||
tmp[n+2] = '\0';
|
||||
string_add_alpha_2_fast(tmp, ": ", n);
|
||||
n = strlcat(tmp, db_name_no_ext, sizeof(tmp));
|
||||
tmp[n ] = '\0';
|
||||
|
||||
|
@ -1179,11 +1179,9 @@ int menu_entries_get_core_title(char *s, size_t len)
|
||||
#endif
|
||||
size_t copied = strlcpy(s, PACKAGE_VERSION, len);
|
||||
copied = strlcat(s, extra_version, len);
|
||||
string_add_space_fast(s, copied);
|
||||
s[copied+1] = '-';
|
||||
string_add_space_fast(s, copied+2);
|
||||
string_add_alpha_3_fast(s, " - ", copied);
|
||||
copied = strlcat(s, core_name, len);
|
||||
string_add_space_fast(s, copied);
|
||||
string_add_alpha_fast(s, ' ', copied);
|
||||
copied = strlcat(s, core_version, len);
|
||||
|
||||
return 0;
|
||||
@ -3911,7 +3909,7 @@ void menu_subsystem_populate(const struct retro_subsystem_info* subsystem, menu_
|
||||
path_basename(content_get_subsystem_rom(j)), sizeof(rom_buff));
|
||||
if (j != content_get_subsystem_rom_id() - 1)
|
||||
{
|
||||
string_add_vertical_bar_fast(rom_buff, copied);
|
||||
string_add_alpha_fast(rom_buff, '|', copied);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2247,13 +2247,7 @@ static void menu_widgets_get_badge_texture(menu_texture_item *tex, const char *b
|
||||
}
|
||||
|
||||
written = strlcpy(badge_file, badge, sizeof(badge_file));
|
||||
|
||||
badge_file[written] = '.';
|
||||
badge_file[written+1] = 'p';
|
||||
badge_file[written+2] = 'n';
|
||||
badge_file[written+3] = 'g';
|
||||
badge_file[written+4] = '\0';
|
||||
|
||||
string_add_alpha_4_fast(badge_file, ".png", written);
|
||||
fill_pathname_application_special(fullpath,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
|
||||
|
305
retroarch.c
305
retroarch.c
@ -4148,30 +4148,24 @@ static bool command_event_save_config(
|
||||
|
||||
if (path_exists && config_save_file(config_path))
|
||||
{
|
||||
size_t written;
|
||||
|
||||
snprintf(s, len, "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||
config_path);
|
||||
|
||||
written = strlcpy(log, "[config] ", sizeof(log));
|
||||
log[written] = '\0';
|
||||
written = strlcat(log, s, sizeof(log));
|
||||
string_add_alpha_9_fast(log, "[config] ", 0);
|
||||
strlcat(log, s, sizeof(log));
|
||||
RARCH_LOG("%s\n", log);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!string_is_empty(str))
|
||||
{
|
||||
size_t written;
|
||||
|
||||
snprintf(s, len, "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
||||
str);
|
||||
|
||||
written = strlcpy(log, "[config] ", sizeof(log));
|
||||
log[written] = '\0';
|
||||
written = strlcat(log, s, sizeof(log));
|
||||
string_add_alpha_9_fast(log, "[config] ", 0);
|
||||
strlcat(log, s, sizeof(log));
|
||||
RARCH_ERR("%s\n", log);
|
||||
}
|
||||
|
||||
@ -4233,7 +4227,8 @@ static bool command_event_save_core_config(void)
|
||||
/* In case of collision, find an alternative name. */
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
char tmp[64] = {0};
|
||||
size_t copied = 0;
|
||||
char tmp[64] = {0};
|
||||
|
||||
fill_pathname_base_noext(
|
||||
config_name,
|
||||
@ -4244,16 +4239,9 @@ static bool command_event_save_core_config(void)
|
||||
config_size);
|
||||
|
||||
if (i)
|
||||
snprintf(tmp, sizeof(tmp), "-%u%s",
|
||||
i, ".cfg");
|
||||
else
|
||||
{
|
||||
tmp[0] = '.';
|
||||
tmp[1] = 'c';
|
||||
tmp[2] = 'f';
|
||||
tmp[3] = 'g';
|
||||
tmp[4] = '\0';
|
||||
}
|
||||
copied = snprintf(tmp, sizeof(tmp), "-%u", i);
|
||||
|
||||
string_add_alpha_4_fast(tmp, ".cfg", copied);
|
||||
|
||||
strlcat(config_path, tmp, config_size);
|
||||
if (!path_is_valid(config_path))
|
||||
@ -6962,7 +6950,7 @@ static bool environ_cb_get_system_info(unsigned cmd, void *data)
|
||||
|
||||
subsystem_current_count = 0;
|
||||
|
||||
RARCH_LOG("Environ SET_SUBSYSTEM_INFO.\n");
|
||||
RARCH_LOG("[Environ]: SET_SUBSYSTEM_INFO.\n");
|
||||
|
||||
for (i = 0; info[i].ident; i++)
|
||||
{
|
||||
@ -7361,13 +7349,13 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
case RETRO_ENVIRONMENT_GET_OVERSCAN:
|
||||
*(bool*)data = !settings->bools.video_crop_overscan;
|
||||
RARCH_LOG("Environ GET_OVERSCAN: %u\n",
|
||||
RARCH_LOG("[Environ]: GET_OVERSCAN: %u\n",
|
||||
(unsigned)!settings->bools.video_crop_overscan);
|
||||
break;
|
||||
|
||||
case RETRO_ENVIRONMENT_GET_CAN_DUPE:
|
||||
*(bool*)data = true;
|
||||
RARCH_LOG("Environ GET_CAN_DUPE: true\n");
|
||||
RARCH_LOG("[Environ]: GET_CAN_DUPE: true\n");
|
||||
break;
|
||||
|
||||
case RETRO_ENVIRONMENT_GET_VARIABLE:
|
||||
@ -7382,7 +7370,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
if (!runloop_core_options)
|
||||
{
|
||||
RARCH_LOG("Environ GET_VARIABLE %s: not implemented.\n",
|
||||
RARCH_LOG("[Environ]: GET_VARIABLE %s: not implemented.\n",
|
||||
var->key);
|
||||
return true;
|
||||
}
|
||||
@ -7414,7 +7402,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
char s[128];
|
||||
s[0] = '\0';
|
||||
|
||||
snprintf(s, sizeof(s), "Environ GET_VARIABLE %s:\n\t%s\n", var->key, var->value ? var->value :
|
||||
snprintf(s, sizeof(s), "[Environ]: GET_VARIABLE %s:\n\t%s\n", var->key, var->value ? var->value :
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE));
|
||||
RARCH_LOG(s);
|
||||
}
|
||||
@ -7431,7 +7419,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
/* SET_VARIABLES: Legacy path */
|
||||
case RETRO_ENVIRONMENT_SET_VARIABLES:
|
||||
RARCH_LOG("Environ SET_VARIABLES.\n");
|
||||
RARCH_LOG("[Environ]: SET_VARIABLES.\n");
|
||||
|
||||
rarch_ctl(RARCH_CTL_CORE_OPTIONS_DEINIT, NULL);
|
||||
rarch_ctl(RARCH_CTL_CORE_VARIABLES_INIT, data);
|
||||
@ -7439,7 +7427,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
break;
|
||||
|
||||
case RETRO_ENVIRONMENT_SET_CORE_OPTIONS:
|
||||
RARCH_LOG("Environ SET_CORE_OPTIONS.\n");
|
||||
RARCH_LOG("[Environ]: SET_CORE_OPTIONS.\n");
|
||||
|
||||
rarch_ctl(RARCH_CTL_CORE_OPTIONS_DEINIT, NULL);
|
||||
rarch_ctl(RARCH_CTL_CORE_OPTIONS_INIT, data);
|
||||
@ -7447,7 +7435,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
break;
|
||||
|
||||
case RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL:
|
||||
RARCH_LOG("Environ RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL.\n");
|
||||
RARCH_LOG("[Environ]: RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL.\n");
|
||||
|
||||
rarch_ctl(RARCH_CTL_CORE_OPTIONS_DEINIT, NULL);
|
||||
rarch_ctl(RARCH_CTL_CORE_OPTIONS_INTL_INIT, data);
|
||||
@ -7455,7 +7443,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
break;
|
||||
|
||||
case RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY:
|
||||
RARCH_LOG("Environ RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY.\n");
|
||||
RARCH_LOG("[Environ]: RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY.\n");
|
||||
|
||||
rarch_ctl(RARCH_CTL_CORE_OPTIONS_DISPLAY, data);
|
||||
|
||||
@ -7464,7 +7452,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
case RETRO_ENVIRONMENT_SET_MESSAGE:
|
||||
{
|
||||
const struct retro_message *msg = (const struct retro_message*)data;
|
||||
RARCH_LOG("Environ SET_MESSAGE: %s\n", msg->msg);
|
||||
RARCH_LOG("[Environ]: SET_MESSAGE: %s\n", msg->msg);
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
if (menu_widgets_inited)
|
||||
menu_widgets_set_libretro_message(msg->msg, roundf((float)msg->frames / 60.0f * 1000.0f));
|
||||
@ -7477,7 +7465,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
case RETRO_ENVIRONMENT_SET_ROTATION:
|
||||
{
|
||||
unsigned rotation = *(const unsigned*)data;
|
||||
RARCH_LOG("Environ SET_ROTATION: %u\n", rotation);
|
||||
RARCH_LOG("[Environ]: SET_ROTATION: %u\n", rotation);
|
||||
if (!settings->bools.video_allow_rotate)
|
||||
break;
|
||||
|
||||
@ -7490,7 +7478,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
|
||||
case RETRO_ENVIRONMENT_SHUTDOWN:
|
||||
RARCH_LOG("Environ SHUTDOWN.\n");
|
||||
RARCH_LOG("[Environ]: SHUTDOWN.\n");
|
||||
|
||||
/* This case occurs when a core (internally) requests
|
||||
* a shutdown event. Must save runtime log file here,
|
||||
@ -7507,7 +7495,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
if (system)
|
||||
{
|
||||
system->performance_level = *(const unsigned*)data;
|
||||
RARCH_LOG("Environ PERFORMANCE_LEVEL: %u.\n",
|
||||
RARCH_LOG("[Environ]: PERFORMANCE_LEVEL: %u.\n",
|
||||
system->performance_level);
|
||||
}
|
||||
break;
|
||||
@ -7532,13 +7520,13 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
|
||||
*(const char**)data = dir_get_ptr(RARCH_DIR_SYSTEM);
|
||||
RARCH_LOG("Environ SYSTEM_DIRECTORY: \"%s\".\n",
|
||||
RARCH_LOG("[Environ]: SYSTEM_DIRECTORY: \"%s\".\n",
|
||||
dir_get(RARCH_DIR_SYSTEM));
|
||||
}
|
||||
else
|
||||
{
|
||||
*(const char**)data = settings->paths.directory_system;
|
||||
RARCH_LOG("Environ SYSTEM_DIRECTORY: \"%s\".\n",
|
||||
RARCH_LOG("[Environ]: SYSTEM_DIRECTORY: \"%s\".\n",
|
||||
settings->paths.directory_system);
|
||||
}
|
||||
|
||||
@ -7551,7 +7539,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
case RETRO_ENVIRONMENT_GET_USERNAME:
|
||||
*(const char**)data = *settings->paths.username ?
|
||||
settings->paths.username : NULL;
|
||||
RARCH_LOG("Environ GET_USERNAME: \"%s\".\n",
|
||||
RARCH_LOG("[Environ]: GET_USERNAME: \"%s\".\n",
|
||||
settings->paths.username);
|
||||
break;
|
||||
|
||||
@ -7560,7 +7548,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
unsigned user_lang = *msg_hash_get_uint(MSG_HASH_USER_LANGUAGE);
|
||||
*(unsigned *)data = user_lang;
|
||||
RARCH_LOG("Environ GET_LANGUAGE: \"%u\".\n", user_lang);
|
||||
RARCH_LOG("[Environ]: GET_LANGUAGE: \"%u\".\n", user_lang);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
@ -7573,14 +7561,14 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
switch (pix_fmt)
|
||||
{
|
||||
case RETRO_PIXEL_FORMAT_0RGB1555:
|
||||
RARCH_LOG("Environ SET_PIXEL_FORMAT: 0RGB1555.\n");
|
||||
RARCH_LOG("[Environ]: SET_PIXEL_FORMAT: 0RGB1555.\n");
|
||||
break;
|
||||
|
||||
case RETRO_PIXEL_FORMAT_RGB565:
|
||||
RARCH_LOG("Environ SET_PIXEL_FORMAT: RGB565.\n");
|
||||
RARCH_LOG("[Environ]: SET_PIXEL_FORMAT: RGB565.\n");
|
||||
break;
|
||||
case RETRO_PIXEL_FORMAT_XRGB8888:
|
||||
RARCH_LOG("Environ SET_PIXEL_FORMAT: XRGB8888.\n");
|
||||
RARCH_LOG("[Environ]: SET_PIXEL_FORMAT: XRGB8888.\n");
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@ -7671,7 +7659,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
[retro_id] = desc->description;
|
||||
}
|
||||
|
||||
RARCH_LOG("Environ SET_INPUT_DESCRIPTORS:\n");
|
||||
RARCH_LOG("[Environ]: SET_INPUT_DESCRIPTORS:\n");
|
||||
|
||||
{
|
||||
unsigned log_level = settings->uints.frontend_log_level;
|
||||
@ -7707,7 +7695,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
retro_keyboard_event_t *frontend_key_event = &runloop_frontend_key_event;
|
||||
retro_keyboard_event_t *key_event = &runloop_key_event;
|
||||
|
||||
RARCH_LOG("Environ SET_KEYBOARD_CALLBACK.\n");
|
||||
RARCH_LOG("[Environ]: SET_KEYBOARD_CALLBACK.\n");
|
||||
if (key_event)
|
||||
*key_event = info->callback;
|
||||
|
||||
@ -7717,7 +7705,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
|
||||
case RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE:
|
||||
RARCH_LOG("Environ SET_DISK_CONTROL_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: SET_DISK_CONTROL_INTERFACE.\n");
|
||||
if (system)
|
||||
system->disk_control_cb =
|
||||
*(const struct retro_disk_control_callback*)data;
|
||||
@ -7731,7 +7719,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
struct retro_hw_render_callback *hwr =
|
||||
video_driver_get_hw_context_internal();
|
||||
|
||||
RARCH_LOG("Environ SET_HW_RENDER.\n");
|
||||
RARCH_LOG("[Environ]: SET_HW_RENDER.\n");
|
||||
|
||||
if (!dynamic_request_hw_context(
|
||||
cb->context_type, cb->version_minor, cb->version_major))
|
||||
@ -7764,7 +7752,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
case RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME:
|
||||
{
|
||||
bool state = *(const bool*)data;
|
||||
RARCH_LOG("Environ SET_SUPPORT_NO_GAME: %s.\n", state ? "yes" : "no");
|
||||
RARCH_LOG("[Environ]: SET_SUPPORT_NO_GAME: %s.\n", state ? "yes" : "no");
|
||||
|
||||
if (state)
|
||||
content_set_does_not_need_content();
|
||||
@ -7789,7 +7777,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
#ifdef HAVE_THREADS
|
||||
{
|
||||
const struct retro_audio_callback *cb = (const struct retro_audio_callback*)data;
|
||||
RARCH_LOG("Environ SET_AUDIO_CALLBACK.\n");
|
||||
RARCH_LOG("[Environ]: SET_AUDIO_CALLBACK.\n");
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
|
||||
return false;
|
||||
@ -7807,7 +7795,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
const struct retro_frame_time_callback *info =
|
||||
(const struct retro_frame_time_callback*)data;
|
||||
|
||||
RARCH_LOG("Environ SET_FRAME_TIME_CALLBACK.\n");
|
||||
RARCH_LOG("[Environ]: SET_FRAME_TIME_CALLBACK.\n");
|
||||
#ifdef HAVE_NETWORKING
|
||||
/* retro_run() will be called in very strange and
|
||||
* mysterious ways, have to disable it. */
|
||||
@ -7823,7 +7811,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
struct retro_rumble_interface *iface =
|
||||
(struct retro_rumble_interface*)data;
|
||||
|
||||
RARCH_LOG("Environ GET_RUMBLE_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: GET_RUMBLE_INTERFACE.\n");
|
||||
iface->set_rumble_state = input_driver_set_rumble_state;
|
||||
break;
|
||||
}
|
||||
@ -7832,7 +7820,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
uint64_t *mask = (uint64_t*)data;
|
||||
|
||||
RARCH_LOG("Environ GET_INPUT_DEVICE_CAPABILITIES.\n");
|
||||
RARCH_LOG("[Environ]: GET_INPUT_DEVICE_CAPABILITIES.\n");
|
||||
if (!current_input->get_capabilities || !current_input_data)
|
||||
return false;
|
||||
*mask = input_driver_get_capabilities();
|
||||
@ -7844,7 +7832,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
struct retro_sensor_interface *iface =
|
||||
(struct retro_sensor_interface*)data;
|
||||
|
||||
RARCH_LOG("Environ GET_SENSOR_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: GET_SENSOR_INTERFACE.\n");
|
||||
iface->set_sensor_state = input_sensor_set_state;
|
||||
iface->get_sensor_input = input_sensor_get_input;
|
||||
break;
|
||||
@ -7854,7 +7842,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
struct retro_camera_callback *cb =
|
||||
(struct retro_camera_callback*)data;
|
||||
|
||||
RARCH_LOG("Environ GET_CAMERA_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: GET_CAMERA_INTERFACE.\n");
|
||||
cb->start = driver_camera_start;
|
||||
cb->stop = driver_camera_stop;
|
||||
|
||||
@ -7872,7 +7860,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
struct retro_location_callback *cb =
|
||||
(struct retro_location_callback*)data;
|
||||
|
||||
RARCH_LOG("Environ GET_LOCATION_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: GET_LOCATION_INTERFACE.\n");
|
||||
cb->start = driver_location_start;
|
||||
cb->stop = driver_location_stop;
|
||||
cb->get_position = driver_location_get_position;
|
||||
@ -7889,7 +7877,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
struct retro_log_callback *cb = (struct retro_log_callback*)data;
|
||||
|
||||
RARCH_LOG("Environ GET_LOG_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: GET_LOG_INTERFACE.\n");
|
||||
cb->log = rarch_log_libretro;
|
||||
break;
|
||||
}
|
||||
@ -7898,7 +7886,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
struct retro_perf_callback *cb = (struct retro_perf_callback*)data;
|
||||
|
||||
RARCH_LOG("Environ GET_PERF_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: GET_PERF_INTERFACE.\n");
|
||||
cb->get_time_usec = cpu_features_get_time_usec;
|
||||
cb->get_cpu_features = cpu_features_get;
|
||||
cb->get_perf_counter = cpu_features_get_perf_counter;
|
||||
@ -7916,7 +7904,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
*dir = *settings->paths.directory_core_assets ?
|
||||
settings->paths.directory_core_assets : NULL;
|
||||
RARCH_LOG("Environ CORE_ASSETS_DIRECTORY: \"%s\".\n",
|
||||
RARCH_LOG("[Environ]: CORE_ASSETS_DIRECTORY: \"%s\".\n",
|
||||
settings->paths.directory_core_assets);
|
||||
break;
|
||||
}
|
||||
@ -7934,7 +7922,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
RARCH_LOG("Environ SET_SYSTEM_AV_INFO.\n");
|
||||
RARCH_LOG("[Environ]: SET_SYSTEM_AV_INFO.\n");
|
||||
|
||||
memcpy(av_info, *info, sizeof(*av_info));
|
||||
command_event(CMD_EVENT_REINIT, NULL);
|
||||
@ -7969,7 +7957,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
unsigned log_level = settings->uints.frontend_log_level;
|
||||
|
||||
if (log_level == RETRO_LOG_DEBUG)
|
||||
RARCH_LOG("Environ SET_SUBSYSTEM_INFO.\n");
|
||||
RARCH_LOG("[Environ]: SET_SUBSYSTEM_INFO.\n");
|
||||
|
||||
for (i = 0; info[i].ident; i++)
|
||||
{
|
||||
@ -8018,7 +8006,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
(const struct retro_controller_info*)data;
|
||||
unsigned log_level = settings->uints.frontend_log_level;
|
||||
|
||||
RARCH_LOG("Environ SET_CONTROLLER_INFO.\n");
|
||||
RARCH_LOG("[Environ]: SET_CONTROLLER_INFO.\n");
|
||||
|
||||
for (i = 0; info[i].types; i++)
|
||||
{
|
||||
@ -8060,7 +8048,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
(const struct retro_memory_map*)data;
|
||||
rarch_memory_descriptor_t *descriptors = NULL;
|
||||
|
||||
RARCH_LOG("Environ SET_MEMORY_MAPS.\n");
|
||||
RARCH_LOG("[Environ]: SET_MEMORY_MAPS.\n");
|
||||
free((void*)system->mmaps.descriptors);
|
||||
system->mmaps.descriptors = 0;
|
||||
system->mmaps.num_descriptors = 0;
|
||||
@ -8122,7 +8110,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_WARN("Environ SET_MEMORY_MAPS, but system pointer not initialized..\n");
|
||||
RARCH_WARN("[Environ]: SET_MEMORY_MAPS, but system pointer not initialized..\n");
|
||||
}
|
||||
|
||||
break;
|
||||
@ -8158,7 +8146,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_LOG("Environ SET_GEOMETRY.\n");
|
||||
RARCH_LOG("[Environ]: SET_GEOMETRY.\n");
|
||||
|
||||
}
|
||||
break;
|
||||
@ -8194,7 +8182,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
#ifdef HAVE_CHEEVOS
|
||||
{
|
||||
bool state = *(const bool*)data;
|
||||
RARCH_LOG("Environ SET_SUPPORT_ACHIEVEMENTS: %s.\n", state ? "yes" : "no");
|
||||
RARCH_LOG("[Environ]: SET_SUPPORT_ACHIEVEMENTS: %s.\n", state ? "yes" : "no");
|
||||
rcheevos_set_support_cheevos(state);
|
||||
}
|
||||
#endif
|
||||
@ -8204,7 +8192,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
const struct retro_hw_render_context_negotiation_interface *iface =
|
||||
(const struct retro_hw_render_context_negotiation_interface*)data;
|
||||
RARCH_LOG("Environ SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE.\n");
|
||||
RARCH_LOG("[Environ]: SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE.\n");
|
||||
hw_render_context_negotiation = iface;
|
||||
break;
|
||||
}
|
||||
@ -8366,7 +8354,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
case RETRO_ENVIRONMENT_SET_SAVE_STATE_IN_BACKGROUND:
|
||||
{
|
||||
bool state = *(const bool*)data;
|
||||
RARCH_LOG("Environ SET_SAVE_STATE_IN_BACKGROUND: %s.\n", state ? "yes" : "no");
|
||||
RARCH_LOG("[Environ]: SET_SAVE_STATE_IN_BACKGROUND: %s.\n", state ? "yes" : "no");
|
||||
|
||||
set_save_state_in_background(state);
|
||||
|
||||
@ -8375,7 +8363,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
|
||||
default:
|
||||
RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd);
|
||||
RARCH_LOG("[Environ]: UNSUPPORTED (#%u).\n", cmd);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -10442,11 +10430,7 @@ static bool runloop_check_movie_init(void)
|
||||
else
|
||||
copied = strlcpy(path, bsv_movie_state.movie_path, sizeof(path));
|
||||
|
||||
path[copied ] = '.';
|
||||
path[copied+1] = 'b';
|
||||
path[copied+2] = 's';
|
||||
path[copied+3] = 'v';
|
||||
path[copied+4] = '\0';
|
||||
string_add_alpha_4_fast(path, ".bsv", copied);
|
||||
|
||||
snprintf(msg, sizeof(msg), "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
|
||||
@ -19165,10 +19149,8 @@ static void video_driver_frame(const void *data, unsigned width,
|
||||
|
||||
if (!string_is_empty(video_info.fps_text))
|
||||
{
|
||||
string_add_space_fast(video_driver_window_title, copied);
|
||||
string_add_vertical_bar_fast(video_driver_window_title, copied+1);
|
||||
string_add_vertical_bar_fast(video_driver_window_title, copied+2);
|
||||
string_add_space_fast(video_driver_window_title, copied+3);
|
||||
string_add_alpha_4_fast(video_driver_window_title,
|
||||
" || ", copied);
|
||||
strlcat(video_driver_window_title,
|
||||
video_info.fps_text, sizeof(video_driver_window_title));
|
||||
}
|
||||
@ -21650,19 +21632,11 @@ static retro_time_t rarch_core_runtime_tick(void)
|
||||
}
|
||||
|
||||
#define _PSUPP_BUF(buf, var, name, desc) \
|
||||
buf[written ] = ' '; \
|
||||
buf[written+1] = ' '; \
|
||||
buf[written+2] = '\0'; \
|
||||
string_add_alpha_2_fast(buf, " ", written); \
|
||||
written = strlcat(buf, name, sizeof(buf)); \
|
||||
buf[written ] = ':'; \
|
||||
buf[written+1] = '\n'; \
|
||||
buf[written+2] = '\t'; \
|
||||
buf[written+3] = '\t'; \
|
||||
buf[written+4] = '\0'; \
|
||||
string_add_alpha_5_fast(buf, ":\n\t\t", written); \
|
||||
written = strlcat(buf, desc, sizeof(buf)); \
|
||||
buf[written ] = ':'; \
|
||||
buf[written+1] = ' '; \
|
||||
buf[written+2] = '\0'; \
|
||||
string_add_alpha_2_fast(buf, ": ", written); \
|
||||
written = strlcat(buf, var ? "yes\n" : "no\n", sizeof(buf)); \
|
||||
buf[written ] = '\0'
|
||||
|
||||
@ -21990,7 +21964,7 @@ static void retroarch_parse_input_and_config(int argc, char *argv[])
|
||||
{
|
||||
size_t copied = strlcat(launch_arguments,
|
||||
argv[i], sizeof(launch_arguments));
|
||||
string_add_space_fast(launch_arguments, copied);
|
||||
string_add_alpha_fast(launch_arguments, ' ', copied);
|
||||
}
|
||||
string_trim_whitespace_left(launch_arguments);
|
||||
string_trim_whitespace_right(launch_arguments);
|
||||
@ -22725,38 +22699,31 @@ bool retroarch_main_init(int argc, char *argv[])
|
||||
|
||||
written = strlcat(str_output, msg_hash_to_str(MSG_CAPABILITIES),
|
||||
sizeof(str_output));
|
||||
str_output[written] = ':';
|
||||
str_output[written+1] = ' ';
|
||||
str_output[written+2] = '\0';
|
||||
string_add_alpha_2_fast(str_output, ": ", written);
|
||||
written = strlcat(str_output, str, sizeof(str_output));
|
||||
written = strlcat(str_output, "\n", sizeof(str_output));
|
||||
|
||||
written = strlcat(str_output, FILE_PATH_LOG_INFO, sizeof(str_output));
|
||||
str_output[written] = ' ';
|
||||
str_output[written+1] = '\0';
|
||||
written = strlcat(str_output, "Built: ", sizeof(str_output));
|
||||
string_add_alpha_8_fast(str_output, " Built: ", written);
|
||||
written += 8;
|
||||
written = strlcat(str_output, __DATE__, sizeof(str_output));
|
||||
written = strlcat(str_output, "\n", sizeof(str_output));
|
||||
|
||||
written = strlcat(str_output, FILE_PATH_LOG_INFO, sizeof(str_output));
|
||||
str_output[written] = ' ';
|
||||
str_output[written+1] = '\0';
|
||||
written = strlcat(str_output, "Version: ", sizeof(str_output));
|
||||
string_add_alpha_10_fast(str_output, " Version: ", written);
|
||||
written += 10;
|
||||
written = strlcat(str_output, PACKAGE_VERSION, sizeof(str_output));
|
||||
written = strlcat(str_output, "\n", sizeof(str_output));
|
||||
|
||||
#ifdef HAVE_GIT_VERSION
|
||||
written = strlcat(str_output, FILE_PATH_LOG_INFO, sizeof(str_output));
|
||||
str_output[written] = ' ';
|
||||
str_output[written+1] = '\0';
|
||||
written = strlcat(str_output, "Git: ", sizeof(str_output));
|
||||
string_add_alpha_6_fast(str_output, " Git: ", written);
|
||||
written = strlcat(str_output, retroarch_git_version, sizeof(str_output));
|
||||
written = strlcat(str_output, "\n", sizeof(str_output));
|
||||
#endif
|
||||
|
||||
written = strlcat(str_output, FILE_PATH_LOG_INFO, sizeof(str_output));
|
||||
str_output[written] = ' ';
|
||||
str_output[written+1] = '\0';
|
||||
string_add_alpha_fast(str_output, ' ', written);
|
||||
written = strlcat(str_output, "=================================================\n", sizeof(str_output));
|
||||
RARCH_LOG_OUTPUT(str_output);
|
||||
}
|
||||
@ -23892,158 +23859,98 @@ int retroarch_get_capabilities(enum rarch_capabilities type,
|
||||
|
||||
if (cpu & RETRO_SIMD_MMX)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'M';
|
||||
s[written++] = 'M';
|
||||
s[written++] = 'X';
|
||||
string_add_alpha_4_fast(s, " MMX", written);
|
||||
written += 4;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_MMXEXT)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'M';
|
||||
s[written++] = 'M';
|
||||
s[written++] = 'X';
|
||||
s[written++] = 'E';
|
||||
s[written++] = 'X';
|
||||
s[written++] = 'T';
|
||||
string_add_alpha_7_fast(s, " MMXEXT", written);
|
||||
written += 7;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_SSE)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'E';
|
||||
string_add_alpha_4_fast(s, " SSE", written);
|
||||
written += 4;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_SSE2)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'E';
|
||||
s[written++] = '2';
|
||||
string_add_alpha_5_fast(s, " SSE2", written);
|
||||
written += 5;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_SSE3)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'E';
|
||||
s[written++] = '3';
|
||||
string_add_alpha_5_fast(s, " SSE3", written);
|
||||
written += 5;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_SSSE3)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'E';
|
||||
s[written++] = '3';
|
||||
string_add_alpha_6_fast(s, " SSSE3", written);
|
||||
written += 6;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_SSE4)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'E';
|
||||
s[written++] = '4';
|
||||
string_add_alpha_5_fast(s, " SSE4", written);
|
||||
written += 5;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_SSE42)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'E';
|
||||
s[written++] = '4';
|
||||
s[written++] = '.';
|
||||
s[written++] = '2';
|
||||
string_add_alpha_7_fast(s, " SSE4.2", written);
|
||||
written += 7;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_AES)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'A';
|
||||
s[written++] = 'E';
|
||||
s[written++] = 'S';
|
||||
string_add_alpha_4_fast(s, " AES", written);
|
||||
written += 4;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_AVX)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'A';
|
||||
s[written++] = 'V';
|
||||
s[written++] = 'X';
|
||||
string_add_alpha_4_fast(s, " AVX", written);
|
||||
written += 4;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_AVX2)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'A';
|
||||
s[written++] = 'V';
|
||||
s[written++] = 'X';
|
||||
s[written++] = '2';
|
||||
string_add_alpha_5_fast(s, " AVX2", written);
|
||||
written += 5;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_NEON)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'N';
|
||||
s[written++] = 'E';
|
||||
s[written++] = 'O';
|
||||
s[written++] = 'N';
|
||||
string_add_alpha_5_fast(s, " NEON", written);
|
||||
written += 5;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_VFPV3)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'V';
|
||||
s[written++] = 'F';
|
||||
s[written++] = 'P';
|
||||
s[written++] = 'v';
|
||||
s[written++] = '3';
|
||||
string_add_alpha_6_fast(s, " VFPv3", written);
|
||||
written += 6;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_VFPV4)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'V';
|
||||
s[written++] = 'F';
|
||||
s[written++] = 'P';
|
||||
s[written++] = 'v';
|
||||
s[written++] = '4';
|
||||
string_add_alpha_6_fast(s, " VFPv4", written);
|
||||
written += 6;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_VMX)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'V';
|
||||
s[written++] = 'M';
|
||||
s[written++] = 'X';
|
||||
string_add_alpha_4_fast(s, " VMX", written);
|
||||
written += 4;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_VMX128)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'V';
|
||||
s[written++] = 'M';
|
||||
s[written++] = 'X';
|
||||
s[written++] = '1';
|
||||
s[written++] = '2';
|
||||
s[written++] = '8';
|
||||
string_add_alpha_7_fast(s, " VMX128", written);
|
||||
written += 7;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_VFPU)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'V';
|
||||
s[written++] = 'F';
|
||||
s[written++] = 'P';
|
||||
s[written++] = 'U';
|
||||
string_add_alpha_5_fast(s, " VFPU", written);
|
||||
written += 5;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_PS)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'P';
|
||||
s[written++] = 'S';
|
||||
string_add_alpha_3_fast(s, " PS", written);
|
||||
written += 3;
|
||||
}
|
||||
if (cpu & RETRO_SIMD_ASIMD)
|
||||
{
|
||||
s[written++] = ' ';
|
||||
s[written++] = 'A';
|
||||
s[written++] = 'S';
|
||||
s[written++] = 'I';
|
||||
s[written++] = 'M';
|
||||
s[written++] = 'D';
|
||||
string_add_alpha_6_fast(s, " ASIMD", written);
|
||||
written += 6;
|
||||
}
|
||||
s[written++] = '\0';
|
||||
}
|
||||
|
@ -237,9 +237,7 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
||||
!string_is_empty(params->name)) ? params->name : (!string_is_empty(display_name) ? display_name : "N/A");
|
||||
size_t written = strlcpy(
|
||||
msg, autoconfig_str, sizeof(msg));
|
||||
|
||||
string_add_space_fast(msg, written);
|
||||
strlcat(msg, "configured.", sizeof(msg));
|
||||
string_add_alpha_12_fast(msg, " configured.", written);
|
||||
|
||||
if (!remote_is_bound)
|
||||
{
|
||||
|
@ -303,7 +303,7 @@ static void* task_push_http_transfer_generic(
|
||||
copied = strlcpy(tmp,
|
||||
msg_hash_to_str(MSG_DOWNLOADING), sizeof(tmp));
|
||||
|
||||
string_add_space_fast(tmp, copied);
|
||||
string_add_alpha_fast(tmp, ' ', copied);
|
||||
|
||||
if (strstr(s, ".index"))
|
||||
strlcat(tmp, msg_hash_to_str(MSG_INDEX_FILE), sizeof(tmp));
|
||||
|
@ -145,11 +145,11 @@ static bool get_thumbnail_paths(
|
||||
|
||||
/* Generate remote path */
|
||||
copied = strlcpy(raw_url, file_path_str(FILE_PATH_CORE_THUMBNAILS_URL), sizeof(raw_url));
|
||||
string_add_backslash_fast(raw_url, copied);
|
||||
string_add_alpha_fast(raw_url, '/', copied);
|
||||
copied = strlcat(raw_url, system_name, sizeof(raw_url));
|
||||
string_add_backslash_fast(raw_url, copied);
|
||||
string_add_alpha_fast(raw_url, '/', copied);
|
||||
copied = strlcat(raw_url, sub_dir, sizeof(raw_url));
|
||||
string_add_backslash_fast(raw_url, copied);
|
||||
string_add_alpha_fast(raw_url, '/', copied);
|
||||
strlcat(raw_url, img_name, sizeof(raw_url));
|
||||
|
||||
if (string_is_empty(raw_url))
|
||||
|
@ -263,11 +263,7 @@ static bool screenshot_dump(
|
||||
{
|
||||
size_t copied = strlcpy(state->filename,
|
||||
name_base, sizeof(state->filename));
|
||||
string_add_dot_fast(state->filename, copied);
|
||||
state->filename[copied+1] = 'p';
|
||||
state->filename[copied+2] = 'n';
|
||||
state->filename[copied+3] = 'g';
|
||||
state->filename[copied+4] = '\0';
|
||||
string_add_alpha_4_fast(state->filename, ".png", copied);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -295,11 +291,7 @@ static bool screenshot_dump(
|
||||
{
|
||||
size_t copied = strlcpy(state->shotname, path_basename(name_base),
|
||||
sizeof(state->shotname));
|
||||
string_add_dot_fast(state->shotname, copied);
|
||||
state->shotname[copied+1] = 'p';
|
||||
state->shotname[copied+2] = 'n';
|
||||
state->shotname[copied+3] = 'g';
|
||||
state->shotname[copied+4] = '\0';
|
||||
string_add_alpha_4_fast(state->shotname, ".png", copied);
|
||||
}
|
||||
|
||||
if ( string_is_empty(screenshot_dir) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user