Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,12 @@ ifeq ($(HAVE_NETWORKING), 1)
deps/rcheevos/src/rapi/rc_api_runtime.o \
deps/rcheevos/src/rapi/rc_api_user.o \

# RVZ/WIA disc image support for RetroAchievements
ifeq ($(HAVE_ZSTD), 1)
DEFINES += -DHAVE_CHEEVOS_RVZ
OBJ += cheevos/cheevos_rvz.o
endif

ifeq ($(HAVE_LUA), 1)
DEFINES += -DHAVE_LUA \
-DLUA_32BITS
Expand Down
33 changes: 31 additions & 2 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
#include "streams/chd_stream.h"
#endif

#ifdef HAVE_CHEEVOS_RVZ
#include "cheevos_rvz.h"
#endif

#include "cheevos.h"
#include "cheevos_client.h"
#include "cheevos_menu.h"
Expand Down Expand Up @@ -1636,8 +1640,33 @@ bool rcheevos_load(const void *data)
gfx_widget_set_cheevos_set_loading(true);
#endif

rc_client_begin_identify_and_load_game(rcheevos_locals.client, RC_CONSOLE_UNKNOWN,
info->path, (const uint8_t*)info->data, info->size, rcheevos_client_load_game_callback, NULL);
/* Detect RVZ files and determine console type (GameCube or Wii) */
{
uint32_t console_id = RC_CONSOLE_UNKNOWN;

#ifdef HAVE_CHEEVOS_RVZ
if (string_is_equal_noncase(path_get_extension(info->path), "rvz"))
{
console_id = rcheevos_rvz_get_console_id(info->path);

/* Only register custom file reader for valid RVZ files */
if (console_id != RC_CONSOLE_UNKNOWN)
{
struct rc_hash_filereader filereader;

filereader.open = rcheevos_rvz_open;
filereader.seek = rcheevos_rvz_seek;
filereader.tell = rcheevos_rvz_tell;
filereader.read = rcheevos_rvz_read;
filereader.close = rcheevos_rvz_close;
rc_hash_init_custom_filereader(&filereader);
}
}
#endif

rc_client_begin_identify_and_load_game(rcheevos_locals.client, console_id,
info->path, (const uint8_t*)info->data, info->size, rcheevos_client_load_game_callback, NULL);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it seems to work for GameCube, but my two Wii test games both generated different hashes than the Dolphin standalone.

Gamecube:

[INFO] [RCHEEVOS] Opened Legend of Zelda, The - The Wind Waker (Europe).rvz
[INFO] [RCHEEVOS] Generated hash 4ac9fb3e05560f402073ff73c49c7276

[INFO] [RCHEEVOS] Opened Mario Kart - Double Dash!! (USA).rvz
[INFO] [RCHEEVOS] Generated hash adad8934d2586d27ec4b653bae52e47b

[INFO] [RCHEEVOS] Opened Metroid Prime (USA) (Rev 2).rvz
[INFO] [RCHEEVOS] Generated hash 92385889dab3531142542a3b7f8502fd

[INFO] [RCHEEVOS] Opened Metroid Prime 2 - Echoes (USA).rvz
[INFO] [RCHEEVOS] Generated hash f7b7c7e8eb92593837ab13d5d62d636e

[INFO] [RCHEEVOS] Opened Paper Mario - The Thousand-Year Door (USA).rvz
[INFO] [RCHEEVOS] Generated hash 495bfe28a1ec59d11d2cc849287549cd

[INFO] [RCHEEVOS] Opened Simpsons, The - Road Rage (USA).rvz
[INFO] [RCHEEVOS] Generated hash 25cd098ca8abb5ee642abb9a9459a575

[INFO] [RCHEEVOS] Opened Super Mario Sunshine (USA).rvz
[INFO] [RCHEEVOS] Generated hash 051e73a951c34842b45641dc4de39f51

[INFO] [RCHEEVOS] Opened Wario World (USA).rvz
[INFO] [RCHEEVOS] Generated hash 2e74fff1b7a94b6576f15f3e67780aaf

Wii:
[INFO] [RCHEEVOS] Opened Bully - Scholarship Edition (USA) (En,Fr,Es).rvz
[INFO] [RCHEEVOS] Generated hash cc00cac3b2298c147d685c967c65ebdd
        dolphin standalone:      eff8921f3062eca576ce97691436c804

[INFO] [RCHEEVOS] Opened Wii Sports Resort (Europe) (En,Fr,De,Es,It) (Rev 1).rvz
[INFO] [RCHEEVOS] Generated hash eb11dc7c0b38ffc83a28b2df4e1ae722
        dolphin standalone:      9561583adf9deb5160b423c981745d06


return true;
}
Expand Down
Loading
Loading