projects
/
h316.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[h316.git]
/
pc-tools
/
ldc
/
ldc.c
diff --git
a/pc-tools/ldc/ldc.c
b/pc-tools/ldc/ldc.c
index ae9ee517320bc323bb4ebb095dfdf945600cd67d..81fd9e1d1048e43358238d90ba52bb05adfb17db 100644
(file)
--- a/
pc-tools/ldc/ldc.c
+++ b/
pc-tools/ldc/ldc.c
@@
-33,6
+33,8
@@
int ignore = 0;
int dosplit = 0;
int splitnum = 0;
int silent = 0;
int dosplit = 0;
int splitnum = 0;
int silent = 0;
+int read_pos = -5;
+int block_pos= -5;
/********************************************************/
/********************************************************/
@@
-214,7
+216,8
@@
datablock *get_block()
if (tapemode)
tapestart ();
do {
if (tapemode)
tapestart ();
do {
- ret = read (inputfd, buffer, 1);
+ read_pos+=ret=read (inputfd, buffer, 1);
+
#ifdef HARDCORE_DEBUG
msgf ("READ : (hex)%02x (bin)%s (dec)%3i (oct)%3o",
buffer[0], bin2str (buffer[0], 8), buffer[0], buffer[0]);
#ifdef HARDCORE_DEBUG
msgf ("READ : (hex)%02x (bin)%s (dec)%3i (oct)%3o",
buffer[0], bin2str (buffer[0], 8), buffer[0], buffer[0]);
@@
-234,7
+237,8
@@
datablock *get_block()
}
} while (*buffer != (unsigned char) CHAR_START);
}
} while (*buffer != (unsigned char) CHAR_START);
-
+
+ block_pos=read_pos;
msg ("get_block(): Blockstart erkannt");
// blk_data = (hw16 *) malloc (MAX_BLOCK_SIZE * sizeof (hw16));
msg ("get_block(): Blockstart erkannt");
// blk_data = (hw16 *) malloc (MAX_BLOCK_SIZE * sizeof (hw16));
@@
-246,6
+250,7
@@
datablock *get_block()
do {
complete = 0;
ret = read (inputfd, buffer + round, 1);
do {
complete = 0;
ret = read (inputfd, buffer + round, 1);
+ read_pos+=ret;
#ifdef HARDCORE_DEBUG
static int lochzahl = 0;
char *bin = bin2str (buffer[round], 8);
#ifdef HARDCORE_DEBUG
static int lochzahl = 0;
char *bin = bin2str (buffer[round], 8);
@@
-302,12
+307,13
@@
datablock *get_block()
if (checksum_error (blk_data, blk_size)) {
if (checksum_error (blk_data, blk_size)) {
- err ("get_block(): Checksummenfehler");
+ errf ("get_block(): Checksum error!\nBlock start: %i (0x%x), read address %i (0x%x).",
+ block_pos,block_pos,read_pos,read_pos);
#ifdef CHECKSUM_DUMP
dump_data (buffer, 3);
#ifdef CHECKSUM_DUMP
dump_data (buffer, 3);
- read (inputfd, buffer, 3);
+ read
_pos+=read
(inputfd, buffer, 3);
dump_data (buffer, 3);
#endif
dump_data (buffer, 3);
#endif
@@
-407,6
+413,9
@@
int main (int argc, char **args)
}
datablock *akt_block;
}
datablock *akt_block;
+ /* Initialize read position */
+ read_pos=0;
+
while (1) {
msg ("********************************************************");
msgf ("Block no. %5i", blk_no++);
while (1) {
msg ("********************************************************");
msgf ("Block no. %5i", blk_no++);