From 2675cd2f765accef35935c8adc600951d74a8e24 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 12 Aug 2014 03:19:02 +0200 Subject: [PATCH] Rename cart_crc --- file.c | 4 ++-- general.h | 2 +- movie.c | 6 +++--- netplay.c | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/file.c b/file.c index 5e415f40f0..b98b0309bf 100644 --- a/file.c +++ b/file.c @@ -135,10 +135,10 @@ static ssize_t read_rom_file(const char *path, void **buf) patch_rom(&ret_buf, &ret); } - g_extern.cart_crc = crc32_calculate(ret_buf, ret); + g_extern.content_crc = crc32_calculate(ret_buf, ret); sha256_hash(g_extern.sha256, ret_buf, ret); RARCH_LOG("CRC32: 0x%x, SHA256: %s\n", - (unsigned)g_extern.cart_crc, g_extern.sha256); + (unsigned)g_extern.content_crc, g_extern.sha256); *buf = ret_buf; return ret; } diff --git a/general.h b/general.h index af2f907f4e..08890255ca 100644 --- a/general.h +++ b/general.h @@ -414,7 +414,7 @@ struct global content_history_t *history; - uint32_t cart_crc; + uint32_t content_crc; char gb_rom_path[PATH_MAX]; char bsx_rom_path[PATH_MAX]; diff --git a/movie.c b/movie.c index 255cd4c7bb..bcf1c4be4d 100644 --- a/movie.c +++ b/movie.c @@ -63,8 +63,8 @@ static bool init_playback(bsv_movie_t *handle, const char *path) return false; } - if (swap_if_big32(header[CRC_INDEX]) != g_extern.cart_crc) - RARCH_WARN("CRC32 checksum mismatch between ROM file and saved ROM checksum in replay file header; replay highly likely to desync on playback.\n"); + if (swap_if_big32(header[CRC_INDEX]) != g_extern.content_crc) + RARCH_WARN("CRC32 checksum mismatch between content file and saved content checksum in replay file header; replay highly likely to desync on playback.\n"); uint32_t state_size = swap_if_big32(header[STATE_SIZE_INDEX]); @@ -106,7 +106,7 @@ static bool init_record(bsv_movie_t *handle, const char *path) // This value is supposed to show up as BSV1 in a HEX editor, big-endian. header[MAGIC_INDEX] = swap_if_little32(BSV_MAGIC); - header[CRC_INDEX] = swap_if_big32(g_extern.cart_crc); + header[CRC_INDEX] = swap_if_big32(g_extern.content_crc); uint32_t state_size = pretro_serialize_size(); diff --git a/netplay.c b/netplay.c index b937227e33..c46d12f5d2 100644 --- a/netplay.c +++ b/netplay.c @@ -518,7 +518,7 @@ static bool get_nickname(netplay_t *handle, int fd) static bool send_info(netplay_t *handle) { uint32_t header[3] = { - htonl(g_extern.cart_crc), + htonl(g_extern.content_crc), htonl(implementation_magic_value()), htonl(pretro_get_memory_size(RETRO_MEMORY_SAVE_RAM)) }; @@ -566,9 +566,9 @@ static bool get_info(netplay_t *handle) return false; } - if (g_extern.cart_crc != ntohl(header[0])) + if (g_extern.content_crc != ntohl(header[0])) { - RARCH_ERR("Cart CRC32s differ. Cannot use different games.\n"); + RARCH_ERR("Content CRC32s differ. Cannot use different games.\n"); return false; } @@ -580,7 +580,7 @@ static bool get_info(netplay_t *handle) if (pretro_get_memory_size(RETRO_MEMORY_SAVE_RAM) != ntohl(header[2])) { - RARCH_ERR("Cartridge SRAM sizes do not correspond.\n"); + RARCH_ERR("Content SRAM sizes do not correspond.\n"); return false; } @@ -625,7 +625,7 @@ static uint32_t *bsv_header_generate(size_t *size, uint32_t magic) bsv_header[MAGIC_INDEX] = swap_if_little32(BSV_MAGIC); bsv_header[SERIALIZER_INDEX] = swap_if_big32(magic); - bsv_header[CRC_INDEX] = swap_if_big32(g_extern.cart_crc); + bsv_header[CRC_INDEX] = swap_if_big32(g_extern.content_crc); bsv_header[STATE_SIZE_INDEX] = swap_if_big32(serialize_size); if (serialize_size && !pretro_serialize(header + 4, serialize_size)) @@ -656,9 +656,9 @@ static bool bsv_parse_header(const uint32_t *header, uint32_t magic) } uint32_t in_crc = swap_if_big32(header[CRC_INDEX]); - if (in_crc != g_extern.cart_crc) + if (in_crc != g_extern.content_crc) { - RARCH_ERR("CRC32 mismatch, got 0x%x, expected 0x%x.\n", in_crc, g_extern.cart_crc); + RARCH_ERR("CRC32 mismatch, got 0x%x, expected 0x%x.\n", in_crc, g_extern.content_crc); return false; }