Fix regression in patching when zlib CRC32 is used.

This commit is contained in:
Themaister 2013-01-24 16:49:23 +01:00
parent 32f45b2f27
commit 40300e502b
2 changed files with 4 additions and 2 deletions

3
hash.h
View File

@ -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);

View File

@ -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();