2020-09-21 17:17:34 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-06-21 12:25:28 +00:00
|
|
|
//
|
2020-09-21 17:17:34 +00:00
|
|
|
// EmulationStation Desktop Edition
|
2020-06-25 17:52:38 +00:00
|
|
|
// PlatformId.cpp
|
2020-06-21 12:25:28 +00:00
|
|
|
//
|
2020-06-23 18:07:00 +00:00
|
|
|
// Index of all supported systems/platforms.
|
2020-06-21 12:25:28 +00:00
|
|
|
//
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
#include "PlatformId.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
#include <string.h>
|
2020-12-16 22:59:00 +00:00
|
|
|
#include <vector>
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
namespace PlatformIds
|
|
|
|
{
|
2021-07-07 18:03:42 +00:00
|
|
|
// clang-format off
|
2022-01-16 17:18:28 +00:00
|
|
|
std::vector<std::string> platformNames {
|
2020-06-21 12:25:28 +00:00
|
|
|
"unknown", // Nothing set.
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2023-01-30 22:16:19 +00:00
|
|
|
"3do", // 3DO Interactive Multiplayer
|
2023-02-03 19:16:29 +00:00
|
|
|
"ags", // Adventure Game Studio Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"amiga", // Commodore Amiga
|
|
|
|
"amigacd32", // Commodore Amiga CD32
|
|
|
|
"amstradcpc", // Amstrad CPC
|
2021-11-03 20:19:38 +00:00
|
|
|
"android", // Google Android
|
2021-02-06 13:20:45 +00:00
|
|
|
"apple2", // Apple II
|
|
|
|
"apple2gs", // Apple IIGS
|
|
|
|
"arcade", // Arcade
|
2022-05-19 15:32:12 +00:00
|
|
|
"arcadia", // Emerson Arcadia 2001
|
2023-01-31 18:36:57 +00:00
|
|
|
"arduboy", // Arduboy Miniature Game System
|
2022-05-12 20:45:52 +00:00
|
|
|
"astrocde", // Bally Astrocade
|
2021-02-06 13:20:45 +00:00
|
|
|
"atari2600", // Atari 2600
|
|
|
|
"atari5200", // Atari 5200
|
|
|
|
"atari7800", // Atari 7800
|
|
|
|
"atari800", // Atari 800
|
|
|
|
"atarijaguar", // Atari Jaguar
|
|
|
|
"atarijaguarcd", // Atari Jaguar CD
|
|
|
|
"atarilynx", // Atari Lynx
|
|
|
|
"atarist", // Atari ST/STE/Falcon
|
|
|
|
"atarixe", // Atari XE
|
2023-01-30 22:16:19 +00:00
|
|
|
"atomiswave", // Sammy Corporation Atomiswave
|
|
|
|
"bbcmicro", // Acorn Computers BBC Micro
|
2021-02-06 13:20:45 +00:00
|
|
|
"c64", // Commodore 64
|
|
|
|
"cavestory", // Cave Story (NXEngine)
|
2021-11-03 17:51:38 +00:00
|
|
|
"cdimono1", // Philips CD-i
|
2021-02-06 13:20:45 +00:00
|
|
|
"cdtv", // Commodore CDTV
|
|
|
|
"channelf", // Fairchild Channel F
|
|
|
|
"coco", // Tandy Color Computer
|
2023-01-30 22:16:19 +00:00
|
|
|
"colecovision", // Coleco ColecoVision
|
2022-05-19 15:32:12 +00:00
|
|
|
"crvision", // VTech CreatiVision
|
2021-02-06 13:20:45 +00:00
|
|
|
"daphne", // Daphne Arcade Laserdisc Emulator
|
|
|
|
"dos", // DOS (PC)
|
2023-01-30 22:16:19 +00:00
|
|
|
"dragon32", // Dragon Data Dragon 32
|
2021-02-06 13:20:45 +00:00
|
|
|
"dreamcast", // Sega Dreamcast
|
2022-07-07 16:20:58 +00:00
|
|
|
"easyrpg", // EasyRPG eame engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"famicom", // Nintendo Family Computer
|
|
|
|
"fds", // Nintendo Famicom Disk System
|
2022-07-09 18:07:16 +00:00
|
|
|
"flash", // Adobe Flash
|
2022-07-06 18:10:28 +00:00
|
|
|
"fmtowns", // Fujitsu FM Towns
|
2021-02-06 13:20:45 +00:00
|
|
|
"gameandwatch", // Nintendo Game and Watch
|
2023-03-01 21:09:27 +00:00
|
|
|
"gamecom", // Tiger Electronics Game.com
|
2021-02-06 13:20:45 +00:00
|
|
|
"gamegear", // Sega Game Gear
|
|
|
|
"gb", // Nintendo Game Boy
|
|
|
|
"gba", // Nintendo Game Boy Advance
|
|
|
|
"gbc", // Nintendo Game Boy Color
|
2021-02-07 14:28:23 +00:00
|
|
|
"gc", // Nintendo GameCube
|
2021-02-06 13:20:45 +00:00
|
|
|
"genesis", // Sega Genesis
|
|
|
|
"gx4000", // Amstrad GX4000
|
|
|
|
"intellivision", // Mattel Electronics Intellivision
|
2023-02-03 19:16:29 +00:00
|
|
|
"lcdgames", // LCD Handheld Games
|
|
|
|
"love", // ChaiLove Game Engine
|
|
|
|
"lutro", // Lutro Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"macintosh", // Apple Macintosh
|
|
|
|
"mastersystem", // Sega Master System
|
|
|
|
"megadrive", // Sega Mega Drive
|
2022-07-04 17:50:19 +00:00
|
|
|
"megaduck", // Creatronic Mega Duck
|
2021-02-06 13:20:45 +00:00
|
|
|
"mess", // Multi Emulator Super System
|
|
|
|
"moonlight", // Moonlight game streaming
|
|
|
|
"moto", // Thomson MO/TO series
|
|
|
|
"msx", // MSX
|
2021-02-07 21:35:34 +00:00
|
|
|
"msx2", // MSX2
|
|
|
|
"msxturbor", // MSX Turbo R
|
2023-02-03 19:16:29 +00:00
|
|
|
"mugen", // M.U.G.E.N Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"n3ds", // Nintendo 3DS
|
|
|
|
"n64", // Nintendo 64
|
|
|
|
"naomi", // Sega NAOMI
|
|
|
|
"nds", // Nintendo DS
|
|
|
|
"neogeo", // SNK Neo Geo
|
|
|
|
"neogeocd", // SNK Neo Geo CD
|
|
|
|
"nes", // Nintendo Entertainment System
|
|
|
|
"ngp", // SNK Neo Geo Pocket
|
|
|
|
"ngpc", // SNK Neo Geo Pocket Color
|
|
|
|
"odyssey2", // Magnavox Odyssey2
|
2023-01-30 22:16:19 +00:00
|
|
|
"openbor", // OpenBOR Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"oric", // Tangerine Computer Systems Oric
|
|
|
|
"palm", // Palm OS
|
|
|
|
"pc", // IBM PC
|
2023-01-30 22:16:19 +00:00
|
|
|
"pc88", // NEC PC-8800 Series
|
|
|
|
"pc98", // NEC PC-9800 Series
|
2021-07-17 08:37:36 +00:00
|
|
|
"pcengine", // NEC PC Engine / TurboGrafx-16
|
|
|
|
"pcenginecd", // NEC PC Engine CD / TurboGrafx-CD
|
2021-02-06 13:20:45 +00:00
|
|
|
"pcfx", // NEC PC-FX
|
2022-05-14 10:02:24 +00:00
|
|
|
"pcwindows", // PC (Windows)
|
2022-06-11 17:48:40 +00:00
|
|
|
"pico8", // PICO-8 Fantasy Console (game engine)
|
2021-02-06 13:20:45 +00:00
|
|
|
"pokemini", // Nintendo Pokémon Mini
|
|
|
|
"ps2", // Sony PlayStation 2
|
|
|
|
"ps3", // Sony PlayStation 3
|
|
|
|
"ps4", // Sony PlayStation 4
|
|
|
|
"psp", // Sony PlayStation Portable
|
|
|
|
"psvita", // Sony PlayStation Vita
|
|
|
|
"psx", // Sony PlayStation 1
|
2023-02-28 17:20:14 +00:00
|
|
|
"pv1000", // Casio PV-1000
|
2023-02-03 19:16:29 +00:00
|
|
|
"residualvm", // ResidualVM Game Engine
|
2023-01-30 22:16:19 +00:00
|
|
|
"samcoupe", // MGT SAM Coupé
|
2021-02-06 13:20:45 +00:00
|
|
|
"satellaview", // Nintendo Satellaview
|
|
|
|
"saturn", // Sega Saturn
|
2023-02-03 19:16:29 +00:00
|
|
|
"scummvm", // ScummVM Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"sega32x", // Sega Mega Drive 32X
|
|
|
|
"segacd", // Sega CD
|
|
|
|
"sg-1000", // Sega SG-1000
|
|
|
|
"snes", // Nintendo SNES (Super Nintendo)
|
2023-02-03 19:16:29 +00:00
|
|
|
"solarus", // Solarus Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"spectravideo", // Spectravideo
|
2021-03-24 18:44:36 +00:00
|
|
|
"steam", // Valve Steam
|
2023-02-03 19:16:29 +00:00
|
|
|
"stratagus", // Stratagus Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"sufami", // Bandai SuFami Turbo
|
|
|
|
"supergrafx", // NEC SuperGrafx
|
2022-07-04 17:50:19 +00:00
|
|
|
"supervision", // Watara Supervision
|
2021-06-23 15:52:33 +00:00
|
|
|
"switch", // Nintendo Switch
|
2021-02-06 13:20:45 +00:00
|
|
|
"ti99", // Texas Instruments TI-99
|
2023-02-03 19:16:29 +00:00
|
|
|
"tic80", // TIC-80 Game Engine
|
2021-02-06 13:20:45 +00:00
|
|
|
"trs-80", // Tandy TRS-80
|
2023-01-30 22:16:19 +00:00
|
|
|
"uzebox", // Uzebox Open Source Console
|
|
|
|
"vectrex", // Smith Engineering Vectrex
|
2021-11-03 17:11:41 +00:00
|
|
|
"vic20", // Commodore VIC-20
|
2021-02-06 13:20:45 +00:00
|
|
|
"videopac", // Philips Videopac G7000 (Magnavox Odyssey2)
|
|
|
|
"virtualboy", // Nintendo Virtual Boy
|
2023-02-01 21:30:43 +00:00
|
|
|
"vsmile", // VTech V.Smile
|
2023-02-25 20:38:25 +00:00
|
|
|
"wasm4", // WASM-4 Fantasy Console
|
2021-02-06 13:20:45 +00:00
|
|
|
"wii", // Nintendo Wii
|
|
|
|
"wiiu", // Nintendo Wii U
|
|
|
|
"wonderswan", // Bandai WonderSwan
|
|
|
|
"wonderswancolor", // Bandai WonderSwan Color
|
|
|
|
"x1", // Sharp X1
|
|
|
|
"x68000", // Sharp X68000
|
|
|
|
"xbox", // Microsoft Xbox
|
|
|
|
"xbox360", // Microsoft Xbox 360
|
|
|
|
"zmachine", // Infocom Z-machine
|
|
|
|
"zx81", // Sinclair ZX81
|
2023-04-07 18:53:58 +00:00
|
|
|
"zxnext", // Sinclair ZX Spectrum Next
|
2021-02-06 13:20:45 +00:00
|
|
|
"zxspectrum", // Sinclair ZX Spectrum
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
"ignore", // Do not allow scraping for this system.
|
|
|
|
"invalid"
|
|
|
|
};
|
2021-07-07 18:03:42 +00:00
|
|
|
// clang-format on
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-12-16 22:59:00 +00:00
|
|
|
PlatformId getPlatformId(const std::string& str)
|
2020-06-21 12:25:28 +00:00
|
|
|
{
|
2020-12-16 22:59:00 +00:00
|
|
|
if (str == "")
|
2020-06-21 12:25:28 +00:00
|
|
|
return PLATFORM_UNKNOWN;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2021-11-17 16:35:34 +00:00
|
|
|
for (unsigned int i = 1; i < PLATFORM_COUNT; ++i) {
|
2021-02-07 14:28:23 +00:00
|
|
|
if (platformNames[i] == str)
|
2020-06-21 12:25:28 +00:00
|
|
|
return (PlatformId)i;
|
|
|
|
}
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
return PLATFORM_UNKNOWN;
|
|
|
|
}
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-12-16 22:59:00 +00:00
|
|
|
const std::string getPlatformName(PlatformId id)
|
2020-06-21 12:25:28 +00:00
|
|
|
{
|
2022-01-03 17:37:43 +00:00
|
|
|
if (id > platformNames.size() - 1)
|
|
|
|
return "unknown";
|
|
|
|
|
2021-07-07 18:03:42 +00:00
|
|
|
// Return the platform name.
|
2021-02-07 14:28:23 +00:00
|
|
|
return platformNames[id];
|
2020-06-21 12:25:28 +00:00
|
|
|
}
|
2021-07-07 18:03:42 +00:00
|
|
|
|
|
|
|
} // namespace PlatformIds
|