From c0ac97d4e2281077156b03102755aaadbbd0288f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 25 Feb 2009 20:19:21 +0100 Subject: [PATCH] revise calculate_checksum --- HACKING | 14 +++++++------- gdigi.c | 23 +++++++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/HACKING b/HACKING index d4b9cf3..14dd6ae 100644 --- a/HACKING +++ b/HACKING @@ -40,13 +40,13 @@ There seems to be two possible ways to figure that out. 1st - when 4th bit is also active, and first value byte is 03 then add 80 to value - So for above example: - ID = 3009 (hex) = 12297 (decimal) - Position = 0 - One of possible values is 0. Usually value range is 0 to 99, - albeit in some cases it's different - you have to check what values can - X-Edit assign (there doesn't seem to be any sanity check in firmware) - This is especially needed for IDs that set some effect type. + So for above example: + ID = 3009 (hex) = 12297 (decimal) + Position = 0 + One of possible values is 0. Usually value range is 0 to 99, + albeit in some cases it's different - you have to check what values can + X-Edit assign (there doesn't seem to be any sanity check in firmware) + This is especially needed for IDs that set some effect type. 2) Save preset patch Patches seem to be simple XML files. diff --git a/gdigi.c b/gdigi.c index ab558cb..2e1bce6 100644 --- a/gdigi.c +++ b/gdigi.c @@ -62,14 +62,21 @@ char calculate_checksum(gchar *array, int length, int check) { int x; char checksum; - checksum = 0; + + checksum = 0x07; + for (x = 0; x