diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 1572ebd29..dca55cd53 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -1264,6 +1264,9 @@ void FileData::launchGame() startDirectory = Utils::String::replace( startDirectory, "%GAMEDIR%", Utils::FileSystem::getParent(Utils::String::replace(romPath, "\"", ""))); + + startDirectory = Utils::String::replace(startDirectory, "%GAMEENTRYDIR%", + Utils::String::replace(romPath, "\"", "")); #else startDirectory = Utils::String::replace( startDirectory, "%EMUDIR%", @@ -1272,14 +1275,17 @@ void FileData::launchGame() startDirectory = Utils::String::replace( startDirectory, "%GAMEDIR%", Utils::FileSystem::getParent(Utils::String::replace(romPath, "\\", ""))); + + startDirectory = Utils::String::replace(startDirectory, "%GAMEENTRYDIR%", + Utils::String::replace(romPath, "\\", "")); #endif if (!Utils::FileSystem::isDirectory(startDirectory)) { Utils::FileSystem::createDirectory(startDirectory); if (!Utils::FileSystem::isDirectory(startDirectory)) { - LOG(LogError) - << "Couldn't launch game, directory defined by %STARTDIR% could not be " - "created, permission problems?"; + LOG(LogError) << "Couldn't launch game, directory \"" << startDirectory + << "\" defined by %STARTDIR% could not be created, " + "permission problems?"; LOG(LogError) << "Raw emulator launch command:"; LOG(LogError) << commandRaw;