Skip to content

Commit

Permalink
Merge branch 'libretro:master' into refresh_rate_float
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanvb authored Jun 16, 2024
2 parents f76f6aa + 1f1ff0a commit 01eab85
Show file tree
Hide file tree
Showing 13 changed files with 172 additions and 142 deletions.
3 changes: 2 additions & 1 deletion audio/common/alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
#include <alsa/asoundlib.h>
#include <asm-generic/errno.h>

#include "alsa.h"

#include "../audio_driver.h"
#include "../common/alsa.h"
#include "../../verbosity.h"

int alsa_init_pcm(snd_pcm_t **pcm,
Expand Down
5 changes: 3 additions & 2 deletions audio/common/alsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#define _RETROARCH_ALSA

#include <boolean.h>
#include "queues/fifo_queue.h"
#include "rthreads/rthreads.h"
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>

/* Header file for common functions that are used by alsa and alsathread. */

/**
Expand Down
6 changes: 3 additions & 3 deletions audio/common/alsathread.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include <alsa/asoundlib.h>
#include <boolean.h>
#include "queues/fifo_queue.h"
#include "rthreads/rthreads.h"
#include "./alsa.h"
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include "alsa.h"

typedef struct alsa_thread_info
{
Expand Down
1 change: 0 additions & 1 deletion audio/common/mmdevice_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "mmdevice_common.h"
#include "mmdevice_common_inline.h"


char* mmdevice_name(IMMDevice *device)
{
HRESULT hr;
Expand Down
15 changes: 8 additions & 7 deletions audio/common/wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
*/

#include "wasapi.h"
#include <stdio.h>
#ifdef HAVE_MICROPHONE
#include "audio/microphone_driver.h"
#include "../microphone_driver.h"
#endif
#include "queues/fifo_queue.h"
#include "lists/string_list.h"
#include "configuration.h"
#include "verbosity.h"
#include "string/stdstring.h"
#include <string/stdstring.h>
#include <queues/fifo_queue.h>
#include <lists/string_list.h>

#include "mmdevice_common.h"

#include "../../configuration.h"
#include "../../verbosity.h"

const char *hresult_name(HRESULT hr)
{
switch (hr)
Expand Down
6 changes: 3 additions & 3 deletions audio/common/wasapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#ifndef RETROARCH_COMMON_WASAPI_H
#define RETROARCH_COMMON_WASAPI_H

#include "../common/mmdevice_common_inline.h"
#include "boolean.h"
#include "mmdevice_common_inline.h"
#include <boolean.h>

/* Shared buffer size replacement placeholders */
#define WASAPI_SH_BUFFER_AUDIO_LATENCY 0
Expand All @@ -37,4 +37,4 @@ IMMDevice *wasapi_init_device(const char *id, EDataFlow data_flow);
IAudioClient *wasapi_init_client(IMMDevice *device, bool *exclusive,
bool *float_fmt, unsigned *rate, unsigned latency, unsigned channels);

#endif /* RETROARCH_COMMON_WASAPI_H */
#endif /* RETROARCH_COMMON_WASAPI_H */
10 changes: 9 additions & 1 deletion intl/msg_hash_be.h
Original file line number Diff line number Diff line change
Expand Up @@ -3556,7 +3556,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_META_GRAB_MOUSE_TOGGLE,
"Захапляе або вызваляе мыш. Пры захопе сістэмны курсор схаваны ды абмежаваны акном RetroArch, тым самым паляпшаючы адносны ўвод мышы."
"Захапляе або вызваляе мыш. Пры захопе сістэмны курсор схаваны ды абмежаваны акном RetroArch, паляпшаючы адносны ўвод мышы."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE,
Expand All @@ -3575,6 +3575,10 @@ MSG_HASH(
"Меню працоўнага стала (пераключэнне)"
)

MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_VRR_RUNLOOP_TOGGLE,
"Сінхранізацыя з частатой кадраў змесціва (пераключэнне)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_RUNAHEAD_TOGGLE,
"Забяганне (пераключэнне)"
Expand Down Expand Up @@ -3677,6 +3681,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2,
"Кнопка R2 (трыгер)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE,
"Турба"
)

/* Settings > Latency */

Expand Down
4 changes: 2 additions & 2 deletions intl/msg_hash_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -1876,11 +1876,11 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_HDR_MAX_NITS,
"Maksimal Pancaran Cahaya Layar"
"Tingkat Serian Layar"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_VIDEO_HDR_MAX_NITS,
"Mengatur maksimal pancaran cahaya layar (dalam cd/m2) dari monitor/TV. Kunjungi situs RTings untuk rujukan."
"Mengatur tingkat serian layar (dalam cd/m2) dari monitor/TV. Kunjungi situs RTings untuk rujukan."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_HDR_PAPER_WHITE_NITS,
Expand Down
52 changes: 22 additions & 30 deletions libretro-common/file/archive_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <compat/posix_string.h>
#include <compat/strl.h>
#include <file/archive_file.h>
#include <file/file_path.h>
Expand Down Expand Up @@ -56,43 +54,37 @@ static int file_archive_get_file_list_cb(

if (valid_exts)
{
char *tok, *save;
bool found_ext = false;
char *valid_exts_cpy = NULL;
size_t path_len = 0;
char last_char = 0;
const char *file_ext = path_get_extension(path);

if (!file_ext)
return 1;

path_len = strlen(path);
last_char = path[path_len - 1];

size_t path_len = strlen(path);
/* Checks if this entry is a directory or a file. */
char last_char = path[path_len - 1];
struct string_list ext_list = {0};

/* Skip if directory. */
if (last_char == '/' || last_char == '\\')
if (last_char == '/' || last_char == '\\' )
return 1;

valid_exts_cpy = strdup(valid_exts);
tok = strtok_r(valid_exts_cpy, "|", &save);

while (tok)
string_list_initialize(&ext_list);
if (string_split_noalloc(&ext_list, valid_exts, "|"))
{
if (string_is_equal_noncase(tok, file_ext))
const char *file_ext = path_get_extension(path);

if (!file_ext)
{
found_ext = true;
break;
string_list_deinitialize(&ext_list);
return 1;
}
tok = strtok_r(NULL, "|", &save);
}
free(valid_exts_cpy);

/* keep iterating */
if (!found_ext)
return -1;
if (!string_list_find_elem_prefix(&ext_list, ".", file_ext))
{
/* keep iterating */
string_list_deinitialize(&ext_list);
return -1;
}

attr.i = RARCH_COMPRESSED_FILE_IN_ARCHIVE;
}

attr.i = RARCH_COMPRESSED_FILE_IN_ARCHIVE;
string_list_deinitialize(&ext_list);
}

return string_list_append(userdata->list, path, attr);
Expand Down
1 change: 0 additions & 1 deletion menu/cbs/menu_cbs_deferred_push.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ static int deferred_push_cursor_manager_list_generic(
char *elem0 = NULL;
char *elem1 = NULL;
char *path_cpy = NULL;
int ret = -1;
const char *path = info->path;

if (!path)
Expand Down
42 changes: 28 additions & 14 deletions menu/cbs/menu_cbs_ok.c
Original file line number Diff line number Diff line change
Expand Up @@ -6181,47 +6181,62 @@ static int action_ok_delete_entry(const char *path,
static int action_ok_rdb_entry_submenu(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
char *tok, *save;
union string_list_elem_attr attr;
char new_label[PATH_MAX_LENGTH];
char *elem0 = NULL;
char *elem1 = NULL;
char *elem2 = NULL;
int ret = -1;
char *rdb = NULL;
int len = 0;
struct string_list str_list = {0};
struct string_list str_list2 = {0};
char *label_cpy = NULL;

if (!label)
return -1;

new_label[0] = '\0';

string_list_initialize(&str_list);
if (!string_split_noalloc(&str_list, label, "|"))
goto end;
label_cpy = strdup(label);

string_list_initialize(&str_list2);
new_label[0] = '\0';

/* element 0 : label
* element 1 : value
* element 2 : database path
*/
if ((tok = strtok_r(label_cpy, "|", &save)))
elem0 = strdup(tok);
if ((tok = strtok_r(NULL, "|", &save)))
elem1 = strdup(tok);
if ((tok = strtok_r(NULL, "|", &save)))
elem2 = strdup(tok);
free(label_cpy);

string_list_initialize(&str_list2);

attr.i = 0;

len += strlen(str_list.elems[1].data) + 1;
string_list_append(&str_list2, str_list.elems[1].data, attr);
len += strlen(elem1) + 1;
string_list_append(&str_list2, elem1, attr);
free(elem1);

len += strlen(str_list.elems[2].data) + 1;
string_list_append(&str_list2, str_list.elems[2].data, attr);
len += strlen(elem2) + 1;
string_list_append(&str_list2, elem2, attr);
free(elem2);

if (!(rdb = (char*)calloc(len, sizeof(char))))
{
if (elem0)
free(elem0);
goto end;
}

string_list_join_concat(rdb, len, &str_list2, "|");

fill_pathname_join_delim(new_label,
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST),
str_list.elems[0].data, '_',
sizeof(new_label));
elem0, '_', sizeof(new_label));
free(elem0);

ret = generic_action_ok_displaylist_push(
rdb, NULL,
Expand All @@ -6232,7 +6247,6 @@ static int action_ok_rdb_entry_submenu(const char *path,
end:
if (rdb)
free(rdb);
string_list_deinitialize(&str_list);
string_list_deinitialize(&str_list2);

return ret;
Expand Down
Loading

0 comments on commit 01eab85

Please sign in to comment.