Skip to content

Fix some VFS issues - #19378

Open
digant73 wants to merge 3 commits into
RPCS3:masterfrom
digant73:vfs_fixes
Open

Fix some VFS issues#19378
digant73 wants to merge 3 commits into
RPCS3:masterfrom
digant73:vfs_fixes

Conversation

@digant73

@digant73 digant73 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Fix some issues on VFS and optimize iso access:

  • Fix: raw-device games folder is written to games.yml without its root delimiter. With the VFS games folder set to a BD drive root (I:/), the entry was stored as I: and then alternated with I:/ on every game-list refresh
  • rpcs3/Emu/System.cpp — a game_found() predicate (no_errors || already_added) now guards both the subfolder descent and the recursive scan, so a path that is already a registered game is not re-registered through a different route.
  • For a raw device that is every refresh (both caches are bypassed by design). add_game() now takes an optional shared_ptr<iso_archive> and skips its own is_iso_file() when given one.
  • New ISO_DESCRIPTORS_OFFSET (which also replaces the two 32768 literals) and a seek to it
  • A std::regex built per directory entry (system_utils.hpp:84). ^PS3_GM[[:digit:]]{2}$ appeared in four places, three of them constructing the regex inside the loop body (AddGame, GetBdvdDir, add_disc_dir). All four now call one inline
  • AddGamesFromDir saved games.yml inside its own recursion (System.cpp:4416, :4493, games_config.h:13). The function is recursive but restored set_save_on_dirty(true) unconditionally, so with use_recursive_scan each nested call wrote the whole file on return and left the per-entry write enabled for the rest of the outer scan — a full YAML emit + pending_file rename per added game. Now the previous value is saved/restored (new is_save_on_dirty()) and the flush happens only at the outermost level.

Comment thread rpcs3/Emu/System.cpp
// Don't write "games.yml" on each added game: it is saved once, at the end of the scan.
// NOTE: this function is recursive, so the previous value is restored instead of being forced back to enabled,
// otherwise a nested scan would re-enable the write for the remaining part of the outer one
const bool save_on_dirty = m_games_config.is_save_on_dirty();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if this is false on the first call then nothing is saved ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, yeah. but that should mean someone else should save it. I do not see anything leaving the state to false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants