support custom bb private keys

This commit is contained in:
Martin Michelsen
2020-04-17 12:20:13 -07:00
parent c54b7cc925
commit 753d732cd4
15 changed files with 220 additions and 223 deletions
+23
View File
@@ -1,5 +1,11 @@
#include "Version.hh"
#include <stdexcept>
#include <strings.h>
using namespace std;
uint16_t flags_for_version(GameVersion version, uint8_t sub_version) {
@@ -55,3 +61,20 @@ const char* name_for_version(GameVersion version) {
return "Unknown";
}
}
GameVersion version_for_name(const char* name) {
if (!strcasecmp(name, "DC") || !strcasecmp(name, "DreamCast")) {
return GameVersion::DC;
}
if (!strcasecmp(name, "PC")) {
return GameVersion::PC;
}
if (!strcasecmp(name, "GC") || !strcasecmp(name, "GameCube")) {
return GameVersion::GC;
}
if (!strcasecmp(name, "BB") || !strcasecmp(name, "BlueBurst") ||
!strcasecmp(name, "Blue Burst")) {
return GameVersion::BB;
}
throw invalid_argument("incorrect version name");
}