Last 1.11 bits
This commit is contained in:
parent
80c948463f
commit
78c2a0895f
4 changed files with 28 additions and 6 deletions
|
@ -10,6 +10,8 @@ std::string CoreNameMapper::getNameForCore(const std::string &core) {
|
|||
base = basename(core.c_str());
|
||||
|
||||
switch( hash(base.c_str()) ) {
|
||||
case hash("cap32_libretro.so"):
|
||||
return "cap32";
|
||||
case hash("fba-external_libretro.so"):
|
||||
case hash("fbalpha2012_libretro.so"):
|
||||
return "FB Alpha 2012";
|
||||
|
|
|
@ -28,7 +28,10 @@ std::string Environment::getWorkingDirectory() {
|
|||
return getExecutablePath();
|
||||
}
|
||||
|
||||
bool Environment::isDX12() {
|
||||
|
||||
|
||||
bool Environment::isLateDX12() {
|
||||
// TODO: migrate to getVersionHash()?
|
||||
// poor man's check to determine DX version. take an md5 of the version png :-)
|
||||
std::string verFile = "/usr/retroarch/ver.png";
|
||||
if (dajoho::file_exists(verFile)) {
|
||||
|
@ -40,3 +43,18 @@ bool Environment::isDX12() {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Environment::isEarlyDX12() {
|
||||
return (getVersionHash() == "a3aa39288b959e3b9590b2ed77ebc13d");
|
||||
}
|
||||
|
||||
std::string Environment::getVersionHash() {
|
||||
// poor man's check to determine DX version. take an md5 of the version png :-)
|
||||
std::string verFile = "/timestamp";
|
||||
if (dajoho::file_exists(verFile)) {
|
||||
std::string content = dajoho::file_get_contents(verFile);
|
||||
std::string hash = GetMD5String(content);
|
||||
return hash;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -9,10 +9,12 @@ class Environment {
|
|||
public:
|
||||
std::string getExecutablePath();
|
||||
std::string getExternalCorePath();
|
||||
bool isDX12();
|
||||
|
||||
|
||||
bool isLateDX12();
|
||||
bool isEarlyDX12();
|
||||
std::string getWorkingDirectory();
|
||||
|
||||
protected:
|
||||
std::string getVersionHash();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ void GameListManager::parseGameList() {
|
|||
fread(&numberOfGames, 1, 4, rp);
|
||||
logger.log("Total: " + std::to_string(numberOfGames));
|
||||
for (int i=0; i < numberOfGames; i++) {
|
||||
if (1==1 || !environment.isDX12() && dajoho::file_exists("/usr/bin/fba")) {
|
||||
if (!environment.isEarlyDX12() && !environment.isLateDX12() && dajoho::file_exists("/usr/bin/fba")) {
|
||||
fread(&game2, sizeof(game2), 1, rp);
|
||||
logger.log(std::to_string(game2.coreType) + "|" + game2.rom + "|" + game2.label);
|
||||
} else {
|
||||
|
@ -53,7 +53,7 @@ std::string GameListManager::addGameToList(const std::string &romName, const std
|
|||
romTitlePre = romName.substr(0, romName.length() - 4);
|
||||
}
|
||||
std::string romTitle = romTitlePre + " ("+suffix+")";
|
||||
if (1==1 || !environment.isDX12() && dajoho::file_exists("/usr/bin/fba")) {
|
||||
if (!environment.isEarlyDX12() && !environment.isLateDX12() && dajoho::file_exists("/usr/bin/fba")) {
|
||||
Game2 game{};
|
||||
game.coreType = 512;
|
||||
strcpy(game.rom, dbRomPath.c_str());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue