FSC: Sort merged directory listings by name (fixes ZombiU black screen with update v32) - #2048
Open
LuismaSP89 wants to merge 1 commit into
Open
FSC: Sort merged directory listings by name (fixes ZombiU black screen with update v32)#2048LuismaSP89 wants to merge 1 commit into
LuismaSP89 wants to merge 1 commit into
Conversation
When a directory exists in more than one mounted layer (base title plus update, for example), the virtual directory iterator concatenated the listings layer by layer, so all of the update's files were returned before any of the base title's files. On hardware FSReadDir returns entries in FST order, which is sorted by name. ZombiU indexes its .bfz archives in the order returned by FSReadDir. With the v32 update installed, its Patch.lin.bfz was enumerated before Gen_Common and the other base archives, the boot sequence resolved the intro video to the wrong archive and the game never got past the black screen after the Ubisoft logo (see the ZombiU wiki page and cemu-project#1823). Moving Patch.lin.bfz into the base content folder, where it gets listed alphabetically, makes the game boot, so the order alone is what breaks it. Sort the merged listing case-insensitively by name whenever more than one folder contributes to it. Single-layer listings are left untouched.
LuismaSP89
marked this pull request as draft
September 2, 2026 21:25
LuismaSP89
marked this pull request as ready for review
September 2, 2026 22:09
Author
|
PS: Same as the previous PR, I did this using AI help. And again... In case the devs doesn't want to merge this commit because they don't like AI things, I totally understand. But this fixes a long-standing issue with just 16 lines of code (Not including the comments). So, in case any other person wants to develop a better fix, at least he/she can take this as an example or reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the long-standing "ZombiU doesn't boot with update v32 installed" problem documented on the wiki (and reported in #1823): the game stays on a black screen after the Ubisoft logo, at 30 FPS, forever.
What the game does
At boot ZombiU enumerates
/vol/content/lynfsatest/BinCafewithFSReadDirand registers its.lin.bfzarchives in the order they are returned. Its boot sequence then loads the intro video by resource id. That resource exists in two archives (Video_Common_1and a duplicate inGen_Common), and which copy gets used depends on the archive order.What goes wrong in Cemu
FSCVirtualFileDirectoryIterator::PopulateIterationListbuilds the listing of a directory that exists in several mounted layers by iterating the layers in priority order and appending each layer's entries. With an update installed, every file from the update is therefore listed before any file from the base title. The v32 update addsBinCafe/Patch.lin.bfz, which becomes the first archive the game registers and shifts all the others. The boot sequence resolves the intro video to the wrong archive (and starts streaming it from the wrong block), waits out its timeouts and the game never leaves the boot screen. On hardware the directory is returned in FST order, i.e. sorted by name, soPatch.lin.bfzlands betweenMip0_Common_1andSndStream_Common_0and everything works.Two experiments showed it is purely the order: removing
Patch.lin.bfzfrom the update makes v32 boot, and so does moving the very same file into the base title'sBinCafefolder, where the host filesystem lists it alphabetically.The fix
Sort the merged listing by name (case-insensitively, like the FSA name comparison) whenever more than one folder contributes to a directory. Listings that come from a single layer are not touched, so games without an update or DLC see exactly what they saw before.
Testing
Confirmed with a build of this branch: ZombiU (EUR) with update v32 installed in its normal location now plays the intro video and reaches the main menu, and the game runs normally from there. Base v0 behaves as before.