cheats: fall back to content path for game-specific files - #19089
cheats: fall back to content path for game-specific files#19089Splaser wants to merge 12 commits into
Conversation
|
Wouldn't we want to save the new cheat into the cheats folder rather than the content directory? I may have misinterpretted it. |
It still saves into the configured cheats directory. The content path is only used as a fallback source for the game-specific filename when runloop_st->name.cheatfile is empty. It is passed through path_basename_nocompression(), while the destination directory is still built from path_cheat_database and core_name. So the resulting path remains: <cheats directory>/<core name>/<game-specific filename>.cht |
|
Reopening after rechecking this against current master. To clarify the scope: RetroArch already has game-specific cheat autosave/autoload infrastructure. This PR fixes a gap where runtime-created cheats may not persist when no The fallback only derives the game-specific filename from the runtime content basename/path. The destination remains: This was validated on Android aarch64 by launching content without loading an existing cheat file, adding a cheat from the Quick Menu, closing the content, and relaunching it. With this patch, the cheat file is created and is automatically loaded on the next launch. This does not change the |
Runtime-created cheats may fail to persist when no cheat file has been loaded beforehand.
Game-specific cheat filenames were derived from runloop_st->name.cheatfile only. When a cheat is created from the menu without first loading an existing .cht file, this value can be empty, causing cheat_manager_get_game_specific_filename() to return 0 and preventing the cheat list from being saved.
Fall back to the current content basename/path when no cheatfile name is available, while preserving the existing cheatfile-based behavior when it is set.
Tested on Android aarch64: