Colorize output of decoded PMA.

This commit is contained in:
2025-11-08 13:51:29 +00:00
parent 62dc4b6704
commit d362591dac

View File

@@ -76,15 +76,14 @@ public static class PMA
if(decoded.DataLength + 2 != CDPMAResponse.Length) if(decoded.DataLength + 2 != CDPMAResponse.Length)
{ {
AaruLogging.Debug(MODULE_NAME, AaruLogging.Debug(MODULE_NAME,
Localization Localization.Expected_CD_PMA_size_0_bytes_is_not_received_size_1_bytes_not_decoding,
.Expected_CD_PMA_size_0_bytes_is_not_received_size_1_bytes_not_decoding, decoded.DataLength + 2,
decoded.DataLength + 2, CDPMAResponse.Length);
CDPMAResponse.Length);
return null; return null;
} }
for(int i = 0; i < (decoded.DataLength - 2) / 11; i++) for(var i = 0; i < (decoded.DataLength - 2) / 11; i++)
{ {
decoded.PMADescriptors[i].Reserved = CDPMAResponse[0 + i * 11 + 4]; decoded.PMADescriptors[i].Reserved = CDPMAResponse[0 + i * 11 + 4];
decoded.PMADescriptors[i].ADR = (byte)((CDPMAResponse[1 + i * 11 + 4] & 0xF0) >> 4); decoded.PMADescriptors[i].ADR = (byte)((CDPMAResponse[1 + i * 11 + 4] & 0xF0) >> 4);
@@ -319,7 +318,7 @@ public static class PMA
break; break;
case 2: case 2:
uint id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame); var id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame);
sb.AppendFormat(Localization.Disc_ID_0_X6, id & 0x00FFFFFF).AppendLine(); sb.AppendFormat(Localization.Disc_ID_0_X6, id & 0x00FFFFFF).AppendLine();
break; break;
@@ -423,18 +422,18 @@ public static class PMA
break; break;
default: default:
sb.AppendLine($"ADR = {descriptor.ADR}"); sb.AppendLine($" [rosybrown]ADR[/] = [teal]{descriptor.ADR}[/]");
sb.AppendLine($"CONTROL = {descriptor.CONTROL}"); sb.AppendLine($"[rosybrown]CONTROL[/] = [teal]{descriptor.CONTROL}[/]");
sb.AppendLine($"TNO = {descriptor.TNO}"); sb.AppendLine($" [rosybrown]TNO[/] = [teal]{descriptor.TNO}[/]");
sb.AppendLine($"POINT = {descriptor.POINT}"); sb.AppendLine($" [rosybrown]POINT[/] = [teal]{descriptor.POINT}[/]");
sb.AppendLine($"Min = {descriptor.Min}"); sb.AppendLine($" [rosybrown]Min[/] = [teal]{descriptor.Min}[/]");
sb.AppendLine($"Sec = {descriptor.Sec}"); sb.AppendLine($" [rosybrown]Sec[/] = [teal]{descriptor.Sec}[/]");
sb.AppendLine($"Frame = {descriptor.Frame}"); sb.AppendLine($" [rosybrown]Frame[/] = [teal]{descriptor.Frame}[/]");
sb.AppendLine($"HOUR = {descriptor.HOUR}"); sb.AppendLine($" [rosybrown]HOUR[/] = [teal]{descriptor.HOUR}[/]");
sb.AppendLine($"PHOUR = {descriptor.PHOUR}"); sb.AppendLine($" [rosybrown]PHOUR[/] = [teal]{descriptor.PHOUR}[/]");
sb.AppendLine($"PMIN = {descriptor.PMIN}"); sb.AppendLine($" [rosybrown]PMIN[/] = [teal]{descriptor.PMIN}[/]");
sb.AppendLine($"PSEC = {descriptor.PSEC}"); sb.AppendLine($" [rosybrown]PSEC[/] = [teal]{descriptor.PSEC}[/]");
sb.AppendLine($"PFRAME = {descriptor.PFRAME}"); sb.AppendLine($" [rosybrown]PFRAME[/] = [teal]{descriptor.PFRAME}[/]");
break; break;
} }