Skip to content

Commit

Permalink
Merge branch 'RetroArchTesting' of github.com:Misunderstood-Wookiee/R…
Browse files Browse the repository at this point in the history
…etroArch-UWP into RetroArchTesting
  • Loading branch information
Misunderstood-Wookiee committed Jun 15, 2024
2 parents ffa85aa + ddaf209 commit d11e60b
Show file tree
Hide file tree
Showing 1,747 changed files with 346,137 additions and 2,643 deletions.
53 changes: 23 additions & 30 deletions audio/audio_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,44 +1009,29 @@ bool audio_driver_get_devices_list(void **data)
#ifdef HAVE_AUDIOMIXER
bool audio_driver_mixer_extension_supported(const char *ext)
{
unsigned i;
struct string_list str_list;
union string_list_elem_attr attr;
bool ret = false;

attr.i = 0;
if (!string_list_initialize(&str_list))
return false;

#ifdef HAVE_STB_VORBIS
string_list_append(&str_list, "ogg", attr);
if (string_is_equal_noncase("ogg", ext))
return true;
#endif
#ifdef HAVE_IBXM
string_list_append(&str_list, "mod", attr);
string_list_append(&str_list, "s3m", attr);
string_list_append(&str_list, "xm", attr);
if (string_is_equal_noncase("mod", ext))
return true;
if (string_is_equal_noncase("s3m", ext))
return true;
if (string_is_equal_noncase("xm", ext))
return true;
#endif
#ifdef HAVE_DR_FLAC
string_list_append(&str_list, "flac", attr);
if (string_is_equal_noncase("flac", ext))
return true;
#endif
#ifdef HAVE_DR_MP3
string_list_append(&str_list, "mp3", attr);
if (string_is_equal_noncase("mp3", ext))
return true;
#endif
string_list_append(&str_list, "wav", attr);

for (i = 0; i < str_list.size; i++)
{
const char *str_ext = str_list.elems[i].data;
if (string_is_equal_noncase(str_ext, ext))
{
ret = true;
break;
}
}

string_list_deinitialize(&str_list);

return ret;
if (string_is_equal_noncase("wav", ext))
return true;
return false;
}

static int audio_mixer_find_index(
Expand Down Expand Up @@ -1688,6 +1673,14 @@ bool audio_driver_start(bool is_shutdown)
return false;
}

const char *audio_driver_get_ident(void)
{
audio_driver_state_t *audio_st = &audio_driver_st;
if (!audio_st->current_audio)
return NULL;
return audio_st->current_audio->ident;
}

bool audio_driver_stop(void)
{
bool stopped;
Expand Down
2 changes: 2 additions & 0 deletions audio/audio_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ extern audio_driver_t audio_rwebaudio;

audio_driver_state_t *audio_state_get_ptr(void);

const char *audio_driver_get_ident(void);

extern audio_driver_t *audio_drivers[];

RETRO_END_DECLS
Expand Down
19 changes: 17 additions & 2 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,23 @@ static void rcheevos_award_achievement(const rc_client_achievement_t* cheevo)
#if defined(HAVE_GFX_WIDGETS)
if (gfx_widgets_ready())
{
gfx_widgets_push_achievement(msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED),
cheevo->title, cheevo->badge_name);
char title[128], subtitle[96];
float rarity = rc_client_get_hardcore_enabled(rcheevos_locals.client) ?
cheevo->rarity_hardcore : cheevo->rarity;

if (rarity >= 10.0)
snprintf(title, sizeof(title), "%s - %0.2f%%",
msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), rarity);
else if (rarity > 0.0)
snprintf(title, sizeof(title), "%s - %0.2f%%",
msg_hash_to_str(MSG_RARE_ACHIEVEMENT_UNLOCKED), rarity);
else
strlcpy(title,
msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), sizeof(title));

snprintf(subtitle, sizeof(subtitle), "%s (%d)", cheevo->title, cheevo->points);

