mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-04-06 05:54:06 +00:00
[Convert] Enhance GameCube/Wii conversion with media tag injection and sector conversion support
This commit is contained in:
@@ -207,6 +207,14 @@ public partial class Convert
|
||||
if(errno != ErrorNumber.NoError) return errno;
|
||||
}
|
||||
|
||||
// Inject GameCube/Wii-specific media tags before copying normal media tags
|
||||
if(isNgcwConversion)
|
||||
{
|
||||
errno = InjectNgcwMediaTags();
|
||||
|
||||
if(errno != ErrorNumber.NoError) return errno;
|
||||
}
|
||||
|
||||
// Convert media tags from input to output format
|
||||
errno = ConvertMediaTags();
|
||||
|
||||
@@ -219,7 +227,8 @@ public partial class Convert
|
||||
_outputImage is IWritableOpticalImage outputOptical &&
|
||||
inputOptical.Tracks != null &&
|
||||
!isPs3Conversion &&
|
||||
!isWiiuConversion)
|
||||
!isWiiuConversion &&
|
||||
!isNgcwConversion)
|
||||
{
|
||||
errno = ConvertOptical(inputOptical, outputOptical, useLong);
|
||||
|
||||
@@ -263,6 +272,25 @@ public partial class Convert
|
||||
|
||||
if(errno != ErrorNumber.NoError) return errno;
|
||||
}
|
||||
else if(isNgcwConversion)
|
||||
{
|
||||
if(_inputImage is IOpticalMediaImage ngcwInputOptical &&
|
||||
_outputImage is IWritableOpticalImage ngcwOutputOptical &&
|
||||
ngcwInputOptical.Tracks != null)
|
||||
{
|
||||
if(!ngcwOutputOptical.SetTracks(ngcwInputOptical.Tracks))
|
||||
{
|
||||
StoppingErrorMessage?.Invoke(string.Format(UI.Error_0_sending_tracks_list_to_output_image,
|
||||
ngcwOutputOptical.ErrorMessage));
|
||||
|
||||
return ErrorNumber.WriteError;
|
||||
}
|
||||
}
|
||||
|
||||
errno = ConvertNgcwSectors();
|
||||
|
||||
if(errno != ErrorNumber.NoError) return errno;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(inputTape == null || outputTape == null || !inputTape.IsTape)
|
||||
@@ -339,14 +367,14 @@ public partial class Convert
|
||||
}
|
||||
}
|
||||
|
||||
if(!isPs3Conversion && !isWiiuConversion && _negativeSectors > 0)
|
||||
if(!isPs3Conversion && !isWiiuConversion && !isNgcwConversion && _negativeSectors > 0)
|
||||
{
|
||||
errno = ConvertNegativeSectors(useLong);
|
||||
|
||||
if(errno != ErrorNumber.NoError) return errno;
|
||||
}
|
||||
|
||||
if(!isPs3Conversion && !isWiiuConversion && _overflowSectors > 0)
|
||||
if(!isPs3Conversion && !isWiiuConversion && !isNgcwConversion && _overflowSectors > 0)
|
||||
{
|
||||
errno = ConvertOverflowSectors(useLong);
|
||||
|
||||
@@ -397,6 +425,9 @@ public partial class Convert
|
||||
// After all metadata has been copied, enrich product code and disc number from Wii U disc header
|
||||
if(isWiiuConversion) EnrichWiiuMetadata();
|
||||
|
||||
// After all metadata has been copied, enrich title/part number from GameCube/Wii disc header
|
||||
if(isNgcwConversion) EnrichNgcwMetadata();
|
||||
|
||||
var closed = false;
|
||||
|
||||
InitProgress?.Invoke();
|
||||
|
||||
Reference in New Issue
Block a user