diff --git a/src/duckstation-libretro/libretro_host_interface.cpp b/src/duckstation-libretro/libretro_host_interface.cpp index e2bb445e6..3563ca45e 100644 --- a/src/duckstation-libretro/libretro_host_interface.cpp +++ b/src/duckstation-libretro/libretro_host_interface.cpp @@ -37,15 +37,6 @@ retro_input_state_t g_retro_input_state_callback; static retro_log_callback s_libretro_log_callback = {}; static bool s_libretro_log_callback_valid = false; -static const char* GetSaveDirectory() -{ - const char* save_directory = nullptr; - if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &save_directory) || !save_directory) - save_directory = "saves"; - - return save_directory; -} - static void LibretroLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, const char* message) { @@ -109,6 +100,15 @@ void LibretroHostInterface::GetGameInfo(const char* path, CDImage* image, std::s code->clear(); } +static const char* GetSaveDirectory() +{ + const char* save_directory = nullptr; + if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &save_directory) || !save_directory) + save_directory = "saves"; + + return save_directory; +} + std::string LibretroHostInterface::GetSharedMemoryCardPath(u32 slot) const { return StringUtil::StdStringFromFormat("%s%cshared_card_%d.mcd", GetSaveDirectory(), FS_OSPATH_SEPERATOR_CHARACTER, @@ -121,6 +121,13 @@ std::string LibretroHostInterface::GetGameMemoryCardPath(const char* game_code, slot + 1); } +std::string LibretroHostInterface::GetShaderCacheBasePath() const +{ + // TODO: Is there somewhere we can save our shaders? + Log_WarningPrint("No shader cache directory available, startup will be slower."); + return std::string(); +} + std::string LibretroHostInterface::GetSettingValue(const char* section, const char* key, const char* default_value /*= ""*/) { diff --git a/src/duckstation-libretro/libretro_host_interface.h b/src/duckstation-libretro/libretro_host_interface.h index 7dda43e60..550027031 100644 --- a/src/duckstation-libretro/libretro_host_interface.h +++ b/src/duckstation-libretro/libretro_host_interface.h @@ -26,6 +26,7 @@ public: void GetGameInfo(const char* path, CDImage* image, std::string* code, std::string* title) override; std::string GetSharedMemoryCardPath(u32 slot) const override; std::string GetGameMemoryCardPath(const char* game_code, u32 slot) const override; + std::string GetShaderCacheBasePath() const override; std::string GetSettingValue(const char* section, const char* key, const char* default_value = "") override; // Called by frontend