Fix Redump bin/cue scan for some DC games + add RVZ/WIA scan support for GC/Wii (#14380)
This commit is contained in:
parent
b88c297f8e
commit
82cac0f9ba
|
@ -140,6 +140,8 @@ enum msg_file_type
|
|||
FILE_TYPE_LUTRO,
|
||||
FILE_TYPE_CHD,
|
||||
FILE_TYPE_WBFS,
|
||||
FILE_TYPE_RVZ,
|
||||
FILE_TYPE_WIA,
|
||||
|
||||
FILE_TYPE_DIRECT_LOAD,
|
||||
|
||||
|
|
|
@ -504,6 +504,14 @@ static enum msg_file_type extension_to_file_type(const char *ext)
|
|||
string_is_equal(ext_lower, "wbfs")
|
||||
)
|
||||
return FILE_TYPE_WBFS;
|
||||
if (
|
||||
string_is_equal(ext_lower, "rvz")
|
||||
)
|
||||
return FILE_TYPE_RVZ;
|
||||
if (
|
||||
string_is_equal(ext_lower, "wia")
|
||||
)
|
||||
return FILE_TYPE_WIA;
|
||||
if (
|
||||
string_is_equal(ext_lower, "lutro")
|
||||
)
|
||||
|
@ -550,12 +558,10 @@ static int task_database_iterate_playlist(
|
|||
return task_database_gdi_get_crc(name, &db_state->crc);
|
||||
}
|
||||
break;
|
||||
/* Consider Wii WBFS files similar to ISO files. */
|
||||
/* Consider WBFS, RVZ and WIA files similar to ISO files. */
|
||||
case FILE_TYPE_WBFS:
|
||||
db_state->serial[0] = '\0';
|
||||
intfstream_file_get_serial(name, 0, SIZE_MAX, db_state->serial, sizeof(db_state->serial));
|
||||
db->type = DATABASE_TYPE_SERIAL_LOOKUP;
|
||||
break;
|
||||
case FILE_TYPE_RVZ:
|
||||
case FILE_TYPE_WIA:
|
||||
case FILE_TYPE_ISO:
|
||||
db_state->serial[0] = '\0';
|
||||
intfstream_file_get_serial(name, 0, SIZE_MAX, db_state->serial, sizeof(db_state->serial));
|
||||
|
|
|
@ -52,8 +52,10 @@
|
|||
|
||||
static struct magic_entry MAGIC_NUMBERS[] = {
|
||||
{ "Nintendo - GameCube", "\xc2\x33\x9f\x3d", 0x00001c},
|
||||
{ "Nintendo - GameCube", "\xc2\x33\x9f\x3d", 0x000074}, /* RVZ, WIA */
|
||||
{ "Nintendo - Wii", "\x5d\x1c\x9e\xa3", 0x000018},
|
||||
{ "Nintendo - Wii", "\x5d\x1c\x9e\xa3", 0x000218},
|
||||
{ "Nintendo - Wii", "\x5d\x1c\x9e\xa3", 0x000218}, /* WBFS */
|
||||
{ "Nintendo - Wii", "\x5d\x1c\x9e\xa3", 0x000070}, /* RVZ, WIA */
|
||||
{ "Sega - Dreamcast", "SEGA SEGAKATANA", 0x000010},
|
||||
{ "Sega - Mega-CD - Sega CD", "SEGADISCSYSTEM", 0x000010},
|
||||
{ "Sega - Saturn", "SEGA SEGASATURN", 0x000010},
|
||||
|
@ -339,6 +341,15 @@ int detect_gc_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
|||
if (intfstream_read(fd, raw_game_id, 4) <= 0)
|
||||
return false;
|
||||
|
||||
if (string_is_equal_fast(raw_game_id, "RVZ", STRLEN_CONST("RVZ"))
|
||||
|| string_is_equal_fast(raw_game_id, "WIA", STRLEN_CONST("WIA")))
|
||||
{
|
||||
if (intfstream_seek(fd, 0x0058, SEEK_SET) < 0)
|
||||
return false;
|
||||
if (intfstream_read(fd, raw_game_id, 4) <= 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
raw_game_id[4] = '\0';
|
||||
|
||||
/** Scrub files with bad data and log **/
|
||||
|
@ -816,9 +827,17 @@ int detect_dc_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
|||
&& raw_game_id[1] == 'K'
|
||||
&& raw_game_id[2] == '-')
|
||||
{
|
||||
|
||||
if (length <= 8)
|
||||
{
|
||||
/* For 8 chars serials in 'MK-xxxxx' format, we need to remove 'MK-' to match Redump database
|
||||
* Sega GT being the only exception (MK-51053), we have to check if it's not that game first */
|
||||
if (string_is_not_equal_fast(raw_game_id, "MK-51053", STRLEN_CONST("MK-51053")))
|
||||
{
|
||||
strncpy(s, raw_game_id + 3, 5);
|
||||
s[5] = '\0';
|
||||
cue_append_multi_disc_suffix(s, filename);
|
||||
return true;
|
||||
}
|
||||
strncpy(s, raw_game_id, 8);
|
||||
s[8] = '\0';
|
||||
cue_append_multi_disc_suffix(s, filename);
|
||||
|
@ -862,6 +881,15 @@ int detect_wii_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
|||
if (intfstream_read(fd, raw_game_id, 6) <= 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string_is_equal_fast(raw_game_id, "RVZ", STRLEN_CONST("RVZ"))
|
||||
|| string_is_equal_fast(raw_game_id, "WIA", STRLEN_CONST("WIA")))
|
||||
{
|
||||
if (intfstream_seek(fd, 0x0058, SEEK_SET) < 0)
|
||||
return false;
|
||||
if (intfstream_read(fd, raw_game_id, 6) <= 0)
|
||||
return false;
|
||||
}
|
||||
raw_game_id[6] = '\0';
|
||||
|
||||
/** Scrub files with bad data and log **/
|
||||
|
|
Loading…
Reference in New Issue