Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/famicom-dumper-client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2023-01-18 15:59:39 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2023-01-18 15:59:39 +0300
commit1487fadc7cf08554ac93aba83303172d73b596e1 (patch)
treecb5f84cd32411559707d0c5e8851aa1b1fc9b891
parentba5fcf3a0b86c3e3d5dd9c23567e14101d331008 (diff)
Debug messages
-rw-r--r--FamicomDumperConnection/FamicomDumperLocal.cs28
1 files changed, 26 insertions, 2 deletions
diff --git a/FamicomDumperConnection/FamicomDumperLocal.cs b/FamicomDumperConnection/FamicomDumperLocal.cs
index a64af28..6630bd1 100644
--- a/FamicomDumperConnection/FamicomDumperLocal.cs
+++ b/FamicomDumperConnection/FamicomDumperLocal.cs
@@ -96,8 +96,32 @@ namespace com.clusterrr.Famicom.DumperConnection
private (DumperCommand Command, byte[] Data) RecvCommand()
{
- var (Command, Data) = connection.RecvCommand();
- return ((DumperCommand)Command, Data);
+ byte command;
+ byte[] data;
+#if DEBUG
+ bool debugging = false;
+ do
+ {
+ (command, data) = connection.RecvCommand();
+ if (command == (byte)DumperCommand.DEBUG)
+ {
+ if (!debugging)
+ Console.Write("Debug data: ");
+ foreach (var b in data)
+ {
+ Console.Write($"{b:X02} ");
+ }
+ debugging = true;
+ } else if (debugging)
+ {
+ Console.WriteLine();
+ }
+ }
+ while (command == (byte)DumperCommand.DEBUG);
+#else
+ (command, data) = connection.RecvCommand();
+#endif
+ return ((DumperCommand)command, data);
}
/// <summary>