mirror of
https://github.com/SabreTools/SabreTools.RedumpLib.git
synced 2026-02-04 05:36:11 +00:00
Add raw cuesheet bytes
This commit is contained in:
@@ -302,6 +302,7 @@ namespace SabreTools.RedumpLib.Test
|
||||
{
|
||||
ClrMameProData = "XXXXXX",
|
||||
Cuesheet = "XXXXXX",
|
||||
CuesheetRaw = [0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39],
|
||||
OtherWriteOffsets = "XXXXXX",
|
||||
};
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ namespace SabreTools.RedumpLib.Test
|
||||
{
|
||||
ClrMameProData = "Datfile",
|
||||
Cuesheet = "Cuesheet",
|
||||
CuesheetRaw = [0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39],
|
||||
CommonWriteOffsets = [0, 12, -12],
|
||||
OtherWriteOffsets = "-2",
|
||||
},
|
||||
|
||||
@@ -14,6 +14,9 @@ namespace SabreTools.RedumpLib.Data.Sections
|
||||
[JsonProperty(PropertyName = "d_cue", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string? Cuesheet { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "d_cue_raw", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public byte[]? CuesheetRaw { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "d_offset", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public int[]? CommonWriteOffsets { get; set; }
|
||||
|
||||
@@ -26,6 +29,7 @@ namespace SabreTools.RedumpLib.Data.Sections
|
||||
{
|
||||
ClrMameProData = this.ClrMameProData,
|
||||
Cuesheet = this.Cuesheet,
|
||||
CuesheetRaw = this.CuesheetRaw?.Clone() as byte[],
|
||||
CommonWriteOffsets = this.CommonWriteOffsets?.Clone() as int[],
|
||||
OtherWriteOffsets = this.OtherWriteOffsets,
|
||||
};
|
||||
|
||||
@@ -479,6 +479,7 @@ namespace SabreTools.RedumpLib
|
||||
|
||||
AddIfExists(output, Template.DATField, section.ClrMameProData + "\n", 1);
|
||||
AddIfExists(output, Template.CuesheetField, section.Cuesheet, 1);
|
||||
// TODO: Figure out how to emit raw cuesheet field instead of normal cuesheet
|
||||
var offset = section.OtherWriteOffsets;
|
||||
if (int.TryParse(offset, out int i))
|
||||
offset = i.ToString("+#;-#;0");
|
||||
|
||||
Reference in New Issue
Block a user