Compare commits

...

9 Commits
1.3.5 ... 1.3.7

Author SHA1 Message Date
Matt Nadareski
d591ee1550 Bump version 2024-05-15 16:16:37 -04:00
Matt Nadareski
9153c931a5 Include comment/content markers 2024-05-15 16:16:07 -04:00
Matt Nadareski
99ebd1f3ac Add extensions for comment and content codes 2024-05-15 16:09:57 -04:00
Matt Nadareski
844f5506f5 Add Applications pseudotag 2024-05-15 16:09:19 -04:00
Matt Nadareski
4be01b25ab Add EidosID pseudotag 2024-05-15 16:07:00 -04:00
Matt Nadareski
22e2e73f65 Add BethesdaID pseudotag 2024-05-15 16:06:06 -04:00
Matt Nadareski
831ea86d4f Add CompatibleOS pseudotag 2024-05-15 16:04:47 -04:00
Matt Nadareski
4475dba94c Bump version 2024-03-15 12:48:36 -04:00
Matt Nadareski
63a758c005 Fix missing fields from output 2024-03-15 12:48:18 -04:00
5 changed files with 156 additions and 1 deletions

View File

@@ -3526,16 +3526,28 @@ namespace SabreTools.RedumpLib.Data
[HumanReadable(ShortName = "[T:ALTF]", LongName = "<b>Alternative Foreign Title</b>:")]
AlternativeForeignTitle,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Applications</b>:", LongName = "<b>Applications</b>:")]
Applications,
[HumanReadable(ShortName = "[T:BID]", LongName = "<b>Bandai ID</b>:")]
BandaiID,
[HumanReadable(ShortName = "[T:BBFC]", LongName = "<b>BBFC Reg. No.</b>:")]
BBFCRegistrationNumber,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Bethesda ID</b>:", LongName = "<b>Bethesda ID</b>:")]
BethesdaID,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>CD Projekt ID</b>:", LongName = "<b>CD Projekt ID</b>:")]
CDProjektID,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Compatible OS</b>:", LongName = "<b>Compatible OS</b>:")]
CompatibleOS,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Disc Hologram ID</b>:", LongName = "<b>Disc Hologram ID</b>:")]
DiscHologramID,
@@ -3547,6 +3559,10 @@ namespace SabreTools.RedumpLib.Data
[HumanReadable(ShortName = "[T:DNAS]", LongName = "<b>DNAS Disc ID</b>:")]
DNASDiscID,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Eidos ID</b>:", LongName = "<b>Eidos ID</b>:")]
EidosID,
[HumanReadable(ShortName = "[T:EAID]", LongName = "<b>Electronic Arts ID</b>:")]
ElectronicArtsID,

View File

