From 40300e502b351d94fedf84c220bf9e68a8718592 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 24 Jan 2013 16:49:23 +0100 Subject: [PATCH] Fix regression in patching when zlib CRC32 is used. --- hash.h | 3 ++- retroarch.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hash.h b/hash.h index 05e6039361..8d5266564e 100644 --- a/hash.h +++ b/hash.h @@ -39,7 +39,8 @@ static inline uint32_t crc32_calculate(const uint8_t *data, size_t length) static inline uint32_t crc32_adjust(uint32_t crc, uint8_t data) { - return crc32(crc, &data, 1); + // zlib and nall have different assumptions on "sign" for this function. + return ~crc32(~crc, &data, 1); } #else uint32_t crc32_calculate(const uint8_t *data, size_t length); diff --git a/retroarch.c b/retroarch.c index b559f6a2bd..bdd2af95b7 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2696,10 +2696,11 @@ int rarch_main_init(int argc, char *argv[]) g_extern.use_sram = true; bool allow_cheats = true; + fill_pathnames(); + if (!init_rom_file(g_extern.game_type)) goto error; - fill_pathnames(); set_savestate_auto_index(); init_system_av_info();