From 18cf2f3f88daaa13f31a4c06e92d3bebb45bd267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Wed, 3 Feb 2016 19:35:59 +0700 Subject: [PATCH] Display Co-op in the database informations --- database_info.c | 5 +++++ database_info.h | 1 + libretro-db/c_converter.c | 2 ++ menu/menu_displaylist.c | 12 ++++++++++-- menu/menu_hash.h | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/database_info.c b/database_info.c index 16f5486577..9701033767 100644 --- a/database_info.c +++ b/database_info.c @@ -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; diff --git a/database_info.h b/database_info.h index 09d1b35831..7bbc68a46f 100644 --- a/database_info.h +++ b/database_info.h @@ -87,6 +87,7 @@ typedef struct unsigned releaseyear; int analog_supported; int rumble_supported; + int coop_supported; void *userdata; } database_info_t; diff --git a/libretro-db/c_converter.c b/libretro-db/c_converter.c index 93c0c0acb9..abb0f6bfde 100644 --- a/libretro-db/c_converter.c +++ b/libretro-db/c_converter.c @@ -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}, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 5d8a5d75e9..9bff42498c 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1413,7 +1413,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) { @@ -1421,7 +1421,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; diff --git a/menu/menu_hash.h b/menu/menu_hash.h index 7e8bf50d3e..0bd31d3b0a 100644 --- a/menu/menu_hash.h +++ b/menu/menu_hash.h @@ -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