gfx_widgets_push_achievement(title, subtitle, cheevo->badge_name);
}
else
#endif
Expand Down
21 changes: 10 additions & 11 deletions cheevos/cheevos_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,17 @@ bool rcheevos_menu_get_state(unsigned menu_offset, char* buffer, size_t buffer_s
if (cheevo)
{
if (cheevo->state != RC_CLIENT_ACHIEVEMENT_STATE_ACTIVE)
{
strlcpy(buffer, msg_hash_to_str(menuitem->state_label_idx), buffer_size);
}
else
{
const char* missable = cheevo->type == RC_CLIENT_ACHIEVEMENT_TYPE_MISSABLE ? "[m] " : "";
size_t _len = strlcpy(buffer, missable, buffer_size);
_len += strlcpy(buffer + _len, msg_hash_to_str(menuitem->state_label_idx), buffer_size - _len);
if (cheevo->measured_progress[0])
snprintf(buffer, buffer_size, "%s%s - %s", missable,
msg_hash_to_str(menuitem->state_label_idx), cheevo->measured_progress);
else
snprintf(buffer, buffer_size, "%s%s", missable,
msg_hash_to_str(menuitem->state_label_idx));
{
_len += strlcpy(buffer + _len, " - ", buffer_size - _len);
strlcpy(buffer + _len, cheevo->measured_progress, buffer_size - _len);
}
}
return true;
}
Expand Down Expand Up @@ -429,10 +428,8 @@ void rcheevos_menu_populate(void* data)
msg_hash_to_str(menuitem->state_label_idx));
}
else
{
snprintf(buffer, sizeof(buffer), "----- %s -----",
msg_hash_to_str(menuitem->state_label_idx));
}

menu_entries_append(info->list, buffer, "",
MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
Expand Down Expand Up @@ -518,6 +515,7 @@ void rcheevos_menu_populate(void* data)

uintptr_t rcheevos_get_badge_texture(const char* badge, bool locked, bool download_if_missing)
{
size_t _len;
char badge_file[24];
char fullpath[PATH_MAX_LENGTH];
uintptr_t tex = 0;
Expand All @@ -535,8 +533,9 @@ uintptr_t rcheevos_get_badge_texture(const char* badge, bool locked, bool downlo
return 0;
#endif

snprintf(badge_file, sizeof(badge_file), "%s%s%s", badge,
locked ? "_lock" : "", FILE_PATH_PNG_EXTENSION);
_len = strlcpy(badge_file, badge, sizeof(badge_file));
_len += strlcpy(badge_file + _len, locked ? "_lock" : "", sizeof(badge_file) - _len);
strlcpy(badge_file + _len, FILE_PATH_PNG_EXTENSION, sizeof(badge_file) - _len);

fill_pathname_application_special(fullpath, sizeof(fullpath),
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
Expand Down
18 changes: 11 additions & 7 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ bool command_get_config_param(command_t *cmd, const char* arg)
(long long)(input_st->bsv_movie_state_handle->identifier),
input_st->bsv_movie_state.flags);
else
snprintf(value_dynamic, sizeof(value_dynamic), "0 0");
strlcpy(value_dynamic, "0 0", sizeof(value_dynamic));
}
#endif
/* TODO: query any string */
Expand Down Expand Up @@ -919,7 +919,6 @@ bool command_get_status(command_t *cmd, const char* arg)
{
/* add some content info */
runloop_state_t *runloop_st = runloop_state_get_ptr();
const char *status = "PLAYING";
const char *content_name = path_basename(path_get(RARCH_PATH_BASENAME)); /* filename only without ext */
int content_crc32 = content_get_crc();
const char* system_id = NULL;
Expand All @@ -929,15 +928,20 @@ bool command_get_status(command_t *cmd, const char* arg)

core_info_get_current_core(&core_info);

if (runloop_st->flags & RUNLOOP_FLAG_PAUSED)
status = "PAUSED";
if (core_info)
system_id = core_info->system_id;
if (!system_id)
system_id = runloop_st->system.info.library_name;

_len = snprintf(reply, sizeof(reply), "GET_STATUS %s %s,%s,crc32=%x\n",
status, system_id, content_name, content_crc32);
_len = strlcpy(reply, "GET_STATUS ", sizeof(reply));
if (runloop_st->flags & RUNLOOP_FLAG_PAUSED)
_len += strlcpy(reply + _len, "PAUSED", sizeof(reply) - _len);
else
_len += strlcpy(reply + _len, "PLAYING", sizeof(reply) - _len);
_len += strlcpy(reply + _len, " ", sizeof(reply) - _len);
_len += strlcpy(reply + _len, system_id, sizeof(reply) - _len);
_len += strlcpy(reply + _len, ",", sizeof(reply) - _len);
_len += strlcpy(reply + _len, content_name, sizeof(reply) - _len);
_len += snprintf(reply + _len, sizeof(reply) - _len, ",crc32=%x\n", content_crc32);
}
else
_len = strlcpy(reply, "GET_STATUS CONTENTLESS", sizeof(reply));
Expand Down
4 changes: 2 additions & 2 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ typedef struct settings
bool audio_rate_control;
bool audio_fastforward_mute;
bool audio_fastforward_speedup;
#ifdef TARGET_OS_IOS
#ifdef IOS
bool audio_respect_silent_mode;
#endif

Expand Down Expand Up @@ -1072,7 +1072,7 @@ typedef struct settings
bool android_input_disconnect_workaround;
#endif

#if defined(HAVE_COCOATOUCH) && defined(TARGET_OS_TV)
#if defined(HAVE_COCOATOUCH)
bool gcdwebserver_alert;
#endif
} bools;
Expand Down
6 changes: 3 additions & 3 deletions cores/libretro-net-retropad/net_retropad_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static void retropad_update_input(void)
}
}

