Merge pull request #2690 from lakkatv/master

Display Co-op in the database informations
This commit is contained in:
Twinaphex 2016-02-03 14:37:09 +01:00
commit f080cfe74f
5 changed files with 19 additions and 2 deletions

View File

@ -71,6 +71,7 @@
#define DB_CURSOR_RELEASEDATE_MONTH 0x790ad76cU
#define DB_CURSOR_RELEASEDATE_YEAR 0x7fd06ed7U
#define DB_CURSOR_RUMBLE_SUPPORTED 0x1a4dc3ecU
#define DB_CURSOR_COOP_SUPPORTED 0x7c953ff6U
#define DB_CURSOR_ANALOG_SUPPORTED 0xf220fc17U
#define DB_CURSOR_SIZE 0x7c9dede0U
#define DB_CURSOR_SERIAL 0x1b843ec5U
@ -237,6 +238,7 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
db_info->analog_supported = -1;
db_info->rumble_supported = -1;
db_info->coop_supported = -1;
for (i = 0; i < item.val.map.len; i++)
{
@ -318,6 +320,9 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
case DB_CURSOR_RUMBLE_SUPPORTED:
db_info->rumble_supported = val->val.uint_;
break;
case DB_CURSOR_COOP_SUPPORTED:
db_info->coop_supported = val->val.uint_;
break;
case DB_CURSOR_ANALOG_SUPPORTED:
db_info->analog_supported = val->val.uint_;
break;

View File

@ -87,6 +87,7 @@ typedef struct
unsigned releaseyear;
int analog_supported;
int rumble_supported;
int coop_supported;
void *userdata;
} database_info_t;

View File

@ -564,6 +564,8 @@ dat_converter_rdb_mappings_t rdb_mappings[] =
{"publisher", "publisher", DAT_CONVERTER_RDB_TYPE_STRING},
{"origin", "origin", DAT_CONVERTER_RDB_TYPE_STRING},
{"coop", "coop", DAT_CONVERTER_RDB_TYPE_UINT},
{"rom.crc", "crc", DAT_CONVERTER_RDB_TYPE_HEX},
{"rom.md5", "md5", DAT_CONVERTER_RDB_TYPE_HEX},
{"rom.sha1", "sha1", DAT_CONVERTER_RDB_TYPE_HEX},

View File

@ -1412,7 +1412,7 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
menu_hash_to_str(MENU_LABEL_RDB_ENTRY_ANALOG),
menu_hash_to_str(MENU_VALUE_TRUE), info->path, info->list) == -1)
goto error;
}
}
if (db_info_entry->rumble_supported == 1)
{
@ -1420,7 +1420,15 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
menu_hash_to_str(MENU_LABEL_RDB_ENTRY_RUMBLE),
menu_hash_to_str(MENU_VALUE_TRUE), info->path, info->list) == -1)
goto error;
}
}
if (db_info_entry->coop_supported == 1)
{
if (create_string_list_rdb_entry_string("Co-op supported",
menu_hash_to_str(MENU_LABEL_RDB_ENTRY_COOP),
menu_hash_to_str(MENU_VALUE_TRUE), info->path, info->list) == -1)
goto error;
}
if (!show_advanced_settings)
continue;

View File

@ -554,6 +554,7 @@ extern "C" {
#define MENU_LABEL_VALUE_RDB_ENTRY_START_CONTENT 0x2cf73cceU
#define MENU_LABEL_RDB_ENTRY_ANALOG 0x9081c2ffU
#define MENU_LABEL_RDB_ENTRY_RUMBLE 0xb8ae8ad4U
#define MENU_LABEL_RDB_ENTRY_COOP 0x7c953ff6U
#define MENU_LABEL_RDB_ENTRY_START_CONTENT 0x95025a55U
#define MENU_LABEL_RDB_ENTRY_DESCRIPTION 0x26aa1f71U
#define MENU_LABEL_VALUE_RDB_ENTRY_DESCRIPTION 0xe61a1f69U