ES-DE/es-app/src/PlatformId.cpp

103 lines
1.8 KiB
C++
Raw Normal View History

#include "PlatformId.h"
2017-11-01 22:21:10 +00:00
#include <string.h>
namespace PlatformIds
{
const char* PlatformNames[PLATFORM_COUNT + 1] = {
"unknown", // nothing set
"3do",
"amiga",
"amstradcpc",
"apple2",
"arcade",
"atari800",
"atari2600",
"atari5200",
"atari7800",
"atarilynx",
"atarist",
"atarijaguar",
"atarijaguarcd",
"atarixe",
"colecovision",
"c64", // commodore 64
"intellivision",
"macintosh",
"xbox",
"xbox360",
2014-11-29 18:51:17 +00:00
"msx",
"neogeo",
"ngp", // neo geo pocket
"ngpc", // neo geo pocket color
"n3ds", // nintendo 3DS
"n64", // nintendo 64
"nds", // nintendo DS
2017-05-22 18:28:04 +00:00
"fds", // Famicom Disk System
"nes", // nintendo entertainment system
"channelf", // Fairchild ChannelF
"gb", // game boy
"gba", // game boy advance
"gbc", // game boy color
"gc", // gamecube
"wii",
"wiiu",
2017-05-23 20:22:34 +00:00
"virtualboy",
"gameandwatch",
"openbor",
"pc",
"sega32x",
"segacd",
"dreamcast",
"gamegear",
"genesis", // sega genesis
"mastersystem", // sega master system
"megadrive", // sega megadrive
"saturn", // sega saturn
2017-05-23 20:22:34 +00:00
"sg-1000",
"psx",
"ps2",
"ps3",
"ps4",
"psvita",
"psp", // playstation portable
"snes", // super nintendo entertainment system
"scummvm",
"x6800",
"solarus",
"pcengine", // (aka turbografx-16) HuCards only
"pcenginecd", // (aka turbografx-16) CD-ROMs only
"wonderswan",
"wonderswancolor",
"zxspectrum",
"zx81",
2017-05-23 20:22:34 +00:00
"videopac",
"vectrex",
"trs-80",
"coco",
"ignore", // do not allow scraping for this system
"invalid"
};
PlatformId getPlatformId(const char* str)
{
if(str == NULL)
return PLATFORM_UNKNOWN;
for(unsigned int i = 1; i < PLATFORM_COUNT; i++)
{
if(strcmp(PlatformNames[i], str) == 0)
return (PlatformId)i;
}
return PLATFORM_UNKNOWN;
}
const char* getPlatformName(PlatformId id)
{
return PlatformNames[id];
}
}