diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7981c873b..6c0171d9b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -241,6 +241,7 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/MathExp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/platform.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Renderer_draw_gl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Renderer_init.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ScraperCmdLine.cpp
diff --git a/README.md b/README.md
index 2fd0e5150..57695ee04 100644
--- a/README.md
+++ b/README.md
@@ -154,8 +154,8 @@ All systems must be contained within the tag.-->
snesemulator %ROM%
-
- 42
+
+ snes
```
diff --git a/src/PlatformId.cpp b/src/PlatformId.cpp
new file mode 100644
index 000000000..0ab9d180c
--- /dev/null
+++ b/src/PlatformId.cpp
@@ -0,0 +1,76 @@
+#include "PlatformId.h"
+
+namespace PlatformIds
+{
+ const char* PlatformNames[PLATFORM_COUNT + 1] = {
+ "unknown", // = 0,
+
+ "3do", // = 1,
+ "amiga", // = 2,
+ "arcade", // = 3,
+ "atari2600", // = 4,
+ "atari5200", // = 5,
+ "atari7800", // = 6,
+ "atariJaguar", // = 7,
+ "atariJaguarCD", // = 8,
+ "atariXE", // = 9,
+ "colecovision", // = 10,
+ "commodore64", // = 11,
+ "intellivision", // = 12,
+ "mac", // = 13,
+ "xbox", // = 14,
+ "xbox360", // = 15,
+ "neogeo", // = 16,
+ "ngp", // = 17,
+ "ngpc", // = 18,
+ "n3ds", // = 19,
+ "n64", // = 20,
+ "nds", // = 21,
+ "nes", // = 22,
+ "gb", // = 23,
+ "gba", // = 24,
+ "gbc", // = 25,
+ "gamecube", // = 26,
+ "wii", // = 27,
+ "wiiu", // = 28,
+ "pc", // = 29,
+ "sega32x", // = 30,
+ "segacd", // = 31,
+ "dreamcast", // = 32,
+ "gamegear", // = 33,
+ "genesis", // = 34,
+ "mastersystem", // = 35,
+ "megadrive", // = 36,
+ "saturn", // = 37,
+ "psx", // = 38,
+ "ps2", // = 39,
+ "ps3", // = 40,
+ "ps4", // = 41,
+ "psvita", // = 42,
+ "psp", // = 43,
+ "snes", // = 44,
+ "pcengine", // = 45,
+ "zxspectrum", // = 46,
+
+ "invalid" // = 47
+ };
+
+ 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];
+ }
+}
diff --git a/src/PlatformId.h b/src/PlatformId.h
index ca22fe511..45659def1 100644
--- a/src/PlatformId.h
+++ b/src/PlatformId.h
@@ -1,5 +1,7 @@
#pragma once
+#include