mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
2836eb976f
@ -25,7 +25,6 @@
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../performance.h"
|
||||
#include "../intl/intl.h"
|
||||
|
||||
#ifndef AUDIO_BUFFER_FREE_SAMPLES_COUNT
|
||||
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)
|
||||
@ -692,8 +691,6 @@ bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
|
||||
if (audio_driver_write(output_data, output_frames * output_size * 2) < 0)
|
||||
{
|
||||
RARCH_ERR(RETRO_LOG_AUDIO_WRITE_FAILED);
|
||||
|
||||
driver->audio_active = false;
|
||||
return false;
|
||||
}
|
||||
|
35
command.c
35
command.c
@ -27,10 +27,10 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <file/file_path.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include <net/net_compat.h>
|
||||
|
||||
#include "msg_hash.h"
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
#include "netplay.h"
|
||||
#endif
|
||||
@ -230,7 +230,7 @@ static bool cmd_set_shader(const char *arg)
|
||||
char msg[PATH_MAX_LENGTH] = {0};
|
||||
enum rarch_shader_type type = RARCH_SHADER_NONE;
|
||||
const char *ext = path_get_extension(arg);
|
||||
uint32_t ext_hash = djb2_calculate(ext);
|
||||
uint32_t ext_hash = msg_hash_calculate(ext);
|
||||
|
||||
switch (ext_hash)
|
||||
{
|
||||
@ -248,7 +248,9 @@ static bool cmd_set_shader(const char *arg)
|
||||
|
||||
snprintf(msg, sizeof(msg), "Shader: \"%s\"", arg);
|
||||
rarch_main_msg_queue_push(msg, 1, 120, true);
|
||||
RARCH_LOG("Applying shader \"%s\".\n", arg);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_APPLYING_SHADER),
|
||||
arg);
|
||||
|
||||
return video_driver_set_shader(type, arg);
|
||||
}
|
||||
@ -314,7 +316,10 @@ static void parse_sub_msg(rarch_cmd_t *handle, const char *tok)
|
||||
handle->state[map[index].id] = true;
|
||||
}
|
||||
else
|
||||
RARCH_WARN("Unrecognized command \"%s\" received.\n", tok);
|
||||
RARCH_WARN("%s \"%s\" %s.\n",
|
||||
msg_hash_to_str(MSG_UNRECOGNIZED_COMMAND),
|
||||
tok,
|
||||
msg_hash_to_str(MSG_RECEIVED));
|
||||
}
|
||||
|
||||
static void parse_msg(rarch_cmd_t *handle, char *buf)
|
||||
@ -379,19 +384,24 @@ static void network_cmd_poll(rarch_cmd_t *handle)
|
||||
static size_t read_stdin(char *buf, size_t size)
|
||||
{
|
||||
DWORD i;
|
||||
DWORD has_read = 0;
|
||||
DWORD avail = 0;
|
||||
bool echo = false;
|
||||
HANDLE hnd = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
if (hnd == INVALID_HANDLE_VALUE)
|
||||
return 0;
|
||||
|
||||
/* Check first if we're a pipe
|
||||
* (not console). */
|
||||
DWORD avail = 0;
|
||||
bool echo = false;
|
||||
|
||||
/* If not a pipe, check if we're running in a console. */
|
||||
if (!PeekNamedPipe(hnd, NULL, 0, NULL, &avail, NULL))
|
||||
{
|
||||
DWORD mode = 0;
|
||||
INPUT_RECORD recs[256];
|
||||
bool has_key = false;
|
||||
DWORD mode = 0, has_read = 0;
|
||||
|
||||
if (!GetConsoleMode(hnd, &mode))
|
||||
return 0;
|
||||
|
||||
@ -401,13 +411,10 @@ static size_t read_stdin(char *buf, size_t size)
|
||||
return 0;
|
||||
|
||||
/* Win32, Y U NO SANE NONBLOCK READ!? */
|
||||
DWORD has_read = 0;
|
||||
INPUT_RECORD recs[256];
|
||||
if (!PeekConsoleInput(hnd, recs,
|
||||
sizeof(recs) / sizeof(recs[0]), &has_read))
|
||||
return 0;
|
||||
|
||||
bool has_key = false;
|
||||
for (i = 0; i < has_read; i++)
|
||||
{
|
||||
/* Very crude, but should get the job done. */
|
||||
@ -436,7 +443,6 @@ static size_t read_stdin(char *buf, size_t size)
|
||||
if (avail > size)
|
||||
avail = size;
|
||||
|
||||
DWORD has_read = 0;
|
||||
if (!ReadFile(hnd, buf, avail, &has_read, NULL))
|
||||
return 0;
|
||||
|
||||
@ -619,7 +625,7 @@ bool network_cmd_send(const char *cmd_)
|
||||
const char *host = NULL;
|
||||
const char *port_ = NULL;
|
||||
global_t *global = global_get_ptr();
|
||||
bool old_verbose = global->verbosity;
|
||||
bool old_verbose = global ? global->verbosity : false;
|
||||
uint16_t port = DEFAULT_NETWORK_CMD_PORT;
|
||||
|
||||
if (!network_init())
|
||||
@ -648,7 +654,8 @@ bool network_cmd_send(const char *cmd_)
|
||||
if (port_)
|
||||
port = strtoul(port_, NULL, 0);
|
||||
|
||||
RARCH_LOG("Sending command: \"%s\" to %s:%hu\n",
|
||||
RARCH_LOG("%s: \"%s\" to %s:%hu\n",
|
||||
msg_hash_to_str(MSG_SENDING_COMMAND),
|
||||
cmd, host, (unsigned short)port);
|
||||
|
||||
ret = verify_command(cmd) && send_udp_packet(host, port, cmd);
|
||||
|
175
command_event.c
175
command_event.c
@ -24,7 +24,7 @@
|
||||
#include "dynamic.h"
|
||||
#include "content.h"
|
||||
#include "screenshot.h"
|
||||
#include "intl/intl.h"
|
||||
#include "msg_hash.h"
|
||||
#include "retroarch.h"
|
||||
#include "dir_list_special.h"
|
||||
|
||||
@ -82,9 +82,12 @@ static void event_free_temporary_content(void)
|
||||
{
|
||||
const char *path = global->temporary_content->elems[i].data;
|
||||
|
||||
RARCH_LOG("Removing temporary content file: %s.\n", path);
|
||||
RARCH_LOG("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path);
|
||||
if (remove(path) < 0)
|
||||
RARCH_ERR("Failed to remove temporary file: %s.\n", path);
|
||||
RARCH_ERR("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE),
|
||||
path);
|
||||
}
|
||||
string_list_free(global->temporary_content);
|
||||
}
|
||||
@ -119,7 +122,7 @@ static void event_init_autosave(void)
|
||||
settings->autosave_interval);
|
||||
|
||||
if (!global->autosave[i])
|
||||
RARCH_WARN(RETRO_LOG_INIT_AUTOSAVE_FAILED);
|
||||
RARCH_WARN("%s\n", msg_hash_to_str(MSG_AUTOSAVE_FAILED));
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,7 +154,11 @@ static void event_save_files(void)
|
||||
{
|
||||
unsigned type = global->savefiles->elems[i].attr.i;
|
||||
const char *path = global->savefiles->elems[i].data;
|
||||
RARCH_LOG("Saving RAM type #%u to \"%s\".\n", type, path);
|
||||
RARCH_LOG("%s #%u %s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_SAVING_RAM_TYPE),
|
||||
type,
|
||||
msg_hash_to_str(MSG_TO),
|
||||
path);
|
||||
save_ram_file(path, type);
|
||||
}
|
||||
}
|
||||
@ -166,32 +173,36 @@ static void event_init_movie(void)
|
||||
if (!(global->bsv.movie = bsv_movie_init(global->bsv.movie_start_path,
|
||||
RARCH_MOVIE_PLAYBACK)))
|
||||
{
|
||||
RARCH_ERR("Failed to load movie file: \"%s\".\n",
|
||||
RARCH_ERR("%s: \"%s\".\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_LOAD_MOVIE_FILE),
|
||||
global->bsv.movie_start_path);
|
||||
rarch_fail(1, "event_init_movie()");
|
||||
}
|
||||
|
||||
global->bsv.movie_playback = true;
|
||||
rarch_main_msg_queue_push("Starting movie playback.", 2, 180, false);
|
||||
RARCH_LOG("Starting movie playback.\n");
|
||||
rarch_main_msg_queue_push_new(MSG_STARTING_MOVIE_PLAYBACK, 2, 180, false);
|
||||
RARCH_LOG("%s.\n", msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK));
|
||||
settings->rewind_granularity = 1;
|
||||
}
|
||||
else if (global->bsv.movie_start_recording)
|
||||
{
|
||||
char msg[PATH_MAX_LENGTH] = {0};
|
||||
snprintf(msg, sizeof(msg), "Starting movie record to \"%s\".",
|
||||
snprintf(msg, sizeof(msg),
|
||||
"%s \"%s\".",
|
||||
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
|
||||
global->bsv.movie_start_path);
|
||||
|
||||
if (!(global->bsv.movie = bsv_movie_init(global->bsv.movie_start_path,
|
||||
RARCH_MOVIE_RECORD)))
|
||||
{
|
||||
rarch_main_msg_queue_push("Failed to start movie record.", 1, 180, true);
|
||||
RARCH_ERR("Failed to start movie record.\n");
|
||||
rarch_main_msg_queue_push_new(MSG_FAILED_TO_START_MOVIE_RECORD, 1, 180, true);
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD));
|
||||
return;
|
||||
}
|
||||
|
||||
rarch_main_msg_queue_push(msg, 1, 180, true);
|
||||
RARCH_LOG("Starting movie record to \"%s\".\n",
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
|
||||
global->bsv.movie_start_path);
|
||||
settings->rewind_granularity = 1;
|
||||
}
|
||||
@ -220,13 +231,16 @@ static void event_disk_control_set_eject(bool new_state, bool print_log)
|
||||
*msg = '\0';
|
||||
|
||||
if (control->set_eject_state(new_state))
|
||||
snprintf(msg, sizeof(msg), "%s virtual disk tray.",
|
||||
new_state ? "Ejected" : "Closed");
|
||||
snprintf(msg, sizeof(msg), "%s %s",
|
||||
new_state ? "Ejected" : "Closed",
|
||||
msg_hash_to_str(MSG_VIRTUAL_DISK_TRAY));
|
||||
else
|
||||
{
|
||||
error = true;
|
||||
snprintf(msg, sizeof(msg), "Failed to %s virtual disk tray.",
|
||||
new_state ? "eject" : "close");
|
||||
snprintf(msg, sizeof(msg), "%s %s %s",
|
||||
msg_hash_to_str(MSG_FAILED_TO),
|
||||
new_state ? "eject" : "close",
|
||||
msg_hash_to_str(MSG_VIRTUAL_DISK_TRAY));
|
||||
}
|
||||
|
||||
if (*msg)
|
||||
@ -273,7 +287,7 @@ void event_disk_control_append_image(const char *path)
|
||||
info.path = path;
|
||||
control->replace_image_index(new_idx, &info);
|
||||
|
||||
strlcpy(msg, "Appended disk: ", sizeof(msg));
|
||||
snprintf(msg, sizeof(msg), "%s: ", msg_hash_to_str(MSG_APPENDED_DISK));
|
||||
strlcat(msg, path, sizeof(msg));
|
||||
RARCH_LOG("%s\n", msg);
|
||||
rarch_main_msg_queue_push(msg, 0, 180, true);
|
||||
@ -337,7 +351,9 @@ static void event_disk_control_set_index(unsigned idx)
|
||||
snprintf(msg, sizeof(msg), "Setting disk %u of %u in tray.",
|
||||
idx + 1, num_disks);
|
||||
else
|
||||
strlcpy(msg, "Removed disk from tray.", sizeof(msg));
|
||||
strlcpy(msg,
|
||||
msg_hash_to_str(MSG_REMOVED_DISK_FROM_TRAY),
|
||||
sizeof(msg));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -345,7 +361,9 @@ static void event_disk_control_set_index(unsigned idx)
|
||||
snprintf(msg, sizeof(msg), "Failed to set disk %u of %u.",
|
||||
idx + 1, num_disks);
|
||||
else
|
||||
strlcpy(msg, "Failed to remove disk from tray.", sizeof(msg));
|
||||
strlcpy(msg,
|
||||
msg_hash_to_str(MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY),
|
||||
sizeof(msg));
|
||||
error = true;
|
||||
}
|
||||
|
||||
@ -385,7 +403,7 @@ static void event_check_disk_prev(
|
||||
|
||||
if (!disk_prev_enable)
|
||||
{
|
||||
RARCH_ERR("Got invalid disk index from libretro.\n");
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_GOT_INVALID_DISK_INDEX));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -420,7 +438,7 @@ static void event_check_disk_next(
|
||||
|
||||
if (!disk_next_enable)
|
||||
{
|
||||
RARCH_ERR("Got invalid disk index from libretro.\n");
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_GOT_INVALID_DISK_INDEX));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -684,7 +702,8 @@ static bool event_init_content(void)
|
||||
event_set_savestate_auto_index();
|
||||
|
||||
if (event_load_save_files())
|
||||
RARCH_LOG("Skipping SRAM load.\n");
|
||||
RARCH_LOG("%s.\n",
|
||||
msg_hash_to_str(MSG_SKIPPING_SRAM_LOAD));
|
||||
|
||||
event_load_auto_state();
|
||||
event_command(EVENT_CMD_BSV_MOVIE_INIT);
|
||||
@ -801,9 +820,8 @@ static bool event_save_core_config(void)
|
||||
sizeof(config_dir));
|
||||
else
|
||||
{
|
||||
const char *message = "Config directory not set. Cannot save new config.";
|
||||
rarch_main_msg_queue_push(message, 1, 180, true);
|
||||
RARCH_ERR("%s\n", message);
|
||||
rarch_main_msg_queue_push_new(MSG_CONFIG_DIRECTORY_NOT_SET, 1, 180, true);
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -891,14 +909,17 @@ static void event_save_state(const char *path,
|
||||
|
||||
if (!save_state(path))
|
||||
{
|
||||
snprintf(s, len, "Failed to save state to \"%s\".", path);
|
||||
snprintf(s, len, "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_FAILED_TO_SAVE_STATE_TO),
|
||||
path);
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings->state_slot < 0)
|
||||
snprintf(s, len, "Saved state to slot #-1 (auto).");
|
||||
snprintf(s, len, "%s #-1 (auto).", msg_hash_to_str(MSG_SAVED_STATE_TO_SLOT));
|
||||
else
|
||||
snprintf(s, len, "Saved state to slot #%d.", settings->state_slot);
|
||||
snprintf(s, len, "%s #%d.", msg_hash_to_str(MSG_SAVED_STATE_TO_SLOT),
|
||||
settings->state_slot);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -915,15 +936,17 @@ static void event_load_state(const char *path, char *s, size_t len)
|
||||
|
||||
if (!load_state(path))
|
||||
{
|
||||
snprintf(s, len, "Failed to load state from \"%s\".", path);
|
||||
snprintf(s, len, "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE),
|
||||
path);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (settings->state_slot < 0)
|
||||
snprintf(s, len, "Loaded state from slot #-1 (auto).");
|
||||
snprintf(s, len, "%s #-1 (auto).", msg_hash_to_str(MSG_LOADED_STATE_FROM_SLOT));
|
||||
else
|
||||
snprintf(s, len, "Loaded state from slot #%d.", settings->state_slot);
|
||||
snprintf(s, len, "%s #%d.", msg_hash_to_str(MSG_LOADED_STATE_FROM_SLOT),
|
||||
settings->state_slot);
|
||||
}
|
||||
|
||||
static void event_main_state(unsigned cmd)
|
||||
@ -937,19 +960,25 @@ static void event_main_state(unsigned cmd)
|
||||
snprintf(path, sizeof(path), "%s%d",
|
||||
global->savestate_name, settings->state_slot);
|
||||
else if (settings->state_slot < 0)
|
||||
fill_pathname_join_delim(path, global->savestate_name, "auto", '.', sizeof(path));
|
||||
fill_pathname_join_delim(path,
|
||||
global->savestate_name, "auto", '.', sizeof(path));
|
||||
else
|
||||
strlcpy(path, global->savestate_name, sizeof(path));
|
||||
|
||||
if (pretro_serialize_size())
|
||||
{
|
||||
if (cmd == EVENT_CMD_SAVE_STATE)
|
||||
event_save_state(path, msg, sizeof(msg));
|
||||
else if (cmd == EVENT_CMD_LOAD_STATE)
|
||||
event_load_state(path, msg, sizeof(msg));
|
||||
switch (cmd)
|
||||
{
|
||||
case EVENT_CMD_SAVE_STATE:
|
||||
event_save_state(path, msg, sizeof(msg));
|
||||
break;
|
||||
case EVENT_CMD_LOAD_STATE:
|
||||
event_load_state(path, msg, sizeof(msg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
strlcpy(msg, "Core does not support save states.", sizeof(msg));
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES), sizeof(msg));
|
||||
|
||||
rarch_main_msg_queue_push(msg, 2, 180, true);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
@ -1080,8 +1109,8 @@ bool event_command(enum event_command cmd)
|
||||
event_init_controllers();
|
||||
break;
|
||||
case EVENT_CMD_RESET:
|
||||
RARCH_LOG(RETRO_LOG_RESETTING_CONTENT);
|
||||
rarch_main_msg_queue_push("Reset.", 1, 120, true);
|
||||
RARCH_LOG("%s.\n", msg_hash_to_str(MSG_RESET));
|
||||
rarch_main_msg_queue_push_new(MSG_RESET, 1, 120, true);
|
||||
pretro_reset();
|
||||
|
||||
/* bSNES since v073r01 resets controllers to JOYPAD
|
||||
@ -1214,11 +1243,13 @@ bool event_command(enum event_command cmd)
|
||||
case EVENT_CMD_AUDIO_MUTE_TOGGLE:
|
||||
{
|
||||
const char *msg = !settings->audio.mute_enable ?
|
||||
"Audio muted." : "Audio unmuted.";
|
||||
msg_hash_to_str(MSG_AUDIO_MUTED):
|
||||
msg_hash_to_str(MSG_AUDIO_UNMUTED);
|
||||
|
||||
if (!audio_driver_mute_toggle())
|
||||
{
|
||||
RARCH_ERR("Failed to unmute audio.\n");
|
||||
RARCH_ERR("%s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_UNMUTE_AUDIO));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1249,11 +1280,15 @@ bool event_command(enum event_command cmd)
|
||||
break;
|
||||
}
|
||||
|
||||
driver->overlay = input_overlay_new(driver->osk_enable ? settings->osk.overlay : settings->input.overlay,
|
||||
driver->osk_enable ? settings->osk.enable : settings->input.overlay_enable,
|
||||
settings->input.overlay_opacity, settings->input.overlay_scale);
|
||||
driver->overlay = input_overlay_new(
|
||||
driver->osk_enable ?
|
||||
settings->osk.overlay : settings->input.overlay,
|
||||
driver->osk_enable ?
|
||||
settings->osk.enable : settings->input.overlay_enable,
|
||||
settings->input.overlay_opacity,
|
||||
settings->input.overlay_scale);
|
||||
if (!driver->overlay)
|
||||
RARCH_ERR("Failed to load overlay.\n");
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_LOAD_OVERLAY));
|
||||
#endif
|
||||
break;
|
||||
case EVENT_CMD_OVERLAY_NEXT:
|
||||
@ -1302,7 +1337,9 @@ bool event_command(enum event_command cmd)
|
||||
event_command(EVENT_CMD_HISTORY_DEINIT);
|
||||
if (!settings->history_list_enable)
|
||||
return false;
|
||||
RARCH_LOG("Loading history file: [%s].\n", settings->content_history_path);
|
||||
RARCH_LOG("%s: [%s].\n",
|
||||
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
|
||||
settings->content_history_path);
|
||||
g_defaults.history = content_playlist_init(
|
||||
settings->content_history_path,
|
||||
settings->content_history_size);
|
||||
@ -1325,15 +1362,15 @@ bool event_command(enum event_command cmd)
|
||||
global->core_info = core_info_list_new();
|
||||
break;
|
||||
case EVENT_CMD_CORE_DEINIT:
|
||||
{
|
||||
struct retro_hw_render_callback *cb = video_driver_callback();
|
||||
event_deinit_core(true);
|
||||
{
|
||||
struct retro_hw_render_callback *cb = video_driver_callback();
|
||||
event_deinit_core(true);
|
||||
|
||||
if (cb)
|
||||
memset(cb, 0, sizeof(*cb));
|
||||
if (cb)
|
||||
memset(cb, 0, sizeof(*cb));
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_CMD_CORE_INIT:
|
||||
if (!event_init_core())
|
||||
return false;
|
||||
@ -1407,7 +1444,7 @@ bool event_command(enum event_command cmd)
|
||||
case EVENT_CMD_PAUSE_CHECKS:
|
||||
if (runloop->is_paused)
|
||||
{
|
||||
RARCH_LOG("Paused.\n");
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_PAUSED));
|
||||
event_command(EVENT_CMD_AUDIO_STOP);
|
||||
|
||||
if (settings->video.black_frame_insertion)
|
||||
@ -1415,7 +1452,7 @@ bool event_command(enum event_command cmd)
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_LOG("Unpaused.\n");
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_UNPAUSED));
|
||||
event_command(EVENT_CMD_AUDIO_START);
|
||||
}
|
||||
break;
|
||||
@ -1471,7 +1508,8 @@ bool event_command(enum event_command cmd)
|
||||
dir_list_sort(global->shader_dir.list, false);
|
||||
|
||||
for (i = 0; i < global->shader_dir.list->size; i++)
|
||||
RARCH_LOG("Found shader \"%s\"\n",
|
||||
RARCH_LOG("%s \"%s\"\n",
|
||||
msg_hash_to_str(MSG_FOUND_SHADER),
|
||||
global->shader_dir.list->elems[i].data);
|
||||
break;
|
||||
case EVENT_CMD_SAVEFILES:
|
||||
@ -1493,7 +1531,8 @@ bool event_command(enum event_command cmd)
|
||||
;
|
||||
|
||||
if (!global->use_sram)
|
||||
RARCH_LOG("SRAM will not be saved.\n");
|
||||
RARCH_LOG("%s\n",
|
||||
msg_hash_to_str(MSG_SRAM_WILL_NOT_BE_SAVED));
|
||||
|
||||
if (global->use_sram)
|
||||
event_command(EVENT_CMD_AUTOSAVE_INIT);
|
||||
@ -1608,7 +1647,9 @@ bool event_command(enum event_command cmd)
|
||||
event_check_disk_eject(control);
|
||||
}
|
||||
else
|
||||
rarch_main_msg_queue_push("Core does not support Disk Options.", 1, 120, true);
|
||||
rarch_main_msg_queue_push_new(
|
||||
MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS,
|
||||
1, 120, true);
|
||||
break;
|
||||
case EVENT_CMD_DISK_NEXT:
|
||||
if (system && system->disk_control.get_num_images)
|
||||
@ -1626,7 +1667,9 @@ bool event_command(enum event_command cmd)
|
||||
event_check_disk_next(control);
|
||||
}
|
||||
else
|
||||
rarch_main_msg_queue_push("Core does not support Disk Options.", 1, 120, true);
|
||||
rarch_main_msg_queue_push_new(
|
||||
MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS,
|
||||
1, 120, true);
|
||||
break;
|
||||
case EVENT_CMD_DISK_PREV:
|
||||
if (system && system->disk_control.get_num_images)
|
||||
@ -1644,7 +1687,9 @@ bool event_command(enum event_command cmd)
|
||||
event_check_disk_prev(control);
|
||||
}
|
||||
else
|
||||
rarch_main_msg_queue_push("Core does not support Disk Options.", 1, 120, true);
|
||||
rarch_main_msg_queue_push_new(
|
||||
MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS,
|
||||
1, 120, true);
|
||||
break;
|
||||
case EVENT_CMD_RUMBLE_STOP:
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
@ -1662,7 +1707,8 @@ bool event_command(enum event_command cmd)
|
||||
if (!driver->input || !input_driver_grab_mouse(grab_mouse_state))
|
||||
return false;
|
||||
|
||||
RARCH_LOG("Grab mouse state: %s.\n",
|
||||
RARCH_LOG("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_GRAB_MOUSE_STATE),
|
||||
grab_mouse_state ? "yes" : "no");
|
||||
|
||||
video_driver_show_mouse(!grab_mouse_state);
|
||||
@ -1679,11 +1725,8 @@ bool event_command(enum event_command cmd)
|
||||
break;
|
||||
case EVENT_CMD_NONE:
|
||||
default:
|
||||
goto error;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
return false;
|
||||
}
|
||||
|
@ -304,10 +304,4 @@ static const bool _avfoundation_supp = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define RARCH_DEFAULT_CONF_PATH_STR "\n\t\tDefaults to retroarch.cfg in same directory as retroarch.exe.\n\t\tIf a default config is not found, " RETRO_FRONTEND " will attempt to create one."
|
||||
#else
|
||||
#define RARCH_DEFAULT_CONF_PATH_STR "\n\t\tBy default looks for config in $XDG_CONFIG_HOME/retroarch/retroarch.cfg,\n\t\t$HOME/.config/retroarch/retroarch.cfg,\n\t\tand $HOME/.retroarch.cfg.\n\t\tIf a default config is not found, " RETRO_FRONTEND " will attempt to create one based on the skeleton config (" GLOBAL_CONFIG_DIR "/retroarch.cfg)."
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
130
configuration.c
130
configuration.c
@ -455,7 +455,8 @@ static void config_set_defaults(void)
|
||||
#endif
|
||||
settings->multimedia.builtin_imageviewer_enable = true;
|
||||
settings->video.scale = scale;
|
||||
settings->video.fullscreen = global->force_fullscreen ? true : fullscreen;
|
||||
settings->video.fullscreen = global->force_fullscreen
|
||||
? true : fullscreen;
|
||||
settings->video.windowed_fullscreen = windowed_fullscreen;
|
||||
settings->video.monitor_index = monitor_index;
|
||||
settings->video.fullscreen_x = fullscreen_x;
|
||||
@ -1219,28 +1220,48 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#ifdef HAVE_THREADS
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.threaded_data_runloop_enable, "threaded_data_runloop_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.threaded_data_runloop_enable,
|
||||
"threaded_data_runloop_enable");
|
||||
#endif
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.dpi.override_enable, "dpi_override_enable");
|
||||
CONFIG_GET_INT_BASE (conf, settings, menu.dpi.override_value, "dpi_override_value");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.dpi.override_enable,
|
||||
"dpi_override_enable");
|
||||
CONFIG_GET_INT_BASE (conf, settings, menu.dpi.override_value,
|
||||
"dpi_override_value");
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.pause_libretro, "menu_pause_libretro");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.mouse.enable, "menu_mouse_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.pointer.enable, "menu_pointer_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.timedate_enable, "menu_timedate_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.core_enable, "menu_core_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.dynamic_wallpaper_enable, "menu_dynamic_wallpaper_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.boxart_enable, "menu_boxart_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.navigation.wraparound.horizontal_enable, "menu_navigation_wraparound_horizontal_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.navigation.wraparound.vertical_enable, "menu_navigation_wraparound_vertical_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.navigation.browser.filter.supported_extensions_enable, "menu_navigation_browser_filter_supported_extensions_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.collapse_subgroups_enable, "menu_collapse_subgroups_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.show_advanced_settings, "menu_show_advanced_settings");
|
||||
CONFIG_GET_HEX_BASE(conf, settings, menu.entry_normal_color, "menu_entry_normal_color");
|
||||
CONFIG_GET_HEX_BASE(conf, settings, menu.entry_hover_color, "menu_entry_hover_color");
|
||||
CONFIG_GET_HEX_BASE(conf, settings, menu.title_color, "menu_title_color");
|
||||
config_get_path(conf, "menu_wallpaper", settings->menu.wallpaper, sizeof(settings->menu.wallpaper));
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.pause_libretro,
|
||||
"menu_pause_libretro");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.mouse.enable,
|
||||
"menu_mouse_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.pointer.enable,
|
||||
"menu_pointer_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.timedate_enable,
|
||||
"menu_timedate_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.core_enable,
|
||||
"menu_core_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.dynamic_wallpaper_enable,
|
||||
"menu_dynamic_wallpaper_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.boxart_enable,
|
||||
"menu_boxart_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.navigation.wraparound.horizontal_enable,
|
||||
"menu_navigation_wraparound_horizontal_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.navigation.wraparound.vertical_enable,
|
||||
"menu_navigation_wraparound_vertical_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings,
|
||||
menu.navigation.browser.filter.supported_extensions_enable,
|
||||
"menu_navigation_browser_filter_supported_extensions_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.collapse_subgroups_enable,
|
||||
"menu_collapse_subgroups_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.show_advanced_settings,
|
||||
"menu_show_advanced_settings");
|
||||
CONFIG_GET_HEX_BASE(conf, settings, menu.entry_normal_color,
|
||||
"menu_entry_normal_color");
|
||||
CONFIG_GET_HEX_BASE(conf, settings, menu.entry_hover_color,
|
||||
"menu_entry_hover_color");
|
||||
CONFIG_GET_HEX_BASE(conf, settings, menu.title_color,
|
||||
"menu_title_color");
|
||||
config_get_path(conf, "menu_wallpaper",
|
||||
settings->menu.wallpaper, sizeof(settings->menu.wallpaper));
|
||||
if (!strcmp(settings->menu.wallpaper, "default"))
|
||||
*settings->menu.wallpaper = '\0';
|
||||
#endif
|
||||
@ -1463,16 +1484,24 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
}
|
||||
}
|
||||
|
||||
config_get_path(conf, "input_remapping_path", settings->input.remapping_path, sizeof(settings->input.remapping_path));
|
||||
|
||||
config_get_path(conf, "resampler_directory", settings->resampler_directory, sizeof(settings->resampler_directory));
|
||||
config_get_path(conf, "extraction_directory", settings->extraction_directory, sizeof(settings->extraction_directory));
|
||||
config_get_path(conf, "input_remapping_directory", settings->input_remapping_directory, sizeof(settings->input_remapping_directory));
|
||||
config_get_path(conf, "core_assets_directory", settings->core_assets_directory, sizeof(settings->core_assets_directory));
|
||||
config_get_path(conf, "assets_directory", settings->assets_directory, sizeof(settings->assets_directory));
|
||||
config_get_path(conf, "dynamic_wallpapers_directory", settings->dynamic_wallpapers_directory, sizeof(settings->dynamic_wallpapers_directory));
|
||||
config_get_path(conf, "boxarts_directory", settings->boxarts_directory, sizeof(settings->boxarts_directory));
|
||||
config_get_path(conf, "playlist_directory", settings->playlist_directory, sizeof(settings->playlist_directory));
|
||||
config_get_path(conf, "input_remapping_path", settings->input.remapping_path,
|
||||
sizeof(settings->input.remapping_path));
|
||||
config_get_path(conf, "resampler_directory", settings->resampler_directory,
|
||||
sizeof(settings->resampler_directory));
|
||||
config_get_path(conf, "extraction_directory", settings->extraction_directory,
|
||||
sizeof(settings->extraction_directory));
|
||||
config_get_path(conf, "input_remapping_directory", settings->input_remapping_directory,
|
||||
sizeof(settings->input_remapping_directory));
|
||||
config_get_path(conf, "core_assets_directory", settings->core_assets_directory,
|
||||
sizeof(settings->core_assets_directory));
|
||||
config_get_path(conf, "assets_directory", settings->assets_directory,
|
||||
sizeof(settings->assets_directory));
|
||||
config_get_path(conf, "dynamic_wallpapers_directory", settings->dynamic_wallpapers_directory,
|
||||
sizeof(settings->dynamic_wallpapers_directory));
|
||||
config_get_path(conf, "boxarts_directory", settings->boxarts_directory,
|
||||
sizeof(settings->boxarts_directory));
|
||||
config_get_path(conf, "playlist_directory", settings->playlist_directory,
|
||||
sizeof(settings->playlist_directory));
|
||||
if (!strcmp(settings->core_assets_directory, "default"))
|
||||
*settings->core_assets_directory = '\0';
|
||||
if (!strcmp(settings->assets_directory, "default"))
|
||||
@ -1484,10 +1513,12 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
if (!strcmp(settings->playlist_directory, "default"))
|
||||
*settings->playlist_directory = '\0';
|
||||
#ifdef HAVE_MENU
|
||||
config_get_path(conf, "rgui_browser_directory", settings->menu_content_directory, sizeof(settings->menu_content_directory));
|
||||
config_get_path(conf, "rgui_browser_directory", settings->menu_content_directory,
|
||||
sizeof(settings->menu_content_directory));
|
||||
if (!strcmp(settings->menu_content_directory, "default"))
|
||||
*settings->menu_content_directory = '\0';
|
||||
config_get_path(conf, "rgui_config_directory", settings->menu_config_directory, sizeof(settings->menu_config_directory));
|
||||
config_get_path(conf, "rgui_config_directory", settings->menu_config_directory,
|
||||
sizeof(settings->menu_config_directory));
|
||||
if (!strcmp(settings->menu_config_directory, "default"))
|
||||
*settings->menu_config_directory = '\0';
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu_show_start_screen, "rgui_show_start_screen");
|
||||
@ -1501,8 +1532,10 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
CONFIG_GET_INT_BASE(conf, settings, archive.mode, "archive_mode");
|
||||
|
||||
config_get_path(conf, "recording_output_directory", global->record.output_dir, sizeof(global->record.output_dir));
|
||||
config_get_path(conf, "recording_config_directory", global->record.config_dir, sizeof(global->record.config_dir));
|
||||
config_get_path(conf, "recording_output_directory", global->record.output_dir,
|
||||
sizeof(global->record.output_dir));
|
||||
config_get_path(conf, "recording_config_directory", global->record.config_dir,
|
||||
sizeof(global->record.config_dir));
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
config_get_path(conf, "overlay_directory", global->overlay_dir, sizeof(global->overlay_dir));
|
||||
@ -1543,7 +1576,8 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
if (settings->fastforward_ratio <= 0.0f)
|
||||
settings->fastforward_ratio = 1.0f;
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, fastforward_ratio_throttle_enable, "fastforward_ratio_throttle_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, fastforward_ratio_throttle_enable,
|
||||
"fastforward_ratio_throttle_enable");
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, pause_nonactive, "pause_nonactive");
|
||||
CONFIG_GET_INT_BASE(conf, settings, autosave_interval, "autosave_interval");
|
||||
@ -2182,8 +2216,6 @@ static void save_keybind(config_file_t *conf, const char *prefix,
|
||||
save_keybind_axis(conf, prefix, base, bind);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* save_keybinds_user:
|
||||
* @conf : pointer to config file object
|
||||
@ -2366,7 +2398,8 @@ bool config_save_file(const char *path)
|
||||
config_set_string(conf, "location_driver", settings->location.driver);
|
||||
#ifdef HAVE_MENU
|
||||
#ifdef HAVE_THREADS
|
||||
config_set_bool(conf,"threaded_data_runloop_enable", settings->menu.threaded_data_runloop_enable);
|
||||
config_set_bool(conf,"threaded_data_runloop_enable",
|
||||
settings->menu.threaded_data_runloop_enable);
|
||||
#endif
|
||||
|
||||
config_set_bool(conf, "dpi_override_enable", settings->menu.dpi.override_enable);
|
||||
@ -2377,7 +2410,8 @@ bool config_save_file(const char *path)
|
||||
config_set_bool(conf,"menu_pointer_enable", settings->menu.pointer.enable);
|
||||
config_set_bool(conf,"menu_timedate_enable", settings->menu.timedate_enable);
|
||||
config_set_bool(conf,"menu_core_enable", settings->menu.core_enable);
|
||||
config_set_bool(conf,"menu_dynamic_wallpaper_enable", settings->menu.dynamic_wallpaper_enable);
|
||||
config_set_bool(conf,"menu_dynamic_wallpaper_enable",
|
||||
settings->menu.dynamic_wallpaper_enable);
|
||||
config_set_bool(conf,"menu_boxart_enable", settings->menu.boxart_enable);
|
||||
config_set_path(conf, "menu_wallpaper", settings->menu.wallpaper);
|
||||
#endif
|
||||
@ -2401,9 +2435,12 @@ bool config_save_file(const char *path)
|
||||
config_set_string(conf, "audio_device", settings->audio.device);
|
||||
config_set_string(conf, "video_filter", settings->video.softfilter_plugin);
|
||||
config_set_string(conf, "audio_dsp_plugin", settings->audio.dsp_plugin);
|
||||
config_set_string(conf, "core_updater_buildbot_url", settings->network.buildbot_url);
|
||||
config_set_string(conf, "core_updater_buildbot_assets_url", settings->network.buildbot_assets_url);
|
||||
config_set_bool(conf, "core_updater_auto_extract_archive", settings->network.buildbot_auto_extract_archive);
|
||||
config_set_string(conf, "core_updater_buildbot_url",
|
||||
settings->network.buildbot_url);
|
||||
config_set_string(conf, "core_updater_buildbot_assets_url",
|
||||
settings->network.buildbot_assets_url);
|
||||
config_set_bool(conf, "core_updater_auto_extract_archive",
|
||||
settings->network.buildbot_auto_extract_archive);
|
||||
config_set_string(conf, "camera_device", settings->camera.device);
|
||||
config_set_bool(conf, "camera_allow", settings->camera.allow);
|
||||
config_set_bool(conf, "audio_rate_control", settings->audio.rate_control);
|
||||
@ -2484,7 +2521,8 @@ bool config_save_file(const char *path)
|
||||
settings->menu.navigation.wraparound.horizontal_enable);
|
||||
config_set_bool(conf, "menu_navigation_wraparound_vertical_enable",
|
||||
settings->menu.navigation.wraparound.vertical_enable);
|
||||
config_set_bool(conf, "menu_navigation_browser_filter_supported_extensions_enable",
|
||||
config_set_bool(conf,
|
||||
"menu_navigation_browser_filter_supported_extensions_enable",
|
||||
settings->menu.navigation.browser.filter.supported_extensions_enable);
|
||||
config_set_bool(conf, "menu_collapse_subgroups_enable",
|
||||
settings->menu.collapse_subgroups_enable);
|
||||
@ -2562,7 +2600,8 @@ bool config_save_file(const char *path)
|
||||
settings->history_list_enable);
|
||||
|
||||
config_set_float(conf, "fastforward_ratio", settings->fastforward_ratio);
|
||||
config_set_bool(conf, "fastforward_ratio_throttle_enable", settings->fastforward_ratio_throttle_enable);
|
||||
config_set_bool(conf, "fastforward_ratio_throttle_enable",
|
||||
settings->fastforward_ratio_throttle_enable);
|
||||
config_set_float(conf, "slowmotion_ratio", settings->slowmotion_ratio);
|
||||
|
||||
config_set_bool(conf, "config_save_on_exit",
|
||||
@ -2620,7 +2659,8 @@ bool config_save_file(const char *path)
|
||||
config_set_bool(conf, "log_verbosity", global->verbosity);
|
||||
config_set_bool(conf, "perfcnt_enable", global->perfcnt_enable);
|
||||
|
||||
config_set_bool(conf, "core_set_supports_no_game_enable", settings->core.set_supports_no_game_enable);
|
||||
config_set_bool(conf, "core_set_supports_no_game_enable",
|
||||
settings->core.set_supports_no_game_enable);
|
||||
|
||||
config_set_int(conf, "archive_mode", settings->archive.mode);
|
||||
|
||||
|
61
content.c
61
content.c
@ -33,8 +33,8 @@
|
||||
#include <compat/strl.h>
|
||||
#include <file/file_path.h>
|
||||
#include <file/file_extract.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "msg_hash.h"
|
||||
#include "content.h"
|
||||
#include "file_ops.h"
|
||||
#include "general.h"
|
||||
@ -61,7 +61,8 @@ static bool read_content_file(unsigned i, const char *path, void **buf,
|
||||
uint8_t *ret_buf = NULL;
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
RARCH_LOG("Loading content file: %s.\n", path);
|
||||
RARCH_LOG("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_LOADING_CONTENT_FILE), path);
|
||||
if (!read_file(path, (void**) &ret_buf, length))
|
||||
return false;
|
||||
|
||||
@ -149,7 +150,9 @@ bool save_state(const char *path)
|
||||
void *data = NULL;
|
||||
size_t size = pretro_serialize_size();
|
||||
|
||||
RARCH_LOG("Saving state: \"%s\".\n", path);
|
||||
RARCH_LOG("%s: \"%s\".\n",
|
||||
msg_hash_to_str(MSG_SAVING_STATE),
|
||||
path);
|
||||
|
||||
if (size == 0)
|
||||
return false;
|
||||
@ -157,19 +160,21 @@ bool save_state(const char *path)
|
||||
data = malloc(size);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
RARCH_ERR("Failed to allocate memory for save state buffer.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
RARCH_LOG("State size: %d bytes.\n", (int)size);
|
||||
RARCH_LOG("%s: %d %s.\n",
|
||||
msg_hash_to_str(MSG_STATE_SIZE),
|
||||
(int)size,
|
||||
msg_hash_to_str(MSG_BYTES));
|
||||
ret = pretro_serialize(data, size);
|
||||
|
||||
if (ret)
|
||||
ret = write_file(path, data, size);
|
||||
|
||||
if (!ret)
|
||||
RARCH_ERR("Failed to save state to \"%s\".\n", path);
|
||||
RARCH_ERR("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_SAVE_STATE_TO),
|
||||
path);
|
||||
|
||||
free(data);
|
||||
|
||||
@ -195,20 +200,28 @@ bool load_state(const char *path)
|
||||
global_t *global = global_get_ptr();
|
||||
bool ret = read_file(path, &buf, &size);
|
||||
|
||||
RARCH_LOG("Loading state: \"%s\".\n", path);
|
||||
RARCH_LOG("%s: \"%s\".\n",
|
||||
msg_hash_to_str(MSG_LOADING_STATE),
|
||||
path);
|
||||
|
||||
if (!ret || size < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to load state from \"%s\".\n", path);
|
||||
RARCH_ERR("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE),
|
||||
path);
|
||||
return false;
|
||||
}
|
||||
|
||||
RARCH_LOG("State size: %u bytes.\n", (unsigned)size);
|
||||
RARCH_LOG("%s: %u %s.\n",
|
||||
msg_hash_to_str(MSG_STATE_SIZE),
|
||||
(unsigned)size,
|
||||
msg_hash_to_str(MSG_BYTES));
|
||||
|
||||
if (settings->block_sram_overwrite && global->savefiles
|
||||
&& global->savefiles->size)
|
||||
{
|
||||
RARCH_LOG("Blocking SRAM overwrite.\n");
|
||||
RARCH_LOG("%s.\n",
|
||||
msg_hash_to_str(MSG_BLOCKING_SRAM_OVERWRITE));
|
||||
blocks = (struct sram_block*)
|
||||
calloc(global->savefiles->size, sizeof(*blocks));
|
||||
|
||||
@ -285,8 +298,11 @@ void load_ram_file(const char *path, int type)
|
||||
{
|
||||
if (rc > (ssize_t)size)
|
||||
{
|
||||
RARCH_WARN("SRAM is larger than implementation expects, doing partial load (truncating %u bytes to %u).\n",
|
||||
(unsigned)rc, (unsigned)size);
|
||||
RARCH_WARN("SRAM is larger than implementation expects, doing partial load (truncating %u %s %s %u).\n",
|
||||
(unsigned)rc,
|
||||
msg_hash_to_str(MSG_BYTES),
|
||||
msg_hash_to_str(MSG_TO),
|
||||
(unsigned)size);
|
||||
rc = size;
|
||||
}
|
||||
memcpy(data, buf, rc);
|
||||
@ -318,13 +334,16 @@ void save_ram_file(const char *path, int type)
|
||||
|
||||
if (!write_file(path, data, size))
|
||||
{
|
||||
RARCH_ERR("Failed to save SRAM.\n");
|
||||
RARCH_ERR("%s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_SAVE_SRAM));
|
||||
RARCH_WARN("Attempting to recover ...\n");
|
||||
dump_to_file_desperate(data, size, type);
|
||||
return;
|
||||
}
|
||||
|
||||
RARCH_LOG("Saved successfully to \"%s\".\n", path);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_SAVED_SUCCESSFULLY_TO),
|
||||
path);
|
||||
}
|
||||
|
||||
static bool load_content_dont_need_fullpath(
|
||||
@ -344,7 +363,9 @@ static bool load_content_dont_need_fullpath(
|
||||
|
||||
if (!ret || len < 0)
|
||||
{
|
||||
RARCH_ERR("Could not read content file \"%s\".\n", path);
|
||||
RARCH_ERR("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_COULD_NOT_READ_CONTENT_FILE),
|
||||
path);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -402,7 +423,9 @@ static bool load_content_need_fullpath(
|
||||
|
||||
if (!ret || len < 0)
|
||||
{
|
||||
RARCH_ERR("Could not read content file \"%s\".\n", path);
|
||||
RARCH_ERR("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_COULD_NOT_READ_CONTENT_FILE),
|
||||
path);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -488,7 +511,7 @@ static bool load_content(const struct retro_subsystem_info *special,
|
||||
ret = pretro_load_game(*content->elems[0].data ? info : NULL);
|
||||
|
||||
if (!ret)
|
||||
RARCH_ERR("Failed to load content.\n");
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_LOAD_CONTENT));
|
||||
|
||||
end:
|
||||
for (i = 0; i < content->size; i++)
|
||||
|
@ -16,13 +16,13 @@
|
||||
*/
|
||||
|
||||
#include <file/file_extract.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "file_ext.h"
|
||||
#include "dir_list_special.h"
|
||||
|
||||
#include "database_info.h"
|
||||
#include "file_ops.h"
|
||||
#include "msg_hash.h"
|
||||
#include "general.h"
|
||||
#include "runloop.h"
|
||||
|
||||
@ -117,7 +117,7 @@ int database_info_build_query(char *s, size_t len,
|
||||
|
||||
database_info_build_query_add_bracket_open(s, len);
|
||||
|
||||
value = djb2_calculate(label);
|
||||
value = msg_hash_calculate(label);
|
||||
|
||||
switch (value)
|
||||
{
|
||||
@ -247,7 +247,7 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
|
||||
continue;
|
||||
|
||||
str = key->val.string.buff;
|
||||
value = djb2_calculate(str);
|
||||
value = msg_hash_calculate(str);
|
||||
|
||||
switch (value)
|
||||
{
|
||||
|
5
driver.c
5
driver.c
@ -14,11 +14,10 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <rhash.h>
|
||||
|
||||
#include "driver.h"
|
||||
#include "general.h"
|
||||
#include "retroarch.h"
|
||||
#include "msg_hash.h"
|
||||
#include "compat/posix_string.h"
|
||||
#include "gfx/video_monitor.h"
|
||||
#include "audio/audio_monitor.h"
|
||||
@ -90,7 +89,7 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||
char *s, size_t len)
|
||||
{
|
||||
const void *drv = NULL;
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
uint32_t hash = msg_hash_calculate(label);
|
||||
|
||||
switch (hash)
|
||||
{
|
||||
|
12
dynamic.c
12
dynamic.c
@ -44,6 +44,7 @@
|
||||
#include "runloop.h"
|
||||
#include "configuration.h"
|
||||
#include "general.h"
|
||||
#include "msg_hash.h"
|
||||
|
||||
#include "input/input_sensor.h"
|
||||
|
||||
@ -311,7 +312,7 @@ static void load_symbols(enum rarch_core_type type)
|
||||
{
|
||||
/* Try to verify that -lretro was not linked in from other modules
|
||||
* since loading it dynamically and with -l will fail hard. */
|
||||
RARCH_ERR("Serious problem. RetroArch wants to load libretro dyamically, but it is already linked.\n");
|
||||
RARCH_ERR("Serious problem. RetroArch wants to load libretro cores dyamically, but it is already linked.\n");
|
||||
RARCH_ERR("This could happen if other modules RetroArch depends on link against libretro directly.\n");
|
||||
RARCH_ERR("Proceeding could cause a crash. Aborting ...\n");
|
||||
rarch_fail(1, "init_libretro_sym()");
|
||||
@ -319,7 +320,7 @@ static void load_symbols(enum rarch_core_type type)
|
||||
|
||||
if (!*settings->libretro)
|
||||
{
|
||||
RARCH_ERR("RetroArch is built for dynamic libretro, but libretro_path is not set. Cannot continue.\n");
|
||||
RARCH_ERR("RetroArch is built for dynamic libretro cores, but libretro_path is not set. Cannot continue.\n");
|
||||
rarch_fail(1, "init_libretro_sym()");
|
||||
}
|
||||
|
||||
@ -329,12 +330,12 @@ static void load_symbols(enum rarch_core_type type)
|
||||
path_resolve_realpath(settings->libretro,
|
||||
sizeof(settings->libretro));
|
||||
|
||||
RARCH_LOG("Loading dynamic libretro from: \"%s\"\n",
|
||||
RARCH_LOG("Loading dynamic libretro core from: \"%s\"\n",
|
||||
settings->libretro);
|
||||
lib_handle = dylib_load(settings->libretro);
|
||||
if (!lib_handle)
|
||||
{
|
||||
RARCH_ERR("Failed to open dynamic library: \"%s\"\n",
|
||||
RARCH_ERR("Failed to open libretro core: \"%s\"\n",
|
||||
settings->libretro);
|
||||
rarch_fail(1, "load_dynamic()");
|
||||
}
|
||||
@ -504,7 +505,8 @@ void libretro_get_current_core_pathname(char *name, size_t size)
|
||||
return;
|
||||
|
||||
pretro_get_system_info(&info);
|
||||
id = info.library_name ? info.library_name : "Unknown";
|
||||
id = info.library_name ? info.library_name :
|
||||
msg_hash_to_str(MSG_UNKNOWN);
|
||||
|
||||
if (!id || strlen(id) >= size)
|
||||
{
|
||||
|
@ -1655,11 +1655,14 @@ static bool gl_frame(void *data, const void *frame,
|
||||
gl_set_prev_texture(gl, &gl->tex_info);
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
if (menu_driver_alive())
|
||||
menu_driver_frame();
|
||||
|
||||
if (gl->menu_texture_enable)
|
||||
gl_draw_texture(gl);
|
||||
{
|
||||
if (menu_driver_alive())
|
||||
menu_driver_frame();
|
||||
|
||||
if (gl->menu_texture_enable)
|
||||
gl_draw_texture(gl);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (msg && driver->font_osd_driver && driver->font_osd_data)
|
||||
|
@ -278,11 +278,7 @@ static bool android_input_lookup_name(char *buf,
|
||||
goto error;
|
||||
|
||||
CALL_INT_METHOD(env, *vendorId, device, getVendorId);
|
||||
if (!*vendorId)
|
||||
{
|
||||
RARCH_ERR("Failed to find vendor id for device ID: %d\n", id);
|
||||
goto error;
|
||||
}
|
||||
|
||||
RARCH_LOG("device vendor id: %d\n", *vendorId);
|
||||
|
||||
getProductId = NULL;
|
||||
@ -292,11 +288,7 @@ static bool android_input_lookup_name(char *buf,
|
||||
|
||||
*productId = 0;
|
||||
CALL_INT_METHOD(env, *productId, device, getProductId);
|
||||
if (!*productId)
|
||||
{
|
||||
RARCH_ERR("Failed to find product id for device ID: %d\n", id);
|
||||
goto error;
|
||||
}
|
||||
|
||||
RARCH_LOG("device product id: %d\n", *productId);
|
||||
|
||||
return true;
|
||||
|
@ -17,8 +17,6 @@
|
||||
#ifndef __INTL_ENGLISH_H
|
||||
#define __INTL_ENGLISH_H
|
||||
|
||||
#define RETRO_FRONTEND "RetroArch"
|
||||
|
||||
#define RETRO_LBL_JOYPAD_B "RetroPad B Button"
|
||||
#define RETRO_LBL_JOYPAD_Y "RetroPad Y Button"
|
||||
#define RETRO_LBL_JOYPAD_SELECT "RetroPad Select Button"
|
||||
@ -81,46 +79,4 @@
|
||||
#define RETRO_LBL_GRAB_MOUSE_TOGGLE "Grab mouse toggle"
|
||||
#define RETRO_LBL_MENU_TOGGLE "Menu toggle"
|
||||
|
||||
#define TERM_STR "\n"
|
||||
|
||||
#define RETRO_MSG_INIT_RECORDING_SKIPPED "Using libretro dummy core. Skipping recording."
|
||||
#define RETRO_MSG_INIT_RECORDING_FAILED "Failed to start recording."
|
||||
#define RETRO_MSG_TAKE_SCREENSHOT "Taking screenshot."
|
||||
#define RETRO_MSG_TAKE_SCREENSHOT_FAILED "Failed to take screenshot."
|
||||
#define RETRO_MSG_TAKE_SCREENSHOT_ERROR "Cannot take screenshot. GPU rendering is used and read_viewport is not supported."
|
||||
#define RETRO_MSG_AUDIO_WRITE_FAILED "Audio backend failed to write. Will continue without sound."
|
||||
#define RETRO_MSG_MOVIE_STARTED_INIT_NETPLAY_FAILED "Movie playback has started. Cannot start netplay."
|
||||
#define RETRO_MSG_INIT_NETPLAY_FAILED "Failed to initialize netplay."
|
||||
#define RETRO_MSG_INIT_AUTOSAVE_FAILED "Could not initialize autosave."
|
||||
#define RETRO_MSG_REWINDING "Rewinding."
|
||||
#define RETRO_MSG_REWIND_REACHED_END "Reached end of rewind buffer."
|
||||
#define RETRO_MSG_MOVIE_RECORD_STOPPING "Stopping movie record."
|
||||
#define RETRO_MSG_MOVIE_PLAYBACK_ENDED "Movie playback ended."
|
||||
#define RETRO_MSG_LIBRETRO_ABI_BREAK RETRO_FRONTEND " is compiled against a different version of libretro than this libretro implementation."
|
||||
#define RETRO_MSG_RESETTING_CONTENT "Resetting content."
|
||||
#define RETRO_MSG_REWIND_INIT "Initializing rewind buffer with size: "
|
||||
#define RETRO_MSG_REWIND_INIT_FAILED "Failed to initialize rewind buffer. Rewinding will be disabled"
|
||||
#define RETRO_MSG_REWIND_INIT_FAILED_NO_SAVESTATES "Implementation does not support save states. Cannot use rewind."
|
||||
#define RETRO_MSG_REWIND_INIT_FAILED_THREADED_AUDIO "Implementation uses threaded audio. Cannot use rewind."
|
||||
|
||||
#define RETRO_LOG_INIT_RECORDING_SKIPPED RETRO_MSG_INIT_RECORDING_SKIPPED TERM_STR
|
||||
#define RETRO_LOG_INIT_RECORDING_FAILED RETRO_MSG_INIT_RECORDING_FAILED TERM_STR
|
||||
#define RETRO_LOG_TAKE_SCREENSHOT RETRO_MSG_TAKE_SCREENSHOT TERM_STR
|
||||
#define RETRO_LOG_TAKE_SCREENSHOT_FAILED RETRO_MSG_TAKE_SCREENSHOT_FAILED TERM_STR
|
||||
#define RETRO_LOG_TAKE_SCREENSHOT_ERROR RETRO_MSG_TAKE_SCREENSHOT_ERROR TERM_STR
|
||||
#define RETRO_LOG_AUDIO_WRITE_FAILED RETRO_MSG_AUDIO_WRITE_FAILED TERM_STR
|
||||
#define RETRO_LOG_MOVIE_STARTED_INIT_NETPLAY_FAILED RETRO_MSG_MOVIE_STARTED_INIT_NETPLAY_FAILED TERM_STR
|
||||
#define RETRO_LOG_INIT_NETPLAY_FAILED RETRO_MSG_INIT_NETPLAY_FAILED TERM_STR
|
||||
#define RETRO_LOG_INIT_AUTOSAVE_FAILED RETRO_MSG_INIT_AUTOSAVE_FAILED TERM_STR
|
||||
#define RETRO_LOG_REWINDING RETRO_MSG_REWINDING TERM_STR
|
||||
#define RETRO_LOG_REWIND_REACHED_END RETRO_MSG_REWIND_REACHED_END TERM_STR
|
||||
#define RETRO_LOG_MOVIE_RECORD_STOPPING RETRO_MSG_MOVIE_RECORD_STOPPING TERM_STR
|
||||
#define RETRO_LOG_MOVIE_PLAYBACK_ENDED RETRO_MSG_MOVIE_PLAYBACK_ENDED TERM_STR
|
||||
#define RETRO_LOG_LIBRETRO_ABI_BREAK RETRO_MSG_LIBRETRO_ABI_BREAK RETRO_FRONTEND TERM_STR
|
||||
#define RETRO_LOG_RESETTING_CONTENT RETRO_MSG_RESETTING_CONTENT TERM_STR
|
||||
#define RETRO_LOG_REWIND_INIT RETRO_MSG_REWIND_INIT TERM_STR
|
||||
#define RETRO_LOG_REWIND_INIT_FAILED RETRO_MSG_REWIND_INIT_FAILED TERM_STR
|
||||
#define RETRO_LOG_REWIND_INIT_FAILED_NO_SAVESTATES RETRO_MSG_REWIND_INIT_FAILED_NO_SAVESTATES TERM_STR
|
||||
#define RETRO_LOG_REWIND_INIT_FAILED_THREADED_AUDIO RETRO_MSG_REWIND_INIT_FAILED_THREADED_AUDIO TERM_STR
|
||||
|
||||
#endif
|
||||
|
@ -20,7 +20,124 @@ const char *msg_hash_to_str_pt(uint32_t hash)
|
||||
{
|
||||
switch (hash)
|
||||
{
|
||||
case 0:
|
||||
case MSG_UNKNOWN:
|
||||
return "Desconhecido";
|
||||
case MSG_RECEIVED:
|
||||
return "recebido";
|
||||
case MSG_UNRECOGNIZED_COMMAND:
|
||||
return "Comando desconhecido";
|
||||
case MSG_SENDING_COMMAND:
|
||||
return "Enviando comando";
|
||||
case MSG_GOT_INVALID_DISK_INDEX:
|
||||
return "Índice de disco inválido.";
|
||||
case MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY:
|
||||
return "Falha ao remover disco da bandeja.";
|
||||
case MSG_REMOVED_DISK_FROM_TRAY:
|
||||
return "Disco removido da bandeja.";
|
||||
case MSG_VIRTUAL_DISK_TRAY:
|
||||
return "bandeja de disco virtual.";
|
||||
case MSG_FAILED_TO:
|
||||
return "Falha ao";
|
||||
case MSG_TO:
|
||||
return "para";
|
||||
case MSG_SAVING_RAM_TYPE:
|
||||
return "Salvando tipo de RAM";
|
||||
case MSG_SAVING_STATE:
|
||||
return "Salvando estado";
|
||||
case MSG_LOADING_STATE:
|
||||
return "Carregando estado";
|
||||
case MSG_FAILED_TO_LOAD_MOVIE_FILE:
|
||||
return "Falha ao carregar vídeo";
|
||||
case MSG_FAILED_TO_LOAD_CONTENT:
|
||||
return "Falha ao carregar conteúdo";
|
||||
case MSG_COULD_NOT_READ_CONTENT_FILE:
|
||||
return "Incapaz de ler arquivo de conteúdo";
|
||||
case MSG_GRAB_MOUSE_STATE:
|
||||
return "Obter estado do mouse";
|
||||
case MSG_PAUSED:
|
||||
return "Pausado.";
|
||||
case MSG_UNPAUSED:
|
||||
return "Despausado.";
|
||||
case MSG_FAILED_TO_LOAD_OVERLAY:
|
||||
return "Falha ao carregar overlay.";
|
||||
case MSG_FAILED_TO_UNMUTE_AUDIO:
|
||||
return "Falha ao desativar mudo.";
|
||||
case MSG_AUDIO_MUTED:
|
||||
return "Áudio mudo.";
|
||||
case MSG_AUDIO_UNMUTED:
|
||||
return "Áudio normal.";
|
||||
case MSG_RESET:
|
||||
return "Reiniciar";
|
||||
case MSG_FAILED_TO_LOAD_STATE:
|
||||
return "Falha ao carregar estado de";
|
||||
case MSG_FAILED_TO_SAVE_STATE_TO:
|
||||
return "Falha ao salvar estado em";
|
||||
case MSG_FAILED_TO_SAVE_SRAM:
|
||||
return "Falha ao salvar SRAM";
|
||||
case MSG_STATE_SIZE:
|
||||
return "Tamanho do estado";
|
||||
case MSG_BLOCKING_SRAM_OVERWRITE:
|
||||
return "Bloqueando Sobrescrição de SRAM";
|
||||
case MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES:
|
||||
return "O core não suporta savestates.";
|
||||
case MSG_SAVED_STATE_TO_SLOT:
|
||||
return "Estado salvo no slot";
|
||||
case MSG_SAVED_SUCCESSFULLY_TO:
|
||||
return "Salvo com sucesso em";
|
||||
case MSG_BYTES:
|
||||
return "bytes";
|
||||
case MSG_CONFIG_DIRECTORY_NOT_SET:
|
||||
return "Diretório de configurações não definido. Incapaz de salvar.";
|
||||
case MSG_SKIPPING_SRAM_LOAD:
|
||||
return "Ignorando carregamento de SRAM.";
|
||||
case MSG_APPENDED_DISK:
|
||||
return "Disco anexado";
|
||||
case MSG_STARTING_MOVIE_PLAYBACK:
|
||||
return "Iniciando reprodução de vídeo.";
|
||||
case MSG_FAILED_TO_REMOVE_TEMPORARY_FILE:
|
||||
return "Falha ao remover arquivo temporário";
|
||||
case MSG_REMOVING_TEMPORARY_CONTENT_FILE:
|
||||
return "Removendo conteúdo temporário";
|
||||
case MSG_LOADED_STATE_FROM_SLOT:
|
||||
return "Estado carregado do slot";
|
||||
case MSG_DOWNLOAD_PROGRESS:
|
||||
return "Progresso do download";
|
||||
case MSG_COULD_NOT_PROCESS_ZIP_FILE:
|
||||
return "Incapaz de processar arquivo ZIP.";
|
||||
case MSG_DOWNLOAD_COMPLETE:
|
||||
return "Download concluído";
|
||||
case MSG_SCANNING_OF_DIRECTORY_FINISHED:
|
||||
return "Exame de diretório concluído";
|
||||
case MSG_SCANNING:
|
||||
return "Examinando";
|
||||
case MSG_REDIRECTING_CHEATFILE_TO:
|
||||
return "Redirecionando cheat para";
|
||||
case MSG_REDIRECTING_SAVEFILE_TO:
|
||||
return "Redirecionando save para";
|
||||
case MSG_REDIRECTING_SAVESTATE_TO:
|
||||
return "Redirecionando savestate para";
|
||||
case MSG_SHADER:
|
||||
return "Shader";
|
||||
case MSG_APPLYING_SHADER:
|
||||
return "Aplicando shader";
|
||||
case MSG_FAILED_TO_APPLY_SHADER:
|
||||
return "Falha ao aplicar shader.";
|
||||
case MSG_STARTING_MOVIE_RECORD_TO:
|
||||
return "Iniciando gravação de vídeo em";
|
||||
case MSG_FAILED_TO_START_MOVIE_RECORD:
|
||||
return "Falha ao iniciar gravação de vídeo.";
|
||||
case MSG_STATE_SLOT:
|
||||
return "Slot de estado";
|
||||
case MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT:
|
||||
return "Reiniciando gravação devido a reinício de driver.";
|
||||
case MSG_SLOW_MOTION:
|
||||
return "Câmera lenta.";
|
||||
case MSG_SLOW_MOTION_REWIND:
|
||||
return "Retrocesso em câmera lenta.";
|
||||
case MSG_REWINDING:
|
||||
return "Retrocedendo.";
|
||||
case MSG_REWIND_REACHED_END:
|
||||
return "Final do buffer de retrocesso atingido.";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -20,10 +20,164 @@ const char *msg_hash_to_str_us(uint32_t hash)
|
||||
{
|
||||
switch (hash)
|
||||
{
|
||||
case MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT:
|
||||
return "Restarting recording due to driver reinit.";
|
||||
case MSG_PROGRAM:
|
||||
return "RetroArch";
|
||||
case MSG_MOVIE_RECORD_STOPPED:
|
||||
return "Stopping movie record.";
|
||||
case MSG_MOVIE_PLAYBACK_ENDED:
|
||||
return "Movie playback ended.";
|
||||
case MSG_AUTOSAVE_FAILED:
|
||||
return "Could not initialize autosave.";
|
||||
case MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED:
|
||||
return "Movie playback has started. Cannot start netplay.";
|
||||
case MSG_NETPLAY_FAILED:
|
||||
return "Failed to initialize netplay.";
|
||||
case MSG_LIBRETRO_ABI_BREAK:
|
||||
return "is compiled against a different version of libretro than this libretro implementation.";
|
||||
case MSG_REWIND_INIT_FAILED_NO_SAVESTATES:
|
||||
return "Implementation does not support save states. Cannot use rewind.";
|
||||
case MSG_REWIND_INIT_FAILED_THREADED_AUDIO:
|
||||
return "Implementation uses threaded audio. Cannot use rewind.";
|
||||
case MSG_REWIND_INIT_FAILED:
|
||||
return "Failed to initialize rewind buffer. Rewinding will be disabled.";
|
||||
case MSG_REWIND_INIT:
|
||||
return "Initializing rewind buffer with size";
|
||||
case MSG_CUSTOM_TIMING_GIVEN:
|
||||
return "Custom timing given";
|
||||
case MSG_VIEWPORT_SIZE_CALCULATION_FAILED:
|
||||
return "Viewport size calculation failed! Will continue using raw data. This will probably not work right ...";
|
||||
case MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING:
|
||||
return "Libretro core is hardware rendered. Must use post-shaded recording as well.";
|
||||
case MSG_RECORDING_TO:
|
||||
return "Recording to";
|
||||
case MSG_DETECTED_VIEWPORT_OF:
|
||||
return "Detected viewport of";
|
||||
case MSG_TAKING_SCREENSHOT:
|
||||
return "Taking screenshot.";
|
||||
case MSG_FAILED_TO_TAKE_SCREENSHOT:
|
||||
return "Failed to take screenshot.";
|
||||
case MSG_FAILED_TO_START_RECORDING:
|
||||
return "Failed to start recording.";
|
||||
case MSG_RECORDING_TERMINATED_DUE_TO_RESIZE:
|
||||
return "Recording terminated due to resize.";
|
||||
case MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED:
|
||||
return "Using libretro dummy core. Skipping recording.";
|
||||
case MSG_UNKNOWN:
|
||||
return "Unknown";
|
||||
case MSG_LOADING_CONTENT_FILE:
|
||||
return "Loading content file";
|
||||
case MSG_RECEIVED:
|
||||
return "received";
|
||||
case MSG_UNRECOGNIZED_COMMAND:
|
||||
return "Unrecognized command";
|
||||
case MSG_SENDING_COMMAND:
|
||||
return "Sending command";
|
||||
case MSG_GOT_INVALID_DISK_INDEX:
|
||||
return "Got invalid disk index.";
|
||||
case MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY:
|
||||
return "Failed to remove disk from tray.";
|
||||
case MSG_REMOVED_DISK_FROM_TRAY:
|
||||
return "Removed disk from tray.";
|
||||
case MSG_VIRTUAL_DISK_TRAY:
|
||||
return "virtual disk tray.";
|
||||
case MSG_FAILED_TO:
|
||||
return "Failed to";
|
||||
case MSG_TO:
|
||||
return "to";
|
||||
case MSG_SAVING_RAM_TYPE:
|
||||
return "Saving RAM type";
|
||||
case MSG_SAVING_STATE:
|
||||
return "Saving state";
|
||||
case MSG_LOADING_STATE:
|
||||
return "Loading state";
|
||||
case MSG_FAILED_TO_LOAD_MOVIE_FILE:
|
||||
return "Failed to load movie file";
|
||||
case MSG_FAILED_TO_LOAD_CONTENT:
|
||||
return "Failed to load content";
|
||||
case MSG_COULD_NOT_READ_CONTENT_FILE:
|
||||
return "Could not read content file";
|
||||
case MSG_GRAB_MOUSE_STATE:
|
||||
return "Grab mouse state";
|
||||
case MSG_PAUSED:
|
||||
return "Paused.";
|
||||
case MSG_UNPAUSED:
|
||||
return "Unpaused.";
|
||||
case MSG_FAILED_TO_LOAD_OVERLAY:
|
||||
return "Failed to load overlay.";
|
||||
case MSG_FAILED_TO_UNMUTE_AUDIO:
|
||||
return "Failed to unmute audio.";
|
||||
case MSG_AUDIO_MUTED:
|
||||
return "Audio muted.";
|
||||
case MSG_AUDIO_UNMUTED:
|
||||
return "Audio unmuted.";
|
||||
case MSG_RESET:
|
||||
return "Reset";
|
||||
case MSG_FAILED_TO_LOAD_STATE:
|
||||
return "Failed to load state from";
|
||||
case MSG_FAILED_TO_SAVE_STATE_TO:
|
||||
return "Failed to save state to";
|
||||
case MSG_FAILED_TO_SAVE_SRAM:
|
||||
return "Failed to save SRAM";
|
||||
case MSG_STATE_SIZE:
|
||||
return "State size";
|
||||
case MSG_FOUND_SHADER:
|
||||
return "Found shader";
|
||||
case MSG_SRAM_WILL_NOT_BE_SAVED:
|
||||
return "SRAM will not be saved.";
|
||||
case MSG_BLOCKING_SRAM_OVERWRITE:
|
||||
return "Blocking SRAM Overwrite";
|
||||
case MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES:
|
||||
return "Core does not support save states.";
|
||||
case MSG_SAVED_STATE_TO_SLOT:
|
||||
return "Saved state to slot";
|
||||
case MSG_SAVED_SUCCESSFULLY_TO:
|
||||
return "Saved successfully to";
|
||||
case MSG_BYTES:
|
||||
return "bytes";
|
||||
case MSG_CONFIG_DIRECTORY_NOT_SET:
|
||||
return "Config directory not set. Cannot save new config.";
|
||||
case MSG_SKIPPING_SRAM_LOAD:
|
||||
return "Skipping SRAM load.";
|
||||
case MSG_APPENDED_DISK:
|
||||
return "Appended disk";
|
||||
case MSG_STARTING_MOVIE_PLAYBACK:
|
||||
return "Starting movie playback.";
|
||||
case MSG_FAILED_TO_REMOVE_TEMPORARY_FILE:
|
||||
return "Failed to remove temporary file";
|
||||
case MSG_REMOVING_TEMPORARY_CONTENT_FILE:
|
||||
return "Removing temporary content file";
|
||||
case MSG_LOADED_STATE_FROM_SLOT:
|
||||
return "Loaded state from slot";
|
||||
case MSG_DOWNLOAD_PROGRESS:
|
||||
return "Download progress";
|
||||
case MSG_COULD_NOT_PROCESS_ZIP_FILE:
|
||||
return "Could not process ZIP file.";
|
||||
case MSG_DOWNLOAD_COMPLETE:
|
||||
return "Download complete";
|
||||
case MSG_SCANNING_OF_DIRECTORY_FINISHED:
|
||||
return "Scanning of directory finished";
|
||||
case MSG_SCANNING:
|
||||
return "Scanning";
|
||||
case MSG_REDIRECTING_CHEATFILE_TO:
|
||||
return "Redirecting cheat file to";
|
||||
case MSG_REDIRECTING_SAVEFILE_TO:
|
||||
return "Redirecting save file to";
|
||||
case MSG_REDIRECTING_SAVESTATE_TO:
|
||||
return "Redirecting savestate to";
|
||||
case MSG_SHADER:
|
||||
return "Shader";
|
||||
case MSG_APPLYING_SHADER:
|
||||
return "Applying shader";
|
||||
case MSG_FAILED_TO_APPLY_SHADER:
|
||||
return "Failed to apply shader.";
|
||||
case MSG_STARTING_MOVIE_RECORD_TO:
|
||||
return "Starting movie record to";
|
||||
case MSG_FAILED_TO_START_MOVIE_RECORD:
|
||||
return "Failed to start movie record.";
|
||||
case MSG_STATE_SLOT:
|
||||
return "State slot";
|
||||
case MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT:
|
||||
return "Restarting recording due to driver reinit.";
|
||||
case MSG_SLOW_MOTION:
|
||||
return "Slow motion.";
|
||||
case MSG_SLOW_MOTION_REWIND:
|
||||
|
@ -65,7 +65,7 @@ FILE *rarch_main_log_file(void);
|
||||
#define PROGRAM_NAME "N/A"
|
||||
#endif
|
||||
|
||||
#if defined(RARCH_INTERNAL)
|
||||
#if defined(RARCH_INTERNAL) && !defined(ANDROID)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "audio/audio_utils.h"
|
||||
#include "record/record_driver.h"
|
||||
#include "gfx/video_pixel_converter.h"
|
||||
#include "intl/intl.h"
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
#include "netplay.h"
|
||||
|
@ -22,8 +22,8 @@
|
||||
|
||||
#include "../../general.h"
|
||||
#include "../../performance.h"
|
||||
#include "../../intl/intl.h"
|
||||
#include "../../system.h"
|
||||
#include "../../intl/intl.h"
|
||||
|
||||
const char axis_labels[4][128] = {
|
||||
RETRO_LBL_ANALOG_LEFT_X,
|
||||
|
@ -83,6 +83,7 @@ enum
|
||||
XMB_TEXTURE_FOLDER,
|
||||
XMB_TEXTURE_ZIP,
|
||||
XMB_TEXTURE_MUSIC,
|
||||
XMB_TEXTURE_IMAGE,
|
||||
XMB_TEXTURE_CORE,
|
||||
XMB_TEXTURE_RDB,
|
||||
XMB_TEXTURE_CURSOR,
|
||||
@ -1123,6 +1124,8 @@ static GLuint xmb_icon_get_id(xmb_handle_t *xmb,
|
||||
return xmb->textures.list[XMB_TEXTURE_ZIP].id;
|
||||
case MENU_FILE_MUSIC:
|
||||
return xmb->textures.list[XMB_TEXTURE_MUSIC].id;
|
||||
case MENU_FILE_IMAGEVIEWER:
|
||||
return xmb->textures.list[XMB_TEXTURE_IMAGE].id;
|
||||
case MENU_FILE_CORE:
|
||||
return xmb->textures.list[XMB_TEXTURE_CORE].id;
|
||||
case MENU_FILE_RDB:
|
||||
@ -1302,6 +1305,8 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||
break;
|
||||
case MENU_VALUE_MUSIC:
|
||||
break;
|
||||
case MENU_VALUE_IMAGE:
|
||||
break;
|
||||
case MENU_VALUE_ON:
|
||||
if (xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id)
|
||||
texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id;
|
||||
@ -2085,6 +2090,9 @@ static void xmb_context_reset_textures(xmb_handle_t *xmb, const char *iconpath)
|
||||
case XMB_TEXTURE_MUSIC:
|
||||
fill_pathname_join(path, iconpath, "music.png", sizeof(path));
|
||||
break;
|
||||
case XMB_TEXTURE_IMAGE:
|
||||
fill_pathname_join(path, iconpath, "image.png", sizeof(path));
|
||||
break;
|
||||
case XMB_TEXTURE_CORE:
|
||||
fill_pathname_join(path, iconpath, "core.png", sizeof(path));
|
||||
break;
|
||||
|
@ -92,7 +92,7 @@ const char *menu_hash_to_str_pt(uint32_t hash)
|
||||
case MENU_LABEL_VALUE_AUDIO_BLOCK_FRAMES:
|
||||
return "Quadros de Blocos de Áudio";
|
||||
case MENU_LABEL_VALUE_INPUT_BIND_MODE:
|
||||
return "Modo Vínculo";
|
||||
return "Modo de Associações";
|
||||
case MENU_LABEL_VALUE_AUTOCONFIG_DESCRIPTOR_LABEL_SHOW:
|
||||
return "Mostrar Rótulos de Autoconfiguração";
|
||||
case MENU_LABEL_VALUE_INPUT_DESCRIPTOR_LABEL_SHOW:
|
||||
@ -324,9 +324,9 @@ const char *menu_hash_to_str_pt(uint32_t hash)
|
||||
case MENU_LABEL_VALUE_VIDEO_FULLSCREEN:
|
||||
return "Usar Modo Tela Cheia";
|
||||
case MENU_LABEL_VALUE_VIDEO_SCALE:
|
||||
return "Interpolação em Janela";
|
||||
return "Variar Escala em Janela";
|
||||
case MENU_LABEL_VALUE_VIDEO_SCALE_INTEGER:
|
||||
return "Interpolação em Inteiros";
|
||||
return "Escala em Degraus Inteiros";
|
||||
case MENU_LABEL_VALUE_PERFCNT_ENABLE:
|
||||
return "Contadores de Desempenho";
|
||||
case MENU_LABEL_VALUE_LIBRETRO_LOG_LEVEL:
|
||||
@ -404,7 +404,7 @@ const char *menu_hash_to_str_pt(uint32_t hash)
|
||||
case MENU_LABEL_VALUE_FPS_SHOW:
|
||||
return "Mostrar Taxa de Quadros";
|
||||
case MENU_LABEL_VALUE_AUDIO_MUTE:
|
||||
return "Desligar Áudio";
|
||||
return "Silenciar Áudio";
|
||||
case MENU_LABEL_VALUE_AUDIO_VOLUME:
|
||||
return "Volume de Áudio (dB)";
|
||||
case MENU_LABEL_VALUE_AUDIO_SYNC:
|
||||
@ -841,6 +841,14 @@ const char *menu_hash_to_str_pt(uint32_t hash)
|
||||
return "Analógico Esquerdo";
|
||||
case MENU_VALUE_RIGHT_ANALOG:
|
||||
return "Analógico Direito";
|
||||
case MENU_LABEL_VALUE_INPUT_HOTKEY_BINDS:
|
||||
return "Associação de Teclas de Atalho";
|
||||
case MENU_LABEL_VALUE_FRAME_THROTTLE_SETTINGS:
|
||||
return "Definições do Limitador de Quadros";
|
||||
case MENU_VALUE_SEARCH:
|
||||
return "Busca:";
|
||||
case MENU_LABEL_VALUE_USE_BUILTIN_IMAGE_VIEWER:
|
||||
return "Usar Visualizador de Imagens Interno";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -480,6 +480,7 @@ extern "C" {
|
||||
#define MENU_VALUE_FALSE 0x0f6bcef0U
|
||||
#define MENU_VALUE_COMP 0x6a166ba5U
|
||||
#define MENU_VALUE_MUSIC 0xc4a73997U
|
||||
#define MENU_VALUE_IMAGE 0xbab7ebf9U
|
||||
#define MENU_VALUE_CORE 0x6a167f7fU
|
||||
#define MENU_VALUE_CURSOR 0x57bba8b4U
|
||||
#define MENU_VALUE_FILE 0x6a496536U
|
||||
|
@ -505,9 +505,9 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
sscanf(value, "%d", setting->value.integer);
|
||||
if (setting->flags & SD_FLAG_HAS_RANGE)
|
||||
{
|
||||
if (*setting->value.integer < setting->min)
|
||||
if (setting->enforce_minrange && *setting->value.integer < setting->min)
|
||||
*setting->value.integer = setting->min;
|
||||
if (*setting->value.integer > setting->max)
|
||||
if (setting->enforce_maxrange && *setting->value.integer > setting->max)
|
||||
*setting->value.integer = setting->max;
|
||||
}
|
||||
break;
|
||||
@ -515,9 +515,9 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
sscanf(value, "%u", setting->value.unsigned_integer);
|
||||
if (setting->flags & SD_FLAG_HAS_RANGE)
|
||||
{
|
||||
if (*setting->value.unsigned_integer < setting->min)
|
||||
if (setting->enforce_minrange && *setting->value.unsigned_integer < setting->min)
|
||||
*setting->value.unsigned_integer = setting->min;
|
||||
if (*setting->value.unsigned_integer > setting->max)
|
||||
if (setting->enforce_maxrange && *setting->value.unsigned_integer > setting->max)
|
||||
*setting->value.unsigned_integer = setting->max;
|
||||
}
|
||||
break;
|
||||
@ -525,9 +525,9 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
sscanf(value, "%f", setting->value.fraction);
|
||||
if (setting->flags & SD_FLAG_HAS_RANGE)
|
||||
{
|
||||
if (*setting->value.fraction < setting->min)
|
||||
if (setting->enforce_minrange && *setting->value.fraction < setting->min)
|
||||
*setting->value.fraction = setting->min;
|
||||
if (*setting->value.fraction > setting->max)
|
||||
if (setting->enforce_maxrange && *setting->value.fraction > setting->max)
|
||||
*setting->value.fraction = setting->max;
|
||||
}
|
||||
break;
|
||||
|
@ -26,7 +26,7 @@ const char *msg_hash_to_str(uint32_t hash)
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!settings)
|
||||
return "null";
|
||||
goto end;
|
||||
|
||||
switch (settings->user_language)
|
||||
{
|
||||
@ -57,6 +57,7 @@ const char *msg_hash_to_str(uint32_t hash)
|
||||
if (ret && strcmp(ret, "null") != 0)
|
||||
return ret;
|
||||
|
||||
end:
|
||||
return msg_hash_to_str_us(hash);
|
||||
}
|
||||
|
||||
|
178
msg_hash.h
Normal file
178
msg_hash.h
Normal file
@ -0,0 +1,178 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2015 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __MSG_HASH_H
|
||||
#define __MSG_HASH_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define MSG_UNKNOWN 0x3a834e55U
|
||||
#define MSG_PROGRAM 0xc339565dU
|
||||
#define MSG_FOUND_SHADER 0x817f42b7U
|
||||
|
||||
#define MSG_LOADING_HISTORY_FILE 0x865210d3U
|
||||
#define MSG_SRAM_WILL_NOT_BE_SAVED 0x16f17d61U
|
||||
|
||||
#define MSG_RECEIVED 0xfe0c06acU
|
||||
|
||||
#define MSG_LOADING_CONTENT_FILE 0x236398dcU
|
||||
|
||||
#define MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED 0x9e8a1febU
|
||||
#define MSG_RECORDING_TERMINATED_DUE_TO_RESIZE 0x361a07feU
|
||||
#define MSG_FAILED_TO_START_RECORDING 0x90c3e2d5U
|
||||
|
||||
#define MSG_REWIND_INIT 0xf7732001U
|
||||
#define MSG_REWIND_INIT_FAILED 0x9c1db0a6U
|
||||
#define MSG_REWIND_INIT_FAILED_THREADED_AUDIO 0x359001b6U
|
||||
#define MSG_REWIND_INIT_FAILED_NO_SAVESTATES 0x979b9cc3U
|
||||
|
||||
#define MSG_LIBRETRO_ABI_BREAK 0xf02cccd7U
|
||||
|
||||
#define MSG_NETPLAY_FAILED 0x61ee3426U
|
||||
#define MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED 0xb1e5dbfcU
|
||||
|
||||
#define MSG_DETECTED_VIEWPORT_OF 0xdf7002baU
|
||||
#define MSG_RECORDING_TO 0x189fd324U
|
||||
#define MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING 0x7f9f7659U
|
||||
#define MSG_VIEWPORT_SIZE_CALCULATION_FAILED 0x9da84911U
|
||||
|
||||
#define MSG_AUTOSAVE_FAILED 0x9a02d8d1U
|
||||
|
||||
#define MSG_MOVIE_RECORD_STOPPED 0xbc7832c1U
|
||||
#define MSG_MOVIE_PLAYBACK_ENDED 0xbeadce2aU
|
||||
|
||||
#define MSG_TAKING_SCREENSHOT 0xdcfda0e0U
|
||||
#define MSG_FAILED_TO_TAKE_SCREENSHOT 0x7a480a2dU
|
||||
|
||||
#define MSG_CUSTOM_TIMING_GIVEN 0x259c95dfU
|
||||
|
||||
#define MSG_SAVING_STATE 0xe4f3eb4dU
|
||||
#define MSG_LOADING_STATE 0x68d8d483U
|
||||
#define MSG_FAILED_TO_SAVE_STATE_TO 0xcc005f3cU
|
||||
#define MSG_FAILED_TO_SAVE_SRAM 0x0f72de6cU
|
||||
#define MSG_STATE_SIZE 0x27b67400U
|
||||
|
||||
#define MSG_FAILED_TO_LOAD_CONTENT 0x0186e5a5U
|
||||
#define MSG_COULD_NOT_READ_CONTENT_FILE 0x2dc7f4a0U
|
||||
#define MSG_SAVED_SUCCESSFULLY_TO 0x9f59a7deU
|
||||
|
||||
#define MSG_BYTES 0x0f30b64cU
|
||||
|
||||
#define MSG_BLOCKING_SRAM_OVERWRITE 0x1f91d486U
|
||||
|
||||
#define MSG_UNRECOGNIZED_COMMAND 0x946b8a50U
|
||||
|
||||
#define MSG_SENDING_COMMAND 0x562cf28bU
|
||||
|
||||
#define MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT 0x5aa753b8U
|
||||
|
||||
#define MSG_REWINDING 0xccbeec2cU
|
||||
#define MSG_SLOW_MOTION_REWIND 0x385adb27U
|
||||
#define MSG_SLOW_MOTION 0x744c437fU
|
||||
#define MSG_REWIND_REACHED_END 0x4f1aab8fU
|
||||
#define MSG_FAILED_TO_START_MOVIE_RECORD 0x61221776U
|
||||
|
||||
#define MSG_STATE_SLOT 0x27b67f67U
|
||||
#define MSG_STARTING_MOVIE_RECORD_TO 0x6a7e0d50U
|
||||
#define MSG_FAILED_TO_START_MOVIE_RECORD 0x61221776U
|
||||
|
||||
#define MSG_FAILED_TO_APPLY_SHADER 0x2094eb67U
|
||||
#define MSG_APPLYING_SHADER 0x35599b7fU
|
||||
#define MSG_SHADER 0x1bb1211cU
|
||||
|
||||
#define MSG_REDIRECTING_SAVESTATE_TO 0x8d98f7a6U
|
||||
#define MSG_REDIRECTING_SAVEFILE_TO 0x868c54a5U
|
||||
#define MSG_REDIRECTING_CHEATFILE_TO 0xd5f1b27bU
|
||||
|
||||
#define MSG_SCANNING 0x4c547516U
|
||||
#define MSG_SCANNING_OF_DIRECTORY_FINISHED 0x399632a7U
|
||||
|
||||
#define MSG_DOWNLOAD_COMPLETE 0x4b9c4f75U
|
||||
#define MSG_COULD_NOT_PROCESS_ZIP_FILE 0xc18c89bbU
|
||||
#define MSG_DOWNLOAD_PROGRESS 0x35ed9411U
|
||||
|
||||
#define MSG_LOADED_STATE_FROM_SLOT 0xadb48582U
|
||||
|
||||
#define MSG_REMOVING_TEMPORARY_CONTENT_FILE 0x7121c9e7U
|
||||
#define MSG_FAILED_TO_REMOVE_TEMPORARY_FILE 0xb6707b1aU
|
||||
|
||||
#define MSG_STARTING_MOVIE_PLAYBACK 0x96e545b6U
|
||||
|
||||
#define MSG_APPENDED_DISK 0x814ea0f0U
|
||||
|
||||
#define MSG_SKIPPING_SRAM_LOAD 0x88d4c8dbU
|
||||
|
||||
#define MSG_CONFIG_DIRECTORY_NOT_SET 0xcd45252aU
|
||||
|
||||
#define MSG_SAVED_STATE_TO_SLOT 0xe1e3dc3bU
|
||||
|
||||
#define MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES 0xd50adf46U
|
||||
#define MSG_FAILED_TO_LOAD_STATE 0x91f348ebU
|
||||
|
||||
#define MSG_RESET 0x10474288U
|
||||
|
||||
#define MSG_AUDIO_MUTED 0xfa0c3bd5U
|
||||
#define MSG_AUDIO_UNMUTED 0x0512bab8U
|
||||
#define MSG_FAILED_TO_UNMUTE_AUDIO 0xf698763aU
|
||||
|
||||
#define MSG_FAILED_TO_LOAD_OVERLAY 0xacf201ecU
|
||||
|
||||
#define MSG_PAUSED 0x143e3307U
|
||||
#define MSG_UNPAUSED 0x95aede0aU
|
||||
|
||||
#define MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS 0x6ba5abf9U
|
||||
|
||||
#define MSG_GRAB_MOUSE_STATE 0x893a7329U
|
||||
|
||||
#define MSG_FAILED_TO_LOAD_MOVIE_FILE 0x9455a5a9U
|
||||
|
||||
#define MSG_FAILED_TO 0x768f6dacU
|
||||
|
||||
#define MSG_SAVING_RAM_TYPE 0x9cd21d2dU
|
||||
|
||||
#define MSG_TO 0x005979a8U
|
||||
|
||||
#define MSG_VIRTUAL_DISK_TRAY 0x4aa37f15U
|
||||
#define MSG_REMOVED_DISK_FROM_TRAY 0xf26a9653U
|
||||
|
||||
#define MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY 0xc1c9a655U
|
||||
|
||||
#define MSG_GOT_INVALID_DISK_INDEX 0xb138dd76U
|
||||
|
||||
const char *msg_hash_to_str(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_fr(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_de(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_es(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_eo(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_it(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_pt(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_nl(uint32_t hash);
|
||||
|
||||
const char *msg_hash_to_str_us(uint32_t hash);
|
||||
|
||||
uint32_t msg_hash_calculate(const char *s);
|
||||
|
||||
#endif
|
||||
|
10
netplay.c
10
netplay.c
@ -25,7 +25,7 @@
|
||||
#include "general.h"
|
||||
#include "autosave.h"
|
||||
#include "dynamic.h"
|
||||
#include "intl/intl.h"
|
||||
#include "msg_hash.h"
|
||||
#include "system.h"
|
||||
|
||||
struct delta_frame
|
||||
@ -1660,7 +1660,7 @@ bool init_netplay(void)
|
||||
|
||||
if (global->bsv.movie_start_playback)
|
||||
{
|
||||
RARCH_WARN(RETRO_LOG_MOVIE_STARTED_INIT_NETPLAY_FAILED);
|
||||
RARCH_WARN("%s\n", msg_hash_to_str(MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1684,10 +1684,10 @@ bool init_netplay(void)
|
||||
return true;
|
||||
|
||||
global->netplay_is_client = false;
|
||||
RARCH_WARN(RETRO_LOG_INIT_NETPLAY_FAILED);
|
||||
RARCH_WARN("%s\n", msg_hash_to_str(MSG_NETPLAY_FAILED));
|
||||
|
||||
rarch_main_msg_queue_push(
|
||||
RETRO_MSG_INIT_NETPLAY_FAILED,
|
||||
rarch_main_msg_queue_push_new(
|
||||
MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED,
|
||||
0, 180, false);
|
||||
return false;
|
||||
}
|
||||
|
7
patch.c
7
patch.c
@ -148,9 +148,11 @@ patch_error_t bps_apply_patch(
|
||||
case SOURCE_COPY:
|
||||
case TARGET_COPY:
|
||||
{
|
||||
int offset = bps_decode(&bps);
|
||||
int offset = bps_decode(&bps);
|
||||
bool negative = offset & 1;
|
||||
|
||||
offset >>= 1;
|
||||
|
||||
if (negative)
|
||||
offset = -offset;
|
||||
|
||||
@ -257,7 +259,8 @@ static uint64_t ups_decode(struct ups_data *data)
|
||||
while (true)
|
||||
{
|
||||
uint8_t x = ups_patch_read(data);
|
||||
offset += (x & 0x7f) * shift;
|
||||
offset += (x & 0x7f) * shift;
|
||||
|
||||
if (x & 0x80)
|
||||
break;
|
||||
shift <<= 7;
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "../general.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../intl/intl.h"
|
||||
#include "../gfx/video_driver.h"
|
||||
#include "../gfx/video_viewport.h"
|
||||
#include "../msg_hash.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
@ -121,22 +121,22 @@ void find_record_driver(void)
|
||||
int i = find_driver_index("record_driver", settings->record.driver);
|
||||
|
||||
if (i >= 0)
|
||||
driver->recording = (const record_driver_t*)audio_driver_find_handle(i);
|
||||
driver->recording = (const record_driver_t*)record_driver_find_handle(i);
|
||||
else
|
||||
{
|
||||
unsigned d;
|
||||
|
||||
RARCH_ERR("Couldn't find any audio driver named \"%s\"\n",
|
||||
RARCH_ERR("Couldn't find any record driver named \"%s\"\n",
|
||||
settings->audio.driver);
|
||||
RARCH_LOG_OUTPUT("Available audio drivers are:\n");
|
||||
for (d = 0; audio_driver_find_handle(d); d++)
|
||||
RARCH_LOG_OUTPUT("Available record drivers are:\n");
|
||||
for (d = 0; record_driver_find_handle(d); d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", record_driver_find_ident(d));
|
||||
RARCH_WARN("Going to default to first audio driver...\n");
|
||||
RARCH_WARN("Going to default to first record driver...\n");
|
||||
|
||||
driver->audio = (const audio_driver_t*)audio_driver_find_handle(0);
|
||||
driver->recording = (const record_driver_t*)record_driver_find_handle(0);
|
||||
|
||||
if (!driver->audio)
|
||||
rarch_fail(1, "find_audio_driver()");
|
||||
if (!driver->recording)
|
||||
rarch_fail(1, "find_record_driver()");
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,7 +216,8 @@ void recording_dump_frame(const void *data, unsigned width,
|
||||
|
||||
if (!vp.width || !vp.height)
|
||||
{
|
||||
RARCH_WARN("Viewport size calculation failed! Will continue using raw data. This will probably not work right ...\n");
|
||||
RARCH_WARN("%s \n",
|
||||
msg_hash_to_str(MSG_VIEWPORT_SIZE_CALCULATION_FAILED));
|
||||
event_command(EVENT_CMD_GPU_RECORD_DEINIT);
|
||||
|
||||
recording_dump_frame(data, width, height, pitch);
|
||||
@ -227,10 +228,9 @@ void recording_dump_frame(const void *data, unsigned width,
|
||||
if (vp.width != global->record.gpu_width ||
|
||||
vp.height != global->record.gpu_height)
|
||||
{
|
||||
static const char msg[] = "Recording terminated due to resize.";
|
||||
RARCH_WARN("%s\n", msg);
|
||||
RARCH_WARN("%s\n", msg_hash_to_str(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE));
|
||||
|
||||
rarch_main_msg_queue_push(msg, 1, 180, true);
|
||||
rarch_main_msg_queue_push_new(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE, 1, 180, true);
|
||||
event_command(EVENT_CMD_RECORD_DEINIT);
|
||||
return;
|
||||
}
|
||||
@ -301,17 +301,18 @@ bool recording_init(void)
|
||||
|
||||
if (global->core_type == CORE_TYPE_DUMMY)
|
||||
{
|
||||
RARCH_WARN(RETRO_LOG_INIT_RECORDING_SKIPPED);
|
||||
RARCH_WARN(msg_hash_to_str(MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!settings->video.gpu_record && hw_render->context_type)
|
||||
{
|
||||
RARCH_WARN("Libretro core is hardware rendered. Must use post-shaded recording as well.\n");
|
||||
RARCH_WARN("%s.\n", msg_hash_to_str(MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING));
|
||||
return false;
|
||||
}
|
||||
|
||||
RARCH_LOG("Custom timing given: FPS: %.4f, Sample rate: %.4f\n",
|
||||
RARCH_LOG("%s: FPS: %.4f, Sample rate: %.4f\n",
|
||||
msg_hash_to_str(MSG_CUSTOM_TIMING_GIVEN),
|
||||
(float)av_info->timing.fps,
|
||||
(float)av_info->timing.sample_rate);
|
||||
|
||||
@ -365,15 +366,12 @@ bool recording_init(void)
|
||||
global->record.gpu_width = vp.width;
|
||||
global->record.gpu_height = vp.height;
|
||||
|
||||
RARCH_LOG("Detected viewport of %u x %u\n",
|
||||
RARCH_LOG("%s %u x %u\n", msg_hash_to_str(MSG_DETECTED_VIEWPORT_OF),
|
||||
vp.width, vp.height);
|
||||
|
||||
global->record.gpu_buffer = (uint8_t*)malloc(vp.width * vp.height * 3);
|
||||
if (!global->record.gpu_buffer)
|
||||
{
|
||||
RARCH_ERR("Failed to allocate GPU record buffer.\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -407,7 +405,8 @@ bool recording_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
RARCH_LOG("Recording to %s @ %ux%u. (FB size: %ux%u pix_fmt: %u)\n",
|
||||
RARCH_LOG("%s %s @ %ux%u. (FB size: %ux%u pix_fmt: %u)\n",
|
||||
msg_hash_to_str(MSG_RECORDING_TO),
|
||||
global->record.path,
|
||||
params.out_width, params.out_height,
|
||||
params.fb_width, params.fb_height,
|
||||
@ -415,7 +414,7 @@ bool recording_init(void)
|
||||
|
||||
if (!record_driver_init_first(&driver->recording, &driver->recording_data, ¶ms))
|
||||
{
|
||||
RARCH_ERR(RETRO_LOG_INIT_RECORDING_FAILED);
|
||||
RARCH_ERR(msg_hash_to_str(MSG_FAILED_TO_START_RECORDING));
|
||||
event_command(EVENT_CMD_GPU_RECORD_DEINIT);
|
||||
|
||||
return false;
|
||||
|
60
retroarch.c
60
retroarch.c
@ -22,10 +22,6 @@
|
||||
#include <errno.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#ifdef HAVE_FFMPEG
|
||||
#include <rhash.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _XBOX
|
||||
#include <xtl.h>
|
||||
@ -40,7 +36,7 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <file/file_path.h>
|
||||
|
||||
#include <rhash.h>
|
||||
#include "msg_hash.h"
|
||||
|
||||
#include "libretro_version_1.h"
|
||||
#include "dynamic.h"
|
||||
@ -53,7 +49,6 @@
|
||||
#include "system.h"
|
||||
|
||||
#include "git_version.h"
|
||||
#include "intl/intl.h"
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "menu/menu.h"
|
||||
@ -150,10 +145,9 @@ static void print_version(void)
|
||||
{
|
||||
char str[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
fprintf(stderr, "%s: Frontend for libretro -- v%s", msg_hash_to_str(MSG_PROGRAM), PACKAGE_VERSION);
|
||||
#ifdef HAVE_GIT_VERSION
|
||||
printf(RETRO_FRONTEND ": Frontend for libretro -- v" PACKAGE_VERSION " -- %s --\n", rarch_git_version);
|
||||
#else
|
||||
puts(RETRO_FRONTEND ": Frontend for libretro -- v" PACKAGE_VERSION " --");
|
||||
printf(" -- %s --\n", rarch_git_version);
|
||||
#endif
|
||||
rarch_info_get_capabilities(RARCH_CAPABILITIES_COMPILER, str, sizeof(str));
|
||||
fprintf(stdout, "%s", str);
|
||||
@ -175,16 +169,22 @@ static void print_help(const char *arg0)
|
||||
|
||||
puts(" -h, --help Show this help message.");
|
||||
puts(" -v, --verbose Verbose logging.");
|
||||
puts(" --log-file=FILE Log " RETRO_FRONTEND " messages to FILE.");
|
||||
puts(" --version Show " RETRO_FRONTEND " version.");
|
||||
puts(" --features Prints available features compiled into " RETRO_FRONTEND ".");
|
||||
puts(" --log-file=FILE Log messages to FILE.");
|
||||
puts(" --version Show version.");
|
||||
puts(" --features Prints available features compiled into program.");
|
||||
puts(" --menu Do not require content or libretro core to be loaded,\n"
|
||||
" starts directly in menu. If no arguments are passed to\n"
|
||||
" " RETRO_FRONTEND ", it is equivalent to using --menu as only argument.");
|
||||
" the program, it is equivalent to using --menu as only argument.");
|
||||
puts(" -s, --save=PATH Path for save files (*.srm).");
|
||||
puts(" -S, --savestate=PATH Path for the save state files (*.state).");
|
||||
puts(" -f, --fullscreen Start " RETRO_FRONTEND " in fullscreen regardless of config settings.");
|
||||
puts(" -c, --config=FILE Path for config file." RARCH_DEFAULT_CONF_PATH_STR);
|
||||
puts(" -f, --fullscreen Start the program in fullscreen regardless of config settings.");
|
||||
puts(" -c, --config=FILE Path for config file."
|
||||
#ifdef _WIN32
|
||||
"\n\t\tDefaults to retroarch.cfg in same directory as retroarch.exe.\n\t\tIf a default config is not found, the program will attempt to create one."
|
||||
#else
|
||||
"\n\t\tBy default looks for config in $XDG_CONFIG_HOME/retroarch/retroarch.cfg,\n\t\t$HOME/.config/retroarch/retroarch.cfg,\n\t\tand $HOME/.retroarch.cfg.\n\t\tIf a default config is not found, the program will attempt to create one based on the skeleton config (" GLOBAL_CONFIG_DIR "/retroarch.cfg)."
|
||||
#endif
|
||||
);
|
||||
puts(" --appendconfig=FILE\n"
|
||||
" Extra config files are loaded in, and take priority over\n"
|
||||
" config selected in -c (or default). Multiple configs are\n"
|
||||
@ -223,7 +223,7 @@ static void print_help(const char *arg0)
|
||||
#endif
|
||||
puts(" --nick=NICK Picks a username (for use with netplay). Not mandatory.");
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
puts(" --command Sends a command over UDP to an already running " RETRO_FRONTEND " process.");
|
||||
puts(" --command Sends a command over UDP to an already running program process.");
|
||||
puts(" Available commands are listed if command is invalid.");
|
||||
#endif
|
||||
|
||||
@ -235,7 +235,7 @@ static void print_help(const char *arg0)
|
||||
puts(" --bps=FILE Specifies path for BPS patch that will be applied to content.");
|
||||
puts(" --ips=FILE Specifies path for IPS patch that will be applied to content.");
|
||||
puts(" --no-patch Disables all forms of content patching.");
|
||||
puts(" -D, --detach Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms.");
|
||||
puts(" -D, --detach Detach program from the running console. Not relevant for all platforms.");
|
||||
puts(" --max-frames=NUMBER\n"
|
||||
" Runs for the specified number of frames, then exits.\n");
|
||||
}
|
||||
@ -305,7 +305,8 @@ static void set_special_paths(char **argv, unsigned num_content)
|
||||
{
|
||||
fill_pathname_dir(global->savestate_name, global->basename,
|
||||
".state", sizeof(global->savestate_name));
|
||||
RARCH_LOG("Redirecting save state to \"%s\".\n",
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_REDIRECTING_SAVESTATE_TO),
|
||||
global->savestate_name);
|
||||
}
|
||||
|
||||
@ -325,7 +326,7 @@ void set_paths_redirect(const char *path)
|
||||
|
||||
uint32_t global_library_name_hash = ((global && info->info.library_name &&
|
||||
(info->info.library_name[0] != '\0'))
|
||||
? djb2_calculate(info->info.library_name) : 0);
|
||||
? msg_hash_calculate(info->info.library_name) : 0);
|
||||
|
||||
if(
|
||||
global_library_name_hash != 0 &&
|
||||
@ -381,21 +382,27 @@ void set_paths_redirect(const char *path)
|
||||
{
|
||||
fill_pathname_dir(global->savefile_name, global->basename,
|
||||
".srm", sizeof(global->savefile_name));
|
||||
RARCH_LOG("Redirecting save file to \"%s\".\n", global->savefile_name);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_REDIRECTING_SAVEFILE_TO),
|
||||
global->savefile_name);
|
||||
}
|
||||
|
||||
if (path_is_directory(global->savestate_name))
|
||||
{
|
||||
fill_pathname_dir(global->savestate_name, global->basename,
|
||||
".state", sizeof(global->savestate_name));
|
||||
RARCH_LOG("Redirecting save state to \"%s\".\n", global->savestate_name);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_REDIRECTING_SAVESTATE_TO),
|
||||
global->savestate_name);
|
||||
}
|
||||
|
||||
if (path_is_directory(global->cheatfile_name))
|
||||
{
|
||||
fill_pathname_dir(global->cheatfile_name, global->basename,
|
||||
".state", sizeof(global->cheatfile_name));
|
||||
RARCH_LOG("Redirecting cheat file to \"%s\".\n", global->cheatfile_name);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_REDIRECTING_CHEATFILE_TO),
|
||||
global->cheatfile_name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -429,7 +436,7 @@ void rarch_set_paths(const char *path)
|
||||
|
||||
enum rarch_content_type rarch_path_is_media_type(const char *path)
|
||||
{
|
||||
uint32_t hash_ext = djb2_calculate(path_get_extension(path));
|
||||
uint32_t hash_ext = msg_hash_calculate(path_get_extension(path));
|
||||
|
||||
switch (hash_ext)
|
||||
{
|
||||
@ -965,7 +972,8 @@ static void rarch_init_savefile_paths(void)
|
||||
{
|
||||
fill_pathname_dir(global->savefile_name, global->basename, ".srm",
|
||||
sizeof(global->savefile_name));
|
||||
RARCH_LOG("Redirecting save file to \"%s\".\n",
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_REDIRECTING_SAVEFILE_TO),
|
||||
global->savefile_name);
|
||||
}
|
||||
}
|
||||
@ -1105,7 +1113,7 @@ void rarch_verify_api_version(void)
|
||||
RARCH_LOG("Compiled against API: %u\n", RETRO_API_VERSION);
|
||||
|
||||
if (pretro_api_version() != RETRO_API_VERSION)
|
||||
RARCH_WARN(RETRO_LOG_LIBRETRO_ABI_BREAK);
|
||||
RARCH_WARN("%s\n", msg_hash_to_str(MSG_LIBRETRO_ABI_BREAK));
|
||||
}
|
||||
|
||||
#define FAIL_CPU(simd_type) do { \
|
||||
@ -1530,7 +1538,7 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
|
||||
size_t supported = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
uint32_t menu_label_hash = djb2_calculate(menu_label);
|
||||
uint32_t menu_label_hash = msg_hash_calculate(menu_label);
|
||||
|
||||
fill_pathname_join(s, dir, path, len);
|
||||
|
||||
|
50
rewind.c
50
rewind.c
@ -21,13 +21,14 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <retro_inline.h>
|
||||
#include "intl/intl.h"
|
||||
#include "dynamic.h"
|
||||
#include "general.h"
|
||||
#include "msg_hash.h"
|
||||
|
||||
#ifndef UINT16_MAX
|
||||
#define UINT16_MAX 0xffff
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
#define UINT32_MAX 0xffffffffu
|
||||
#endif
|
||||
@ -64,15 +65,19 @@ size thisstart;
|
||||
|
||||
size_t state_manager_raw_maxsize(size_t uncomp)
|
||||
{
|
||||
const int maxcblkcover = UINT16_MAX * sizeof(uint16_t); /* bytes covered by a compressed block */
|
||||
size_t uncomp16 = (uncomp + sizeof(uint16_t) - 1) & ~sizeof(uint16_t); /* uncompressed size, rounded to 16 bits */
|
||||
size_t maxcblks = (uncomp + maxcblkcover - 1) / maxcblkcover; /* number of blocks */
|
||||
return uncomp16 + maxcblks * sizeof(uint16_t)*2 /* two u16 overhead per block */ + sizeof(uint16_t)*3; /* three u16 to end it */
|
||||
/* bytes covered by a compressed block */
|
||||
const int maxcblkcover = UINT16_MAX * sizeof(uint16_t);
|
||||
/* uncompressed size, rounded to 16 bits */
|
||||
size_t uncomp16 = (uncomp + sizeof(uint16_t) - 1) & ~sizeof(uint16_t);
|
||||
/* number of blocks */
|
||||
size_t maxcblks = (uncomp + maxcblkcover - 1) / maxcblkcover;
|
||||
return uncomp16 + maxcblks * sizeof(uint16_t) * 2 /* two u16 overhead per block */ + sizeof(uint16_t) *
|
||||
3; /* three u16 to end it */
|
||||
}
|
||||
|
||||
void *state_manager_raw_alloc(size_t len, uint16_t uniq)
|
||||
{
|
||||
size_t len16 = (len + sizeof(uint16_t) - 1) & ~sizeof(uint16_t);
|
||||
size_t len16 = (len + sizeof(uint16_t) - 1) & ~sizeof(uint16_t);
|
||||
|
||||
uint16_t *ret = (uint16_t*)calloc(len16 + sizeof(uint16_t) * 4 + 16, 1);
|
||||
|
||||
@ -218,12 +223,14 @@ static INLINE size_t find_same(const uint16_t *a, const uint16_t *b)
|
||||
return a - a_org;
|
||||
}
|
||||
|
||||
size_t state_manager_raw_compress(const void *src, const void *dst, size_t len, void *patch)
|
||||
size_t state_manager_raw_compress(const void *src,
|
||||
const void *dst, size_t len, void *patch)
|
||||
{
|
||||
const uint16_t *old16 = (const uint16_t*)src;
|
||||
const uint16_t *new16 = (const uint16_t*)dst;
|
||||
const uint16_t *old16 = (const uint16_t*)src;
|
||||
const uint16_t *new16 = (const uint16_t*)dst;
|
||||
uint16_t *compressed16 = (uint16_t*)patch;
|
||||
size_t num16s = (len + sizeof(uint16_t) - 1) / sizeof(uint16_t);
|
||||
size_t num16s = (len + sizeof(uint16_t) - 1)
|
||||
/ sizeof(uint16_t);
|
||||
|
||||
while (num16s)
|
||||
{
|
||||
@ -276,9 +283,10 @@ size_t state_manager_raw_compress(const void *src, const void *dst, size_t len,
|
||||
return (uint8_t*)(compressed16+3) - (uint8_t*)patch;
|
||||
}
|
||||
|
||||
void state_manager_raw_decompress(const void *patch, size_t patchlen, void *data, size_t datalen)
|
||||
void state_manager_raw_decompress(const void *patch,
|
||||
size_t patchlen, void *data, size_t datalen)
|
||||
{
|
||||
uint16_t *out16 = (uint16_t*)data;
|
||||
uint16_t *out16 = (uint16_t*)data;
|
||||
const uint16_t *patch16 = (const uint16_t*)patch;
|
||||
|
||||
(void)patchlen;
|
||||
@ -383,13 +391,13 @@ state_manager_t *state_manager_new(size_t state_size, size_t buffer_size)
|
||||
if (!state)
|
||||
return NULL;
|
||||
|
||||
state->blocksize = (state_size + sizeof(uint16_t) - 1) & ~sizeof(uint16_t);
|
||||
state->blocksize = (state_size + sizeof(uint16_t) - 1) & ~sizeof(uint16_t);
|
||||
/* the compressed data is surrounded by pointers to the other side */
|
||||
state->maxcompsize = state_manager_raw_maxsize(state_size) + sizeof(size_t) * 2;
|
||||
state->data = (uint8_t*)malloc(buffer_size);
|
||||
state->data = (uint8_t*)malloc(buffer_size);
|
||||
|
||||
state->thisblock = (uint8_t*)state_manager_raw_alloc(state_size, 0);
|
||||
state->nextblock = (uint8_t*)state_manager_raw_alloc(state_size, 1);
|
||||
state->thisblock = (uint8_t*)state_manager_raw_alloc(state_size, 0);
|
||||
state->nextblock = (uint8_t*)state_manager_raw_alloc(state_size, 1);
|
||||
if (!state->data || !state->thisblock || !state->nextblock)
|
||||
goto error;
|
||||
|
||||
@ -560,7 +568,7 @@ void init_rewind(void)
|
||||
|
||||
if (audio_driver_has_callback())
|
||||
{
|
||||
RARCH_ERR(RETRO_LOG_REWIND_INIT_FAILED_THREADED_AUDIO);
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_REWIND_INIT_FAILED));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -568,18 +576,20 @@ void init_rewind(void)
|
||||
|
||||
if (!global->rewind.size)
|
||||
{
|
||||
RARCH_ERR(RETRO_LOG_REWIND_INIT_FAILED_NO_SAVESTATES);
|
||||
RARCH_ERR("%s.\n",
|
||||
msg_hash_to_str(MSG_REWIND_INIT_FAILED_THREADED_AUDIO));
|
||||
return;
|
||||
}
|
||||
|
||||
RARCH_LOG(RETRO_MSG_REWIND_INIT "%u MB\n",
|
||||
RARCH_LOG("%s: %u MB\n",
|
||||
msg_hash_to_str(MSG_REWIND_INIT),
|
||||
(unsigned)(settings->rewind_buffer_size / 1000000));
|
||||
|
||||
global->rewind.state = state_manager_new(global->rewind.size,
|
||||
settings->rewind_buffer_size);
|
||||
|
||||
if (!global->rewind.state)
|
||||
RARCH_WARN(RETRO_LOG_REWIND_INIT_FAILED);
|
||||
RARCH_WARN("%s.\n", msg_hash_to_str(MSG_REWIND_INIT_FAILED));
|
||||
|
||||
state_manager_push_where(global->rewind.state, &state);
|
||||
pretro_serialize(state, global->rewind.size);
|
||||
|
50
runloop.c
50
runloop.c
@ -21,12 +21,10 @@
|
||||
#include <retro_log.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <rhash.h>
|
||||
|
||||
#include "configuration.h"
|
||||
#include "dynamic.h"
|
||||
#include "performance.h"
|
||||
#include "intl/intl.h"
|
||||
#include "retroarch.h"
|
||||
#include "runloop.h"
|
||||
#include "runloop_data.h"
|
||||
@ -142,7 +140,8 @@ static void check_stateslots(bool pressed_increase, bool pressed_decrease)
|
||||
else
|
||||
return;
|
||||
|
||||
snprintf(msg, sizeof(msg), "State slot: %d",
|
||||
snprintf(msg, sizeof(msg), "%s: %d",
|
||||
msg_hash_to_str(MSG_STATE_SLOT),
|
||||
settings->state_slot);
|
||||
|
||||
rarch_main_msg_queue_push(msg, 1, 180, true);
|
||||
@ -268,7 +267,9 @@ static bool check_movie_init(void)
|
||||
strlcpy(path, global->bsv.movie_path, sizeof(path));
|
||||
strlcat(path, ".bsv", sizeof(path));
|
||||
|
||||
snprintf(msg, sizeof(msg), "Starting movie record to \"%s\".", path);
|
||||
snprintf(msg, sizeof(msg), "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
|
||||
path);
|
||||
|
||||
global->bsv.movie = bsv_movie_init(path, RARCH_MOVIE_RECORD);
|
||||
|
||||
@ -279,14 +280,16 @@ static bool check_movie_init(void)
|
||||
if (global->bsv.movie)
|
||||
{
|
||||
rarch_main_msg_queue_push(msg, 1, 180, true);
|
||||
RARCH_LOG("Starting movie record to \"%s\".\n", path);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
|
||||
path);
|
||||
}
|
||||
else
|
||||
{
|
||||
rarch_main_msg_queue_push_new(
|
||||
MSG_FAILED_TO_START_MOVIE_RECORD,
|
||||
1, 180, true);
|
||||
RARCH_ERR("Failed to start movie record.\n");
|
||||
RARCH_ERR(msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD));
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -305,9 +308,9 @@ static bool check_movie_record(void)
|
||||
if (!global->bsv.movie)
|
||||
return false;
|
||||
|
||||
rarch_main_msg_queue_push(
|
||||
RETRO_MSG_MOVIE_RECORD_STOPPING, 2, 180, true);
|
||||
RARCH_LOG(RETRO_LOG_MOVIE_RECORD_STOPPING);
|
||||
rarch_main_msg_queue_push_new(
|
||||
MSG_MOVIE_RECORD_STOPPED, 2, 180, true);
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_MOVIE_RECORD_STOPPED));
|
||||
|
||||
event_command(EVENT_CMD_BSV_MOVIE_DEINIT);
|
||||
|
||||
@ -327,9 +330,9 @@ static bool check_movie_playback(void)
|
||||
if (!global->bsv.movie_end)
|
||||
return false;
|
||||
|
||||
rarch_main_msg_queue_push(
|
||||
RETRO_MSG_MOVIE_PLAYBACK_ENDED, 1, 180, false);
|
||||
RARCH_LOG(RETRO_LOG_MOVIE_PLAYBACK_ENDED);
|
||||
rarch_main_msg_queue_push_new(
|
||||
MSG_MOVIE_PLAYBACK_ENDED, 1, 180, false);
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_MOVIE_PLAYBACK_ENDED));
|
||||
|
||||
event_command(EVENT_CMD_BSV_MOVIE_DEINIT);
|
||||
|
||||
@ -395,7 +398,7 @@ static void check_shader_dir(bool pressed_next, bool pressed_prev)
|
||||
|
||||
shader = global->shader_dir.list->elems[global->shader_dir.ptr].data;
|
||||
ext = path_get_extension(shader);
|
||||
ext_hash = djb2_calculate(ext);
|
||||
ext_hash = msg_hash_calculate(ext);
|
||||
|
||||
switch (ext_hash)
|
||||
{
|
||||
@ -411,13 +414,16 @@ static void check_shader_dir(bool pressed_next, bool pressed_prev)
|
||||
return;
|
||||
}
|
||||
|
||||
snprintf(msg, sizeof(msg), "Shader #%u: \"%s\".",
|
||||
snprintf(msg, sizeof(msg), "%s #%u: \"%s\".",
|
||||
msg_hash_to_str(MSG_SHADER),
|
||||
(unsigned)global->shader_dir.ptr, shader);
|
||||
rarch_main_msg_queue_push(msg, 1, 120, true);
|
||||
RARCH_LOG("Applying shader \"%s\".\n", shader);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_APPLYING_SHADER),
|
||||
shader);
|
||||
|
||||
if (!video_driver_set_shader(type, shader))
|
||||
RARCH_WARN("Failed to apply shader.\n");
|
||||
RARCH_WARN(msg_hash_to_str(MSG_FAILED_TO_APPLY_SHADER));
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -548,7 +554,8 @@ static int do_state_checks(event_cmd_state_t *cmd)
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
if (driver->netplay_data)
|
||||
return do_netplay_state_checks(cmd->netplay_flip_pressed, cmd->fullscreen_toggle);
|
||||
return do_netplay_state_checks(cmd->netplay_flip_pressed,
|
||||
cmd->fullscreen_toggle);
|
||||
#endif
|
||||
|
||||
check_pause(cmd->pause_pressed, cmd->frameadvance_pressed);
|
||||
@ -560,8 +567,10 @@ static int do_state_checks(event_cmd_state_t *cmd)
|
||||
cmd->rewind_pressed))
|
||||
return 1;
|
||||
|
||||
check_fast_forward_button(cmd->fastforward_pressed, cmd->hold_pressed, cmd->old_hold_pressed);
|
||||
check_stateslots(cmd->state_slot_increase, cmd->state_slot_decrease);
|
||||
check_fast_forward_button(cmd->fastforward_pressed,
|
||||
cmd->hold_pressed, cmd->old_hold_pressed);
|
||||
check_stateslots(cmd->state_slot_increase,
|
||||
cmd->state_slot_decrease);
|
||||
|
||||
if (cmd->save_state_pressed)
|
||||
event_command(EVENT_CMD_SAVE_STATE);
|
||||
@ -574,7 +583,8 @@ static int do_state_checks(event_cmd_state_t *cmd)
|
||||
if (cmd->movie_record)
|
||||
check_movie();
|
||||
|
||||
check_shader_dir(cmd->shader_next_pressed, cmd->shader_prev_pressed);
|
||||
check_shader_dir(cmd->shader_next_pressed,
|
||||
cmd->shader_prev_pressed);
|
||||
|
||||
if (cmd->disk_eject_pressed)
|
||||
event_command(EVENT_CMD_DISK_EJECT_TOGGLE);
|
||||
|
12
screenshot.c
12
screenshot.c
@ -35,7 +35,7 @@
|
||||
#endif
|
||||
|
||||
#include "general.h"
|
||||
#include "intl/intl.h"
|
||||
#include "msg_hash.h"
|
||||
#include "gfx/scaler/scaler.h"
|
||||
#include "retroarch.h"
|
||||
#include "runloop.h"
|
||||
@ -316,20 +316,20 @@ bool take_screenshot(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_ERR(RETRO_LOG_TAKE_SCREENSHOT_ERROR);
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT));
|
||||
ret = false;
|
||||
}
|
||||
|
||||
|
||||
if (ret)
|
||||
{
|
||||
RARCH_LOG(RETRO_LOG_TAKE_SCREENSHOT);
|
||||
msg = RETRO_MSG_TAKE_SCREENSHOT;
|
||||
RARCH_LOG("%s.\n", msg_hash_to_str(MSG_TAKING_SCREENSHOT));
|
||||
msg = msg_hash_to_str(MSG_TAKING_SCREENSHOT);
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_WARN(RETRO_LOG_TAKE_SCREENSHOT_FAILED);
|
||||
msg = RETRO_MSG_TAKE_SCREENSHOT_FAILED;
|
||||
RARCH_WARN("%s.\n", msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT));
|
||||
msg = msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT);
|
||||
}
|
||||
|
||||
rarch_main_msg_queue_push(msg, 1, runloop->is_paused ? 1 : 180, true);
|
||||
|
9
system.c
9
system.c
@ -17,7 +17,7 @@
|
||||
|
||||
#include "system.h"
|
||||
#include "dynamic.h"
|
||||
#include "intl/intl.h"
|
||||
#include "msg_hash.h"
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#define DEFAULT_EXT "zip"
|
||||
@ -69,13 +69,14 @@ void rarch_system_info_init(void)
|
||||
pretro_get_system_info(&system->info);
|
||||
|
||||
if (!system->info.library_name)
|
||||
system->info.library_name = "Unknown";
|
||||
system->info.library_name = msg_hash_to_str(MSG_UNKNOWN);
|
||||
if (!system->info.library_version)
|
||||
system->info.library_version = "v0";
|
||||
|
||||
#ifndef RARCH_CONSOLE
|
||||
snprintf(system->title_buf, sizeof(system->title_buf),
|
||||
RETRO_FRONTEND " : ");
|
||||
strlcpy(system->title_buf,
|
||||
msg_hash_to_str(MSG_PROGRAM), sizeof(system->title_buf));
|
||||
strlcat(system->title_buf, " : ", sizeof(system->title_buf));
|
||||
#endif
|
||||
strlcat(system->title_buf, system->info.library_name, sizeof(system->title_buf));
|
||||
strlcat(system->title_buf, " ", sizeof(system->title_buf));
|
||||
|
@ -16,11 +16,9 @@
|
||||
#include <compat/strcasestr.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include <rhash.h>
|
||||
|
||||
#include "../dir_list_special.h"
|
||||
#include "../file_ops.h"
|
||||
|
||||
#include "../msg_hash.h"
|
||||
#include "../general.h"
|
||||
#include "../runloop_data.h"
|
||||
#include "tasks.h"
|
||||
@ -58,11 +56,14 @@ static int database_info_iterate_start
|
||||
|
||||
snprintf(msg, sizeof(msg),
|
||||
#ifdef _WIN32
|
||||
"%Iu/%Iu: Scanning %s...\n",
|
||||
"%Iu/%Iu: %s %s...\n",
|
||||
#else
|
||||
"%zu/%zu: Scanning %s...\n",
|
||||
"%zu/%zu: %s %s...\n",
|
||||
#endif
|
||||
db->list_ptr, db->list->size, name);
|
||||
db->list_ptr,
|
||||
db->list->size,
|
||||
msg_hash_to_str(MSG_SCANNING),
|
||||
name);
|
||||
|
||||
if (msg[0] != '\0')
|
||||
rarch_main_msg_queue_push(msg, 1, 180, true);
|
||||
@ -85,7 +86,7 @@ static int database_info_iterate_playlist(
|
||||
|
||||
path_parent_dir(parent_dir);
|
||||
|
||||
extension_hash = djb2_calculate(path_get_extension(name));
|
||||
extension_hash = msg_hash_calculate(path_get_extension(name));
|
||||
|
||||
switch (extension_hash)
|
||||
{
|
||||
@ -151,13 +152,6 @@ static int database_info_list_iterate_new(database_state_handle_t *db_state, con
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO/FIXME -
|
||||
* * - What 'core' to bind a playlist entry to if
|
||||
* we are in Load Content (Detect Core)? Let the user
|
||||
* choose the core to be loaded with it upon selecting
|
||||
* the playlist entry?
|
||||
* * - Implement ZIP handling.
|
||||
**/
|
||||
static int database_info_list_iterate_found_match(
|
||||
database_state_handle_t *db_state,
|
||||
database_info_handle_t *db,
|
||||
@ -168,13 +162,14 @@ static int database_info_list_iterate_found_match(
|
||||
char db_playlist_path[PATH_MAX_LENGTH] = {0};
|
||||
char db_playlist_base_str[PATH_MAX_LENGTH] = {0};
|
||||
char entry_path_str[PATH_MAX_LENGTH] = {0};
|
||||
content_playlist_t *playlist = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *db_path = db_state->list->elems[db_state->list_index].data;
|
||||
const char *entry_path = db ? db->list->elems[db->list_ptr].data : NULL;
|
||||
content_playlist_t *playlist = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *db_path = db_state->list->elems[db_state->list_index].data;
|
||||
const char *entry_path = db ? db->list->elems[db->list_ptr].data : NULL;
|
||||
database_info_t *db_info_entry = &db_state->info->list[db_state->entry_index];
|
||||
|
||||
fill_short_pathname_representation(db_playlist_base_str, db_path, sizeof(db_playlist_base_str));
|
||||
fill_short_pathname_representation(db_playlist_base_str,
|
||||
db_path, sizeof(db_playlist_base_str));
|
||||
|
||||
path_remove_extension(db_playlist_base_str);
|
||||
|
||||
@ -205,7 +200,8 @@ static int database_info_list_iterate_found_match(
|
||||
RARCH_LOG("entry path str: %s\n", entry_path_str);
|
||||
#endif
|
||||
|
||||
content_playlist_push(playlist, entry_path_str, db_info_entry->name, "DETECT", "DETECT", db_crc, db_playlist_base_str);
|
||||
content_playlist_push(playlist, entry_path_str,
|
||||
db_info_entry->name, "DETECT", "DETECT", db_crc, db_playlist_base_str);
|
||||
|
||||
content_playlist_write_file(playlist);
|
||||
content_playlist_free(playlist);
|
||||
@ -296,9 +292,6 @@ static int database_info_iterate_playlist_zip(
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static int database_info_iterate(database_state_handle_t *state, database_info_handle_t *db)
|
||||
{
|
||||
const char *name = db ? db->list->elems[db->list_ptr].data : NULL;
|
||||
@ -342,7 +335,7 @@ static int database_info_poll(db_handle_t *db)
|
||||
if (str_list->size > 0)
|
||||
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
|
||||
if (str_list->size > 1)
|
||||
cb_type_hash = djb2_calculate(str_list->elems[1].data);
|
||||
cb_type_hash = msg_hash_calculate(str_list->elems[1].data);
|
||||
|
||||
switch (cb_type_hash)
|
||||
{
|
||||
@ -413,7 +406,7 @@ void rarch_main_data_db_iterate(bool is_thread, void *data)
|
||||
}
|
||||
else
|
||||
{
|
||||
rarch_main_msg_queue_push("Scanning of directory finished.\n", 0, 180, true);
|
||||
rarch_main_msg_queue_push_new(MSG_SCANNING_OF_DIRECTORY_FINISHED, 0, 180, true);
|
||||
db->status = DATABASE_STATUS_FREE;
|
||||
}
|
||||
break;
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include <string/string_list.h>
|
||||
#include <compat/strl.h>
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
#include <net/net_compat.h>
|
||||
|
||||
#include "../file_ops.h"
|
||||
#include "../general.h"
|
||||
#include "../msg_hash.h"
|
||||
#include "../runloop_data.h"
|
||||
#include "tasks.h"
|
||||
|
||||
@ -102,10 +102,10 @@ static int cb_generic_download(void *data, size_t len,
|
||||
if (!write_file(output_path, data, len))
|
||||
return -1;
|
||||
|
||||
snprintf(msg, sizeof(msg), "Download complete: %s.",
|
||||
snprintf(msg, sizeof(msg), "%s: %s.",
|
||||
msg_hash_to_str(MSG_DOWNLOAD_COMPLETE),
|
||||
core_updater_path);
|
||||
|
||||
|
||||
rarch_main_msg_queue_push(msg, 1, 90, true);
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
@ -118,7 +118,7 @@ static int cb_generic_download(void *data, size_t len,
|
||||
{
|
||||
if (!zlib_parse_file(output_path, NULL, zlib_extract_core_callback,
|
||||
(void*)dir_path))
|
||||
RARCH_LOG("Could not process ZIP file.\n");
|
||||
RARCH_LOG(msg_hash_to_str(MSG_COULD_NOT_PROCESS_ZIP_FILE));
|
||||
|
||||
if (path_file_exists(output_path))
|
||||
remove(output_path);
|
||||
@ -251,7 +251,7 @@ static int cb_http_conn_default(void *data_, size_t len)
|
||||
|
||||
if (http->connection.elem1[0] != '\0')
|
||||
{
|
||||
uint32_t label_hash = djb2_calculate(http->connection.elem1);
|
||||
uint32_t label_hash = msg_hash_calculate(http->connection.elem1);
|
||||
|
||||
switch (label_hash)
|
||||
{
|
||||
@ -352,27 +352,29 @@ static int rarch_main_data_http_iterate_poll(http_handle_t *http)
|
||||
**/
|
||||
static int rarch_main_data_http_iterate_transfer(void *data)
|
||||
{
|
||||
http_handle_t *http = (http_handle_t*)data;
|
||||
size_t pos = 0, tot = 0;
|
||||
int percent = 0;
|
||||
if (!net_http_update(http->handle, &pos, &tot))
|
||||
{
|
||||
if(tot != 0)
|
||||
percent=(unsigned long long)pos*100/(unsigned long long)tot;
|
||||
else
|
||||
percent=0;
|
||||
|
||||
if (percent > 0)
|
||||
{
|
||||
char tmp[PATH_MAX_LENGTH] = {0};
|
||||
snprintf(tmp, sizeof(tmp), "Download progress: %d%%", percent);
|
||||
data_runloop_osd_msg(tmp, sizeof(tmp));
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
http_handle_t *http = (http_handle_t*)data;
|
||||
size_t pos = 0, tot = 0;
|
||||
int percent = 0;
|
||||
|
||||
if (!net_http_update(http->handle, &pos, &tot))
|
||||
{
|
||||
if(tot != 0)
|
||||
percent = (unsigned long long)pos * 100
|
||||
/ (unsigned long long)tot;
|
||||
|
||||
if (percent > 0)
|
||||
{
|
||||
char tmp[PATH_MAX_LENGTH] = {0};
|
||||
snprintf(tmp, sizeof(tmp), "%s: %d%%",
|
||||
msg_hash_to_str(MSG_DOWNLOAD_PROGRESS),
|
||||
percent);
|
||||
data_runloop_osd_msg(tmp, sizeof(tmp));
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rarch_main_data_http_iterate(bool is_thread, void *data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user