Compare commits

..

6 Commits
1.6.2 ... 1.6.3

Author SHA1 Message Date
Matt Nadareski
f0f3a1a194 Bump version 2024-12-28 13:52:24 -05:00
Deterous
55f5262198 Add new Protection pseudo site code (#9)
* Add Protection pseudo site tag

* Use new sitecode in redumplib
2024-12-27 12:33:35 -05:00
Matt Nadareski
1d247b1f6f Use string comparison on tab replacement when possible 2024-12-25 22:13:26 -05:00
Matt Nadareski
32c57736ae Duplicate write offset field for convenience (fixes #8) 2024-12-25 22:03:55 -05:00
Deterous
8ab312ba8b Convert <Tab> (#7) 2024-12-24 21:07:51 -05:00
Matt Nadareski
3ea01ca933 Ensure .NET versions are installed for testing 2024-12-19 10:52:22 -05:00
10 changed files with 38 additions and 5 deletions

View File

@@ -16,7 +16,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Run tests
run: dotnet test

View File

@@ -11,7 +11,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Build
run: dotnet build

View File

@@ -9,7 +9,7 @@
<Nullable>enable</Nullable>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.6.2</Version>
<Version>1.6.3</Version>
</PropertyGroup>
<!-- Support All Frameworks -->

View File

@@ -708,6 +708,7 @@ namespace SabreTools.RedumpLib.Test.Data
SiteCode.PFIHash,
SiteCode.PostgapType,
SiteCode.PPN,
SiteCode.Protection,
SiteCode.RingNonZeroDataStart,
SiteCode.Series,
SiteCode.SSHash,

View File

@@ -20,19 +20,21 @@ namespace SabreTools.RedumpLib.Test
// TODO: Write tests for FormatOutputData(CommonDiscInfoSection)
[Fact]
public void FormatOutputData_CDINullSACNull_Minimal()
public void FormatOutputData_CDINullSACNullTAWONull_Minimal()
{
string expected = "Common Disc Info:\n\tRegion: SPACE! (CHANGE THIS)\n\tLanguages: ADD LANGUAGES HERE (ONLY IF YOU TESTED)\n\n\tRingcode Information:\n\n\n";
var builder = new StringBuilder();
CommonDiscInfoSection? section = null;
SizeAndChecksumsSection? sac = null;
TracksAndWriteOffsetsSection? tawo = null;
int? fullyMatchedID = null;
List<int>? partiallyMatchedIDs = null;
Formatter.FormatOutputData(builder,
section,
sac,
tawo,
fullyMatchedID,
partiallyMatchedIDs);

View File

@@ -487,6 +487,10 @@ namespace SabreTools.RedumpLib
// Nintendo Gamecube
case SiteCode.InternalName:
continue;
// Protection
case SiteCode.Protection:
continue;
}
// If we don't already have this site code, add it to the dictionary

View File

@@ -3660,6 +3660,10 @@ namespace SabreTools.RedumpLib.Data
[HumanReadable(ShortName = "[T:PPN]", LongName = "<b>PPN</b>:")]
PPN,
// This doesn't have a site tag for some systems yet
[HumanReadable(ShortName = "<b>Protection</b>:", LongName = "<b>Protection</b>:")]
Protection,
// This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Ring non-zero data start</b>:", LongName = "<b>Ring non-zero data start</b>:")]
RingNonZeroDataStart,

View File

@@ -1259,6 +1259,7 @@ namespace SabreTools.RedumpLib.Data
SiteCode.PFIHash => true,
SiteCode.PostgapType => true,
SiteCode.PPN => true,
SiteCode.Protection => true,
SiteCode.RingNonZeroDataStart => true,
SiteCode.Series => true,
SiteCode.SSHash => true,

View File

@@ -32,6 +32,8 @@ namespace SabreTools.RedumpLib
SiteCode.Filename,
SiteCode.Protection,
SiteCode.BBFCRegistrationNumber,
SiteCode.DiscHologramID,
SiteCode.DNASDiscID,
@@ -132,6 +134,7 @@ namespace SabreTools.RedumpLib
FormatOutputData(output,
info.CommonDiscInfo,
info.SizeAndChecksums,
info.TracksAndWriteOffsets,
info.FullyMatchedID,
info.PartiallyMatchedIDs);
output.AppendLine();
@@ -241,6 +244,7 @@ namespace SabreTools.RedumpLib
internal static void FormatOutputData(StringBuilder output,
CommonDiscInfoSection? section,
SizeAndChecksumsSection? sac,
TracksAndWriteOffsetsSection? tawo,
int? fullyMatchedID,
List<int>? partiallyMatchedIDs)
{
@@ -351,7 +355,13 @@ namespace SabreTools.RedumpLib
AddIfExists(output, "Label Side " + Template.AdditionalMouldField, section?.Layer1AdditionalMould, 0);
}
var offset = tawo?.OtherWriteOffsets;
if (int.TryParse(offset, out int i))
offset = i.ToString("+#;-#;0");
AddIfExists(output, Template.WriteOffsetField, offset, 0);
output.AppendLine();
AddIfExists(output, Template.BarcodeField, section?.Barcode, 1);
AddIfExists(output, Template.EXEDateBuildDate, section?.EXEDateBuildDate, 1);
AddIfExists(output, Template.ErrorCountField, section?.ErrorsCount, 1);
@@ -530,8 +540,13 @@ namespace SabreTools.RedumpLib
&& key != "Cuesheet")
{
// Convert to tabs
#if NETCOREAPP
value = value.Replace("<tab>", "\t", StringComparison.OrdinalIgnoreCase);
#else
value = value.Replace("<tab>", "\t");
value = value.Replace("<TAB>", "\t");
value = value.Replace("<Tab>", "\t");
#endif
value = value.Replace(" ", "\t");
// Sanitize whitespace around tabs

View File

@@ -8,7 +8,7 @@
<Nullable>enable</Nullable>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.6.2</Version>
<Version>1.6.3</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>