From 46790fc1cbbcfc5315b791e55aefee61ce55c94b Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 13 May 2022 19:18:38 +0200 Subject: [PATCH] Added a new %GAMEDIR% variable to be used in conjunction with the %STARTDIR% variable. --- es-app/src/FileData.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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);