feat: Add Wii Backup File WBFS scanning

This commit is contained in:
Rob Loach 2018-04-29 09:51:38 -04:00
parent 6cd046a42a
commit 00092eb5ea
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
3 changed files with 15 additions and 2 deletions

View File

@ -136,6 +136,7 @@ enum msg_file_type
FILE_TYPE_ISO, FILE_TYPE_ISO,
FILE_TYPE_LUTRO, FILE_TYPE_LUTRO,
FILE_TYPE_CHD, FILE_TYPE_CHD,
FILE_TYPE_WBFS,
FILE_TYPE_DIRECT_LOAD, FILE_TYPE_DIRECT_LOAD,
@ -665,7 +666,7 @@ enum msg_hash_enums
MENU_LABEL(INPUT_UNIFIED_MENU_CONTROLS), MENU_LABEL(INPUT_UNIFIED_MENU_CONTROLS),
/* Video */ /* Video */
MENU_LABEL(CRT_SWITCH_RESOLUTION), MENU_LABEL(CRT_SWITCH_RESOLUTION),
MENU_LABEL(CRT_SWITCH_RESOLUTION_SUPER), MENU_LABEL(CRT_SWITCH_RESOLUTION_SUPER),
MENU_LABEL(VIDEO_FONT_ENABLE), MENU_LABEL(VIDEO_FONT_ENABLE),
MENU_LABEL(VIDEO_FONT_PATH), MENU_LABEL(VIDEO_FONT_PATH),

View File

@ -595,6 +595,11 @@ static enum msg_file_type extension_to_file_type(const char *ext)
string_is_equal(ext, "CHD") string_is_equal(ext, "CHD")
) )
return FILE_TYPE_CHD; return FILE_TYPE_CHD;
if (
string_is_equal(ext, "wbfs") ||
string_is_equal(ext, "WBFS")
)
return FILE_TYPE_WBFS;
if ( if (
string_is_equal(ext, "lutro") || string_is_equal(ext, "lutro") ||
string_is_equal(ext, "LUTRO") string_is_equal(ext, "LUTRO")
@ -642,6 +647,8 @@ static int task_database_iterate_playlist(
return task_database_gdi_get_crc(name, &db_state->crc); return task_database_gdi_get_crc(name, &db_state->crc);
} }
break; break;
/* Consider Wii WBFS files similar to ISO files. */
case FILE_TYPE_WBFS:
case FILE_TYPE_ISO: case FILE_TYPE_ISO:
db_state->serial[0] = '\0'; db_state->serial[0] = '\0';
intfstream_file_get_serial(name, 0, SIZE_MAX, db_state->serial); intfstream_file_get_serial(name, 0, SIZE_MAX, db_state->serial);
@ -1301,7 +1308,7 @@ bool task_push_dbscan(
const char *playlist_directory, const char *playlist_directory,
const char *content_database, const char *content_database,
const char *fullpath, const char *fullpath,
bool directory, bool directory,
bool show_hidden_files, bool show_hidden_files,
retro_task_callback_t cb) retro_task_callback_t cb)
{ {

View File

@ -333,6 +333,11 @@ int detect_serial_ascii_game(intfstream_t *fd, char *game_id)
game_id[15] = '\0'; game_id[15] = '\0';
numberOfAscii = 0; numberOfAscii = 0;
/* When scanning WBFS files, "WBFS" is discovered as the first serial. Ignore it. */
if (string_is_equal(game_id, "WBFS")) {
continue;
}
/* Loop through until we run out of ASCII characters. */ /* Loop through until we run out of ASCII characters. */
for (i = 0; i < 15; i++) for (i = 0; i < 15; i++)
{ {