Skip to content

Commit

Permalink
[cheevos] upgrade to rcheevos 11.0 (#15859)
Browse files Browse the repository at this point in the history
* update rcheevos

* update rcheevos
  • Loading branch information
Jamiras authored Nov 2, 2023
1 parent 636a6e9 commit 8523eaf
Show file tree
Hide file tree
Showing 48 changed files with 7,856 additions and 1,195 deletions.
16 changes: 14 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2101,20 +2101,31 @@ ifeq ($(HAVE_NETWORKING), 1)
DEFINES += -DHAVE_CHEEVOS
INCLUDE_DIRS += -Ideps/rcheevos/include

ifneq ($(HAVE_THREADS), 1)
DEFINES += -DRC_NO_THREADS
else ifneq (,$(filter GEKKO,$(CFLAGS)))
# Gekko (Wii) and 3DS use custom pthread wrappers (see rthreads.c)
DEFINES += -DRC_NO_THREADS
else ifneq (,$(filter _3DS,$(CFLAGS)))
DEFINES += -DRC_NO_THREADS
endif

OBJ += cheevos/cheevos.o \
cheevos/cheevos_client.o \
cheevos/cheevos_menu.o \
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
deps/rcheevos/src/rc_client.o \
deps/rcheevos/src/rc_compat.o \
deps/rcheevos/src/rc_libretro.o \
deps/rcheevos/src/rc_util.o \
deps/rcheevos/src/rcheevos/alloc.o \
deps/rcheevos/src/rcheevos/compat.o \
deps/rcheevos/src/rcheevos/condition.o \
deps/rcheevos/src/rcheevos/condset.o \
deps/rcheevos/src/rcheevos/consoleinfo.o \
deps/rcheevos/src/rcheevos/format.o \
deps/rcheevos/src/rcheevos/lboard.o \
deps/rcheevos/src/rcheevos/memref.o \
deps/rcheevos/src/rcheevos/operand.o \
deps/rcheevos/src/rcheevos/rc_libretro.o \
deps/rcheevos/src/rcheevos/richpresence.o \
deps/rcheevos/src/rcheevos/runtime.o \
deps/rcheevos/src/rcheevos/runtime_progress.o \
Expand All @@ -2123,6 +2134,7 @@ ifeq ($(HAVE_NETWORKING), 1)
deps/rcheevos/src/rhash/cdreader.o \
deps/rcheevos/src/rhash/hash.o \
deps/rcheevos/src/rapi/rc_api_common.o \
deps/rcheevos/src/rapi/rc_api_info.o \
deps/rcheevos/src/rapi/rc_api_runtime.o \
deps/rcheevos/src/rapi/rc_api_user.o \

Expand Down
14 changes: 7 additions & 7 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#include "../deps/rcheevos/include/rc_runtime.h"
#include "../deps/rcheevos/include/rc_runtime_types.h"
#include "../deps/rcheevos/include/rc_hash.h"
#include "../deps/rcheevos/src/rcheevos/rc_libretro.h"
#include "../deps/rcheevos/src/rc_libretro.h"

/* Define this macro to prevent cheevos from being deactivated when they trigger. */
#undef CHEEVOS_DONT_DEACTIVATE
Expand Down Expand Up @@ -163,7 +163,7 @@ static void rcheevos_handle_log_message(const char* message)
CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", message);
}

static void rcheevos_get_core_memory_info(unsigned id,
static void rcheevos_get_core_memory_info(uint32_t id,
rc_libretro_core_memory_info_t* info)
{
retro_ctx_memory_info_t ctx_info;
Expand Down Expand Up @@ -220,10 +220,10 @@ uint8_t* rcheevos_patch_address(unsigned address)
return rc_libretro_memory_find(&rcheevos_locals.memory, address);
}

static unsigned rcheevos_peek(unsigned address,
unsigned num_bytes, void* ud)
static uint32_t rcheevos_peek(uint32_t address,
uint32_t num_bytes, void* ud)
{
unsigned avail;
uint32_t avail;
uint8_t* data = rc_libretro_memory_find_avail(
&rcheevos_locals.memory, address, &avail);

Expand Down Expand Up @@ -1321,7 +1321,7 @@ static void rcheevos_runtime_event_handler(
}
}

static int rcheevos_runtime_address_validator(unsigned address)
static int rcheevos_runtime_address_validator(uint32_t address)
{
return rc_libretro_memory_find(
&rcheevos_locals.memory, address) != NULL;
Expand Down Expand Up @@ -2066,7 +2066,7 @@ static void rcheevos_identify_game_callback(void* userdata)
rcheevos_fetch_game_data();
}

static int rcheevos_get_image_path(unsigned index, char* buffer, size_t buffer_size)
static int rcheevos_get_image_path(uint32_t index, char* buffer, size_t buffer_size)
{
rarch_system_info_t *sys_info = &runloop_state_get_ptr()->system;
if (!sys_info->disk_control.cb.get_image_path)
Expand Down
2 changes: 1 addition & 1 deletion cheevos/cheevos_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ static void rcheevos_async_award_achievement_callback(
{
if ((int)api_response.awarded_achievement_id != request->id)
snprintf(buffer, buffer_size, "Achievement %u awarded instead",
api_response.awarded_achievement_id);
(unsigned)api_response.awarded_achievement_id);
else if (api_response.response.error_message)
{
/* previously unlocked achievements are returned as a "successful" error */
Expand Down
2 changes: 1 addition & 1 deletion cheevos/cheevos_locals.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define __RARCH_CHEEVOS_LOCALS_H

#include "../deps/rcheevos/include/rc_runtime.h"
#include "../deps/rcheevos/src/rcheevos/rc_libretro.h"
#include "../deps/rcheevos/src/rc_libretro.h"

#include <boolean.h>
#include <queues/task_queue.h>
Expand Down
22 changes: 22 additions & 0 deletions deps/rcheevos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# v11.0.0
* add rc_client_t and related functions
* add RC_MEMSIZE_FLOAT_BE
* add Game Pak SRAM to GBA memory map
* add hash method for Super Cassettevision
* add PSP to potential consoles for chd iterator
* add content_type to rc_api_request_t for client to pass to server
* add rc_api_process_X_server_response methods to pass status_code and body_length to response processing functions
* add additional error codes to rc_api_process_login_response: RC_INVALID_CREDENTIALS, RC_EXPIRED_TOKEN, RC_ACCESS_DENIED
* rc_api_start_session now also returns unlocks without having to explicitly call rc_api_fetch_user_unlocks separately
* add validation warning for using hit target of 1 on ResetIf condition
* move compat.c up a directory and rename to rc_compat.c as it's shared by all subfolders
* move rc_libretro.c up a directory as it uses files from all subfolders
* convert loosely sized types to strongly sized types (unsigned -> uint32t, unsigned char -> uint8_t, etc)

# v10.7.1
* add rc_runtime_alloc
* add rc_libretro_memory_find_avail
* extract nginx errors from HTML returned for JSON endpoints
* fix real address for 32X extension RAM
* fix crash attempting to calculate gamecube hash for non-existent file

# v10.7.0
* add hash method and memory map for Gamecube
* add console enum, hash method, and memory map for DSi
Expand Down
Loading

0 comments on commit 8523eaf

Please sign in to comment.