XboxISO separate functions for partition extraction (#89)

* XboxISO funcs for partition extraction

* Add new parameter with default
This commit is contained in:
Deterous
2026-04-20 12:59:39 +09:00
committed by GitHub
parent ab4bb4cca3
commit c179cf410b

View File

@@ -9,15 +9,30 @@ namespace SabreTools.Wrappers
{
long initialOffset = _dataSource.Position;
// Extract all files from the video partition
var videoWrapper = new ISO9660(VideoPartition, _dataSource, initialOffset, _dataSource.Length);
bool success = videoWrapper?.Extract(outputDirectory, includeDebug) ?? false;
// Extract all files from the game partition
var gameWrapper = new XDVDFS(GamePartition, _dataSource, initialOffset + Constants.XisoOffsets[XGDType], Constants.XisoLengths[XGDType]);
success |= gameWrapper?.Extract(outputDirectory, includeDebug) ?? false;
bool success = ExtractVideoPartition(outputDirectory, includeDebug, initialOffset);
success |= ExtractGamePartition(outputDirectory, includeDebug);
return success;
}
/// <summary>
/// Extract all files from the Video ISO partition only
/// </summary>
public bool ExtractVideoPartition(string outputDirectory, bool includeDebug, long initialOffset = 0)
{
// Extract all files from the video partition
var videoWrapper = new ISO9660(VideoPartition, _dataSource, initialOffset, _dataSource.Length);
return videoWrapper?.Extract(outputDirectory, includeDebug) ?? false;
}
/// <summary>
/// Extract all files from the XDVDFS (XISO) game partition only
/// </summary>
public bool ExtractGamePartition(string outputDirectory, bool includeDebug, long initialOffset = 0)
{
// Extract all files from the game partition
var gameWrapper = new XDVDFS(GamePartition, _dataSource, initialOffset + Constants.XisoOffsets[XGDType], Constants.XisoLengths[XGDType]);
return gameWrapper?.Extract(outputDirectory, includeDebug) ?? false;
}
}
}