mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	romfs: Add SingleDiscard extraction type
Needed for manual RomFS extraction, as Full generates an extra directory and Truncated generates variable results.
This commit is contained in:
		
							parent
							
								
									94db6e5f3f
								
							
						
					
					
						commit
						abbcc8e61e
					
				| @ -119,6 +119,9 @@ VirtualDir ExtractRomFS(VirtualFile file, RomFSExtractionType type) { | |||||||
| 
 | 
 | ||||||
|     VirtualDir out = std::move(root); |     VirtualDir out = std::move(root); | ||||||
| 
 | 
 | ||||||
|  |     if (type == RomFSExtractionType::SingleDiscard) | ||||||
|  |         return out->GetSubdirectories().front(); | ||||||
|  | 
 | ||||||
|     while (out->GetSubdirectories().size() == 1 && out->GetFiles().empty()) { |     while (out->GetSubdirectories().size() == 1 && out->GetFiles().empty()) { | ||||||
|         if (out->GetSubdirectories().front()->GetName() == "data" && |         if (out->GetSubdirectories().front()->GetName() == "data" && | ||||||
|             type == RomFSExtractionType::Truncated) |             type == RomFSExtractionType::Truncated) | ||||||
|  | |||||||
| @ -35,6 +35,7 @@ static_assert(sizeof(IVFCHeader) == 0xE0, "IVFCHeader has incorrect size."); | |||||||
| enum class RomFSExtractionType { | enum class RomFSExtractionType { | ||||||
|     Full,          // Includes data directory
 |     Full,          // Includes data directory
 | ||||||
|     Truncated,     // Traverses into data directory
 |     Truncated,     // Traverses into data directory
 | ||||||
|  |     SingleDiscard, // Traverses into the first subdirectory of root
 | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // Converts a RomFS binary blob to VFS Filesystem
 | // Converts a RomFS binary blob to VFS Filesystem
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Zach Hilman
						Zach Hilman