@@ -1063,6 +1063,141 @@ namespace SabreTools.RedumpLib.Data
#region Site Code
/// <summary>
/// List all site codes with their short usable names
/// </summary>
public static List<string> ListSiteCodes()
{
var siteCodes = new List<string>();
foreach (var val in Enum.GetValues(typeof(SiteCode)))
{
string? shortName = ((SiteCode?)val).ShortName()?.TrimEnd(':');
string? longName = ((SiteCode?)val).LongName()?.TrimEnd(':');
bool isCommentCode = ((SiteCode?)val).IsCommentCode();
bool isContentCode = ((SiteCode?)val).IsContentCode();
bool isMultiline = ((SiteCode?)val).IsMultiLine();
// Invalid codes should be skipped
if (shortName == null || longName == null)
continue;
// Handle site tags
string siteCode;
if (shortName == longName)
siteCode = "***".PadRight(16, ' ');
else
siteCode = shortName.PadRight(16, ' ');
// Handle expanded tags
siteCode += longName.PadRight(32, ' ');
// Include special indicators, if necessary
var additionalInfo = new List<string>();
if (isCommentCode)
additionalInfo.Add("Comment Field");
if (isContentCode)
additionalInfo.Add("Content Field");
if (isMultiline)
additionalInfo.Add("Multiline");
if (additionalInfo.Count > 0)
siteCode += $"[{string.Join(", ", [.. additionalInfo])}]";
// Add the formatted site code
siteCodes.Add(siteCode);
}
return siteCodes;
}
/// <summary>
/// Check if a site code should live in the comments section
/// </summary>
/// <param name="siteCode">SiteCode to check</param>
/// <returns>True if the code field is in comments by default, false otherwise</returns>
public static bool IsCommentCode(this SiteCode? siteCode)
{
return siteCode switch
{
// Identifying Info
SiteCode.AlternativeTitle => true,
SiteCode.AlternativeForeignTitle => true,
SiteCode.BBFCRegistrationNumber => true,
SiteCode.CompatibleOS => true,
SiteCode.DiscHologramID => true,
SiteCode.DMIHash => true,
SiteCode.DNASDiscID => true,
SiteCode.Genre => true,
SiteCode.InternalSerialName => true,
SiteCode.ISBN => true,
SiteCode.ISSN => true,
SiteCode.PFIHash => true,
SiteCode.PostgapType => true,
SiteCode.PPN => true,
SiteCode.Series => true,
SiteCode.SSHash => true,
SiteCode.SSVersion => true,
SiteCode.VCD => true,
SiteCode.VFCCode => true,
SiteCode.VolumeLabel => true,
SiteCode.XeMID => true,
SiteCode.XMID => true,
// Publisher / Company IDs
SiteCode.AcclaimID => true,
SiteCode.ActivisionID => true,
SiteCode.BandaiID => true,
SiteCode.BethesdaID => true,
SiteCode.EidosID => true,
SiteCode.ElectronicArtsID => true,
SiteCode.FoxInteractiveID => true,
SiteCode.GTInteractiveID => true,
SiteCode.JASRACID => true,
SiteCode.KingRecordsID => true,
SiteCode.KoeiID => true,
SiteCode.KonamiID => true,
SiteCode.LucasArtsID => true,
SiteCode.MicrosoftID => true,
SiteCode.NaganoID => true,
SiteCode.NipponIchiSoftwareID => true,
SiteCode.OriginID => true,
SiteCode.PonyCanyonID => true,
SiteCode.SegaID => true,
SiteCode.SelenID => true,
SiteCode.SierraID => true,
SiteCode.TaitoID => true,
SiteCode.UbisoftID => true,
SiteCode.ValveID => true,
_ => false,
};
}
/// <summary>
/// Check if a site code should live in the contents section
/// </summary>
/// <param name="siteCode">SiteCode to check</param>
/// <returns>True if the code field is in contents by default, false otherwise</returns>
public static bool IsContentCode(this SiteCode? siteCode)
{
return siteCode switch
{
SiteCode.Applications => true,
SiteCode.Extras => true,
SiteCode.GameFootage => true,
SiteCode.Games => true,
SiteCode.NetYarozeGames => true,
SiteCode.Patches => true,
SiteCode.PlayableDemos => true,
SiteCode.RollingDemos => true,
SiteCode.Savegames => true,
SiteCode.TechDemos => true,
SiteCode.Videos => true,
_ => false,
};
}
/// <summary>
/// Check if a site code is multi-line or not
/// </summary>

View File

@@ -35,12 +35,14 @@
// Automatic Information
public const string FrontendVersionField = "Frontend Version";
public const string DumpingProgramField = "Dumping Program";
public const string DumpingDateField = "Date";
public const string DumpingDriveManufacturer = "Manufacturer";
public const string DumpingDriveModel = "Model";
public const string DumpingDriveFirmware = "Firmware";
public const string ReportedDiscType = "Reported Disc Type";
public const string C2ErrorCountField = "C2 Error Count";
public const string PVDField = "Primary Volume Descriptor (PVD)";
public const string DATField = "DAT";
public const string SizeField = "Size";

View File

@@ -229,12 +229,14 @@ namespace SabreTools.RedumpLib
// Dumping Info section
output.Add(""); output.Add("Dumping Info:");
AddIfExists(output, Template.FrontendVersionField, info.DumpingInfo?.FrontendVersion, 1);
AddIfExists(output, Template.DumpingProgramField, info.DumpingInfo?.DumpingProgram, 1);
AddIfExists(output, Template.DumpingDateField, info.DumpingInfo?.DumpingDate, 1);
AddIfExists(output, Template.DumpingDriveManufacturer, info.DumpingInfo?.Manufacturer, 1);
AddIfExists(output, Template.DumpingDriveModel, info.DumpingInfo?.Model, 1);
AddIfExists(output, Template.DumpingDriveFirmware, info.DumpingInfo?.Firmware, 1);
AddIfExists(output, Template.ReportedDiscType, info.DumpingInfo?.ReportedDiscType, 1);
AddIfExists(output, Template.C2ErrorCountField, info.DumpingInfo?.C2ErrorsCount, 1);
// Make sure there aren't any instances of two blank lines in a row
string? last = null;

View File

@@ -7,7 +7,7 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.3.5</Version>
<Version>1.3.7</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>