Changed some platform enumerators to make them more clear and consistent.

This commit is contained in:
Leon Styhre 2021-02-07 20:49:52 +01:00
parent 7da2f6b039
commit 47f5b889d5
4 changed files with 103 additions and 104 deletions

View file

@ -48,7 +48,7 @@ FileData::FileData(
// Metadata needs at least a name field (since that's what getName() will return). // Metadata needs at least a name field (since that's what getName() will return).
if (metadata.get("name").empty()) { if (metadata.get("name").empty()) {
if ((system->hasPlatformId(PlatformIds::ARCADE) || if ((system->hasPlatformId(PlatformIds::ARCADE) ||
system->hasPlatformId(PlatformIds::NEOGEO)) && system->hasPlatformId(PlatformIds::SNK_NEO_GEO)) &&
metadata.getType() != FOLDER_METADATA) { metadata.getType() != FOLDER_METADATA) {
// If it's a MAME or Neo Geo game, expand the game name accordingly. // If it's a MAME or Neo Geo game, expand the game name accordingly.
metadata.set("name", metadata.set("name",
@ -406,7 +406,7 @@ const bool FileData::isArcadeAsset()
{ {
const std::string stem = Utils::FileSystem::getStem(mPath); const std::string stem = Utils::FileSystem::getStem(mPath);
return ((mSystem && (mSystem->hasPlatformId(PlatformIds::ARCADE) || return ((mSystem && (mSystem->hasPlatformId(PlatformIds::ARCADE) ||
mSystem->hasPlatformId(PlatformIds::NEOGEO))) && mSystem->hasPlatformId(PlatformIds::SNK_NEO_GEO))) &&
(MameNames::getInstance()->isBios(stem) || (MameNames::getInstance()->isBios(stem) ||
MameNames::getInstance()->isDevice(stem))); MameNames::getInstance()->isDevice(stem)));
} }
@ -415,7 +415,7 @@ const bool FileData::isArcadeGame()
{ {
const std::string stem = Utils::FileSystem::getStem(mPath); const std::string stem = Utils::FileSystem::getStem(mPath);
return ((mSystem && (mSystem->hasPlatformId(PlatformIds::ARCADE) || return ((mSystem && (mSystem->hasPlatformId(PlatformIds::ARCADE) ||
mSystem->hasPlatformId(PlatformIds::NEOGEO))) && mSystem->hasPlatformId(PlatformIds::SNK_NEO_GEO))) &&
(!MameNames::getInstance()->isBios(stem) && (!MameNames::getInstance()->isBios(stem) &&
!MameNames::getInstance()->isDevice(stem))); !MameNames::getInstance()->isDevice(stem)));
} }

View file

@ -18,13 +18,13 @@ namespace PlatformIds
THREEDO, // Names can't start with a number. THREEDO, // Names can't start with a number.
ADVENTUREGAMESTUDIO, ADVENTUREGAMESTUDIO,
AMIGA, COMMODORE_AMIGA,
AMIGACD32, COMMODORE_AMIGA_CD32,
AMSTRAD_CPC, AMSTRAD_CPC,
APPLE_II, APPLE_II,
APPLE_IIGS, APPLE_IIGS,
ARCADE, ARCADE,
ASTROCADE, BALLY_ASTROCADE,
ATARI_2600, ATARI_2600,
ATARI_5200, ATARI_5200,
ATARI_7800, ATARI_7800,
@ -40,26 +40,26 @@ namespace PlatformIds
CAVESTORY, CAVESTORY,
COMMODORE_CDTV, COMMODORE_CDTV,
FAIRCHILD_CHANNELF, FAIRCHILD_CHANNELF,
TANDY, TANDY_COLOR_COMPUTER,
COLECOVISION, COLECOVISION,
DAPHNE, DAPHNE,
DOS, DOS,
DRAGON32, DRAGON32,
SEGA_DREAMCAST, SEGA_DREAMCAST,
FAMICOM, NINTENDO_FAMICOM,
FAMICOM_DISK_SYSTEM, NINTENDO_FAMICOM_DISK_SYSTEM,
NINTENDO_GAME_AND_WATCH, NINTENDO_GAME_AND_WATCH,
SEGA_GAME_GEAR, SEGA_GAME_GEAR,
GAME_BOY, NINTENDO_GAME_BOY,
GAME_BOY_ADVANCE, NINTENDO_GAME_BOY_ADVANCE,
GAME_BOY_COLOR, NINTENDO_GAME_BOY_COLOR,
NINTENDO_GAMECUBE, NINTENDO_GAMECUBE,
SEGA_GENESIS, SEGA_GENESIS,
AMSTRAD_GX4000, AMSTRAD_GX4000,
INTELLIVISION, INTELLIVISION,
LOVE, LOVE,
LUTRO, LUTRO,
MAC_OS, APPLE_MACINTOSH,
SEGA_MASTER_SYSTEM, SEGA_MASTER_SYSTEM,
SEGA_MEGA_DRIVE, SEGA_MEGA_DRIVE,
MESS, MESS,
@ -70,26 +70,26 @@ namespace PlatformIds
NINTENDO_64, NINTENDO_64,
SEGA_NAOMI, SEGA_NAOMI,
NINTENDO_DS, NINTENDO_DS,
NEOGEO, SNK_NEO_GEO,
NEOGEO_CD, SNK_NEO_GEO_CD,
NINTENDO_ENTERTAINMENT_SYSTEM, NINTENDO_ENTERTAINMENT_SYSTEM,
NEOGEO_POCKET, SNK_NEO_GEO_POCKET,
NEOGEO_POCKET_COLOR, SNK_NEO_GEO_POCKET_COLOR,
VIDEOPAC_ODYSSEY2, VIDEOPAC_ODYSSEY2,
OPENBOR, OPENBOR,
ORIC, TANGERINE_ORIC,
PALM_OS, PALM_OS,
PC, PC,
TURBOGRAFX_16, NEC_PC_ENGINE,
TURBOGRAFX_CD, NEC_PC_ENGINE_CD,
PCFX, NEC_PCFX,
NINTENDO_POKEMON_MINI, NINTENDO_POKEMON_MINI,
PLAYSTATION_2, SONY_PLAYSTATION_2,
PLAYSTATION_3, SONY_PLAYSTATION_3,
PLAYSTATION_4, SONY_PLAYSTATION_4,
PLAYSTATION_PORTABLE, SONY_PLAYSTATION_PORTABLE,
PLAYSTATION_VITA, SONY_PLAYSTATION_VITA,
PLAYSTATION, SONY_PLAYSTATION,
RESIDUALVM, RESIDUALVM,
SAMCOUPE, SAMCOUPE,
NINTENDO_SATELLAVIEW, NINTENDO_SATELLAVIEW,
@ -102,25 +102,25 @@ namespace PlatformIds
SOLARUS, SOLARUS,
SPECTRAVIDEO, SPECTRAVIDEO,
STRATAGUS, STRATAGUS,
SUFAMI_TURBO, BANDAI_SUFAMI_TURBO,
SUPERGRAFX, NEC_SUPERGRAFX,
TI99, TEXAS_INSTRUMENTS_TI99,
TRS80_COLOR_COMPUTER, TANDY_TRS80,
UZEBOX, UZEBOX,
VECTREX, VECTREX,
VIDEOPAC, PHILIPS_VIDEOPAC,
NINTENDO_VIRTUAL_BOY, NINTENDO_VIRTUAL_BOY,
NINTENDO_WII, NINTENDO_WII,
NINTENDO_WII_U, NINTENDO_WII_U,
WONDERSWAN, BANDAI_WONDERSWAN,
WONDERSWAN_COLOR, BANDAI_WONDERSWAN_COLOR,
SHARP_X1, SHARP_X1,
SHARP_X68000, SHARP_X68000,
XBOX, MICROSOFT_XBOX,
XBOX_360, MICROSOFT_XBOX_360,
ZMACHINE, SINCLAIR_Z_MACHINE,
ZX81_SINCLAR, SINCLAIR_ZX81_SINCLAR,
ZX_SPECTRUM, SINCLAIR_ZX_SPECTRUM,
PLATFORM_IGNORE, // Do not allow scraping for this system. PLATFORM_IGNORE, // Do not allow scraping for this system.
PLATFORM_COUNT PLATFORM_COUNT

View file

@ -35,8 +35,8 @@ namespace
const std::map<PlatformId, std::string> gamesdb_new_platformid_map { const std::map<PlatformId, std::string> gamesdb_new_platformid_map {
{ THREEDO, "25" }, { THREEDO, "25" },
{ AMIGA, "4911" }, { COMMODORE_AMIGA, "4911" },
{ AMIGACD32, "4947" }, { COMMODORE_AMIGA_CD32, "4947" },
{ AMSTRAD_CPC, "4914" }, { AMSTRAD_CPC, "4914" },
{ APPLE_II, "4942" }, { APPLE_II, "4942" },
{ ARCADE, "23" }, { ARCADE, "23" },
@ -54,23 +54,23 @@ const std::map<PlatformId, std::string> gamesdb_new_platformid_map {
{ COMMODORE_64, "40" }, { COMMODORE_64, "40" },
{ DAPHNE, "23" }, { DAPHNE, "23" },
{ INTELLIVISION, "32" }, { INTELLIVISION, "32" },
{ MAC_OS, "37" }, { APPLE_MACINTOSH, "37" },
{ XBOX, "14" }, { MICROSOFT_XBOX, "14" },
{ XBOX_360, "15" }, { MICROSOFT_XBOX_360, "15" },
{ MOONLIGHT, "1" }, { MOONLIGHT, "1" },
{ MSX, "4929" }, { MSX, "4929" },
{ NEOGEO, "24" }, { SNK_NEO_GEO, "24" },
{ NEOGEO_CD, "24" }, { SNK_NEO_GEO_CD, "24" },
{ NEOGEO_POCKET, "4922" }, { SNK_NEO_GEO_POCKET, "4922" },
{ NEOGEO_POCKET_COLOR, "4923" }, { SNK_NEO_GEO_POCKET_COLOR, "4923" },
{ NINTENDO_3DS, "4912" }, { NINTENDO_3DS, "4912" },
{ NINTENDO_64, "3" }, { NINTENDO_64, "3" },
{ NINTENDO_DS, "8" }, { NINTENDO_DS, "8" },
{ FAMICOM_DISK_SYSTEM, "4936" }, { NINTENDO_FAMICOM_DISK_SYSTEM, "4936" },
{ NINTENDO_ENTERTAINMENT_SYSTEM, "7" }, { NINTENDO_ENTERTAINMENT_SYSTEM, "7" },
{ GAME_BOY, "4" }, { NINTENDO_GAME_BOY, "4" },
{ GAME_BOY_ADVANCE, "5" }, { NINTENDO_GAME_BOY_ADVANCE, "5" },
{ GAME_BOY_COLOR, "41" }, { NINTENDO_GAME_BOY_COLOR, "41" },
{ NINTENDO_GAMECUBE, "2" }, { NINTENDO_GAMECUBE, "2" },
{ NINTENDO_WII, "9" }, { NINTENDO_WII, "9" },
{ NINTENDO_WII_U, "38" }, { NINTENDO_WII_U, "38" },
@ -78,10 +78,10 @@ const std::map<PlatformId, std::string> gamesdb_new_platformid_map {
{ NINTENDO_GAME_AND_WATCH, "-1" }, { NINTENDO_GAME_AND_WATCH, "-1" },
{ NINTENDO_POKEMON_MINI, "4957" }, { NINTENDO_POKEMON_MINI, "4957" },
{ NINTENDO_SATELLAVIEW, "6" }, { NINTENDO_SATELLAVIEW, "6" },
{ SUFAMI_TURBO, "6" }, { BANDAI_SUFAMI_TURBO, "6" },
{ DOS, "1" }, { DOS, "1" },
{ PC, "1" }, { PC, "1" },
{ PCFX, "4930" }, { NEC_PCFX, "4930" },
{ SEGA_32X, "33" }, { SEGA_32X, "33" },
{ SEGA_CD, "21" }, { SEGA_CD, "21" },
{ SEGA_DREAMCAST, "16" }, { SEGA_DREAMCAST, "16" },
@ -91,25 +91,25 @@ const std::map<PlatformId, std::string> gamesdb_new_platformid_map {
{ SEGA_MEGA_DRIVE, "36" }, { SEGA_MEGA_DRIVE, "36" },
{ SEGA_SATURN, "17" }, { SEGA_SATURN, "17" },
{ SEGA_SG1000, "4949" }, { SEGA_SG1000, "4949" },
{ PLAYSTATION, "10" }, { SONY_PLAYSTATION, "10" },
{ PLAYSTATION_2, "11" }, { SONY_PLAYSTATION_2, "11" },
{ PLAYSTATION_3, "12" }, { SONY_PLAYSTATION_3, "12" },
{ PLAYSTATION_4, "4919" }, { SONY_PLAYSTATION_4, "4919" },
{ PLAYSTATION_VITA, "39" }, { SONY_PLAYSTATION_VITA, "39" },
{ PLAYSTATION_PORTABLE, "13" }, { SONY_PLAYSTATION_PORTABLE, "13" },
{ SUPER_NINTENDO, "6" }, { SUPER_NINTENDO, "6" },
{ SHARP_X1, "4977" }, { SHARP_X1, "4977" },
{ SHARP_X68000, "4931"}, { SHARP_X68000, "4931"},
{ SUPERGRAFX, "34" }, // Combined with TurboGrafx-16 { NEC_SUPERGRAFX, "34" },
{ TURBOGRAFX_16, "34" }, // HuCards only. { NEC_PC_ENGINE, "34" },
{ TURBOGRAFX_CD, "4955" }, // CD-ROMs only. { NEC_PC_ENGINE_CD, "4955" },
{ WONDERSWAN, "4925" }, { BANDAI_WONDERSWAN, "4925" },
{ WONDERSWAN_COLOR, "4926" }, { BANDAI_WONDERSWAN_COLOR, "4926" },
{ ZX_SPECTRUM, "4913" }, { SINCLAIR_ZX_SPECTRUM, "4913" },
{ VIDEOPAC_ODYSSEY2, "4927" }, { VIDEOPAC_ODYSSEY2, "4927" },
{ VECTREX, "4939" }, { VECTREX, "4939" },
{ TRS80_COLOR_COMPUTER, "4941" }, { TANDY_COLOR_COMPUTER, "4941" },
{ TANDY, "4941" }, { TANDY_TRS80, "4941" },
}; };
void thegamesdb_generate_json_scraper_requests(const ScraperSearchParams& params, void thegamesdb_generate_json_scraper_requests(const ScraperSearchParams& params,

View file

@ -28,8 +28,8 @@ using namespace PlatformIds;
// https://www.screenscraper.fr/api/systemesListe.php?devid=xxx&devpassword=yyy&softname=zzz&output=XML // https://www.screenscraper.fr/api/systemesListe.php?devid=xxx&devpassword=yyy&softname=zzz&output=XML
const std::map<PlatformId, unsigned short> screenscraper_platformid_map { const std::map<PlatformId, unsigned short> screenscraper_platformid_map {
{ THREEDO, 29 }, { THREEDO, 29 },
{ AMIGA, 64 }, { COMMODORE_AMIGA, 64 },
{ AMIGACD32, 130 }, { COMMODORE_AMIGA_CD32, 130 },
{ AMSTRAD_CPC, 65 }, { AMSTRAD_CPC, 65 },
{ AMSTRAD_GX4000, 87 }, { AMSTRAD_GX4000, 87 },
{ APPLE_II, 86 }, { APPLE_II, 86 },
@ -46,31 +46,31 @@ const std::map<PlatformId, unsigned short> screenscraper_platformid_map {
{ ATARI_XE, 43 }, { ATARI_XE, 43 },
{ ATOMISWAVE, 53 }, { ATOMISWAVE, 53 },
{ BBC_MICRO, 37 }, { BBC_MICRO, 37 },
{ CAVESTORY, 135 }, { CAVESTORY, 135 },
{ COLECOVISION, 48 }, { COLECOVISION, 48 },
{ COMMODORE_64, 66 }, { COMMODORE_64, 66 },
{ COMMODORE_CDTV, 129 }, { COMMODORE_CDTV, 129 },
{ DAPHNE, 49 }, { DAPHNE, 49 },
{ INTELLIVISION, 115 }, { INTELLIVISION, 115 },
{ LUTRO, 206 }, { LUTRO, 206 },
{ MAC_OS, 146 }, { APPLE_MACINTOSH, 146 },
{ XBOX, 32 }, { MICROSOFT_XBOX, 32 },
{ XBOX_360, 33 }, { MICROSOFT_XBOX_360, 33 },
{ MOONLIGHT, 138 }, { MOONLIGHT, 138 },
{ MSX, 113 }, { MSX, 113 },
{ NEOGEO, 142 }, { SNK_NEO_GEO, 142 },
{ NEOGEO_CD, 142 }, { SNK_NEO_GEO_CD, 142 },
{ NEOGEO_POCKET, 25}, { SNK_NEO_GEO_POCKET, 25},
{ NEOGEO_POCKET_COLOR, 82 }, { SNK_NEO_GEO_POCKET_COLOR, 82 },
{ NINTENDO_3DS, 17 }, { NINTENDO_3DS, 17 },
{ NINTENDO_64, 14 }, { NINTENDO_64, 14 },
{ NINTENDO_DS, 15 }, { NINTENDO_DS, 15 },
{ FAMICOM_DISK_SYSTEM, 106 }, { NINTENDO_FAMICOM_DISK_SYSTEM, 106 },
{ NINTENDO_ENTERTAINMENT_SYSTEM, 3 }, { NINTENDO_ENTERTAINMENT_SYSTEM, 3 },
{ FAIRCHILD_CHANNELF, 80 }, { FAIRCHILD_CHANNELF, 80 },
{ GAME_BOY, 9 }, { NINTENDO_GAME_BOY, 9 },
{ GAME_BOY_ADVANCE, 12 }, { NINTENDO_GAME_BOY_ADVANCE, 12 },
{ GAME_BOY_COLOR, 10 }, { NINTENDO_GAME_BOY_COLOR, 10 },
{ NINTENDO_GAMECUBE, 13 }, { NINTENDO_GAMECUBE, 13 },
{ NINTENDO_WII, 16 }, { NINTENDO_WII, 16 },
{ NINTENDO_WII_U, 18 }, { NINTENDO_WII_U, 18 },
@ -78,12 +78,12 @@ const std::map<PlatformId, unsigned short> screenscraper_platformid_map {
{ NINTENDO_GAME_AND_WATCH, 52 }, { NINTENDO_GAME_AND_WATCH, 52 },
{ NINTENDO_POKEMON_MINI, 211 }, { NINTENDO_POKEMON_MINI, 211 },
{ NINTENDO_SATELLAVIEW, 107 }, { NINTENDO_SATELLAVIEW, 107 },
{ SUFAMI_TURBO, 108 }, { BANDAI_SUFAMI_TURBO, 108 },
{ DOS, 135 }, { DOS, 135 },
{ PC, 135 }, { PC, 135 },
{ PCFX, 72 }, { NEC_PCFX, 72 },
{ OPENBOR, 214 }, { OPENBOR, 214 },
{ ORIC, 131 }, { TANGERINE_ORIC, 131 },
{ SCUMMVM, 123}, { SCUMMVM, 123},
{ SEGA_32X, 19 }, { SEGA_32X, 19 },
{ SEGA_CD, 20 }, { SEGA_CD, 20 },
@ -97,25 +97,24 @@ const std::map<PlatformId, unsigned short> screenscraper_platformid_map {
{ SHARP_X1, 220}, { SHARP_X1, 220},
{ SHARP_X68000, 79}, { SHARP_X68000, 79},
{ SOLARUS, 223 }, { SOLARUS, 223 },
{ PLAYSTATION, 57 }, { SONY_PLAYSTATION, 57 },
{ PLAYSTATION_2, 58 }, { SONY_PLAYSTATION_2, 58 },
{ PLAYSTATION_3, 59 }, { SONY_PLAYSTATION_3, 59 },
// Missing Sony Playstation 4 ? { SONY_PLAYSTATION_VITA, 62 },
{ PLAYSTATION_VITA, 62 }, { SONY_PLAYSTATION_PORTABLE, 61 },
{ PLAYSTATION_PORTABLE, 61 },
{ SAMCOUPE, 213 }, { SAMCOUPE, 213 },
{ SUPER_NINTENDO, 4 }, { SUPER_NINTENDO, 4 },
{ SUPERGRAFX, 105 }, { NEC_SUPERGRAFX, 105 },
{ TURBOGRAFX_16, 31 }, { NEC_PC_ENGINE, 31 },
{ TURBOGRAFX_CD, 114 }, { NEC_PC_ENGINE_CD, 114 },
{ WONDERSWAN, 45 }, { BANDAI_WONDERSWAN, 45 },
{ WONDERSWAN_COLOR, 46 }, { BANDAI_WONDERSWAN_COLOR, 46 },
{ ZX_SPECTRUM, 76 }, { SINCLAIR_ZX_SPECTRUM, 76 },
{ ZX81_SINCLAR, 77 }, { SINCLAIR_ZX81_SINCLAR, 77 },
{ VIDEOPAC_ODYSSEY2, 104 }, { VIDEOPAC_ODYSSEY2, 104 },
{ VECTREX, 102 }, { VECTREX, 102 },
{ TRS80_COLOR_COMPUTER, 144 }, { TANDY_TRS80, 144 },
{ TANDY, 144 }, { TANDY_COLOR_COMPUTER, 144 },
{ SEGA_NAOMI, 56 }, { SEGA_NAOMI, 56 },
{ THOMSON_MOTO, 141 }, { THOMSON_MOTO, 141 },
{ UZEBOX, 216 }, { UZEBOX, 216 },