static void netretropad_open_udp_socket(void)
static void open_UDP_socket()
{
socket_target_t in_target;

Expand Down Expand Up @@ -702,7 +702,7 @@ void NETRETROPAD_CORE_PREFIX(retro_set_video_refresh)(retro_video_refresh_t cb)
void NETRETROPAD_CORE_PREFIX(retro_reset)(void)
{
netretropad_check_variables();
netretropad_open_udp_socket();
open_UDP_socket();
}

void NETRETROPAD_CORE_PREFIX(retro_run)(void)
Expand Down Expand Up @@ -985,7 +985,7 @@ void NETRETROPAD_CORE_PREFIX(retro_run)(void)
bool NETRETROPAD_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
{
netretropad_check_variables();
netretropad_open_udp_socket();
open_UDP_socket();

/* If a .ratst file is given (only possible via command line),
* initialize test sequence. */
Expand Down
19 changes: 19 additions & 0 deletions deps/glslang/glslang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)

option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)

option(ENABLE_HLSL "Enables HLSL input support" ON)

option(ENABLE_OPT "Enables spirv-opt capability if present" ON)

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
Expand All @@ -45,6 +47,10 @@ if(ENABLE_NV_EXTENSIONS)
add_definitions(-DNV_EXTENSIONS)
endif(ENABLE_NV_EXTENSIONS)

if(ENABLE_HLSL)
add_definitions(-DENABLE_HLSL)
endif(ENABLE_HLSL)

if(WIN32)
set(CMAKE_DEBUG_POSTFIX "d")
if(MSVC)
Expand Down Expand Up @@ -87,6 +93,9 @@ function(glslang_set_link_args TARGET)
endif()
endfunction(glslang_set_link_args)

# We depend on these for later projects, so they should come first.
add_subdirectory(External)

if(NOT TARGET SPIRV-Tools-opt)
set(ENABLE_OPT OFF)
endif()
Expand All @@ -95,9 +104,19 @@ if(ENABLE_OPT)
message(STATUS "optimizer enabled")
add_definitions(-DENABLE_OPT=1)
else()
if(ENABLE_HLSL)
message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL")
endif()
add_definitions(-DENABLE_OPT=0)
endif()

add_subdirectory(glslang)
add_subdirectory(OGLCompilersDLL)
if(ENABLE_GLSLANG_BINARIES)
add_subdirectory(StandAlone)
endif()
add_subdirectory(SPIRV)
if(ENABLE_HLSL)
add_subdirectory(hlsl)
endif(ENABLE_HLSL)
add_subdirectory(gtests)
43 changes: 43 additions & 0 deletions deps/glslang/glslang/External/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Suppress all warnings from external projects.
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w)

if(BUILD_TESTING)
if(TARGET gmock)
message(STATUS "Google Mock already configured - use it")
elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
# We need to make sure Google Test does not mess up with the
# global CRT settings on Windows.
if(WIN32)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif(WIN32)
add_subdirectory(googletest)
set(GTEST_TARGETS
gtest
gtest_main
gmock
gmock_main)
foreach(target ${GTEST_TARGETS})
set_property(TARGET ${target} PROPERTY FOLDER gtest)
endforeach()
mark_as_advanced(gmock_build_tests
BUILD_GMOCK
BUILD_GTEST
BUILD_SHARED_LIBS
gtest_build_samples
gtest_build_tests
gtest_disable_pthreads
gtest_force_shared_crt
gtest_hide_internal_symbols)
else()
message(STATUS
"Google Mock was not found - tests based on that will not build")
endif()
endif()

if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt)
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools)
set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools)
endif()
endif()

Loading

0 comments on commit d11e60b

Please sign in to comment.