@@ -209,6 +209,9 @@ public override void GenerateSubmissionInfo(SubmissionInfo info, MediaType? medi
209209 long scsiErrors = GetSCSIErrorCount ( $ "{ basePath } .log") ;
210210 info . CommonDiscInfo . ErrorsCount = scsiErrors == - 1 ? "Error retrieving error count" : scsiErrors . ToString ( ) ;
211211
212+ // Get BCA information, if available
213+ info . Extras . BCA = GetBCA ( $ "{ basePath } .bca") ;
214+
212215 // Bluray-specific options
213216 if ( mediaType == MediaType . BluRay || mediaType == MediaType . NintendoWiiUOpticalDisc )
214217 {
@@ -217,6 +220,7 @@ public override void GenerateSubmissionInfo(SubmissionInfo info, MediaType? medi
217220 {
218221 case RedumpSystem . MicrosoftXboxOne :
219222 case RedumpSystem . MicrosoftXboxSeriesXS :
223+ case RedumpSystem . NintendoWiiU :
220224 case RedumpSystem . SonyPlayStation3 :
221225 case RedumpSystem . SonyPlayStation4 :
222226 case RedumpSystem . SonyPlayStation5 :
@@ -868,6 +872,47 @@ private static bool IsManufacturerEmpty(string inputFilename)
868872
869873 #region Information Extraction Methods
870874
875+ /// <summary>
876+ /// Get the hex contents of the BCA file
877+ /// </summary>
878+ /// <param name="bcaPath">Path to the BCA file associated with the dump</param>
879+ /// <returns>BCA data as a hex string if possible, null on error</returns>
880+ /// <remarks>https://stackoverflow.com/questions/9932096/add-separator-to-string-at-every-n-characters</remarks>
881+ internal static string ? GetBCA ( string bcaPath )
882+ {
883+ // If the file doesn't exist, we can't get the info
884+ if ( string . IsNullOrEmpty ( bcaPath ) )
885+ return null ;
886+ if ( ! File . Exists ( bcaPath ) )
887+ return null ;
888+
889+ try
890+ {
891+ var hex = ProcessingTool . GetFullFile ( bcaPath , true ) ;
892+ if ( hex is null )
893+ return null ;
894+
895+ // Separate into blocks of 4 hex digits and newlines
896+ // Skips the 4-byte header
897+ var bca = new StringBuilder ( ) ;
898+ for ( int i = 4 ; i < hex . Length ; i ++ )
899+ {
900+ bca . Append ( hex [ i ] ) ;
901+ if ( ( i + 1 ) % 32 == 0 )
902+ bca . AppendLine ( ) ;
903+ else if ( ( i + 1 ) % 4 == 0 )
904+ bca . Append ( ' ' ) ;
905+ }
906+
907+ return bca . ToString ( ) ;
908+ }
909+ catch
910+ {
911+ // Absorb the exception right now
912+ return null ;
913+ }
914+ }
915+
871916 /// <summary>
872917 /// Get the cuesheet from the input file, if possible
873918 /// </summary>
0 commit comments