From 541750243dac8cc6dd3b2f3ace24b994c03688a9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 27 Oct 2023 22:49:11 +0200 Subject: [PATCH] Added support for a %GAMEDIRRAW% launch command variable --- es-app/src/FileData.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index ab6f31e8c..69eb22899 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -1592,6 +1592,10 @@ void FileData::launchGame() command = Utils::String::replace(command, "%GAMEDIR%", Utils::FileSystem::getEscapedPath(Utils::FileSystem::getParent( Utils::String::replace(romPath, "\"", "")))); + command = Utils::String::replace( + command, "%GAMEDIRRAW%", + Utils::String::replace( + Utils::FileSystem::getParent(Utils::String::replace(romPath, "\"", "")), "/", "\\")); #else command = Utils::String::replace(command, "%ESPATH%", Utils::FileSystem::getExePath()); command = Utils::String::replace(command, "%EMUDIR%", @@ -1600,6 +1604,9 @@ void FileData::launchGame() command = Utils::String::replace(command, "%GAMEDIR%", Utils::FileSystem::getEscapedPath(Utils::FileSystem::getParent( Utils::String::replace(romPath, "\\", "")))); + command = Utils::String::replace( + command, "%GAMEDIRRAW%", + Utils::FileSystem::getParent(Utils::String::replace(romPath, "\\", ""))); #endif // Trim any leading and trailing whitespace characters as they could cause launch issues.