diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 14722e985..495d7b7cb 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -1239,10 +1239,18 @@ void FileData::launchGame() startDirectory = Utils::String::replace( startDirectory, "%EMUDIR%", Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\"", ""))); + + startDirectory = Utils::String::replace( + startDirectory, "%GAMEDIR%", + Utils::FileSystem::getParent(Utils::String::replace(romPath, "\"", ""))); #else startDirectory = Utils::String::replace( startDirectory, "%EMUDIR%", Utils::FileSystem::getParent(Utils::String::replace(binaryPath, "\\", ""))); + + startDirectory = Utils::String::replace( + startDirectory, "%GAMEDIR%", + Utils::FileSystem::getParent(Utils::String::replace(romPath, "\\", ""))); #endif if (!Utils::FileSystem::isDirectory(startDirectory)) { Utils::FileSystem::createDirectory(startDirectory);