Rename cart_crc
This commit is contained in:
parent
968c9d907e
commit
2675cd2f76
4
file.c
4
file.c
|
@ -135,10 +135,10 @@ static ssize_t read_rom_file(const char *path, void **buf)
|
||||||
patch_rom(&ret_buf, &ret);
|
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);
|
sha256_hash(g_extern.sha256, ret_buf, ret);
|
||||||
RARCH_LOG("CRC32: 0x%x, SHA256: %s\n",
|
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;
|
*buf = ret_buf;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -414,7 +414,7 @@ struct global
|
||||||
|
|
||||||
content_history_t *history;
|
content_history_t *history;
|
||||||
|
|
||||||
uint32_t cart_crc;
|
uint32_t content_crc;
|
||||||
|
|
||||||
char gb_rom_path[PATH_MAX];
|
char gb_rom_path[PATH_MAX];
|
||||||
char bsx_rom_path[PATH_MAX];
|
char bsx_rom_path[PATH_MAX];
|
||||||
|
|
6
movie.c
6
movie.c
|
@ -63,8 +63,8 @@ static bool init_playback(bsv_movie_t *handle, const char *path)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (swap_if_big32(header[CRC_INDEX]) != g_extern.cart_crc)
|
if (swap_if_big32(header[CRC_INDEX]) != g_extern.content_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");
|
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]);
|
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.
|
// This value is supposed to show up as BSV1 in a HEX editor, big-endian.
|
||||||
header[MAGIC_INDEX] = swap_if_little32(BSV_MAGIC);
|
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();
|
uint32_t state_size = pretro_serialize_size();
|
||||||
|
|
||||||
|
|
14
netplay.c
14
netplay.c
|
@ -518,7 +518,7 @@ static bool get_nickname(netplay_t *handle, int fd)
|
||||||
static bool send_info(netplay_t *handle)
|
static bool send_info(netplay_t *handle)
|
||||||
{
|
{
|
||||||
uint32_t header[3] = {
|
uint32_t header[3] = {
|
||||||
htonl(g_extern.cart_crc),
|
htonl(g_extern.content_crc),
|
||||||
htonl(implementation_magic_value()),
|
htonl(implementation_magic_value()),
|
||||||
htonl(pretro_get_memory_size(RETRO_MEMORY_SAVE_RAM))
|
htonl(pretro_get_memory_size(RETRO_MEMORY_SAVE_RAM))
|
||||||
};
|
};
|
||||||
|
@ -566,9 +566,9 @@ static bool get_info(netplay_t *handle)
|
||||||
return false;
|
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;
|
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]))
|
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;
|
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[MAGIC_INDEX] = swap_if_little32(BSV_MAGIC);
|
||||||
bsv_header[SERIALIZER_INDEX] = swap_if_big32(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);
|
bsv_header[STATE_SIZE_INDEX] = swap_if_big32(serialize_size);
|
||||||
|
|
||||||
if (serialize_size && !pretro_serialize(header + 4, 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]);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue