mirror of
https://github.com/SabreTools/SabreTools.RedumpLib.git
synced 2026-02-08 13:54:31 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0f3a1a194 | ||
|
|
55f5262198 | ||
|
|
1d247b1f6f | ||
|
|
32c57736ae | ||
|
|
8ab312ba8b | ||
|
|
3ea01ca933 |
5
.github/workflows/build_and_test.yml
vendored
5
.github/workflows/build_and_test.yml
vendored
@@ -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
|
||||
|
||||
5
.github/workflows/check_pr.yml
vendored
5
.github/workflows/check_pr.yml
vendored
@@ -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
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -708,6 +708,7 @@ namespace SabreTools.RedumpLib.Test.Data
|
||||
SiteCode.PFIHash,
|
||||
SiteCode.PostgapType,
|
||||
SiteCode.PPN,
|
||||
SiteCode.Protection,
|
||||
SiteCode.RingNonZeroDataStart,
|
||||
SiteCode.Series,
|
||||
SiteCode.SSHash,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user